Any idea on the steps to install Linaria in a SvelteKit project
Environment
- SvelteKit: 1.0.0-next.516
- Linaria version: ^4.1.3
- Bundler (+ version): vite ^3.1.0
- Node.js version: 16.14.0
- OS: MacOS
Description
Have no clue how to install Linaria on SvelteKit. I tried the https://github.com/denn1s/vite-plugin-linaria plugin but it did not work.
It is a similar problem with #1068: we have to process .svelte and .vue files before they will be processed by Svelte or Vue. To achieve that, we have to teach Babel to understand the syntax of that files, if it's even possible. Maybe there is another way that can allow preprocessing script section, but since I'm unfamiliar with Vue and Svelte builders, I need some time for investigation or help from the community :)
I dont know if this info helps, but there is a sample in https://github.com/madhavarshney/svelte-linaria-sample
that I tested, and it work somehow with "linaria": "^1.3.3" and "linaria": "^2.3.1" (not namespaced one, webpack 5 + linaria/loader + svelte).
The sample uses Linaria in svelte files:
<script>
import { css } from 'linaria';
const localStyle = css`
color: green;
`;
</script>
But when I changed to the namespace ones (@linaria/*), stop working.
Any updates?