bud
bud copied to clipboard
[bug] bud-react not triggering react-refresh
Agreement
- [X] This is not a duplicate of an existing issue
- [X] I have read the guidelines for Contributing to Roots Projects
- [X] This is not a personal support request that should be posted on the Roots Discourse community
Describe the issue
React doesn't refresh upon saving React components. However, it does work if you explicitly add the folder path of your React components to Bud's watch list.
For example:
bud.watch([
'resources/views',
'app',
'resources/scripts/react-components'
]);
Basically the exact post here: https://discourse.roots.io/t/roots-bud-react-or-roots-bud-swc-v6-20-0-does-not-trigger-react-refresh-or-hot-reloading/26827/3
Expected Behavior
Hot reloading should work. 😄
Actual Behavior
Nothing.
Steps To Reproduce
- Add
@roots/bud-reactand@roots/bud-swcto a project. (Note: I've only tested this in a Sage theme.) - Saving React components does not trigger refresh.
version
6.20.0
Logs
No response
Configuration
export default async (app) => {
app
.entry({
app: ['@scripts/app', '@styles/app'],
})
.assets(['images']);
app.setPublicPath('/wp-content/themes/whatever/public');
app
.proxy('https://site.test')
.watch([
'resources/views',
'app',
'resources/scripts/react-components/', // <-- Refresh works when this is added
]);
};
Relevant .budfiles
No response