Closed JericoFX closed 2 years ago
Hi, i follow the guide and put the optimizeCss() in vite config, it actually work from 700kb to 158kb, but the problem is that i actually lose the Theme toggle and the nav bar submenus.
import { defineConfig } from 'vite' import { svelte } from '@sveltejs/vite-plugin-svelte' import { optimizeImports, optimizeCss, elements, icons } from "carbon-preprocess-svelte"; // https://vitejs.dev/config/ export default defineConfig({ plugins: [svelte(), optimizeImports(), elements({ theme: "all" }), icons()], base: "" })
i take it off in the code and now everything work but the css bundle is really hight
fix theme toggle
optimizeCss({ // https://purgecss.com/safelisting.html safelist: { standard: ["theme"], }, })
i will try it , thanks for the response !
Hi, i follow the guide and put the optimizeCss() in vite config, it actually work from 700kb to 158kb, but the problem is that i actually lose the Theme toggle and the nav bar submenus.
i take it off in the code and now everything work but the css bundle is really hight