日本免费高清视频-国产福利视频导航-黄色在线播放国产-天天操天天操天天操天天操|www.shdianci.com

學無先后,達者為師

網站首頁 編程語言 正文

webpack5.6.0解決報The ‘mode‘ option has not been set, webpack will fallback to ‘production‘ fo的錯誤、問題

作者:web半晨 更新時間: 2022-06-06 編程語言


1、打包報錯信息

// 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": {
	// 開發(fā)環(huán)境
	"dev": "webpack --mode development",  
	// 生產環(huán)境
	"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

原文鏈接:https://blog.csdn.net/weixin_51157081/article/details/122290431

欄目分類
最近更新