小编and*_*ves的帖子

在 Angular 库中保留符号链接

我有个问题。

我正在尝试使用 ng-cli 创建一个 Angular 8 库,但我无法使用npm link.

我试图在我的 angular.json 上添加这个:

    "build": {
      "builder": "@angular-devkit/build-ng-packagr:build",
      "options": {
        "preserveSymlinks": true,
        "tsConfig": "projects/button/tsconfig.lib.json",
        "project": "projects/button/ng-package.json"
      }
    }, 
Run Code Online (Sandbox Code Playgroud)

但得到:

"Schema validation failed with the following errors: Data path ""
should NOT have additional properties(preserveSymlinks)."
Run Code Online (Sandbox Code Playgroud)

我发现它不适用于图书馆。

然后我尝试将其添加到我的 tsconfig.lib.json 中:

 "angularCompilerOptions": {
    "annotateForClosureCompiler": true,
    "skipTemplateCodegen": true,
    "strictMetadataEmit": true,
    "fullTemplateTypeCheck": true,
    "strictInjectionParameters": true,
    "enableResourceInlining": true,
    "preserveSymlinks": true
  }
Run Code Online (Sandbox Code Playgroud)

什么也没发生。

我在这里搜索了一个解决方案,但找不到类似的东西。

我怎样才能做到?

谢谢!

npm npm-link angular angular8 angular-cli-v8

13
推荐指数
1
解决办法
1万
查看次数

标签 统计

angular ×1

angular-cli-v8 ×1

angular8 ×1

npm ×1

npm-link ×1