Fix port for real

This commit is contained in:
Andras Schmelczer 2026-01-26 20:20:44 +00:00
parent 0c6283d2fa
commit f685bdca04

View file

@ -1,13 +1,18 @@
const path = require('path'); const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin'); const HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = { module.exports = (env, argv) => {
const isProduction = argv.mode === 'production';
return {
entry: './src/index.tsx', entry: './src/index.tsx',
output: { output: {
path: path.resolve(__dirname, 'dist'), path: path.resolve(__dirname, 'dist'),
filename: 'bundle.js', filename: 'bundle.js',
clean: true, clean: true,
publicPath: './',
// Empty string generates relative paths that work through proxies
publicPath: '',
}, },
resolve: { resolve: {
extensions: ['.ts', '.tsx', '.js', '.jsx'], extensions: ['.ts', '.tsx', '.js', '.jsx'],
@ -33,7 +38,14 @@ module.exports = {
devServer: { devServer: {
port: 3000, port: 3000,
allowedHosts: 'all', allowedHosts: 'all',
historyApiFallback: true, historyApiFallback: {
index: 'index.html',
},
// Disable WebSocket-based HMR for proxy compatibility
// VS Code web proxy sends WebSocket messages as Blobs which breaks HMR
webSocketServer: false,
hot: false,
liveReload: false,
proxy: [ proxy: [
{ {
context: ['/api'], context: ['/api'],
@ -41,4 +53,5 @@ module.exports = {
}, },
], ],
}, },
};
}; };