这是我的 nuxt.config.ts 文件
export default defineNuxtConfig({
css: [
'@/assets/main.css'
],
serverMiddleware: [
'~/serverMiddleware/test'
]
})
但是 TypeScript 抛出这个错误:
Argument of type '{ css: string[]; serverMiddleware: { path: string; handler: string; }[]; }' is not assignable to parameter of type 'NuxtConfig'.
Object literal may only specify known properties, and 'serverMiddleware' does not exist in type 'NuxtConfig'.ts(2345)
(property) serverMiddleware: {
path: string;
handler: string;
}[]`
我查看了文档和 YouTube,但我找不到如何去做。