vue,webpick打包时报错Unexpected token: punc(()网上说是es2015转换问题,我的项目没有webpack.config.js文件,修改 { test: /\.js$/, loader: 'babel-loader', include: [resolve('src'), resolve('test'),resolve('/src/api/index.js')] } 也没有效果.求大神指点!!!
1 回答
aluckdog
TA贡献1847条经验 获得超7个赞
下载新的vue-cli,webpack项目,拷贝.babelrc文件到原项目根目录下
{
"presets": [
["env", {
"modules": false,
"targets": {
"browsers": ["> 1%", "last 2 versions", "not ie <= 8"]
}
}],
"stage-2"
],
"plugins": ["transform-runtime"],
"env": {
"test": {
"presets": ["env", "stage-2"],
"plugins": ["istanbul"]
}
}
}
添加回答
举报
0/150
提交
取消