Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: consider custom devServer config #10492

Merged
merged 1 commit into from Aug 4, 2021

Conversation

graphicfox
Copy link
Contributor

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

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
@strapi-cla
Copy link

strapi-cla commented Jun 15, 2021

CLA assistant check
All committers have signed the CLA.

@soupette soupette self-requested a review June 21, 2021 07:35
Copy link
Contributor

@soupette soupette left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Thank you for your contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue: enhancement Issue suggesting an enhancement to an existing feature source: core:admin Source is core/admin package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants