Skip to content
This repository has been archived by the owner on Jan 3, 2019. It is now read-only.

nodemon changes retriggers client webpack recompilation even though only server files updated #16

Open
terencechow opened this issue Oct 21, 2016 · 6 comments

Comments

@terencechow
Copy link

Hi,

I see package.json does nodemon exec babel-node bin/server.js

Following the code, that will trigger server/main.js which retriggers the webpack compiler for the client.

When updating a server file is it necessary to retrigger the webpack compiler for the client? I would think no since if I am updating the server folder, that has no effect on the client code and that could take a while if the client code is large.

Do you have this problem as well? (I am asking because my app is modelled after yours, but not exactly identical.). From the code I mentioned above however it does look like you would have the issue I mentioned above...

Any suggestions on fixing?

@bodyno
Copy link

bodyno commented Oct 22, 2016

It's because nodemon.json this file I sepcify

{
  "verbose": false,
  "ignore": ["dist", "coverage", "tests", "src"]
}

@terencechow
Copy link
Author

I think you misunderstand. The folder server is not ignored in your nodemon.json. Therefore any changes to server will trigger nodemon to restart the app. That triggers the webpack configs to be recompiled. However since webpack was not touched on your changes in the server folder, it doesn't make sense to recompile them. You can skip that step and only have nodemon restart your server. This is relevant for example if you are adding POST routes or updating middleware in your server folder, etc. Basically anything you are doing that doesn't touch webpack configs shouldn't have them recompile

@bodyno
Copy link

bodyno commented Oct 24, 2016

Now I understand. It's a bug. I'll fix it

@peterpme
Copy link

Hey @bodyno, still interested in fixing this? Otherwise let's close this 🙂 Thanks!

@terencechow
Copy link
Author

Please don't close if not fixed. It is a pretty crucial aspect of a universal rendering app.

@peterpme
Copy link

@terencechow then fix it 🙂

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants