Restart webpack development server on changing .env file #22702
Replies: 11 comments
-
@vsavkin I want to clarify I primary work with Nest.js |
Beta Was this translation helpful? Give feedback.
-
Maybe you can configure webpackDevServer.watchFiles in build executor webpackConfig options? |
Beta Was this translation helpful? Give feedback.
-
This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs. |
Beta Was this translation helpful? Give feedback.
-
it's still relevant |
Beta Was this translation helpful? Give feedback.
-
For me too, really annoying when using Tilt too. |
Beta Was this translation helpful? Give feedback.
-
This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs. |
Beta Was this translation helpful? Give feedback.
-
it's still relevant |
Beta Was this translation helpful? Give feedback.
-
for this one, it is not supported out of the box. For nx, it reads the env variable when the process got forked , it does not re-update the env variable while the process is running. |
Beta Was this translation helpful? Give feedback.
-
This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs. |
Beta Was this translation helpful? Give feedback.
-
it's still relevant |
Beta Was this translation helpful? Give feedback.
-
The We could reload the entire processes, but then you'd still have to wait for the full build, so it's not really better. It's possible we can do something smarter, like tracking what variables are being set, but it requires some design and is non-trivial. |
Beta Was this translation helpful? Give feedback.
-
Description
each time when .env file is changed webpack source .env and apply to process.env, the development server then use updated environment variables so you don't need to stop the dev server and start with the nx serve command again, thus we reduce time on rebuilding the same stuff in case of usage typescript instead of plain javascript
Motivation
I am often faced with the need to update the .env file with new values or adding new ones, then I need to stop the development server and restart with the nx serve command again.
I need to work with the codebase where webpack takes up to 4 minutes to start the development server, so it makes the devex not so good.
Suggested Implementation
Need to investigate how's it possible to make it real with webpack
Alternate Implementations
Beta Was this translation helpful? Give feedback.
All reactions