@@ -18,7 +18,17 @@ function Angular2App(defaults, options, additionalPaths) {
18
18
}
19
19
20
20
Angular2App . prototype . toTree = function ( ) {
21
- var sourceTree = 'src' ;
21
+ var sourceDir = 'src' ;
22
+
23
+ var sourceTree = new Funnel ( 'src' , {
24
+ destDir : 'src'
25
+ } ) ;
26
+
27
+ var typingsTree = new Funnel ( 'typings' , {
28
+ include : [ 'browser.d.ts' , 'browser/**' ] ,
29
+ destDir : 'typings'
30
+ } ) ;
31
+
22
32
var vendorNpmFiles = [
23
33
'systemjs/dist/system-polyfills.js' ,
24
34
'systemjs/dist/system.src.js' ,
@@ -31,28 +41,36 @@ Angular2App.prototype.toTree = function() {
31
41
'angular2/bundles/upgrade.dev.js'
32
42
] ;
33
43
44
+
45
+
34
46
if ( this . options && this . options . vendorNpmFiles ) {
35
47
vendorNpmFiles = vendorNpmFiles . concat ( this . options . vendorNpmFiles ) ;
36
48
}
37
49
38
50
var tsConfigCompilerOptions = JSON . parse ( fs . readFileSync ( 'src/tsconfig.json' , 'utf-8' ) ) . compilerOptions ;
51
+ // TODO(i): kill rootFilePaths in broccoli-typescript and use tsconfig.json#files instead
52
+ tsConfigCompilerOptions . rootFilePaths = JSON . parse ( fs . readFileSync ( 'src/tsconfig.json' , 'utf-8' ) ) . files ;
53
+
39
54
tsConfigCompilerOptions . rootFilePaths = [ 'typings.d.ts' ] . concat ( this . additionalPaths )
40
55
. map ( function ( name ) {
41
- return path . join ( process . cwd ( ) , sourceTree , name )
56
+ return path . join ( process . cwd ( ) , sourceDir , name )
42
57
} ) ;
43
58
44
- var tsTree = compileWithTypescript ( sourceTree , tsConfigCompilerOptions ) ;
45
- var tsSrcTree = new Funnel ( sourceTree , {
59
+ var srcAndTypingsTree = mergeTrees ( [ sourceDir , typingsTree ] ) ;
60
+
61
+ var tsTree = compileWithTypescript ( srcAndTypingsTree , tsConfigCompilerOptions ) ;
62
+
63
+ var tsSrcTree = new Funnel ( sourceDir , {
46
64
include : [ '**/*.ts' ] ,
47
65
allowEmpty : true
48
66
} ) ;
49
67
50
- var jsTree = new Funnel ( sourceTree , {
68
+ var jsTree = new Funnel ( sourceDir , {
51
69
include : [ '**/*.js' ] ,
52
70
allowEmpty : true
53
71
} ) ;
54
72
55
- var assetTree = new Funnel ( sourceTree , {
73
+ var assetTree = new Funnel ( sourceDir , {
56
74
include : [ '**/*.*' ] ,
57
75
exclude : [ '**/*.ts' , '**/*.js' ] ,
58
76
allowEmpty : true
0 commit comments