You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
and open the css in build/_app/assets/pages/__layout.svelte-[NUMBERS].css you can search for "I_need_this_comment" (which is a comment in src/app.css) and you can find it in the final css bundle.
Now if you comment out the first line in src/app.css enabling @tailwind base; and build again with the same command the comment is lost!!!
This drove me crazy!
Can you please help me understand what is going on?
Thanks!
Severity
serious, but I can work around it
The text was updated successfully, but these errors were encountered:
Looks like postcss may be what's removing the comments. I'd suggest opening an issue there, because I doubt this is a Svelte-Kit bug per se.
BTW, I experimented with your repro and found that if you move the @tailwind base line to below the comment, the comment isn't removed. I don't have time to pursue this further, but hopefully that will help you with narrowing this down.
I'll leave this issue open for now, just in case there really is a Svelte-Kit bug. But at the moment, I'm thinking it's something to do with postcss and not Svelte-Kit.
Describe the bug
I created a new SvelteKit app (with command from https://kit.svelte.dev/docs#introduction-getting-started):
npm init --yes svelte@next my-app
Here the repo: https://github.com/frederikhors/iss-svelte-kit-tailwind-comments
I added Tailwind in this commit: https://github.com/frederikhors/iss-svelte-kit-tailwind-comments/commit/84906710c497d57c8394430a482049605c2c390f.
If you run the project with
npm run dev
(afternpm install
of course) it works (Tailwind works, there is abg-red-500
in__layout.svelte
).What doesn't work is this crazy thing:
If you build with
rm -rf ./node_modules/.vite/ && rm -rf build && npm run build
and open the css in
build/_app/assets/pages/__layout.svelte-[NUMBERS].css
you can search for "I_need_this_comment
" (which is a comment insrc/app.css
) and you can find it in the final css bundle.Now if you comment out the first line in
src/app.css
enabling@tailwind base;
and build again with the same command the comment is lost!!!This drove me crazy!
Can you please help me understand what is going on?
Thanks!
Severity
serious, but I can work around it
The text was updated successfully, but these errors were encountered: