Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSS issue if importing some svelte in contentScript AND in options #12

Closed
HugoGresse opened this issue Apr 5, 2022 · 6 comments · Fixed by #13
Closed

CSS issue if importing some svelte in contentScript AND in options #12

HugoGresse opened this issue Apr 5, 2022 · 6 comments · Fixed by #13

Comments

@HugoGresse
Copy link

HugoGresse commented Apr 5, 2022

I wanted to have a common TabBar.svelte used in the contentScript app as well as in the options App.

So the file architecture look like

/entries/contentScript/primary/App.svelte (import ~/lib/TabBar.svelte)
/entries/options/App.svelte (import ~/lib/TabBar.svelte)
/lib/TabBar.svelte

The issue is as soon as the options App.svelte import the TabBar, the contentScript/primary/main.z2EEd.css is not longer generated upon build.
For know I'm duplicating the file to prevent this issue, I've no clue how to fix this correctly though.

My repo is here: https://github.com/HugoGresse/app-store-review-templates
You'll need to import the App.svelte from the contentScript into options/App.svelte

@samrum
Copy link
Owner

samrum commented Apr 5, 2022

Thanks for the repo that demonstrates the issue! I have a branch that refactors the way chunk assets are processed for Vite 2.9 here that may fix it. I can test it with your repo later.

@HugoGresse
Copy link
Author

I can test it quickly as soon as you release a snapshot! The repo does not directly reproduce the issue, you'll need to remove the duplicate file from lib/ and change the import in options/App.svelte

@samrum
Copy link
Owner

samrum commented Apr 6, 2022

I checked and made some tweaks to that branch and it'll fix that issue. It'll be part of an upcoming 1.0.0 release, though there are some breaking changes that'll require some small code changes on your end.

@HugoGresse
Copy link
Author

I can manage that! thank you!

@HugoGresse
Copy link
Author

I can confirm the version 1.0.2 does fix the issue. Thanks!

@HugoGresse
Copy link
Author

HugoGresse commented Oct 11, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants