Include specified node_modules in webpack loader
MIT License
Include node modules which meet one of following requirements in webpack loader:
module
fieldengines.node > 0.10
yarn add webpack-node-modules --dev
// webpack.config.js
const path = require('path')
const nodeModules = require('webpack-node-modules')
module.exports = {
module: {
rules: [{
test: /\.js$/,
loader: 'babel-loader',
include: [
// Your app
path.join(__dirname, 'src'),
// Modules with `module` field or `engines.node > 0.10`
nodeModules()
]
}]
}
}
git checkout -b my-new-feature
git commit -am 'Add some feature'
git push origin my-new-feature
webpack-node-modules © egoist, Released under the MIT License. Authored and maintained by egoist with help from contributors (list).
egoistian.com · GitHub @egoist · Twitter @rem_rin_rin