Skip to content

Commit

Permalink
fix(config): fix devServer port
Browse files Browse the repository at this point in the history
  • Loading branch information
Hyperkid123 committed Jun 23, 2021
1 parent bb1573c commit b32fb4f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions packages/config/src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const proxy = require('@redhat-cloud-services/frontend-components-config-utiliti
const MiniCssExtractPlugin = require('mini-css-extract-plugin');

module.exports = ({
port = 1337,
port,
publicPath,
appEntry,
rootFolder,
Expand Down Expand Up @@ -34,6 +34,7 @@ module.exports = ({
console.warn('betaEnv is deprecated in favor of env');
}

const devServerPort = typeof port === 'number' ? port : useProxy || standalone ? 1337 : 8002;
return {
mode: mode || (isProd ? 'production' : 'development'),
devtool: false,
Expand Down Expand Up @@ -157,7 +158,7 @@ module.exports = ({
},
devServer: {
contentBase: `${rootFolder || ''}/dist`,
port,
port: devServerPort,
https: https || Boolean(useProxy),
host: '0.0.0.0', // This shares on local network. Needed for docker.host.internal
hot: false, // Use livereload instead of HMR which is spotty with federated modules
Expand Down Expand Up @@ -185,7 +186,7 @@ module.exports = ({
routesPath,
useProxy,
standalone,
port,
port: devServerPort,
reposDir,
appUrl,
publicPath,
Expand Down
2 changes: 1 addition & 1 deletion packages/config/src/config.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ describe('should create dummy config with no options', () => {
contentBase: '/dist',
https: false,
host: '0.0.0.0',
port: 1337,
port: 8002,
hot: false,
disableHostCheck: true,
historyApiFallback: {
Expand Down

0 comments on commit b32fb4f

Please sign in to comment.