Skip to content

Commit

Permalink
Extending Razzle
Browse files Browse the repository at this point in the history
  • Loading branch information
artur-barrionuevo committed Oct 22, 2024
1 parent 9316a5d commit 0e8e2d0
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions frontend/razzle.extend.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
module.exports = {
modifyWebpackConfig({ env: { target, dev }, webpackConfig }) {
// Only apply this modification for development (dev) and client-side (web)
if (dev && target === 'web') {
// Override the devServer configuration
webpackConfig.devServer = {
...webpackConfig.devServer, // Preserve existing configuration
port: 3000, // Force webpack-dev-server to use port 3000
host: '0.0.0.0', // Listen on all network interfaces
hot: true, // Enable hot module reloading
historyApiFallback: true, // SPA fallback for routing
client: {
overlay: {
warnings: false,
errors: true,
},
},
headers: {
'Access-Control-Allow-Origin': '*', // Optional: CORS if necessary
},
};
}
return webpackConfig;
},
};

0 comments on commit 0e8e2d0

Please sign in to comment.