module not found:error:can't resolve‘./components/layer/layer.js’ in webpack-demo/src/app,js什么意思?
如题module not found:error:can't resolve‘./components/layer/layer.js’ in webpack-demo/src/app,js什么意思?,使用babel转换ES6
如题module not found:error:can't resolve‘./components/layer/layer.js’ in webpack-demo/src/app,js什么意思?,使用babel转换ES6
2017-03-15
中间加一个 -o 表示输出文件夹output。
webpack ./src/page/index/index.js -o ./dist/app.js
但是打包后的app.js是被压缩过的,显示为一行。
可以注意到有提示:
WARNING in configuration The 'mode' option has not been set, webpack will fallback to 'production' for this value. 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/
是因为默认的打包模式为production生产环境模式,所以为了减少文件体积,压缩成了一行。
要设置成可读性好的怎么办?将mode变为development开发环境即可。
也就是加上--mode development即可。
webpack --mode development ./src/page/index/index.js -o ./dist/app.js
举报