File tree Expand file tree Collapse file tree 5 files changed +25
-17
lines changed
Expand file tree Collapse file tree 5 files changed +25
-17
lines changed Original file line number Diff line number Diff line change @@ -3,4 +3,4 @@ node_modules/
33types /
44.vscode
55! .env.example
6- .env
6+ * .env
Original file line number Diff line number Diff line change 11const path = require ( 'path' ) ;
22const HtmlWebpackPlugin = require ( 'html-webpack-plugin' ) ;
3- const webpack = require ( 'webpack' ) ;
4- require ( 'dotenv' ) . config ( { path : './.env' } ) ;
3+ require ( 'dotenv' ) . config ( { path : './.env' } ) ;
54
65module . exports = {
76 entry : {
87 index : './src/index.ts' ,
98 } ,
109 plugins : [
11- new webpack . DefinePlugin ( {
12- WEBSOCKET_URL : JSON . stringify ( ( process . env . WEBSOCKET_URL !== undefined ) ? process . env . WEBSOCKET_URL : '' )
13- } ) ,
1410 new HtmlWebpackPlugin ( {
1511 title : 'Scalable Pixel Streaming Frontend' ,
1612 template : './src/index.html' ,
Original file line number Diff line number Diff line change 11const { merge } = require ( 'webpack-merge' ) ;
22const common = require ( './webpack.common.js' ) ;
33const path = require ( 'path' ) ;
4+ const webpack = require ( 'webpack' ) ;
45
56module . exports = merge ( common , {
67 mode : 'development' ,
78 devtool : 'source-map' ,
8- } ) ;
9+ plugins : [
10+ new webpack . DefinePlugin ( {
11+ WEBSOCKET_URL : JSON . stringify ( ( process . env . WEBSOCKET_URL !== undefined ) ? process . env . WEBSOCKET_URL : undefined )
12+ } ) ,
13+ ]
14+ } ) ;
Original file line number Diff line number Diff line change 11const { merge } = require ( 'webpack-merge' ) ;
22const common = require ( './webpack.common.js' ) ;
3+ const webpack = require ( 'webpack' ) ;
34
45module . exports = merge ( common , {
5- mode : 'production' ,
6- optimization : {
7- usedExports : true ,
8- minimize : true
9- } ,
10- stats : 'errors-only' ,
11- performance : {
12- hints : false
13- }
6+ mode : 'production' ,
7+ optimization : {
8+ usedExports : true ,
9+ minimize : true
10+ } ,
11+ stats : 'errors-only' ,
12+ performance : {
13+ hints : false
14+ } ,
15+ plugins : [
16+ new webpack . DefinePlugin ( {
17+ WEBSOCKET_URL : undefined
18+ } ) ,
19+ ]
1420} ) ;
Original file line number Diff line number Diff line change @@ -61,7 +61,7 @@ export class SPSApplication extends Application {
6161 this . stream . setSignallingUrlBuilder ( ( ) => {
6262
6363 // if we have overriden the signalling server URL with a .env file use it here
64- if ( WEBSOCKET_URL ) {
64+ if ( WEBSOCKET_URL !== undefined ) {
6565 return WEBSOCKET_URL as string ;
6666 }
6767
You can’t perform that action at this time.
0 commit comments