-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsvelte.config.js
More file actions
38 lines (35 loc) · 1.07 KB
/
svelte.config.js
File metadata and controls
38 lines (35 loc) · 1.07 KB
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
import adapterStatic from '@sveltejs/adapter-static';
import adapterNode from '@sveltejs/adapter-node';
import { mdsvex } from 'mdsvex';
const useStatic = process.env.ADAPTER === 'static';
const config = {
extensions: ['.svelte', '.md'],
preprocess: [
mdsvex({ extensions: ['.md'] })
],
kit: {
adapter: useStatic
? adapterStatic({
pages: 'build',
assets: 'build',
fallback: '404.html',
precompress: false,
strict: false
})
: adapterNode({
out: 'build-node'
}),
paths: { base: '' },
prerender: {
// /tvplot-app/ is a static asset (standalone HTML viewer bundled
// from the tvplot package), not a SvelteKit route. Links to it from
// the layout and home page look like 404s to the prerender crawler
// but resolve correctly at runtime on GitHub Pages.
handleHttpError: ({ path, message }) => {
if (path === '/tvplot-app' || path.startsWith('/tvplot-app/')) return;
throw new Error(message);
}
}
}
};
export default config;