Only output single file on build

This commit is contained in:
Timothy Farrell 2026-05-12 17:31:35 +00:00
parent b3697fa61f
commit 0c908e8919

View File

@ -3,14 +3,16 @@ import { svelte } from '@sveltejs/vite-plugin-svelte'
import { viteSingleFile } from 'vite-plugin-singlefile'
// https://vite.dev/config/
export default defineConfig({
export default defineConfig(({ command }) => ({
plugins: [
svelte(),
viteSingleFile({
...(command === 'build'
? [viteSingleFile({
inlineStyles: true,
inlineScripts: true,
removeUnusedCss: true,
}),
})]
: []),
],
build: {
target: 'esnext',
@ -24,4 +26,4 @@ export default defineConfig({
setupFiles: ['./tests/setup.js'],
include: ['src/**/*.test.js', 'tests/**/*.test.js'],
},
})
}))