I am getting an 'Unexpected token import' error
[issue link]I am trying to use vue-intersect in a nuxt project. vue-intersect is added as a standard node_module.
/node_modules/vue-intersect/dist/index.js:1
(function (exports, require, module, __filename, __dirname) { import Vue from ‘vue’;
^^^^^^
SyntaxError: Unexpected token import
at Object.exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:513:28)
at Object.Module._extensions…js (module.js:550:10)
at Module.load (module.js:458:32)
at tryModuleLoad (module.js:417:12)
at Function.Module._load (module.js:409:3)
at Module.require (module.js:468:17)
at require (internal/module.js:20:19)
My build configuration is below in nuxt.config.js (have excluded the node_modules too)
build: {
/*
** Run ESLINT on save
*/
extend (config, ctx) {
if (ctx.dev && ctx.isClient) {
config.module.rules.push({
enforce: ‘pre’,
test: /.(js|vue)$/,
loader: ‘eslint-loader’
})
}
},
What do I need to do to get rid of this error?