aboutsummaryrefslogtreecommitdiff
path: root/svelte.config.js
blob: 9c3f3fe2b2bb65364bb06cba19a5a566f39fe58a (plain)
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import adapter from '@sveltejs/adapter-static'
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte'

// GitHub Pages serves the project at https://<user>.github.io/<repo>/.
// BASE_PATH is set by the deploy workflow (e.g. '/hollowdark'); during local
// dev it stays empty so the app works at the root.
const BASE_PATH = process.env.BASE_PATH ?? ''

/** @type {import('@sveltejs/kit').Config} */
const config = {
  preprocess: vitePreprocess(),
  kit: {
    adapter: adapter({
      pages: 'dist',
      assets: 'dist',
      fallback: '404.html', // GitHub Pages convention for SPA deep-link fallback
      precompress: false,
      strict: true
    }),
    paths: {
      base: BASE_PATH
    },
    files: {
      assets: 'static',
      appTemplate: 'app/app.html',
      hooks: {
        client: 'hooks/client.ts'
      },
      lib: 'ui-lib',
      params: 'params',
      routes: 'routes',
      serviceWorker: 'service-worker.ts'
    },
    alias: {
      engine: 'engine',
      events: 'events',
      'content-system': 'content-system',
      flow: 'flow',
      scene: 'scene',
      memoir: 'memoir',
      birth: 'birth',
      death: 'death',
      continuation: 'continuation',
      worldgen: 'worldgen',
      persistence: 'persistence',
      rng: 'rng',
      time: 'time',
      loading: 'loading',
      'ui-lib': 'ui-lib',
      utils: 'utils',
      content: 'content',
      built: 'built'
    }
  }
}

export default config