Skip to content

Commit 967c553

Browse files
committed
Set include settings as necessary for TS itself.
1 parent 68c9c32 commit 967c553

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

lib/typescript-preprocessor.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
1-
const fs = require('fs');
21
const path = require('path');
32

43
const debug = require('debug')('ember-cli-typescript');
5-
const find = require('broccoli-stew').find;
64
const Funnel = require('broccoli-funnel');
75
const MergeTrees = require('broccoli-merge-trees');
86
const ts = require('typescript');
97
const tsc = require('broccoli-typescript-compiler').typescript;
10-
const UnwatchedDir = require('broccoli-source').UnwatchedDir;
118

129
function readConfig(configFile) {
1310
const result = ts.readConfigFile(configFile, ts.sys.readFile);
@@ -27,6 +24,10 @@ class TypeScriptPreprocessor {
2724

2825
const tsconfig = readConfig(path.join('.', 'tsconfig.json'))
2926

27+
// The `include` setting is meant for the IDE integration; broccoli manages
28+
// manages its own input files.
29+
tsconfig.include = ['**/*.ts'];
30+
3031
// tsc needs to emit files on the broccoli pipeline, but not in the default
3132
// config. Otherwise its compiled `.js` files may be created inadvertently.
3233
tsconfig.compilerOptions.noEmit = false;
@@ -35,13 +36,14 @@ class TypeScriptPreprocessor {
3536
this.tsconfig = tsconfig;
3637
}
3738

38-
toTree(inputNode, inputPath, outputPath) {
39+
toTree(inputNode /* , inputPath, outputPath */) {
3940
const js = new Funnel(inputNode, {
40-
exclude: [/ts$/],
41+
exclude: ['**/*.ts'],
4142
annotation: 'JS files',
4243
});
4344

4445
const tsFiles = new Funnel(inputNode, {
46+
include: ['**/*.ts'],
4547
annotation: 'TS files',
4648
});
4749

0 commit comments

Comments
 (0)