Skip to content

Commit

Permalink
Bug fix building for prod to exclude the WEBSOCKET_URL var stored in …
Browse files Browse the repository at this point in the history
…the .env file
  • Loading branch information
david-macpherson committed Feb 22, 2024
1 parent 4be7567 commit 959eaa3
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 12 deletions.
3 changes: 0 additions & 3 deletions examples/webRtcTcpDetectEvent/webpack.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ module.exports = {
index: './src/index.ts',
},
plugins: [
new webpack.DefinePlugin({
WEBSOCKET_URL: JSON.stringify((process.env.WEBSOCKET_URL !== undefined) ? process.env.WEBSOCKET_URL : '')
}),
new HtmlWebpackPlugin({
title: 'Scalable Pixel Streaming Frontend',
template: './src/index.html',
Expand Down
6 changes: 6 additions & 0 deletions examples/webRtcTcpDetectEvent/webpack.dev.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
const { merge } = require('webpack-merge');
const common = require('./webpack.common.js');
const path = require('path');
const webpack = require('webpack');

module.exports = merge(common, {
mode: 'development',
devtool: 'source-map',
plugins: [
new webpack.DefinePlugin({
WEBSOCKET_URL: JSON.stringify((process.env.WEBSOCKET_URL !== undefined) ? process.env.WEBSOCKET_URL : '')
}),
]
});
24 changes: 15 additions & 9 deletions examples/webRtcTcpDetectEvent/webpack.prod.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
const { merge } = require('webpack-merge');
const common = require('./webpack.common.js');
const webpack = require('webpack');

module.exports = merge(common, {
mode: 'production',
optimization: {
usedExports: true,
minimize: true
},
stats: 'errors-only',
performance: {
hints: false
}
mode: 'production',
optimization: {
usedExports: true,
minimize: true
},
stats: 'errors-only',
performance: {
hints: false
},
plugins: [
new webpack.DefinePlugin({
WEBSOCKET_URL: undefined
}),
]
});

0 comments on commit 959eaa3

Please sign in to comment.