-
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathvite.config.ts
More file actions
31 lines (28 loc) · 1007 Bytes
/
Copy pathvite.config.ts
File metadata and controls
31 lines (28 loc) · 1007 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import tailwindcss from '@tailwindcss/vite';
import adapter from '@sveltejs/adapter-static';
import { sveltekit } from '@sveltejs/kit/vite';
import { defineConfig } from 'vite';
export default defineConfig({
define: {
// Lets forum.config.ts auto-detect the repo when building in GitHub Actions
__GF_REPOSITORY__: JSON.stringify(process.env.GITHUB_REPOSITORY ?? '')
},
plugins: [
tailwindcss(),
sveltekit({
compilerOptions: {
// Force runes mode for the project, except for libraries. Can be removed in svelte 6.
runes: ({ filename }) => filename.split(/[/\\]/).includes('node_modules') ? undefined : true
},
// Static SPA build for GitHub Pages: every non-prerendered URL is
// served by the 404.html fallback, which boots the client router.
adapter: adapter({
fallback: '404.html'
}),
paths: {
// Set BASE_PATH=/repo-name when deploying to <user>.github.io/<repo-name>
base: (process.env.BASE_PATH as `/${string}` | undefined) || ''
}
})
]
});