Skip to content

Commit

Permalink
use vite preprocessing instead of svelte-preprocess.
Browse files Browse the repository at this point in the history
  • Loading branch information
mgrubinger committed Jan 13, 2023
1 parent e0ed830 commit 700381d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 21 deletions.
4 changes: 0 additions & 4 deletions src/routes/+layout.svelte
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
<script>
import Header from '$lib/Header.svelte';
import '/src/styles/styles.scss';
</script>

<slot />

<style lang="scss">
</style>
16 changes: 0 additions & 16 deletions svelte.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import adapter from '@sveltejs/adapter-vercel';
import preprocess from 'svelte-preprocess';
import autoprefixer from 'autoprefixer';

const isProduction = process.env.NODE_ENV === 'production' ? true : false;

Expand All @@ -9,20 +7,6 @@ const config = {
kit: {
adapter: adapter()
},
preprocess: [
preprocess({
sourceMap: !isProduction,
scss: {
// We can use a path relative to the root because
// svelte-preprocess automatically adds it to `includePaths`
// if none is defined.
prependData: `@import 'src/styles/variables.scss';`
},
postcss: {
plugins: [autoprefixer()]
}
})
],
vitePlugin: {
experimental: {
inspector: {
Expand Down
12 changes: 11 additions & 1 deletion vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,19 @@ const config = {
// these are the aliases and paths to them
$utils: path.resolve('./src/lib/utils')
}
}
},
css: {
preprocessorOptions: {
scss: {
additionalData: `
@import 'src/styles/variables.scss';
`,
},
},
},
};

// see https://geoffrich.net/posts/svelte-social-image/
function rawFonts(ext) {
return {
name: 'vite-plugin-raw-fonts',
Expand Down

0 comments on commit 700381d

Please sign in to comment.