-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsvelte.config.js
70 lines (66 loc) · 1.87 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
import adapter from '@sveltejs/adapter-static'
import postcssFunctions from 'postcss-functions'
import preprocess from 'svelte-preprocess'
import linearClamp from './tool/postcss-linear-clamp.cjs'
import toitPlugin from './tool/toit-plugin.js'
import Icons from 'unplugin-icons/vite'
import svg from '@poppanator/sveltekit-svg'
import postcssNesting from 'postcss-nesting'
import postcssLabFunction from 'postcss-lab-function'
/** @type {import('@sveltejs/kit').Config} */
const config = {
// Consult https://github.com/sveltejs/svelte-preprocess
// for more information about preprocessors
preprocess: preprocess({
postcss: {
plugins: [
// * * * WARNING * * *
// Every plugin here needs to be added in postcss.config.cjs as well!
postcssNesting(),
// I'd love to use `preserve: true` just for Safari here, but that
// doesn't work with css variables.
postcssLabFunction({ preserve: false }),
postcssFunctions({
functions: { linearClamp },
}),
],
},
}),
kit: {
adapter: adapter({
// default options are shown
pages: 'build',
assets: 'build',
fallback: null,
}),
// Make sure this plays nice with GitHub Pages.
trailingSlash: 'always',
// hydrate the <div id="svelte"> element in src/app.html
target: '#svelte',
vite: {
plugins: [
toitPlugin(),
Icons({
compiler: 'svelte',
// scale: 1,
}),
svg({
// https://github.com/svg/svgo#configuration
svgoOptions: {
plugins: [
{
name: 'preset-default',
params: {
overrides: {
removeViewBox: false,
},
},
},
],
},
}),
],
},
},
}
export default config