在生产模式下构建angular 7应用程序时出错

时间:2019-06-27 11:34:47

标签: angular

我正在Visual Studio命令提示符下为Angular 7应用程序运行ng build --prod命令,并得到错误。我不知道为什么会抱怨。我看到了一条帖子,上面提到删除rootDir消除了错误

ERROR in ./node_modules/@progress/kendo-angular-inputs/dist/es2015/index.ngfactory.js
Module not found: Error: Can't resolve '../../../kendo-angular-resize-sensor/dist/es2015/index.ngfactory' in 'C:\Development\360-manager\src\WebUI2_0\manager-ui\node_modules\@progress\kendo-angular-inputs\dist\es2015'

tsConfig.json

{
  "compileOnSave": false,
  "compilerOptions": {
      "paths": { "*": ["types/*"] },
    "baseUrl": "./",
    "importHelpers": true,
    "outDir": "./dist/out-tsc",
    "sourceMap": true,
    "declaration": false,
    "module": "es2015",
    "moduleResolution": "node",
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "target": "es5",
    "typeRoots": [
      "node_modules/@types"
    ],
    "lib": [
      "es2017",
      "dom"
    ]
  }
}

在src文件夹下,我有两个tsConfig.jsons

tsConfig.json

  "compileOnSave": false,
  "compilerOptions": {
    "lib": ["es2017", "dom"],
    "target": "es5",
    "module": "commonjs",
    "moduleResolution": "node",
    "sourceMap": true,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "removeComments": false,
    "noImplicitAny": false,
    "outDir": "lib",
    "declaration": true,
    "rootDir": "."
  },
  "include": ["ng2-ckeditor.ts", "src/**/*"],
  "exclude": ["node_modules"]
}

tsconfig-aot.json

{
  "compileOnSave": false,
  "compilerOptions": {
    "lib": ["es2017", "dom"],
    "target": "es5",
    "module": "commonjs",
    "moduleResolution": "node",
    "sourceMap": true,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "removeComments": false,
    "noImplicitAny": false,
    "outDir": "lib",
    "declaration": true,
    "rootDir": "."
  },
  "files": [
    "ng2-ckeditor.ts"
  ],
  "exclude": [
    "node_modules"
  ],
  "angularCompilerOptions": {
    "skipMetadataEmit": false,
    "skipTemplateCodegen": false,
    "annotationsAs": "decorators"
  }
}

0 个答案:

没有答案