@@ -55,6 +55,8 @@ export interface CreateConfigOptions extends CommonConfigOptions {
55
55
blockLegacyChrome ?: boolean ;
56
56
devtool ?: Configuration [ 'devtool' ] ;
57
57
_unstableSpdy ?: boolean ;
58
+ frontendCRDPath ?: string ;
59
+ deploymentBuild ?: boolean ;
58
60
}
59
61
60
62
export const createConfig = ( {
@@ -101,6 +103,8 @@ export const createConfig = ({
101
103
devtool = false ,
102
104
// enables SPDY as a dev server
103
105
_unstableSpdy = false ,
106
+ frontendCRDPath = path . resolve ( rootFolder , 'deploy/frontend.yaml' ) ,
107
+ deploymentBuild = false ,
104
108
} : CreateConfigOptions ) : Configuration => {
105
109
if ( typeof _unstableHotReload !== 'undefined' ) {
106
110
fecLogger ( LogType . warn , `The _unstableHotReload option in shared webpack config is deprecated. Use hotReload config instead.` ) ;
@@ -269,56 +273,59 @@ export const createConfig = ({
269
273
...resolve . fallback ,
270
274
} ,
271
275
} ,
272
- devServer : {
273
- static : {
274
- directory : `${ rootFolder || '' } /dist` ,
275
- } ,
276
- port : devServerPort ,
277
- server : _unstableSpdy ? 'spdy' : https || Boolean ( useProxy ) ? 'https' : 'http' ,
278
- host : '0.0.0.0' , // This shares on local network. Needed for docker.host.internal
279
- hot : internalHotReload , // Use livereload instead of HMR which is spotty with federated modules
280
- liveReload : ! internalHotReload ,
281
- allowedHosts : 'all' ,
282
- // https://github.com/bripkens/connect-history-api-fallback
283
- historyApiFallback : {
284
- // We should really implement the same logic as cloud-services-config
285
- //
286
- // Until then let known api calls fall through instead of returning /index.html
287
- // for easier `fetch` debugging
288
- rewrites : [
289
- { from : / ^ \/ a p i / , to : '/404.html' } ,
290
- { from : / ^ \/ c o n f i g / , to : '/404.html' } ,
291
- ] ,
292
- verbose : Boolean ( proxyVerbose ) ,
293
- disableDotRule : true ,
294
- } ,
295
- devMiddleware : {
296
- writeToDisk : true ,
297
- } ,
298
- client,
299
- ...proxy ( {
300
- env,
301
- localChrome,
302
- keycloakUri,
303
- customProxy,
304
- routes,
305
- routesPath,
306
- useProxy,
307
- proxyURL,
308
- standalone,
276
+ ...( ! deploymentBuild && {
277
+ devServer : {
278
+ static : {
279
+ directory : `${ rootFolder || '' } /dist` ,
280
+ } ,
309
281
port : devServerPort ,
310
- reposDir,
311
- appUrl,
312
- publicPath,
313
- proxyVerbose,
314
- target,
315
- registry,
316
- bounceProd,
317
- useAgent,
318
- useDevBuild,
319
- blockLegacyChrome,
320
- } ) ,
321
- } ,
282
+ server : _unstableSpdy ? 'spdy' : https || Boolean ( useProxy ) ? 'https' : 'http' ,
283
+ host : '0.0.0.0' , // This shares on local network. Needed for docker.host.internal
284
+ hot : internalHotReload , // Use livereload instead of HMR which is spotty with federated modules
285
+ liveReload : ! internalHotReload ,
286
+ allowedHosts : 'all' ,
287
+ // https://github.com/bripkens/connect-history-api-fallback
288
+ historyApiFallback : {
289
+ // We should really implement the same logic as cloud-services-config
290
+ //
291
+ // Until then let known api calls fall through instead of returning /index.html
292
+ // for easier `fetch` debugging
293
+ rewrites : [
294
+ { from : / ^ \/ a p i / , to : '/404.html' } ,
295
+ { from : / ^ \/ c o n f i g / , to : '/404.html' } ,
296
+ ] ,
297
+ verbose : Boolean ( proxyVerbose ) ,
298
+ disableDotRule : true ,
299
+ } ,
300
+ devMiddleware : {
301
+ writeToDisk : true ,
302
+ } ,
303
+ client,
304
+ ...proxy ( {
305
+ env,
306
+ localChrome,
307
+ keycloakUri,
308
+ customProxy,
309
+ routes,
310
+ routesPath,
311
+ useProxy,
312
+ proxyURL,
313
+ standalone,
314
+ port : devServerPort ,
315
+ reposDir,
316
+ appUrl,
317
+ publicPath,
318
+ proxyVerbose,
319
+ target,
320
+ registry,
321
+ bounceProd,
322
+ useAgent,
323
+ useDevBuild,
324
+ blockLegacyChrome,
325
+ frontendCRDPath,
326
+ } ) ,
327
+ } ,
328
+ } ) ,
322
329
} ;
323
330
} ;
324
331
0 commit comments