Skip to content

Commit 5fa2592

Browse files
authored
Merge pull request #5213 from SergioChan/fix-issue-5196-rewrite-relative-import-extensions
fix(config): preserve rewriteRelativeImportExtensions setting
2 parents a98e1e2 + 628bd61 commit 5fa2592

File tree

2 files changed

+22
-23
lines changed

2 files changed

+22
-23
lines changed

src/legacy/config/config-set.spec.ts

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -68,34 +68,34 @@ describe('config-set', () => {
6868
expect(compilerOptions.module).toBe(ts.ModuleKind.CommonJS)
6969
})
7070

71-
it('should override some default options', () => {
72-
expect(
73-
getParsedTsconfig({
74-
tsconfig: {
75-
inlineSourceMap: true,
76-
declaration: true,
77-
isolatedDeclarations: true,
78-
noEmit: true,
79-
removeComments: true,
80-
out: 'foo',
81-
outFile: 'foo.js',
82-
composite: true,
83-
declarationDir: 'foo',
84-
declarationMap: true,
85-
emitDeclarationOnly: true,
86-
sourceRoot: 'foo',
87-
tsBuildInfoFile: 'foo.info',
88-
rewriteRelativeImportExtensions: true,
89-
},
90-
}).options,
91-
).toMatchObject({
71+
it('should override compiler defaults but preserve rewriteRelativeImportExtensions', () => {
72+
const options = getParsedTsconfig({
73+
tsconfig: {
74+
inlineSourceMap: true,
75+
declaration: true,
76+
isolatedDeclarations: true,
77+
noEmit: true,
78+
removeComments: true,
79+
out: 'foo',
80+
outFile: 'foo.js',
81+
composite: true,
82+
declarationDir: 'foo',
83+
declarationMap: true,
84+
emitDeclarationOnly: true,
85+
sourceRoot: 'foo',
86+
tsBuildInfoFile: 'foo.info',
87+
rewriteRelativeImportExtensions: true,
88+
},
89+
}).options
90+
91+
expect(options).toMatchObject({
9292
inlineSourceMap: false,
9393
declaration: false,
9494
isolatedDeclarations: false,
9595
noEmit: false,
9696
removeComments: false,
97-
rewriteRelativeImportExtensions: false,
9897
})
98+
expect(options.rewriteRelativeImportExtensions).toBe(true)
9999
})
100100

101101
it.each([

src/legacy/config/config-set.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,6 @@ export class ConfigSet {
177177
emitDeclarationOnly: undefined,
178178
sourceRoot: undefined,
179179
tsBuildInfoFile: undefined,
180-
rewriteRelativeImportExtensions: false,
181180
}
182181

183182
/**

0 commit comments

Comments
 (0)