1、按老师的要求打包报错,网上说我本地的webpack版本太高,改用命令
webpack hello.js -o hello.bundle.js
2、dev和build环境都配置完成之后,运行npm run dev报错,错误内容如下:
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! webpack-test@1.0.0 dev: `webpack --mode development`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the webpack-test@1.0.0 dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\yi.lingyu\AppData\Roaming\npm-cache\_logs\2018-12-25T03_38_19_017Z-debug.log
输出后是map 结构的模块化, 为啥不是数组的呢
可以使用
webpack hello.js --output hello.bundle.js --mode development
我这里使用是可以正确输出的,希望可以帮到你
webpack hello.js ./dist/main.js --mode development 新版适用
`webpack --mode development`缺失“=”符号