-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
svelte.config.js
47 lines (41 loc) · 1.07 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
import auto from '@sveltejs/adapter-auto';
import ghPages from '@sveltejs/adapter-static';
import netlify from '@sveltejs/adapter-netlify';
import { resolve } from 'node:path';
import { sveltePreprocess } from 'svelte-preprocess';
/** @type {import('@sveltejs/kit').Config} */
const config = {
// Consult https://github.com/sveltejs/svelte-preprocess
// for more information about preprocessors
preprocess: sveltePreprocess({
includePaths: ['node_modules', 'src']
}),
kit: {
adapter: getAdapter(),
paths: {
base: process.env.GITHUB_WORKFLOW ? process.env.BASE_PATH : undefined,
},
alias: {
$: resolve('./src'),
$components: resolve('./src/components'),
$meta: resolve('./src/meta'),
$stores: resolve('./src/stores')
}
}
};
function getAdapter() {
switch(true) {
case Boolean(process.env.GITHUB_WORKFLOW):
return ghPages({
fallback: '404.html',
precompress: true,
});
case Boolean(process.env.NETLIFY):
return netlify({
edge: true,
});
default:
return auto();
}
}
export default config;