astro/packages/renderers/renderer-svelte/index.js
Ben Holmes 79282163e2
fix: Svelte PostCSS config error (#2807)
* fix: Svelte PostCSS config error

* chore: changeset
2022-03-15 19:32:39 -04:00

31 lines
732 B
JavaScript

import { svelte } from '@sveltejs/vite-plugin-svelte';
import preprocess from 'svelte-preprocess';
export default {
name: '@astrojs/renderer-svelte',
client: './client.js',
server: './server.js',
viteConfig({ mode }) {
return {
optimizeDeps: {
include: ['@astrojs/renderer-svelte/client.js', 'svelte', 'svelte/internal'],
exclude: ['@astrojs/renderer-svelte/server.js'],
},
plugins: [
svelte({
emitCss: true,
compilerOptions: { dev: mode === 'development', hydratable: true },
preprocess: [
preprocess({
less: true,
sass: { renderSync: true },
scss: { renderSync: true },
stylus: true,
typescript: true,
}),
],
}),
],
};
},
};