javascript - import 'amaze' 出现 error Extra semicolon semi
巴扎黑
巴扎黑 2017-04-10 16:50:08
0
1
539

代码如下,我引入了一个JS,出现error Extra semicolon semi错误,要怎么破呀。。。require('amazeui')也是一样的,这是为什么呢。

import Vue from 'vue'
import App from './app.vue'
// import amazeui from 'amazeui'
import 'amazeui';
/* eslint-disable no-new */
new Vue({
  el: 'body',
  components: { App }
})

错误提示:

RROR in ./src/main.js

/Users/james/Documents/gitHubLib/vue-loader-example/src/main.js
  4:17  error  Extra semicolon  semi

✖ 1 problem (1 error, 0 warnings)
巴扎黑
巴扎黑

reply all(1)
Peter_Zhu

是因为你使用了eslint,这个是eslint的规范报错,能不用分号就不用分号。
然后这里报错的原因是因为amazeUI那个库不符合eslint的规范,在webpack配置文件中exclude加入node_modules

{
        test: /\.js$/,
        loader: 'babel!eslint',
        // make sure to exclude 3rd party code in node_modules
        exclude: /node_modules/
  }
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!