Skip to content

Commit 1204fdb

Browse files
committed
fix(FR-2195): add theme.json to dev server file watcher for hot-reload (#5725)
Resolves #5706(FR-2195) ## Summary - Added `resources/theme.json` to the `filesToWatch` array in `react/craco.config.cjs` - This ensures that editing `theme.json` during development triggers an automatic full page reload, matching the existing pattern used for `config.toml`, `index.html`, and i18n translations ## What Changed **`react/craco.config.cjs`** (1 line added): ```javascript path.resolve(__dirname, '../resources/theme.json'), ``` Added after the `resources/i18n` watch entry. The existing `fs.watch` debounce mechanism (100ms timer sending `'static-changed'` WebSocket message) now covers `theme.json` changes automatically. ## Test Plan - [ ] Start dev server with `pnpm run build:d` - [ ] Edit `resources/theme.json` (e.g., change a color value) - [ ] Verify the browser automatically reloads after the change - [ ] Confirm the updated theme is applied without manual refresh
1 parent 4ca3d4c commit 1204fdb

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

react/craco.config.cjs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ module.exports = {
8888
// at runtime (they are not bundled by webpack), so a page reload is
8989
// needed to re-fetch the updated translations.
9090
path.resolve(__dirname, '../resources/i18n'),
91+
// Watch theme.json so that theme customization changes during development
92+
// trigger a full page reload.
93+
path.resolve(__dirname, '../resources/theme.json'),
9194
];
9295

9396
const watchers = filesToWatch

0 commit comments

Comments
 (0)