2.0.0 • Published 6 years ago

require-fool-webpack v2.0.0

Weekly downloads
7
License
MIT
Repository
github
Last release
6 years ago

require-fool-webpack Build Status

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-webpack

Usage

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.js

After

const requireFoolWebpack = require('require-fool-webpack');
const foo = requireFoolWebpack(getPath());

No warning! \o/

License

MIT © Sindre Sorhus