File tree Expand file tree Collapse file tree 1 file changed +24
-1
lines changed Expand file tree Collapse file tree 1 file changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -96,13 +96,36 @@ module.exports = {
96
96
}
97
97
98
98
this . _addon . logger . debug ( `setup *.hbs compiler with ${ htmlbarsOptions . pluginNames } ` ) ;
99
- return debugTree (
99
+ let output = debugTree (
100
100
this . _addon . transpileTree ( inputTree , {
101
101
isProduction,
102
102
...htmlbarsOptions ,
103
103
} ) ,
104
104
'03-output'
105
105
) ;
106
+
107
+ let checker = new VersionChecker ( this . _addon . project ) . for ( 'ember-cli' , 'npm' ) ;
108
+ let requiresBabelTree = checker . lt ( '3.13.0' ) ;
109
+ let isAddon = this . _addon . parent !== this . _addon . project ;
110
+
111
+ // as a result of https://github.com/ember-cli/ember-cli-htmlbars/pull/749 we are relying
112
+ // on babel for all template comilation. This works fine since [email protected] but before
113
+ // that there was a different path for **addon** templates and they would not be compiled
114
+ // correctly. This change wraps the output of addons in a babel tree since ember-cli
115
+ // isn't doing that properly.
116
+ if ( requiresBabelTree && isAddon ) {
117
+ let babelAddon = this . _addon . parent . addons . find (
118
+ ( addon ) => addon . name === 'ember-cli-babel'
119
+ ) ;
120
+ output = babelAddon . transpileTree ( output , {
121
+ babel : this . _addon . parent . options . babel ,
122
+ 'ember-cli-babel' : {
123
+ compileModules : false ,
124
+ } ,
125
+ } ) ;
126
+ }
127
+
128
+ return output ;
106
129
} ,
107
130
108
131
precompile ( string , _options ) {
You can’t perform that action at this time.
0 commit comments