webpack4 在webpack-config.js 中 mode設置沒有用


//webpack-config.js
const path = require('path'); module.exports = { mode: 'none', entry: './src/index.js', output: { filename: 'bundle.js', path: path.resolve(__dirname, '../dist') }       };

在package.json 中scripts 增加
"build": "webpack --mode production ./src/index.js --output ./dist/bundle.js"
"dev": "webpack --mode development ./src/index.js --output ./dist/bundle.js"
 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM