Eric
06/19/2025, 10:47 AMconst config = {
async rewrites() {
return [
{
source: '/api/:path*',
destination: '<http://localhost:4000/:path*>' // Proxy to Backend
}
]
}
};
Chrimaeon
06/19/2025, 10:53 AMChrimaeon
06/19/2025, 10:56 AMEric
06/19/2025, 11:37 AMChrimaeon
06/19/2025, 11:38 AMIf you want to make further adjustments to the webpack configuration, place your additional configuration files inside a directory calledin the root of your project.webpack.config.d
Chrimaeon
06/19/2025, 11:38 AMWhen building your project, allconfiguration files will automatically be merged into the.js
file.build/js/packages/projectName/webpack.config.js
Chrimaeon
06/19/2025, 11:39 AMEric
06/19/2025, 11:40 AMChrimaeon
06/19/2025, 11:41 AMEric
06/19/2025, 11:41 AMChrimaeon
06/19/2025, 11:42 AMEric
06/19/2025, 11:42 AMEric
06/19/2025, 11:49 AMconfig.module.rules.push({
proxy: [
{
context: ['/api'],
target: '<http://localhost:3000>',
},
],
});
Eric
06/19/2025, 11:50 AMChrimaeon
06/19/2025, 12:04 PMcomposeApp/
?
2. you do not want to change the config.module.rules
but the config.devServer
see the second link I posted in the first response.Eric
06/19/2025, 12:05 PMChrimaeon
06/19/2025, 12:05 PMcomposeApp
😉Chrimaeon
06/19/2025, 12:06 PM(function (config) {
config.devServer = {
...config.devServer,
"historyApiFallback": true,
proxy: [{
context: ['/api'],
target: '<http://localhost:8089>',
}],
};
})(config);
Eric
06/19/2025, 12:08 PM