-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsvelte.config.js
49 lines (42 loc) · 1.3 KB
/
svelte.config.js
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
import adapter from '@sveltejs/adapter-static';
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
/** @type {import('@sveltejs/kit').Config} */
const config = {
preprocess: vitePreprocess(),
kit: {
adapter: adapter(),
paths: {
// https://www.okupter.com/blog/deploy-sveltekit-website-to-github-pages#set-the-base-path
// because Github pages serves the website from a subfolder, not from root
// base: process.env.NODE_ENV === 'production' ? '/weather-frontend' : '',
relative: false,
},
alias: {
$api: 'src/api',
$assets: 'src/assets',
$config: 'src/config',
$styles: 'src/styles',
$types: 'src/types',
$utils: 'src/utils',
},
files: {
serviceWorker: 'src/workers/sw.ts',
},
serviceWorker: {
// https://vite-pwa-org.netlify.app/frameworks/sveltekit.html#generate-custom-service-worker
// https://kit.svelte.dev/docs/service-workers
// disable the sveltekit automatic registration,
// because we are doing the registration manually in +layout.svelte with vite-plugin-pwa
register: false,
},
},
vitePlugin: {
// https://github.com/sveltejs/vite-plugin-svelte/blob/main/docs/inspector.md
inspector: {
showToggleButton: 'always',
toggleKeyCombo: 'meta-shift',
toggleButtonPos: 'bottom-right',
},
},
};
export default config;