I tried to configure web pack for reacts web app, it kept telling me to use
npm install -D webpack-cli :
The CLI moved into a separate package: webpack-cli.
Please install 'webpack-cli' in addition to webpack itself to use the CLI.
-> When using npm: npm install webpack-cli -D
-> When using yarn: yarn add webpack-cli -D
module.js:557
throw err;
^
when I did what it was asking me it gave me this error :
C:\Users\Desktop\lazabre1>webpack-dev-server
C:\Users\Desktop\lazabre1\webpack.config.js:59
new webpack.NoErrorsPlugin()
^
this is my webpack.config.js file :
var webpack = require('webpack');
var path = require('path');
module.exports = {
devtool: 'inline-source-map',
entry: [
'webpack-dev-server/client?http://127.0.0.1:8080/',
'webpack/hot/only-dev-server',
'./src'
],
output: {
path: path.join(__dirname, 'public'),
filename: 'bundle.js'
},
resolve: {
modulesDirectories: ['node_modules', 'src'],
extensions: ['', '.js']
},
module: {
loaders: [
{
test: /\.jsx?$/,
exclude: /node_modules/,
loaders: ['react-hot', 'babel?presets[]=react,presets[]=es2015']
}
]
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin()
]
};
I have 2 questions: first - how to solve this problem //
second - what is the difference between npm install webpack and npm install webpack-cli.