@@ -38,17 +38,7 @@ module.exports = class IncrementalTypescriptCompiler {
3838 this . _didAutoresolve = false ;
3939 }
4040
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 ( ) {
5242 let triggerTree = new Funnel ( this . _triggerDir , { destDir : 'app' } ) ;
5343
5444 let appTree = new TypescriptOutput ( this , {
@@ -60,10 +50,23 @@ module.exports = class IncrementalTypescriptCompiler {
6050 [ mirage ] : 'app/mirage' ,
6151 } ) ;
6252
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 } ) ;
6454 return new Funnel ( tree , { srcDir : 'app' } ) ;
6555 }
6656
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+
6770 treeForAddons ( ) {
6871 let paths = { } ;
6972 for ( let addon of this . addons ) {
0 commit comments