Skip to content

Commit 635de55

Browse files
clydinmgechev
authored andcommitted
fix(@schematics/angular): enable tsickle for library compilation
This is required to support forward references in ES2015 target code. tsickle provides the constructor parameter downlevel logic that removes the runtime TDZ error that would otherwise be encountered.
1 parent 6b28d3a commit 635de55

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

packages/schematics/angular/library/files/tsconfig.lib.json.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
"compilerOptions": {
44
"outDir": "<%= relativePathToWorkspaceRoot %>/out-tsc/lib",
55
"target": "es2015",
6-
"emitDecoratorMetadata": true,
76
"declaration": true,
87
"inlineSources": true,
98
"types": [],
@@ -13,6 +12,7 @@
1312
]
1413
},
1514
"angularCompilerOptions": {
15+
"annotateForClosureCompiler": true,
1616
"skipTemplateCodegen": true,
1717
"strictMetadataEmit": true,
1818
"fullTemplateTypeCheck": true,

packages/schematics/angular/library/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,11 @@ function addDependenciesToPackageJson() {
103103
name: 'ng-packagr',
104104
version: '^5.1.0',
105105
},
106+
{
107+
type: NodeDependencyType.Dev,
108+
name: 'tsickle',
109+
version: '^0.35.0',
110+
},
106111
{
107112
type: NodeDependencyType.Default,
108113
name: 'tslib',

0 commit comments

Comments
 (0)