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?
<!--cmty--><!--cmty_prevent_hook--><div align="right"><sub><em>This question is available on <a href="https://nuxtjs.cmty.io">Nuxt.js</a> community (<a href="https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c1636">#c1636</a>)</em></sub></div>