1.webpack单文件打包
webpack src/entry.js dist/bundle.js (webpack3)
webpack src/entry.js -o dist/bundle.js (webpack4)
2.webpack打包的黄色警告

是因为webpack4引入了开发模式 生产模式 无三种,黄色警告是因为打包的时候没有设置模式
webpack src/entry.js -o dist/bundle.js --mode development(设置开发模式)
webpack src/entry.js -o dist/bundle.js --model production(生产模式)
3.使用webpack-dev-server报错

webpack4中把cli分离出来,使用npm install -D webpack-cli
4.webpack.config.js初配置

网友评论