fix: consider custom devServer config #10492
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I´m using a custom Docker setup and had trouble to get the watch-admin running. After some testing i found a few things.
I had to first add the url to the config and second add the devServer config.
webpack: (config, webpack) => {
config.devServer = {
host: '0.0.0.0',
useLocalIp: false
};
return config;
},
After that strapi develop --watch-admin was accessible over the docker ip. But because the config gets not forwarded in the opts, the hot reload doesn't work.
That's because this doesn't get the args that i setup.
function createDomain(options, server) {
const protocol = options.https ? 'https' : 'http';
const hostname = options.useLocalIp
? ip.v4.sync() || 'localhost'
: options.host || 'localhost';
If there is a another way I would like to know. Otherwise I would appreciate this small hotfix.
Here my original problem -> https://stackoverflow.com/questions/8925820/javascript-object-push-function
What does it do?
Describe the technical changes you did.
Why is it needed?
Describe the issue you are solving.
How to test it?
Provide information about the environment and the path to verify the behaviour.
Related issue(s)/PR(s)
Let us know if this is related to any issue/pull request