3.0.0 • Published 1 year ago
require-fool-webpack v3.0.0
require-fool-webpack
Use dynamic
require()without webpack finding out
Because webpack is super annoying. 💩
You need to supply it an absolute path.
Install
npm install require-fool-webpackUsage
Before
const foo = require(getPath());Warning from webpack:
WARNING in ./app/node_modules/conf/index.js
1:33-43 Critical dependency: the request of a dependency is an expression
@ ./app/node_modules/conf/index.js
@ ./app/node_modules/electron-store/index.js
@ ./app/config.js
@ ./app/renderer/index.jsAfter
const requireFoolWebpack = require('require-fool-webpack');
const foo = requireFoolWebpack(getPath());No warning! \o/
License
MIT © Sindre Sorhus