Skip to content

Commit 1fa59e4

Browse files
authored
no watch in prod (#5439)
1 parent c943313 commit 1fa59e4

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎packages/apostrophe/modules/@apostrophecms/template/lib/viewWatcher.js‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ module.exports = (self) => {
4141
if (self.options.loader && self.options.loader.noWatch) {
4242
return;
4343
}
44+
// In production the file tree is static and watching only burns
45+
// file descriptors. Honor NODE_ENV unconditionally.
46+
if (process.env.NODE_ENV === 'production') {
47+
return;
48+
}
4449
// chokidar's recursive watching is not reliable on WSL; preserve the
4550
// historical behavior of skipping watch setup entirely there.
4651
if (isWsl) {

0 commit comments

Comments
 (0)