ad-generator / vite.config.js
fahmiaziz98
init
f76a60c
import tailwindcss from '@tailwindcss/vite';
import { sveltekit } from '@sveltejs/kit/vite';
import { defineConfig } from 'vite';
export default defineConfig({
plugins: [tailwindcss(), sveltekit()],
server: {
host: true, // Allow external connections
port: 7860,
allowedHosts: [
'localhost',
'127.0.0.1',
'0.0.0.0',
'fahmiaziz-ad-generator.hf.space',
'.hf.space', // Allow all huggingface spaces
'.ngrok.io', // Allow ngrok tunnels
'.vercel.app', // Allow Vercel deployments
'.netlify.app', // Allow Netlify deployments
],
hmr: {
port: 7861, // Use different port for HMR
host: 'localhost'
}
},
preview: {
host: true,
port: 7860,
allowedHosts: [
'localhost',
'127.0.0.1',
'0.0.0.0',
'fahmiaziz-ad-generator.hf.space',
'.hf.space',
'.ngrok.io',
'.vercel.app',
'.netlify.app',
]
},
build: {
outDir: 'build',
sourcemap: false, // Disable sourcemaps for production
minify: 'esbuild',
rollupOptions: {
output: {
manualChunks: {
vendor: ['svelte'],
},
},
},
},
});