nuxt.js 引入vux 之后:run generate的时候uglifyJs 报错, run dev 的时候可以成功但是,只要刷新页面就会报 unexpected token import
plugins: [
'~plugins/api'
],
build: {
vendor: ['axios','vux'],
extend (config, ctx) {
if (ctx.dev && ctx.isClient) {
config.module.rules.push({
enforce: 'pre',
test: /\.(js|vue)$/,
loader: 'eslint-loader',
exclude: /(node_modules)/
})
}
vuxLoader.merge(config,{
options: {
isWebpack2: true
},
plugins: [{
name: 'vux-ui'
}, {
name: 'duplicate-style'
}]
})
},
babel: {
presets: ['es2015', 'stage-0'],
"plugins": ["transform-runtime"]
},
loaders:[{
test:/\.vue$/,
loader: 'vue-loader'
}]
},
相关分类