-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathsvelte.config.js
44 lines (41 loc) · 1.11 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
import adapter from '@sveltejs/adapter-node';
import { sveltePreprocess } from 'svelte-preprocess';
// import atImport from 'postcss-import';
import path from 'path';
/** @type {import('@sveltejs/kit').Config} */
const config = {
// Consult https://github.com/sveltejs/svelte-preprocess
// for more information about preprocessors
preprocess: sveltePreprocess(),
kit: {
adapter: adapter({
precompress: true,
}),
env: {
dir: path.resolve('./'),
publicPrefix: 'PUBLIC_',
},
csp: {
mode: 'hash',
},
csrf: {
// Only disable if in development mode
checkOrigin: process.env.NODE_ENV !== 'development',
},
alias: {
'$ui': './src/components/ui',
'$comp': './src/components',
'$stores': './src/stores',
'$lib': './src/lib',
'$params': './src/params',
'$content': './src/content',
},
},
// Only way I found to hide warnings from node_modules that doesn't break everything
// vitePlugin: { exclude: ['**/node_modules/**'] } doesn't work
onwarn: (warning, handler) => {
if (warning.filename.includes('node_modules')) return;
handler(warning);
},
};
export default config;