【发布时间】:2018-07-12 09:28:00
【问题描述】:
我有一个带有 NuxtJS(在 ./src/client/ 中)和 NestJS(在 ./src/ 中)的项目服务器/)。
NuxtJS 的 tsconfig.json 是 tsconfig.json 的扩展,适用于全球项目。
我不知道如何才能对项目进行操作。
https://github.com/pirmax/nuxt-and-nest/tree/develop
当我转到根页面时,我在 NuxtJS 上出现错误:
使用 { runInNewContext: false 时,bundle export 应该是一个函数 }。
如果我在我的项目中删除所有 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"
]
}
【问题讨论】:
标签: typescript nuxt.js