Open emircanerkul opened 2 years ago
@emircanerkul Could you link to a GitHub repo with a minimum reproduction? Thanks 🙏
@jacksteamdev Sure,
Here: https://github.com/emircanerkul/chrome-extension-tools/tree/main/issue/422
Thanks,
@emircanerkul Awesome, thanks!
I noticed that as well about a week ago, wanted to implement the plugin with a typical Svelte project, I did not think it was a bug of some sort, just a limitation of Vite. I just imported the scss in code and works now https://github.com/Nonua/chrome-vite-svelte-ts-sass-boilerplate/blob/master/src/popup/index.ts
@Nonua I know within js scss injection works well but I want to put this in the head due to speed up. Otherwise, CSS does not load earlier. Also, I don't want to put all my js in the head because it will block First Contentful Paint
Also, this problem wasn't there when I work without crxjs. I think this might caused by HMR
@pierreneter I know this way works perfectly but I want to separate CSS and js. Otherwise, if I did like you said it will compile as one file and that blocks First Contentful Paint due to my script being really huge.
@pierreneter I tried but it included all CSS into the js file as I remember. Also, I want to put it in head tags. Is that possible?
You can use this repo: https://github.com/emircanerkul/chrome-extension-tools/tree/main/issue/422
It just does not work scss import within HTML tag when on HMR mode
@pierreneter might be you're right but this only happens when building with vite. NOT when using vite dev which is what i said from the beginning.
But without crxjs vite works perfect and compile in head scss perfectly
Build tool
Vite
Where do you see the problem?
Describe the bug
I'm using this code to compile scss file. It works perfectly when I run build command. But this feature does not work in the npm dev
Reproduction
Create a basic extension. Add scss into the head.
Logs
System Info
Severity
annoyance