@@ -13,6 +13,7 @@ import {
13
13
import { ERROR_PREFIX } from '../lib/ui' ;
14
14
import { treeKillSync as killProcessSync } from '../lib/utils/tree-kill' ;
15
15
import { BuildAction } from './build.action' ;
16
+ import { assertNonArray } from '../lib/utils/type-assertions' ;
16
17
17
18
export class StartAction extends BuildAction {
18
19
public async handle ( commandInputs : Input [ ] , commandOptions : Input [ ] ) {
@@ -44,6 +45,8 @@ export class StartAction extends BuildAction {
44
45
watchAssetsModeOption && watchAssetsModeOption . value
45
46
) ;
46
47
const debugFlag = debugModeOption && debugModeOption . value ;
48
+ assertNonArray ( debugFlag ) ;
49
+
47
50
const binaryToRun = getValueOrDefault (
48
51
configuration ,
49
52
'exec' ,
@@ -81,7 +84,7 @@ export class StartAction extends BuildAction {
81
84
const envFileOption = commandOptions . find (
82
85
( option ) => option . name === 'envFile' ,
83
86
) ;
84
- const envFile = envFileOption ?. value as string ;
87
+ const envFile = ( envFileOption ?. value ?? [ ] ) as string [ ] ;
85
88
86
89
const onSuccess = this . createOnSuccessHook (
87
90
entryFile ,
@@ -120,7 +123,7 @@ export class StartAction extends BuildAction {
120
123
binaryToRun : string ,
121
124
options : {
122
125
shell : boolean ;
123
- envFile ?: string ;
126
+ envFile ?: string [ ] ;
124
127
} ,
125
128
) {
126
129
let childProcessRef : any ;
@@ -177,7 +180,7 @@ export class StartAction extends BuildAction {
177
180
binaryToRun : string ,
178
181
options : {
179
182
shell : boolean ;
180
- envFile ?: string ;
183
+ envFile ?: string [ ] ;
181
184
} ,
182
185
) {
183
186
let outputFilePath = join ( outDirName , sourceRoot , entryFile ) ;
@@ -206,9 +209,14 @@ export class StartAction extends BuildAction {
206
209
typeof debug === 'string' ? `--inspect=${ debug } ` : '--inspect' ;
207
210
processArgs . unshift ( inspectFlag ) ;
208
211
}
209
- if ( options . envFile ) {
210
- processArgs . unshift ( `--env-file=${ options . envFile } ` ) ;
212
+
213
+ if ( options . envFile && options . envFile . length > 0 ) {
214
+ const envFileNodeArgs = options . envFile . map (
215
+ ( envFilePath ) => `--env-file=${ envFilePath } ` ,
216
+ ) ;
217
+ processArgs . unshift ( envFileNodeArgs . join ( ' ' ) ) ;
211
218
}
219
+
212
220
processArgs . unshift ( '--enable-source-maps' ) ;
213
221
214
222
return spawn ( binaryToRun , processArgs , {
0 commit comments