bud icon indicating copy to clipboard operation
bud copied to clipboard

[bug] bud-react not triggering react-refresh

Open joshuafredrickson opened this issue 1 year ago • 0 comments

Agreement

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

  1. Add @roots/bud-react and @roots/bud-swc to a project. (Note: I've only tested this in a Sage theme.)
  2. 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

joshuafredrickson avatar Apr 11 '24 15:04 joshuafredrickson