Skip to content

Commit 68c9c32

Browse files
committed
Only process the tsconfig once.
1 parent 2674082 commit 68c9c32

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

lib/typescript-preprocessor.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,18 @@ class TypeScriptPreprocessor {
2424
this.name = 'ember-cli-typescript';
2525
this.ext = 'ts';
2626
this.options = JSON.parse(JSON.stringify(options));
27-
}
2827

29-
toTree(inputNode, inputPath, outputPath) {
30-
const tsconfig = readConfig(path.join('.', 'tsconfig.json'));
28+
const tsconfig = readConfig(path.join('.', 'tsconfig.json'))
3129

3230
// tsc needs to emit files on the broccoli pipeline, but not in the default
3331
// config. Otherwise its compiled `.js` files may be created inadvertently.
3432
tsconfig.compilerOptions.noEmit = false;
3533
delete tsconfig.compilerOptions.outDir;
3634

35+
this.tsconfig = tsconfig;
36+
}
37+
38+
toTree(inputNode, inputPath, outputPath) {
3739
const js = new Funnel(inputNode, {
3840
exclude: [/ts$/],
3941
annotation: 'JS files',
@@ -43,7 +45,7 @@ class TypeScriptPreprocessor {
4345
annotation: 'TS files',
4446
});
4547

46-
const ts = tsc(tsFiles, { tsconfig });
48+
const ts = tsc(tsFiles, { tsconfig: this.tsconfig });
4749

4850
// Put everything together.
4951
return new MergeTrees([js, ts], {

0 commit comments

Comments
 (0)