-
Notifications
You must be signed in to change notification settings - Fork 24
/
svelte.config.js
44 lines (38 loc) · 1.22 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
import sveltePreprocess from 'svelte-preprocess';
import adapterBun from 'svelte-adapter-bun';
import adapterStatic from '@sveltejs/adapter-static';
const mode = process.env.NODE_ENV || 'development';
const dev = mode === 'development' || process.env.RUNTIME === 'development';
process.env.TAILWIND_MODE = dev ? 'watch' : 'build';
/** @type {import('@sveltejs/kit').Config} */
const config = {
// Consult https://github.com/sveltejs/svelte-preprocess
// for more information about preprocessors
preprocess: sveltePreprocess({
postcss: true,
sourceMap: true
}),
kit: {
// By default, `npm run build` will create a standard Node app.
// You can create optimized builds for different platforms by
// specifying a different adapter
adapter: process.env.SVELTE_ADAPTER === 'bun' ? adapterBun({
out: 'build/node',
dynamic_origin: true,
development: dev,
}) : adapterStatic({
pages: 'build/static',
assets: 'build/static',
fallback: 'index.html'
}),
paths: {
base: process.env.SVELTE_BASE_PATH || ''
},
prerender: {
handleHttpError: 'warn',
handleMissingId: 'ignore',
origin: process.env.PUBLIC_BASE_URL
}
}
};
export default config;