-
Notifications
You must be signed in to change notification settings - Fork 34
/
svelte.config.js
52 lines (44 loc) · 1.28 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
52
import preprocess from 'svelte-preprocess';
import path from 'path';
import mdPlugin from 'vite-plugin-markdown';
import markdownIt from 'markdown-it';
import anchor from 'markdown-it-anchor';
import kebab from 'lodash.kebabcase';
import adapter from '@sveltejs/adapter-static';
const slugify = (s) => kebab(s);
const mdit = markdownIt();
mdit.use(anchor, { slugify });
const isProduction = process.env.NODE_ENV === 'production';
/** @type {import('@sveltejs/kit').Config} */
const config = {
// Consult https://github.com/sveltejs/svelte-preprocess
// for more information about preprocessors
preprocess: [
preprocess({
postcss: true
})
],
kit: {
adapter: adapter(),
paths: {
base: isProduction ? '/svelte-forms' : '',
assets: isProduction ? 'https://chainlist.github.io/svelte-forms' : ''
},
// hydrate the <div id="svelte"> element in src/app.html
package: {
exports: (file) => file.includes('index.ts')
},
vite: {
plugins: [mdPlugin.plugin({ mode: ['html', 'toc'], markdownIt: mdit })],
resolve: {
alias: {
$components: path.resolve('src/components'),
$utils: path.resolve('src/utils'),
'svelte-forms': path.resolve('src/lib'),
'svelte-forms/validators': path.resolve('src/lib/validators')
}
}
}
}
};
export default config;