【发布时间】:2017-05-23 21:38:27
【问题描述】:
我想将 Angular 2 项目编译为 commonjs 模块。
我有这个tsconfig.json:
{
"compilerOptions": {
"declaration": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"mapRoot": "./",
"module": "commonjs",
"moduleResolution": "node",
"outDir": "../dist/lib",
"sourceMap": true,
"target": "es5",
"removeComments": true
}
}
我使用ntsc,但出现以下错误:
node_modules/@angular/common/src/directives/ng_class.d.ts(46,34): error TS2304: Cannot find name 'Set'.
node_modules/@angular/common/src/pipes/async_pipe.d.ts(44,38): error TS2304: Cannot find name 'Promise'.
node_modules/@angular/compiler/src/aot/compiler.d.ts(32,38): error TS2304: Cannot find name 'Promise'.
node_modules/@angular/compiler/src/aot/compiler.d.ts(44,32): error TS2304: Cannot find name 'Map'.
我有npm版本4.0.5、nodev7.3.0和ntscVersion 2.1.0
【问题讨论】:
标签: angular typescript commonjs