-
Notifications
You must be signed in to change notification settings - Fork 237
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
Restart the app if environment variables change #389
Conversation
I tested this locally, when I make changes to the .env file and save them, nodemon doesn't restart the app. |
Thanks for the testing. I’ve changed it so that it actually works in b7bf675:
|
I have pulled Chris' change locally and confirmed that changing a file ending with .js, .json and .env triggers nodemon to restart the application. |
I think all we need is an addition to the CHANGELOG under 'features' |
@NickColley done and squashed into aaf531c |
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.
Sweet thanks Chris
Quick thought, does this affect very first start up after install? The kit creates empty .env at that point, wonder if that triggers restart and if that's a problem |
@joelanman no problems from my testing.
only restarts once when the edit is made. |
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.
Looks great, thanks! Do you mind rebasing, as there's now a conflict with CHANGELOG
Could be confusing why your changes aren’t having any effect. Doing this using the existing file-extension-based config doesn’t work because nodemon doesn’t undestand that `.env` is a file with no name, and an extension of `env`. So I’ve removed the file-extension-based stuff entirely and rewritten it to use globbing. Tested locally that: - changing `server.js` or `.env` causes the app to restart - changing a file inside `node_modules` _doesn’t_ cause the app to restart
Rebased against master. |
👍 to merge |
Thanks, @quis! |
Could be confusing why your changes aren’t having any effect.
Someone should probably test this before merging it 😬
cc @edwardhorsford