1- const fs = require ( 'fs' ) ;
21const path = require ( 'path' ) ;
32
43const debug = require ( 'debug' ) ( 'ember-cli-typescript' ) ;
5- const find = require ( 'broccoli-stew' ) . find ;
64const Funnel = require ( 'broccoli-funnel' ) ;
75const MergeTrees = require ( 'broccoli-merge-trees' ) ;
86const ts = require ( 'typescript' ) ;
97const tsc = require ( 'broccoli-typescript-compiler' ) . typescript ;
10- const UnwatchedDir = require ( 'broccoli-source' ) . UnwatchedDir ;
118
129function 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 : [ / t s $ / ] ,
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