fix(compiler-cli): extend angularCompilerOptions in tsconfig from node (#40694)
TypeScript supports non rooted extends, we should do the same https://github.com/microsoft/TypeScript/blob/b346f5764e4d500ebdeff7086e43690ea533a305/src/compiler/commandLineParser.ts#L2603-L2628 Closes: #36715 PR Close #40694
This commit is contained in:
@@ -102,4 +102,38 @@ describe('perform_compile', () => {
|
||||
annotateForClosureCompiler: false,
|
||||
}));
|
||||
});
|
||||
|
||||
it('should merge tsconfig "angularCompilerOptions" when extends point to node package', () => {
|
||||
support.writeFiles({
|
||||
'tsconfig-level-1.json': `{
|
||||
"extends": "@angular-ru/tsconfig",
|
||||
"angularCompilerOptions": {
|
||||
"enableIvy": false
|
||||
}
|
||||
}
|
||||
`,
|
||||
'node_modules/@angular-ru/tsconfig/tsconfig.json': `{
|
||||
"compilerOptions": {
|
||||
"strict": true
|
||||
},
|
||||
"angularCompilerOptions": {
|
||||
"skipMetadataEmit": true
|
||||
}
|
||||
}
|
||||
`,
|
||||
'node_modules/@angular-ru/tsconfig/package.json': `{
|
||||
"name": "@angular-ru/tsconfig",
|
||||
"version": "0.0.0",
|
||||
"main": "./tsconfig.json"
|
||||
}
|
||||
`,
|
||||
});
|
||||
|
||||
const {options} = readConfiguration(path.resolve(basePath, 'tsconfig-level-1.json'));
|
||||
expect(options).toEqual(jasmine.objectContaining({
|
||||
strict: true,
|
||||
skipMetadataEmit: true,
|
||||
enableIvy: false,
|
||||
}));
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user