猿问

vue,webpick打包时Unexpected token: punc(()

vue,webpick打包时报错Unexpected token: punc(()

网上说是es2015转换问题,

我的项目没有webpack.config.js文件,

修改


     {

            test: /\.js$/,

            loader: 'babel-loader',

            include: [resolve('src'), resolve('test'),resolve('/src/api/index.js')]

        }

        

也没有效果.求大神指点!!!


PIPIONE
浏览 1793回答 1
1回答

aluckdog

下载新的vue-cli,webpack项目,拷贝.babelrc文件到原项目根目录下{"presets": [["env", {&nbsp; "modules": false,&nbsp; "targets": {&nbsp; &nbsp; "browsers": ["> 1%", "last 2 versions", "not ie <= 8"]&nbsp; }}],"stage-2"],"plugins": ["transform-runtime"],"env": {"test": {&nbsp; "presets": ["env", "stage-2"],&nbsp; "plugins": ["istanbul"]}}}
随时随地看视频慕课网APP

相关分类

JavaScript
我要回答