File tree Expand file tree Collapse file tree 1 file changed +20
-3
lines changed
Expand file tree Collapse file tree 1 file changed +20
-3
lines changed Original file line number Diff line number Diff line change 1- process . env . NODE_ENV = process . env . NODE_ENV || 'development'
1+ const environment = require ( "./environment" ) ;
2+ const { merge } = require ( "webpack-merge" ) ;
23
3- const environment = require ( './environment' )
4+ process . env . NODE_ENV = process . env . NODE_ENV || "development" ;
5+ const defaultConfig = environment . toWebpackConfig ( ) ;
46
5- module . exports = environment . toWebpackConfig ( )
7+ if ( process . env . GITPOD_WORKSPACE_URL ) {
8+ const [ protocol , hostname ] = process . env . GITPOD_WORKSPACE_URL . split ( "://" ) ;
9+
10+ // ex: https://3035-fuchsia-lamprey-16r2m3h5.ws-us14.gitpod.io
11+ const devServerPublic = `https://3035-${ hostname } ` ;
12+
13+ const mergedConfig = merge ( defaultConfig , {
14+ devServer : {
15+ public : devServerPublic ,
16+ } ,
17+ } ) ;
18+
19+ module . exports = mergedConfig ;
20+ } else {
21+ module . exports = defaultConfig ;
22+ }
You can’t perform that action at this time.
0 commit comments