Add or document support for Webpack HMR
See original GitHub issueIssue type:
- question
- bug report
- feature request
- documentation issue
nestjs-config version
1.3.21
@nestjs/common+core or other package versions
- @nestjs/common:
6.1.0
- @nestjs/core:
6.1.0
Excepted behavior
Actual behavior or outcome (for issue)
Library worked great for me on a different project. I want to use this library with a new project, but this time I am trying to use the Webpack HMR capabilities to make the app reload a lot faster. Since Nest ships with this out-of-the-box would it be nice to have some kind of recipe for supporting this flow?
I’m not familiar with the internals of this library so not sure if it’s even possible to be honest. It would be really handy to be able to use this library with HMR though!
Replication/Example
ConfigModule.resolveRootPath(__dirname).load('config/**/!(*.d).{ts,js}')
Works using yarn start
with ts-node
. Doesn’t work with yarn start:hmr
. The module initializes but no configuration is being read. Likely because all of the configuration is being appended into the server.js
and is no longer in a config
folder.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:12
@OLDIN
oh I see! So it’s more about the file type than the .env file. I was presuming webpack loaded it’s own dotenv package and was loading from a different dir or something like that but it sounds like this is more file type related.
I will try and investigate. My time is rather limited at the moment though as I’m working 2 jobs and still got to release V2! If I can find some time to investigate this in the next month or 2 I will. I’ll try and get V2 published first though! After that I’ll defo have a look into it!