Yuns

Results 226 comments of Yuns

This feature is really nice, I am exploring how to implement [HMR in content script like CRXJS](https://crxjs.dev/vite-plugin/getting-started/react/content-script-hmr#react-refresh-in-action), it is really a magic.

@aklinker1 Both examples seems ok, here is my demo https://github.com/yunsii/chrome-extension-raw-demo/blob/master/src/js/isolated_content_script.js ![image](https://github.com/wxt-dev/wxt/assets/18096089/4e1008ba-9c1c-4404-be8b-2520b2fde54d)

> we'll go with whatever option makes the most sense during the implementation. What's the meaning? I do not understand exactly.

So it means that `document_start` and `document_idle` can use `type: "module"`?

> Did some testing with the `run_at` field. Behaved exactly as I expected. It could be useful to set the `run_at` field. For ecxample, with `document_start` you load your script...

![image](https://github.com/wxt-dev/wxt/assets/18096089/0d615732-ac6c-468d-b92a-cc41c5de7eb3) It may have to be improved priority? These erros occured after I upload our extension to firefox extension workshop.

> CSS from the page is always applied to the page What's the meaning? Shadow dom CSS from `createShadowRootUi` will apply to the page?

Is there any approach to override the function?

I think the way like [eslint-ts-patch](https://github.com/antfu/eslint-ts-patch) to patch vite is a good choice, wxt has taken over vite after all.

> So you're recommending I fork vite and use a custom version? I don't think so, it seems a special API `const Module = require('node:module')` can be used to replace...