File: /var/www/affstore-landing/vite.config.ts
import { sveltekit } from '@sveltejs/kit/vite';
import { defineConfig } from 'vite';
import { readFileSync } from 'fs';
import { fileURLToPath } from 'url';
const file = fileURLToPath(new URL('package.json', import.meta.url));
const json = readFileSync(file, 'utf8');
const pkg = JSON.parse(json);
export default defineConfig({
plugins: [sveltekit()],
server: {
host: 'localhost',
port: 3000,
strictPort: false,
open: true,
},
build: {
sourcemap: false,
ssrManifest: true,
minify: 'terser',
cssMinify: true,
cssCodeSplit: true,
rollupOptions: {
output: {
manualChunks: undefined,
},
},
},
define: {
__APP_VERSION__: JSON.stringify(pkg.version),
},
css: {
preprocessorOptions: {
scss: {
api: 'modern-compiler', // or "modern"
},
},
},
});