- npm run build时,webpack打包总是失败报错如下
- WARNING in asset size limit: The
- TypeError: Cannot read property
- webpack 在打包时在访问打包里面的index时,出现路径错
- Cannot find module 'webpack-cli/
- 3.vue启动问题You may use special com
- Nginx开启Gzip压缩大幅提高页面加载速度
- UnhandledPromiseRejectionWarning
- vue打包发布之后,Iconfont 文件找不到
- 【解决】ERROR in xxx.js from UglifyJ
npm run build时,webpack打包总是失败,最后发现时swiper版本问题导致
ERROR in static/js/3.d01bcc22c94d9c3efc50.js from UglifyJs
Unexpected token: name (Dom7) [static/js/3.d01bcc22c94d9c3efc50.js:8780,6]
ERROR in static/js/5.1af5c8bc024d7163cb1f.js from UglifyJs
Unexpected token: name (Dom7) [static/js/5.1af5c8bc024d7163cb1f.js:741,6]
错误截图.png
解决方案:
swiper版本问题,修改位置build/webpace.base.conf.js
增加resolve('node_modules/dom7'),resolve('node_modules/swiper')
module: {
rules: [
{
test: /\.js$/,
loader: 'babel-loader',
options: {
presets: ['env', 'stage-2']
},
include: [resolve('src'), resolve('test'),resolve('node_modules/dom7'),resolve('node_modules/swiper'),]
},
]
}
网友评论