-
Notifications
You must be signed in to change notification settings - Fork 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
Build: Restart server on file change #848
Conversation
I'm just testing this and after running It's probably the "`" character it has problems with (https://github.com/Automattic/wp-calypso/blob/try/restart-server-on-change/server/bundler/index.js#L55). Interesting that it works in the master branch. |
Great, thanks for spotting that, @lamosty. The Keep your eye open for the [Status] Needs Review labels on PRs, which are generally further along in development and need more eyes on them: https://github.com/Automattic/wp-calypso/blob/master/CONTRIBUTING.md#lifecycle-of-a-pull-request |
@seear Thanks. Ah, that was it. Alright, I'll do that. Thanks for the info. |
Also use Nodemon to restart server after compilation.
6258e17
to
9a87d96
Compare
Running webpack with |
Nodemon watches server and shared folders and restarts both compilation and the node server on a change.
I don't believe that this is currently a desirable change. Because the client JS is built by the Node server, and there is no way to cache the compiled JS to disk, restarting the Node server means a long wait (~46 seconds on my machine) before the system is running again. We should revisit this PR once we have a better solution for marking components as useable server-side (see #1594). |
At the moment, changes to a file used on the server, including shared modules, requires the Node server to be restarted. Now that we are starting to use more shared modules, an automatic compile/restart becomes more important.
This PR changes the run target so that it:
Runs webpack --watch on server files in the background to compile on change.
Uses nodemon to restart server after compilation.
To Test
make clean
make run
Make a change to any file used on the server and check that the server restarts and picks up the change