crxjs / chrome-extension-tools

Bundling Chrome Extensions can be pretty complex. It doesn't have to be.
https://crxjs.dev/vite-plugin
2.98k stars 192 forks source link

HMR doesn't replace tailwind css #288

Closed riywo closed 2 years ago

riywo commented 2 years ago

Build tool

Vite

Where do you see the problem?

Describe the bug

Related to #274 , but I'm not sure it's the same issue. I'll spend more time to reproduce later and update this description. Sorry for a poor report now.

When I update a tailwind class in a React component, RPCE reloads components and its class name is updated. However, the css embedded by content_scripts isn't updated until I restart vite. Therefore, the new class isn't accessible even I reload the target page by browser because tailwind postcss? only imports the classes actually used.

By checking Chrome devtools, it looks like triggering some update on the embedded css but the content is still old.

When I access the vite server directly, though, the css embedded is updated correctly (the new class is appended). So, I guess the signal is sent from vite server but RPCE misses it somewhere.

I can workaround by using nodemon to restart the vite server whenever files are changed, but it's slower than HMR.

Reproduction

TODO

Logs

Will update once created a repro.

System Info

Will update once created a repro.

Severity

annoyance

liaoliao666 commented 2 years ago

I have also this issue, its a pain point to me. hope it gets fixed soon.

jacksteamdev commented 2 years ago

This should be fixed in v1.0.6 :rocket: @crxjs/vite-plugin - npm