File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed
Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -128,6 +128,24 @@ module.exports = function makeWebpackConfig(options) {
128128 sourceComments : false
129129 } ;< % } % >
130130
131+ < % _ if ( filters . babel ) { - % >
132+ config.babel = {
133+ shouldPrintComment ( commentContents ) {
134+ < % _ if ( filters . flow ) { - % >
135+ let regex = DEV
136+ // keep `// @flow`, `/*@ngInject*/`, & flow type comments in dev
137+ ? / ( @ f l o w | @ n g I n j e c t | ^ : ) /
138+ // keep `/*@ngInject */`
139+ : / @ n g I n j e c t / ;
140+ return regex . test ( commentContents ) ;
141+ < % _ } -%>
142+ < % _ if ( ! filters . flow ) { - % >
143+ // keep `/*@ngInject*/`
144+ return /@ngInject/.test(commentContents);
145+ < % _ } - % >
146+ }
147+ } < % } % >
148+
131149 // Initialize module
132150 config.module = {
133151 preLoaders : [ ] ,
@@ -138,7 +156,6 @@ module.exports = function makeWebpackConfig(options) {
138156 // Compiles ES6 and ES7 into ES5 code
139157 test : / \. j s $ / ,
140158 loader : 'babel' ,
141- query : { comments : DEV || E2E } ,
142159 include : [
143160 path . resolve ( __dirname , 'client/' ) ,
144161 path . resolve ( __dirname , 'node_modules/lodash-es/' )
You can’t perform that action at this time.
0 commit comments