-
Notifications
You must be signed in to change notification settings - Fork 214
Conversation
@@ -33,7 +32,7 @@ module.exports = (neutrino, opts = {}) => { | |||
historyApiFallback: true, | |||
publicPath: '/', | |||
headers: { | |||
host: `${publicHost}:${port}` | |||
host: publicHost |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does this produce when no value is passed for public
? What is produced here when the host is overridden?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@eliperelman When no value is passed to public
and the host
is overridden:
module.exports = {
use: [
[
'@neutrinojs/react',
{
devServer: {
host: '0.0.0.0',
port: 3000,
}
}
]
]
};
Outputs in the inspect mode (relevant snippet):
{
devServer: {
headers: {
host: '0.0.0.0'
},
host: '0.0.0.0',
port: 3000,
'public': '0.0.0.0',
},
entry: {
index: [
'/Users/haali/Documents/Mozilla/projects/neutrino-dev/node_modules/webpack-dev-server/client/index.js?http://0.0.0.0',
'/Users/haali/Documents/Mozilla/projects/neutrino-dev/node_modules/webpack/hot/dev-server.js',
'/Users/haali/Documents/Mozilla/projects/neutrino-dev/node_modules/react-hot-loader/patch.js',
'/Users/haali/Documents/Mozilla/projects/todelete/src/index'
]
},
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if public is 0.0.0.0:3000
?
packages/neutrino/bin/start.js
Outdated
@@ -43,7 +43,7 @@ module.exports = (middleware, args, cli) => { | |||
}); | |||
} else { | |||
const { devServer } = compiler.options; | |||
const url = `${devServer.https ? 'https' : 'http'}://${devServer.public}`; | |||
const url = `${devServer.https ? 'https' : 'http'}://${devServer.public}:${devServer.port}`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was my concern as well, because we used to have this. public
should also have the port built into it, since the value for public
can be host:port. We need to normalize the value in dev-server differently to account for this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I know what you mean. Deleting the last commit and pushing something else now.
d113148
to
a3e6e95
Compare
@eliperelman Let me know if the last commit is what you wanted. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like it!
@helfi92 looks like there's still a problem: |
@eliperelman What config are you using? Asking so I can replicate on my machine. |
Oh, I see. I replicate when I don't provide any custom config for devServer. Will send a patch. |
* Respect values for devServer.public * Normalize path
Fixes #669.