@@ -38,17 +38,7 @@ module.exports = class IncrementalTypescriptCompiler {
38
38
this . _didAutoresolve = false ;
39
39
}
40
40
41
- treeForApp ( ) {
42
- // This could be more efficient, but we can hopefully assume there won't be dozens
43
- // or hundreds of TS addons in dev mode all at once.
44
- // Using node-merge-trees in the TypescriptOutput plugin would allow for mappings
45
- // like { foo: 'out', bar: 'out' } so we'd only need one Broccoli node for this.
46
- let addonAppTrees = this . addons . map ( addon => {
47
- return new TypescriptOutput ( this , {
48
- [ `${ this . _relativeAddonRoot ( addon ) } /app` ] : 'app' ,
49
- } ) ;
50
- } ) ;
51
-
41
+ treeForHost ( ) {
52
42
let triggerTree = new Funnel ( this . _triggerDir , { destDir : 'app' } ) ;
53
43
54
44
let appTree = new TypescriptOutput ( this , {
@@ -60,10 +50,23 @@ module.exports = class IncrementalTypescriptCompiler {
60
50
[ mirage ] : 'app/mirage' ,
61
51
} ) ;
62
52
63
- let tree = new MergeTrees ( addonAppTrees . concat ( [ triggerTree , appTree , mirageTree ] . filter ( Boolean ) ) , { overwrite : true } ) ;
53
+ let tree = new MergeTrees ( [ triggerTree , mirageTree , appTree ] . filter ( Boolean ) , { overwrite : true } ) ;
64
54
return new Funnel ( tree , { srcDir : 'app' } ) ;
65
55
}
66
56
57
+ // Returns any developing addons' app trees. Note that the host app itself is managed
58
+ // by treeForHost() above, as it needs to be treated specially by the build to always
59
+ // 'win' when the host and an addon have clashing files.
60
+ treeForApp ( ) {
61
+ let addonAppTrees = this . addons . map ( addon => {
62
+ return new TypescriptOutput ( this , {
63
+ [ `${ this . _relativeAddonRoot ( addon ) } /app` ] : 'app' ,
64
+ } ) ;
65
+ } ) ;
66
+
67
+ return new MergeTrees ( addonAppTrees , { overwrite : true } ) ;
68
+ }
69
+
67
70
treeForAddons ( ) {
68
71
let paths = { } ;
69
72
for ( let addon of this . addons ) {
0 commit comments