Description
I followed exactly each step of the guide making a fresh new Svelte (not Sveltekit) project and the generated CSS file in dist/assets is 254KB.
I didn't import any Flowbite components or used any Tailwind classes, yet the generated CSS file is including pretty much all of Tailwind.
The FAQ mentions using PurgeCSS in these cases, but it seems the npm package cannot be installed, my understanding is it's meant for Tailwind v3 but Flowbite uses v4 (I think?), which should already be including only the necessary CSS in the build:
npm error dev tailwindcss@"^4.1.17" from the root project
npm error Could not resolve dependency:
npm error peer tailwindcss@"^3.3.0" from vite-plugin-tailwind-purgecss@0.3.5
This is the app.css
@import "tailwindcss";
@plugin '@tailwindcss/forms';
@plugin '@tailwindcss/typography';
@plugin 'flowbite/plugin';
@custom-variant dark (&:where(.dark, .dark *));
@source "../node_modules/flowbite-svelte/dist";
@source "../node_modules/flowbite-svelte-icons/dist";
This is App.svelte
<script>
import "./app.css";
</script>
Hello
Is there any step I'm missing?
Minimal Reproduction
// About compilation, not code
Steps to Reproduce
- Follow guide making a fresh new Svelte (not Sveltekit) project: https://flowbite-svelte.com/docs/pages/quickstart
- Run
npm run build
- CSS file in
dist/assets is 254KB
Environment
System:
OS: Linux 5.15 Debian GNU/Linux 12 (bookworm) 12 (bookworm)
CPU: (10) arm64 unknown
Memory: 7.96 GB / 23.45 GB
Container: Yes
Shell: 5.2.15 - /bin/bash
Binaries:
Node: 22.21.1 - /usr/local/share/nvm/versions/node/v22.21.1/bin/node
Yarn: 1.22.22 - /usr/bin/yarn
npm: 10.9.4 - /usr/local/share/nvm/versions/node/v22.21.1/bin/npm
pnpm: 10.26.2 - /usr/local/share/nvm/versions/node/v22.21.1/bin/pnpm
npmPackages:
flowbite: ^4.0.1 => 4.0.1
flowbite-svelte: ^1.31.0 => 1.31.0
svelte: ^5.46.1 => 5.46.1
vite: ^6.4.1 => 6.4.1
Relevant Logs / Console Output
Screenshots / GIF (optional)
No response
Additional Context (optional)
No response
Checklist
Description
I followed exactly each step of the guide making a fresh new Svelte (not Sveltekit) project and the generated CSS file in
dist/assetsis 254KB.I didn't import any Flowbite components or used any Tailwind classes, yet the generated CSS file is including pretty much all of Tailwind.
The FAQ mentions using PurgeCSS in these cases, but it seems the npm package cannot be installed, my understanding is it's meant for Tailwind v3 but Flowbite uses v4 (I think?), which should already be including only the necessary CSS in the build:
This is the
app.cssThis is
App.svelteIs there any step I'm missing?
Minimal Reproduction
// About compilation, not codeSteps to Reproduce
npm run builddist/assetsis 254KBEnvironment
System: OS: Linux 5.15 Debian GNU/Linux 12 (bookworm) 12 (bookworm) CPU: (10) arm64 unknown Memory: 7.96 GB / 23.45 GB Container: Yes Shell: 5.2.15 - /bin/bash Binaries: Node: 22.21.1 - /usr/local/share/nvm/versions/node/v22.21.1/bin/node Yarn: 1.22.22 - /usr/bin/yarn npm: 10.9.4 - /usr/local/share/nvm/versions/node/v22.21.1/bin/npm pnpm: 10.26.2 - /usr/local/share/nvm/versions/node/v22.21.1/bin/pnpm npmPackages: flowbite: ^4.0.1 => 4.0.1 flowbite-svelte: ^1.31.0 => 1.31.0 svelte: ^5.46.1 => 5.46.1 vite: ^6.4.1 => 6.4.1Relevant Logs / Console Output
Screenshots / GIF (optional)
No response
Additional Context (optional)
No response
Checklist