gpt4 book ai didi

NuxtJS 的 TypeScript 和 tsconfig.json 文件

转载 作者:行者123 更新时间:2023-12-05 07:32:18 26 4
gpt4 key购买 nike

我有一个使用NuxtJS(在./src/client/)和NestJS(在./src/服务器/).

NuxtJStsconfig.jsontsconfig.json的扩展,用于全局项目。

我不知道我能为项目做些什么。

https://github.com/pirmax/nuxt-and-nest/tree/develop

当我转到根页面时,NuxtJS 出现错误:

bundle export should be a function when using { runInNewContext: false }.

如果我在我的项目中删除所有 NestJS 的痕迹,NuxtJS 启动良好,但是当我在 tsconfig.json 中添加我的配置时,该项目给我这个错误。

我的tsconfig.json在./src/client/

{
"extends": "../../tsconfig.json",
"compilerOptions": {
"rootDir": ".",
"target": "es5",
"lib": ["dom", "es2015"],
"module": "es2015",
"moduleResolution": "node",
"experimentalDecorators": true,
"noImplicitAny": false,
"noImplicitThis": false,
"strictNullChecks": true,
"removeComments": true,
"suppressImplicitAnyIndexErrors": true,
"allowSyntheticDefaultImports": true,
"allowJs": true,
"baseUrl": ".",
"paths": {
"~/*": ["./*"]
}
}
}

我的 tsconfig.json 在 ./(root)

{
"compilerOptions": {
"declaration": false,
"noImplicitAny": false,
"removeComments": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"module": "commonjs",
"lib": ["es2015"],
"target": "es5",
"sourceMap": true,
"allowJs": true,
"outDir": "./dist",
"baseUrl": ".",
"paths": {
"~/*": [
"./*"
],
"@app/*": [
"./src/client/*"
],
"@server/*": [
"./src/server/*"
]
}
},
"include": [
"src/server/**/*"
],
"exclude": [
"node_modules",
"**/*.spec.ts"
]
}

最佳答案

Here是我放在一起的示例,它展示了 Typescript 与 Nuxt 的结合使用。

关于NuxtJS 的 TypeScript 和 tsconfig.json 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51301959/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com