我正在this library加载到我的Nuxt项目中,并且正在寻找一种方法,可以在我的nuxt.config.js文件中使用target: static
将此ESModule转换为CommonJS。
现在,如果我运行nuxt generate
命令,则会得到“ FATAL config.build.transpile.push不是函数”,这意味着我不能将build.transpile
与静态目标。
我已经在nuxt.config.js中指定了它:
target: 'static',
build: {
transpile: 'countup.js',
},
顺便说一下,它在开发模式下运行良好。