nwb
nwb copied to clipboard
Double configuration necessary to change HMR url
IMO this is confusing, while the docs suggest to edit the port forwarding in nwb.config.js
this configuration will be overridden unless the same argument is specified in the command.
https://github.com/insin/nwb/blob/734537207b9024145c97c3a6c8a78366b311c705/src/createServerWebpackConfig.js#L26
To override the default configuration I had both to define a nwb.config.js
module.exports = {
type: 'react-app',
devServer: {
port: 3000,
public: "localhost:3000",
publicPath: "http://localhost:3000/",
disableHostCheck: true,
open: false
},
webpack: {
publicPath: "http://localhost:3000/",
}
}
and define the port in the command in package.json
{
...
scripts: {
...
"start": "nwb serve-react-app --port 3000",
}
This is similar to #524, as any args
config will have been added to serverConfig
by this point, so it should only be checking serverConfig
at this point - I should be able to fix both at the same time.