-
Notifications
You must be signed in to change notification settings - Fork 0
/
svelte.config.js
51 lines (47 loc) · 1.21 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-auto'
import vercel from '@sveltejs/adapter-vercel'
import autoprefixer from 'autoprefixer'
import cssnano from 'cssnano'
import { resolve } from 'path'
import preprocess from 'svelte-preprocess'
import { directives } from './directives.config.js'
const rootDomain = process.env["VITE_DOMAIN"]
const dev = process.env.NODE_ENV === 'development'
/** @type {import('@sveltejs/kit').Config} */
const config = {
preprocess: preprocess({
sass: {
includePaths: ['src'],
prependData: '@import "src/lib/sass/main.sass"',
renderSync: true
},
postcss: {
plugins: [
cssnano({ preset: 'cssnano-preset-default' }),
autoprefixer({})
]
},
}),
kit: {
adapter: dev ? adapter() : vercel(),
csp: {
mode: 'auto',
directives: directives(dev, rootDomain)
},
alias: {
$lib: resolve('src/lib'),
$stores: resolve('./src/lib/stores'),
$types: resolve('src/lib/types'),
$components: resolve('./src/lib/components')
},
files: {
assets: 'static',
lib: 'src/lib',
routes: 'src/routes',
serviceWorker: 'src/service-worker',
template: 'src/app.html',
hooks: 'src/hooks'
},
}
}
export default config