chore: better Rocket DX (no endless refresh loops, but manual refresh)

This commit is contained in:
Thijs Louisse 2024-11-21 11:54:56 +01:00 committed by Thijs Louisse
parent 3e13adedc2
commit e2b9bdc8cd
2 changed files with 24 additions and 0 deletions

View file

@ -2,3 +2,8 @@ node_modules/**
/docs/_assets
/docs/_includes
/docs/_data
# this means we have no endless loops with refreshing pages
/docs/_merged_includes
/docs/_merged_assets
/docs/_merged_data

View file

@ -0,0 +1,19 @@
diff --git a/node_modules/@rocket/cli/src/RocketStart.js b/node_modules/@rocket/cli/src/RocketStart.js
index c7bd339..4a751a6 100755
--- a/node_modules/@rocket/cli/src/RocketStart.js
+++ b/node_modules/@rocket/cli/src/RocketStart.js
@@ -96,11 +96,13 @@ export class RocketStart {
await this.eleventy.write();
}
+
/** @type {DevServerConfig} */
const devServerConfig = metaConfigToWebDevServerConfig(
{
nodeResolve: true,
- watch: this.config.watch !== undefined ? this.config.watch : true,
+ // This prevents endless watch loops (manual refreshes are needed now, but this is a good tradeoff)
+ watch: false, // this.config.watch !== undefined ? this.config.watch : true,
rootDir: this.config.outputDevDir,
open: true,
clearTerminalOnReload: false,