【问题标题】:Angular 2 AOT compilation requires component nameAngular 2 AOT 编译需要组件名称
【发布时间】:2018-01-18 17:10:24
【问题描述】:

我对 AOT 编译有疑问。当我运行构建任务时,它会询问我一些新的组件名称。这将是 CI 的一个问题。这是Example

我的 tsconfig.json 文件:

{
  "compilerOptions": {
    "declaration": false,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "lib": [ "es6", "dom" ],
    "mapRoot": "./",
    "module": "commonjs",
    "moduleResolution": "node",
    "sourceMap": true,
    "target": "es5",
    "typeRoots": [
      "./node_modules/@types"
    ],
    "types": [
      "node"
    ],
    "noUnusedLocals": true,
    "pretty": true,
    "removeComments": true
  },
  "angularCompilerOptions": {
    "genDir": ".",
    "entryModule": "src/app/app.module#AppModule"
  }
}

有人可以建议如何避免输入此名称吗?`

【问题讨论】:

    标签: angular angular2-aot


    【解决方案1】:

    实际上,这不是问题!小心,因为 npm 中有一个名为“ngc”的包,所以它与 Angular Compiler CLI 同名。

    【讨论】:

    • 是的。如果你不小心运行了npm install ngc,你会得到这个替代的包二进制文件,而不是你想要的角度编译器二进制文件。这个包是一个非官方的组件生成器,它需要 Name: 来创建一个新的组件骨架。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-01-10
    • 2017-03-10
    • 2017-01-13
    • 2017-05-29
    • 2017-09-23
    • 2018-02-15
    • 2020-09-03
    相关资源
    最近更新 更多