Unexpected token: punc (() [./node_modules/_vue-particles错误

这是由于vue-particles是使用es6语法写的,直接是不能使用的,所以需要在webpack.base.conf.js文件中添加下面这段话

{
    test: /\.js$/,
        loader: 'babel-loader',
    include: [resolve('src'), resolve('test'), resolve('node_modules/vue-particles')]
}

如果是使用cnpm安装的话,需要给上面的修改一下,如下

resolve('node_modules/_vue-particles')

参考自:https://github.com/creotip/vue-particles/issues/7

如果您觉得本文对您有用,欢迎捐赠或留言~
微信支付
支付宝

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注