【问题标题】:Error while building Angular app with agm-spiderfier使用 agm-spiderfier 构建 Angular 应用程序时出错
【发布时间】:2020-11-01 06:33:48
【问题描述】:
  1. 使用 AGM Spidefier 库编译我的代码时出现错误 TypeScript 编译中缺少 \node_modules\agm-spiderfier\index.ts。请通过 'files' 或 'include' 属性确保它在您的 tsconfig 中。

  2. 下面是我的 tsconfig.app.json 和 tsconfig.spec.json

tsconfig.app.json

      {
         "extends": "./tsconfig.base.json",
         "compilerOptions": {
          "outDir": "./out-tsc/app",
           "types": []
        },
      "files": [
        "src/main.ts",
        "src/polyfills.ts"
      ],
      "include": [
        "src/**/*.d.ts",
        "../node_modules/agm-spiderfier/*.ts"
      ]
    }

tsconfig.spec.json

    {
      "extends": "./tsconfig.base.json",
      "compilerOptions": {
        "outDir": "./out-tsc/spec",
        "types": [
          "jasmine",
          "googlemaps"  
        ]
      },
      "files": [
        "src/test.ts",
        "src/polyfills.ts",
        "../node_modules/agm-spiderfier/index.ts",    
      ],
      "include": [
        "src/**/*.spec.ts",
        "src/**/*.d.ts",
        "../node_modules/agm-spiderfier/*.ts"
      ]
    }

【问题讨论】:

    标签: angular agm


    【解决方案1】:
        Please modify your both the files as below.
        
        tsconfig.app.json
        
        "include": [
            "src/**/*.d.ts",
            "node_modules/agm-spiderfier/**/*.ts"
          ]
        
    
    tsconfig.spec.json
        
         "include": [
            "src/**/*.spec.ts",
            "src/**/*.d.ts",
            "node_modules/agm-spiderfier/**/*.ts"
          ]
    

    【讨论】:

      猜你喜欢
      • 2020-11-30
      • 2020-12-07
      • 1970-01-01
      • 1970-01-01
      • 2019-04-30
      • 2020-11-04
      • 1970-01-01
      • 2022-07-22
      • 2012-04-22
      相关资源
      最近更新 更多