WARNING in configuration The 'mode' option has not been set. Set 'mode' option to 'development' or 'production' to enable defaults for this environment. ERROR in multi ./src/index.js ./dist/bundle.js
The following is the help message from webpack by typing webpack --help
in webpack 4
Usage without config file: webpack <entry> [<entry>] --output [-o] <output>
Notice: --output need to be specified explicitly
Solution:
webpack src/index.js --output dist/bundle.js --mode development
And if you are using webpack.config.js
:
const path = require('path');
module.exports = {
mode: 'development', // set mode option, 'development' or 'production'
entry: './src/index.js',
output: {
path: path.resolve(__dirname,'dist'),
filename: "bundle.js"
}
};
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With