-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsvelte.config.js
32 lines (30 loc) · 1012 Bytes
/
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
/** @type {import('@sveltejs/kit').Config} */
import adapter from '@sveltejs/adapter-static';
import 'dotenv/config';
import { mdsvex } from 'mdsvex';
import preprocess from 'svelte-preprocess';
import { imagetools } from 'vite-imagetools';
import { vanillaExtractPlugin } from '@vanilla-extract/vite-plugin';
const config = {
extensions: ['.svelte', '.md', '.svelte.md'],
preprocess: [preprocess(), mdsvex({ extensions: ['.svelte.md', '.md', '.svx'] })],
kit: {
adapter: adapter(),
files: {
hooks: 'src/hooks',
},
// hydrate the <div id="svelte"> element in src/app.html
target: '#svelte',
vite: {
define: {
'process.env.VITE_BUILD_TIME': JSON.stringify(new Date().toISOString()),
},
plugins: [vanillaExtractPlugin(), imagetools({ force: true })],
ssr:
process.env.NODE_ENV === 'development'
? {}
: { noExternal: ['@vanilla-extract/css', '@vanilla-extract/css/fileScope'] },
},
},
};
export default config;