xlsdg / vue-countup-v2

Vue.js component wrap for countUp.js
https://inorganik.github.io/countUp.js/
MIT License
379 stars 56 forks source link

Unexpected token import in nuxt #13

Open albertpb opened 5 years ago

albertpb commented 5 years ago

image

nxmad commented 5 years ago

It happens because original CountUp.js library was rewritten. But I found the solution. You need to add this to the build section of your nuxt.config.js:

transpile: [
  'countup.js',
],
indifisher commented 4 years ago

The above fix by @nxmad didn't work for me. I can't use this with nuxt.

chrisleekr commented 4 years ago

For those who need a workaround, I had succeeded by adding both 'countup.js', and 'vue-countup-v2' in nuxt.config.js

build: {
    /*
     ** You can extend webpack config here
     */
    transpile: ['countup.js', 'vue-countup-v2'],
    extend(_config, _ctx) {}
  },
pksingh2612 commented 4 years ago

https://github.com/xlsdg/vue-countup-v2/issues/13#issuecomment-639915236 it works for me on both dev and prod mode

but done little change in a script tag

Githubissues.
  • Githubissues is a development platform for aggregating issues.