-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
templates(express): use watcher.on("add").on("change")
#6922
Conversation
Also add in comments on what to change for CJS
|
broadcastDevReady(build); | ||
} | ||
|
||
chokidar |
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.
chokidar
isn't a production dependency, so it would be better to use (await import("chokidar"))
, remove the chokidar
import at the top of the file, make createDevRequestHandler()
async, and await on it at the app.all()
handler.
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 the patch to use await import, not sure if it's the best way to write 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.
In my code, I imported directly in the createDevRequestHandler()
function, but this way is probably the cleanest if swapping in CJS is important.
watcher.on("add").on("change")
Probably not. Should close this and rewrite express server.js with updated syntax. |
Also add in comments on what to change for CJS
Does not close #6919 but the debugger might help with bug tracking.
This actually get the express template in line with existing v2 dev doc changes.
Testing Strategy: