-
Notifications
You must be signed in to change notification settings - Fork 27.2k
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
Add next configuration as an option for custom servers #2058
Conversation
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.
The idea looks great to me.
Could you work on this change?
this.http = null | ||
this.config = getConfig(this.dir) | ||
this.config = getConfig(this.dir, conf) |
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.
If we've a config via the option, it shouldn't read from the filesystem. Change the code to reflect that.
And make sure to get default configurations. May be we need to add method called withDefaults
to server/config.js
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.
Well, for my use case, I still want to be able to read from filesystem to overwrite default & custom server.
That's why I have this order in Object.assign
Your thoughts?
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.
@arunoda Is this OK?
@reel everything looks great to me. Let's wait for tests. |
Actually the error is not our fault. So. I'm taking this in. |
Thank's @arunoda Here's a peak at what we can do now: https://github.com/usehenri/henri/blob/master/packages/view/conf.js |
* Add a configuration parameter to custom server startup * Adding related documentation * Do not access filesystem if configuration is supplied * Make the configuration log clearer * Make the conf default value to `null`
Instead of having a
next.config.js
file, we can dynamically add configuration from the custom server.The use case would be to support many different webpack configuration with a
minimist
flag.I can add an example if wanted.