Sage 9, React, Webpack watch, build and HMR

Hi there,

so I’m trying to use React.js along with Sage 9 alpha 4

and am stuck with yarn run start, Hot reloading or rebuilding

my problem is that I can not get React components to be hot replaced

and as I’d be happy to live with rebuilding on save
so I tried to watch .jsx files
but as far as I understand watch does not rebuild - only reload

so I have 2 questions:

  • Do I need React Hot Loader to enable HMR for React components (I’d say yes - but then has someone tweaked the config to do it and can help? otherwise I’ll get at it)

  • How can I simply trigger a rebuild on save (which would help get going for the time being)

I’ve been trying to sort things out bt myself since yesterday but well … i’m stuck (or tired)

would love some help from more webpack savvy users

thanks in advance

1 Like

Were you able to find a solution to this?

I was interested in running the same setup.

Hi,

unfortunately I did not pursue further (as far as I can remember … )

I won’t have time to look into this but maybe some one else has/will …

not so helpful I know …

hope you can get it working
let us know if you do

thnks

I have found a solution to this problem.

I will try to edit this post and post my solution to the related files when I get a chunk of free time.

If anyone runs into this problem - please feel free to nag me via email in the meantime:

domdambrogia at g m a i l dot com

Cheers! :slight_smile: