参考:https://www.jb51.net/article/161558.htm
nuxt.config.js中 webpack的关于ts的loader, 鱿鱼config.module可能取值为undefined 要做以下处理
extend(config, ctx) {
if (ctx.isClient && ctx.isDev) {
const module = config.module
if (module) {
module.rules.push({
test: /\.ts$/,
exclude: ['/node_modules/', '/vendor/', '/.nuxt/'],
loader: 'ts-loader',
options: {
appendTsSuffixTo: [/\.vue$/],
transpileOnly: true
}
})
}
}
}
待整理