forked from CodingCatDev/codingcat.dev
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsvelte.config.js
More file actions
37 lines (33 loc) · 891 Bytes
/
svelte.config.js
File metadata and controls
37 lines (33 loc) · 891 Bytes
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
import preprocess from 'svelte-preprocess';
import adapter from '@sveltejs/adapter-auto';
import { mdsvex } from 'mdsvex';
// TODO: remove .svx and .md from production builds
/** @type {import('@sveltejs/kit').Config} */
console.log(`Using ${process.env.NODE_ENV} config`);
const config = {
kit: {
adapter: adapter(),
prerender: {
handleMissingId: 'warn',
handleHttpError: ({ path, referrer, message }) => {
// if nothing refers to it we don't care
// most likely this is a draft in production
// TODO: can we make this better?
if (referrer === null) {
console.debug('SKIPPING 404 ISSUE', path);
return;
}
// otherwise fail the build
throw new Error(message);
}
}
},
extensions: ['.svelte', '.svx', '.md'],
preprocess: [
mdsvex({ extensions: ['.svx', '.md'] }),
preprocess({
postcss: true
})
]
};
export default config;