Angular无法以生产模式构建

时间:2018-11-30 15:25:36

标签: angular angular-cli

我有一个Angular网站,如果我不使用--prod,则构建可以正常进行,我尝试设置allowJs:false,构建密码,但是该网站无法正常工作。 这是配置文件:

tsconfig.json

{
  "compileOnSave": false,
  "compilerOptions": {
    "outDir": "./dist/out-tsc",
    "sourceMap": true,
    "declaration": false,
    "moduleResolution": "node",
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "target": "es5",
    "typeRoots": [
      "node_modules/@types"
    ],
    "lib": [
      "es2017",
      "dom"
    ]
  },
  "include": [
    "src/**/*",
    "node_modules/json-typescript-mapper/libs/utils.ts",
    "node_modules/angular2-logger/app/core/level.ts",
    "node_modules/angular2-logger/app/core/logger.ts",
    "node_modules/angular2-logger/app/core/providers.ts"
  ]
}

tsconfig.app.json

{
  "extends": "../tsconfig.json",
  "compilerOptions": {
    "outDir": "../out-tsc/app",
    "baseUrl": "./",
    "module": "es2015",
    "types": [],
    "allowJs": true
  },
  "exclude": [
    "test.ts",
    "node_modules",
    "definitions",
    "**/*.spec.ts"
  ]
}

错误是:

error TS5055: cannot write file D:/**/node_modules/core-js/modules/es7.reflect.get-own-metadata.js' because it would overwrite input file. Adding a tsconfig.json file will help organze projects that contain both Typescript and Javascript files. Learn more at https://aka.ms/tsconfig 

您有什么想法吗?

0 个答案:

没有答案