-
Notifications
You must be signed in to change notification settings - Fork 26.8k
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 support for custom hot reload config #823
Conversation
Shall we document this in the README. |
@arunoda definitely, wanted you to check it first :) |
|
||
if (this.config.hotReloader) { | ||
console.log('> Using "hotReloader" config function defined in next.config.js.') | ||
hotReloaderConfig = this.config.hotReloader(hotReloaderConfig) |
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 should be called webpackDevMiddleware
instead of hotReloader
?
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.
Updated 🙌
I'm not sure if this is required, since ideally, typescript files also should be transpiled via webpack (maybe by https://github.com/TypeStrong/ts-loader). In this case you don't have to change the |
I have no good idea about #757 though :| |
@nkzawa That's a good case of having this API. But not sure we should do it now or wait for 2.0? |
@arunoda was thinking about this myself. I guess 2.1 since it's a new feature. |
Added to readme. Also added the |
@@ -130,7 +132,7 @@ export default class HotReloader { | |||
} | |||
} : {} | |||
|
|||
this.webpackDevMiddleware = webpackDevMiddleware(compiler, { | |||
let hotReloaderConfig = { |
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.
let's rename this too
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.
Done
} | ||
|
||
if (this.config.webpackDevMiddleware) { | ||
console.log('> Using "hotReloader" config function defined in next.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.
and 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.
Done 👍
@timneutkens this looks great. Thank you. @nkzawa in my (limited) experience of using TypeScript loaders (both ts-loader and awesome-typescript-loader) is they can introduce additional problems and confusion especially when babel plugins are also used. |
@nkzawa what is the state of this PR? would love to see this merged, b.c. using next with external sheets is a bit painful :/ |
@nkzawa This couldn't come any sooner... Thanks for this @timneutkens |
Created a new PR, cause merging master with this branch was not possible. |
Any news ? Thanks in advance ! |
We need this feature, resolved 👍 |
This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread. |
Stats from current PRDefault Server ModeGeneral
Client Bundles (main, webpack, commons)
Client Bundles (main, webpack, commons) Modern
Client Pages
Client Pages Modern
Client Build Manifests
Rendered Page Sizes
Serverless ModeGeneral
Client Bundles (main, webpack, commons)
Client Bundles (main, webpack, commons) Modern
Client Pages
Client Pages Modern
Client Build Manifests
Serverless bundles
Commit: 3f1e19e |
Fixes #757 #96