Skip to content

Commit

Permalink
Prevent memory leaks in staging by adding env var (#730)
Browse files Browse the repository at this point in the history
* add env variable to prevent reload

* add env variable to prevent reload

* add env variable to prevent reload

* lint error fix

* prevent memory leaks

* detect HMR
  • Loading branch information
OSamkova authored Apr 7, 2021
1 parent 828361e commit 8f10896
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/server/src/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const clearModuleCache = moduleName => {
}

export const smartRequire = modulePath => {
if (process.env.NODE_ENV !== 'production') {
if (process.env.NODE_ENV !== 'production' && module.hot) {
clearModuleCache(modulePath)
}

Expand Down

0 comments on commit 8f10896

Please sign in to comment.