yosevu / react-content-script

An example project to build Chrome extensions using React and TypeScript. Ideal for developers looking to create efficient and modern Chrome extensions with a focus on a clean development workflow using Vite and crxjs.
202 stars 56 forks source link

HMR not working #13

Closed Shivraj97 closed 1 year ago

Shivraj97 commented 1 year ago

Hi, I cloned the repo and did npm install and npm run dev and was able to load the extension but as CRX promised that it can hot reload both the content script and popup script but it's not doing so or do I have to build every time I make change to source code ? Can you please help.

yosevu commented 1 year ago

Hi @Shivraj97, I'll take a look!

Norfeldt commented 1 year ago

Perhaps using nodemon to trigger a rebuild on save could be one way of going about it?

https://www.npmjs.com/package/nodemon

yosevu commented 1 year ago

Hmm, it looks like other people have this issue too: https://github.com/crxjs/chrome-extension-tools/issues/515. Will try updating the dependency as suggested.

yosevu commented 1 year ago

I updated the crxjs vite-plugin version @Shivraj97, which fixed yarn dev. content-script and popup HMR work as expected. Make sure that you are making changes and looking at the correct app i.e. popup src in the extension popup window and content-script src on blank.org etc.