代码之家  ›  专栏  ›  技术社区  ›  pirmax

nuxtjs的typescript和tsconfig.json文件

  •  0
  • pirmax  · 技术社区  · 7 年前

    我有一个项目 nuxtjs公司 ( in./src/客户/ )以及 内斯特 ( 在./src/server中/ )中。

    这个 TSOCONT.JSON 对于 nuxtjs公司 TSOCONT.JSON 全球项目。

    我不知道怎样才能把这个项目做好。

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

    当我转到根页面时,nuxtjs上有一个错误:

    当使用{runinnewcontext:false时,bundle export应该是一个函数 }。

    如果我删除所有 内斯特 在我的项目中, nuxtjs公司 开始不错,但是当我在 TSOCONT.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位于./(根目录)

    {
      "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"
      ]
    }
    
    1 回复  |  直到 7 年前
        1
  •  0
  •   husayt    7 年前

    Here 是我放在一起的一个例子,展示了如何使用带有nuxt的typescript。

    推荐文章