-
Notifications
You must be signed in to change notification settings - Fork 0
/
svelte.config.js
51 lines (46 loc) · 1.19 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
48
49
50
51
import adapter from '@sveltejs/adapter-static';
import { vitePreprocess } from '@sveltejs/kit/vite';
import { mdsvex } from 'mdsvex';
import mdsvexConfig from './mdsvex.config.js';
let dev = process.env.NODE_ENV === 'development';
if (process.env.NODE_DEV === 'development') {
dev = true;
}
/** @type {import('@sveltejs/kit').Config} */
const config = {
extensions: ['.svelte', ...mdsvexConfig.extensions],
preprocess: [vitePreprocess(), mdsvex(mdsvexConfig)],
onwarn: (warning, handler) => {
if (warning.code.startsWith('a11y-')) {
return;
}
// console.log('\x1b[36m%s\x1b[0m', 'I am cyan'); //cyan
console.log('\n\nsvelte:warnings:\x1b[31m%s\x1b[0m', JSON.stringify(warning, null, 2));
handler(warning);
},
kit: {
paths: {
base: dev ? '' : '/LK-Blog-SvelteKit'
// base: dev ? '' : '/blog'
},
prerender: {
handleMissingId: 'ignore'
},
alias: {
$components: './src/components',
$lib: './src/lib',
$stores: './src/stores',
$styles: './src/styles',
$utils: './src/utils',
$types: './src/types.d.ts'
},
adapter: adapter({
pages: 'docs',
assets: 'docs',
fallback: '200.html',
precompress: false,
strict: true
})
}
};
export default config;