ERROR in static/js/vendor.cce10fda4a9a074cd1d7.js from UglifyJs
Unexpected token: punc (() [./~/_dom7@2.0.0@dom7/src/methods.js:7,0][static/js/vendor.cce10fda4a9a074cd1d7.js:10294,10]
Build failed with errors.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! hgui@1.0.0 build: `node build/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the hgui@1.0.0 build 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! /root/.npm/_logs/2017-09-29T12_05_58_655Z-debug.log
根据回答,我试了一下将dom7这个modules也加入到webpack的babel-loader:
{
test: /\.js$/,
loader: 'babel-loader',
include: [resolve('src'), resolve('test'),resolve('node_modules/_dom7@2.0.0@dom7/src')]
},
接下来显示的却是:
ERROR in static/js/vendor.b4322554ee076d6e4c5e.js from UglifyJs
Unexpected token: name (w) [./~/_swiper@4.0.0-beta.4@swiper/dist/js/swiper.module.js:16,0][static/js/vendor.b4322554ee076d6e4c5e.js:11543,4]
Build failed with errors.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! hgui@1.0.0 build: `node build/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the hgui@1.0.0 build 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! /root/.npm/_logs/2017-09-29T17_13_49_547Z-debug.log
感觉这样子下去要没完没了了。
然后我再:
{
test: /\.js$/,
loader: 'babel-loader',
include: [resolve('src'), resolve('test'),resolve('node_modules/_dom7@2.0.0@dom7/src'),resolve('node_modules/_swiper@4.0.0-beta.4@swiper')]
},
最后
> node build/build.js
⠴ building for production...Killed
这是什么情况?如果我想引入这个插件我应该如何配置这个webpack?
我是vue-cli架的手脚,我用swiper也是报一样的错误,用这个vue-awesome-swiper,在swiper进行vue封装,用起来一毛一样 压缩不出错,