File tree 3 files changed +5
-4
lines changed
3 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ export const commandBundle = async (opts: IOpts = {}) => {
41
41
await bundleDlls ( { dllOutPath, dllFileName, dllMainfestName } ) ;
42
42
43
43
runWebpackDevServer ( {
44
- mode : 'development' ,
44
+ mode : opts . mode ?? 'development' ,
45
45
outFileName : pri . sourceConfig . bundleFileName ,
46
46
devServerPort : freePort ,
47
47
publicPath : `https://localhost:${ freePort } ` ,
Original file line number Diff line number Diff line change @@ -2,4 +2,5 @@ export interface IOpts {
2
2
skipLint ?: boolean ;
3
3
dev ?: boolean ;
4
4
publicPath ?: string ;
5
+ mode ?: 'development' | 'production' ;
5
6
}
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ export const projectDev = async (options: any) => {
26
26
if ( options && options . debugDashboard ) {
27
27
await debugDashboard ( ) ;
28
28
} else {
29
- await debugProject ( ) ;
29
+ await debugProject ( options ) ;
30
30
}
31
31
} ;
32
32
@@ -62,7 +62,7 @@ async function debugDashboard() {
62
62
} ) ;
63
63
}
64
64
65
- async function debugProject ( ) {
65
+ async function debugProject ( options ?: any ) {
66
66
const freePort = pri . sourceConfig . devPort || ( await portfinder . getPortPromise ( ) ) ;
67
67
const dashboardServerPort = await portfinder . getPortPromise ( { port : freePort + 1 } ) ;
68
68
const dashboardClientPort = await portfinder . getPortPromise ( { port : freePort + 2 } ) ;
@@ -142,7 +142,7 @@ async function debugProject() {
142
142
143
143
// Serve project
144
144
await runWebpackDevServer ( {
145
- mode : 'development' ,
145
+ mode : options ?. mode ?? 'development' ,
146
146
autoOpenBrowser : true ,
147
147
hot : pri . sourceConfig . hotReload ,
148
148
publicPath : globalState . sourceConfig . publicPath ,
You can’t perform that action at this time.
0 commit comments