File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ export const commandBundle = async (opts: IOpts = {}) => {
4141 await bundleDlls ( { dllOutPath, dllFileName, dllMainfestName } ) ;
4242
4343 runWebpackDevServer ( {
44- mode : 'development' ,
44+ mode : opts . mode ?? 'development' ,
4545 outFileName : pri . sourceConfig . bundleFileName ,
4646 devServerPort : freePort ,
4747 publicPath : `https://localhost:${ freePort } ` ,
Original file line number Diff line number Diff line change @@ -2,4 +2,5 @@ export interface IOpts {
22 skipLint ?: boolean ;
33 dev ?: boolean ;
44 publicPath ?: string ;
5+ mode ?: 'development' | 'production' ;
56}
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ export const projectDev = async (options: any) => {
2626 if ( options && options . debugDashboard ) {
2727 await debugDashboard ( ) ;
2828 } else {
29- await debugProject ( ) ;
29+ await debugProject ( options ) ;
3030 }
3131} ;
3232
@@ -62,7 +62,7 @@ async function debugDashboard() {
6262 } ) ;
6363}
6464
65- async function debugProject ( ) {
65+ async function debugProject ( options ?: any ) {
6666 const freePort = pri . sourceConfig . devPort || ( await portfinder . getPortPromise ( ) ) ;
6767 const dashboardServerPort = await portfinder . getPortPromise ( { port : freePort + 1 } ) ;
6868 const dashboardClientPort = await portfinder . getPortPromise ( { port : freePort + 2 } ) ;
@@ -142,7 +142,7 @@ async function debugProject() {
142142
143143 // Serve project
144144 await runWebpackDevServer ( {
145- mode : 'development' ,
145+ mode : options ?. mode ?? 'development' ,
146146 autoOpenBrowser : true ,
147147 hot : pri . sourceConfig . hotReload ,
148148 publicPath : globalState . sourceConfig . publicPath ,
You can’t perform that action at this time.
0 commit comments