File tree Expand file tree Collapse file tree 3 files changed +10
-4
lines changed Expand file tree Collapse file tree 3 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,8 @@ var ERROR = 2;
5
5
module . exports = {
6
6
env : {
7
7
'node' : true ,
8
- 'es2017' : true
8
+ 'es2017' : true ,
9
+ 'es2020' : true
9
10
} ,
10
11
11
12
extends : 'eslint:recommended' ,
Original file line number Diff line number Diff line change @@ -6,16 +6,20 @@ var U = require('../../../utils'),
6
6
7
7
var isBaseControllerExportExpression = types . buildMatchMemberExpression ( 'exports.baseController' ) ;
8
8
9
- const GENCODE_OPTIONS = {
9
+ let GENCODE_OPTIONS = {
10
10
retainLines : true
11
11
} ;
12
12
13
- exports . processController = function ( code , file ) {
13
+ exports . processController = function ( code , file , isProduction = false ) {
14
14
var baseController = '' ,
15
15
moduleCodes = '' ,
16
16
newCode = '' ,
17
17
exportSpecifiers = [ ] ;
18
18
19
+ if ( isProduction ) {
20
+ GENCODE_OPTIONS . retainLines = false ;
21
+ }
22
+
19
23
try {
20
24
var ast = babylon . parse ( code , { sourceFilename : file , sourceType : 'unambiguous' } ) ;
21
25
Original file line number Diff line number Diff line change @@ -952,8 +952,9 @@ exports.loadController = function(file) {
952
952
U . die ( 'Error reading controller file "' + file + '".' , e ) ;
953
953
}
954
954
955
+ var isProduction = compilerConfig . alloyConfig ?. deploytype === 'production' ;
955
956
// get the base controller for this controller, also process import/export statements
956
- var controller = astController . processController ( contents , file ) ;
957
+ var controller = astController . processController ( contents , file , isProduction ) ;
957
958
code . controller = controller . code ;
958
959
code . parentControllerName = controller . base ;
959
960
code . es6mods = controller . es6mods ;
You can’t perform that action at this time.
0 commit comments