-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
npm run build fails after updating to Webpack 3 and adding a plugin to my config #5179
Description
Hi,
I am relatively new to Webpack and JavaScript bundlers and things like Babel, so please excuse my noobiness. I was following this article on Medium and I am running into problems. (In fact, I set up Webpack 2 for the first time the weekend before I read this article.)
Do you want to request a feature or report a bug?
bug
What is the current behavior?
npm run build fails after updating to webpack 3 and adding: (on a side note: why can't I just enter webpack like some people can?)
plugins: [
new webpack.optimize.ModuleConcatenationPlugin()
]
to my webpack configuration file.
If the current behavior is a bug, please provide the steps to reproduce.
My old config:
var path = require('path');
module.exports = {
entry: './src/index.js',
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, 'dist')
},
module: {
rules: [{
test: /\.js$/, exclude: /node_modules/, loader: "babel-loader"
}]
}
};
My new (broken) config:
var path = require('path');
module.exports = {
entry: './src/index.js',
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, 'dist')
},
module: {
rules: [{
test: /\.js$/, exclude: /node_modules/, loader: "babel-loader"
}]
},
plugins: [
new webpack.optimize.ModuleConcatenationPlugin()
]
};
What is the expected behavior?
It should run. I'm not even using scope hoisting yet I think, so I don't know why it would fail.
If this is a feature request, what is motivation or use case for changing the behavior?
it's not
Please mention other relevant information such as the browser version, Node.js version, webpack version and Operating System.
Node v7.9.0
Webpack v3 (although the webpack -v command doesn't work)
Windows 10
debug log
If I somehow broke any of the rules here please let me know.