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

Support for svelte style preprocessing #389

Open
Rajaniraiyn opened this issue Jan 8, 2023 · 2 comments
Open

Support for svelte style preprocessing #389

Rajaniraiyn opened this issue Jan 8, 2023 · 2 comments

Comments

@Rajaniraiyn
Copy link

Lightningcss is cool and working good with most of the bundlers.

I am using Svelte + Vite with official vite-plugin-lightningcss but the styles declared in .svelte files are not transpiled or minified using lightningcss. I tried to manually add lightning css as a style preprocessor in svelte configuration but I couldn't able to add it.

Please add svelte compiler support via a plugin or a config option

@devongovett
Copy link
Member

Seems like it would need to be added to https://github.com/sveltejs/vite-plugin-svelte or maybe even to Vite itself. Looks like the svelte plugin calls Vite's CSS transformer, which unfortunately only supports a hard coded set of preprocessors at the moment (eg Sass, Less, PostCSS, etc). See vitejs/vite#11029 which requests support for Lightning CSS in Vite. Not sure there is really much else I can do here without it being more extensible.

@Rajaniraiyn
Copy link
Author

sorry for so late response. You're correct but I made lightningcss as scss plugin in svelte instead of default recommended ones all works fine except the svelte vscode extension throws a warning message that you haven't installed scss transpiler. I got another issue as lightningcss does not bundles external css or scss files together while using this method.

And just out of my curiosity, why we can't use lightning css as scss with vite? will there be any issues?

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

No branches or pull requests

2 participants