vue-countup-v2
vue-countup-v2 copied to clipboard
Unexpected token import in nuxt
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',
],
The above fix by @nxmad didn't work for me. I can't use this with nuxt.
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) {}
},
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