Files
Watcharr/svelte.config.js
T
IRHM b6def6f43d Replace import with use for sass and reduce css output bundle by only prepending partials
- Moved main scss files to src/styles.
- Instead of prepending all our global styles in svelte.config.js, we now only prepend our sass logic that doesn't build to css, which reduces the output css massively by avoiding duplicative imports. Our norm.scss is now imported in the root +layout file.
- Update sass package
- Renamed mixins and vars scss files to start with an underscore, which indicates they are partial files
2026-02-14 21:17:05 +00:00

34 lines
892 B
JavaScript

import adapter from "@sveltejs/adapter-node";
import { vitePreprocess } from "@sveltejs/vite-plugin-svelte";
import { sveltePreprocess } from "svelte-preprocess";
/** @type {import('@sveltejs/kit').Config} */
const config = {
// Consult https://kit.svelte.dev/docs/integrations#preprocessors
// for more information about preprocessors
preprocess: [
sveltePreprocess({
scss: {
// Only prepend partials that we want access to everywhere
// by default. They can't have css otherwise our css output
// will be bloated. Global styles can be in our `norm.scss` file
// which is imported (`@use`d) in our root `+layout.svelte` file.
prependData:
`@use "./src/styles/_vars.scss" as *;` +
`@use "./src/styles/_mixins.scss" as *;`,
},
}),
vitePreprocess(),
],
kit: {
adapter: adapter(),
alias: {
"@": "src",
},
},
};
export default config;