-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsvelte.config.js
More file actions
46 lines (44 loc) · 1.24 KB
/
svelte.config.js
File metadata and controls
46 lines (44 loc) · 1.24 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
39
40
41
42
43
44
45
46
import adapter from '@sveltejs/adapter-static';
import preprocess from 'svelte-preprocess';
export default {
kit: {
adapter: adapter({
// default options are shown
pages: 'build',
assets: 'build',
fallback: null,
precompress: false,
ssr: true
// strict: false
}),
paths: {
//base: process.env.NODE_ENV === 'production' ? '/planthub' : ''
base: process.env.NODE_ENV === 'production' ? '' : ''
},
alias: {
// $docs: path.resolve('./src/docs')
},
// Consult https://github.com/sveltejs/svelte-preprocess
// for more information about preprocessors
// Build throws error for all links pointing to the backend. Therefor we need to exclude for checking the link during build.
prerender: {
handleHttpError: ({ status, path, referrer, referenceType }) => {
if (path.startsWith('/backend/') || path.startsWith('/images/') || path == '/') {
//do nothing as it links to backend
} else {
throw new Error(
path +
' Missing link.' +
`${status} ${path}${referrer ? ` (${referenceType} from ${referrer})` : ''}`
);
}
console.warn(`${status} ${path}${referrer ? ` (${referenceType} from ${referrer})` : ''}`);
}
}
},
preprocess: [
preprocess({
postcss: true
})
]
};