使用ng-packagr时,角度通用构建失败吗?

时间:2018-12-21 07:24:46

标签: typescript angular-universal ng-packagr

我已经使用 ng-packagr 为我的控件创建角度包。它像美丽一样被创造。但是如果我在角度通用示例中使用该程序包,则在捆绑时会引发以下错误

ERROR in ./node_modules/@syncfusion/ej2-angular-grids/@syncfusion/ej2- 
angular-grids.es5.js
Module parse failed: Identifier '__extends' has already been declared 
(1836:9)
You may need an appropriate loader to handle this file type.
|     }
| }
| import { __extends } from "tslib";
| var __decorate$1 = (this && this.__decorate) || function (decorators,  
target, key, desc) {
|     var c = arguments.length, r = c < 3 ? target : desc === null ? desc = 
Object.getOwnPropertyDescriptor(target, key) : desc, d;

如果我创建正常的angular-cli ,也会发生同样的问题,但是我已经解决了升级compiler-cli软件包的问题,​​但普遍无法解决此问题。

  

ng-packagr配置

ng-package.json

{
 "$schema": "./node_modules/ng-packagr/ng-package.schema.json",
  "lib": {
    "entryFile": "./public_api.ts"
  },
  "whitelistedNonPeerDependencies": [
    "syncfusion",
    "typedoc", "angular"
  ]
}

package.json

"scripts": {
        "packagr": "ng-packagr -p ng-package.json"
    }
  

它抛出ts-lib错误,我想解决这个问题,或者我想知道如何在ng-packagr中禁用 ts-lib

0 个答案:

没有答案