目录
1、打包报错信息
- 1、打包报错信息
- 2、解决方案
-
- 2.1、设置package.json
- 2.2、设置webpack.config.js
- 3、相关文章
// WARNING in configuration // The 'mode' option has not been set, webpack will fallback to 'production' // for thisvalue. Set 'mode' option to 'development' or 'production' to enable // defaults for each environment. // You can also set it to 'none' to disable any default behavior. Learn more: // https://webpack.js.org/concepts/mode/2、解决方案 2.1、设置package.json
"scripts": { // 开发环境 "dev": "webpack --mode development", // 生产环境 "build": "webpack --mode production", }2.2、设置webpack.config.js
module.exports = { entry: './src/app.js', output: { path: path.resolve(__dirname, 'dist'), filename: 'main.js' }, // 设置mode mode: 'development' }3、相关文章
webpack4.0-解决webpack 报The ‘mode’ option has not been set, webpack will fallback to ‘production’ fo