Spaces:
Sleeping
Sleeping
fahmiaziz98
commited on
Commit
·
f76a60c
1
Parent(s):
b49796c
init
Browse files- svelte.config.js +14 -1
- vite.config.js +44 -3
svelte.config.js
CHANGED
@@ -11,7 +11,20 @@ const config = {
|
|
11 |
// adapter-auto only supports some environments, see https://svelte.dev/docs/kit/adapter-auto for a list.
|
12 |
// If your environment is not supported, or you settled on a specific environment, switch out the adapter.
|
13 |
// See https://svelte.dev/docs/kit/adapters for more information about adapters.
|
14 |
-
adapter: adapter(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
}
|
16 |
};
|
17 |
|
|
|
11 |
// adapter-auto only supports some environments, see https://svelte.dev/docs/kit/adapter-auto for a list.
|
12 |
// If your environment is not supported, or you settled on a specific environment, switch out the adapter.
|
13 |
// See https://svelte.dev/docs/kit/adapters for more information about adapters.
|
14 |
+
adapter: adapter({
|
15 |
+
// Options for adapter-node
|
16 |
+
out: 'build',
|
17 |
+
precompress: false,
|
18 |
+
envPrefix: '',
|
19 |
+
}),
|
20 |
+
|
21 |
+
// Allow all hosts in development and production
|
22 |
+
csrf: {
|
23 |
+
checkOrigin: false, // Disable CSRF origin checking for flexibility
|
24 |
+
},
|
25 |
+
|
26 |
+
// Trust proxy headers
|
27 |
+
trustProxy: true,
|
28 |
}
|
29 |
};
|
30 |
|
vite.config.js
CHANGED
@@ -5,6 +5,47 @@ import { defineConfig } from 'vite';
|
|
5 |
export default defineConfig({
|
6 |
plugins: [tailwindcss(), sveltekit()],
|
7 |
server: {
|
8 |
-
|
9 |
-
|
10 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
export default defineConfig({
|
6 |
plugins: [tailwindcss(), sveltekit()],
|
7 |
server: {
|
8 |
+
host: true, // Allow external connections
|
9 |
+
port: 7860,
|
10 |
+
allowedHosts: [
|
11 |
+
'localhost',
|
12 |
+
'127.0.0.1',
|
13 |
+
'0.0.0.0',
|
14 |
+
'fahmiaziz-ad-generator.hf.space',
|
15 |
+
'.hf.space', // Allow all huggingface spaces
|
16 |
+
'.ngrok.io', // Allow ngrok tunnels
|
17 |
+
'.vercel.app', // Allow Vercel deployments
|
18 |
+
'.netlify.app', // Allow Netlify deployments
|
19 |
+
],
|
20 |
+
hmr: {
|
21 |
+
port: 7861, // Use different port for HMR
|
22 |
+
host: 'localhost'
|
23 |
+
}
|
24 |
+
},
|
25 |
+
preview: {
|
26 |
+
host: true,
|
27 |
+
port: 7860,
|
28 |
+
allowedHosts: [
|
29 |
+
'localhost',
|
30 |
+
'127.0.0.1',
|
31 |
+
'0.0.0.0',
|
32 |
+
'fahmiaziz-ad-generator.hf.space',
|
33 |
+
'.hf.space',
|
34 |
+
'.ngrok.io',
|
35 |
+
'.vercel.app',
|
36 |
+
'.netlify.app',
|
37 |
+
]
|
38 |
+
},
|
39 |
+
build: {
|
40 |
+
outDir: 'build',
|
41 |
+
sourcemap: false, // Disable sourcemaps for production
|
42 |
+
minify: 'esbuild',
|
43 |
+
rollupOptions: {
|
44 |
+
output: {
|
45 |
+
manualChunks: {
|
46 |
+
vendor: ['svelte'],
|
47 |
+
},
|
48 |
+
},
|
49 |
+
},
|
50 |
+
},
|
51 |
+
});
|