-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
40 lines (39 loc) · 1.07 KB
/
vite.config.ts
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
import { defineConfig } from 'vite';
import ssr from 'vike/plugin';
import preact from '@preact/preset-vite';
import { validateJson } from './scripts/validation.mjs';
import postcssConfig from './postcss.config';
export default (() => {
validateJson('src/data/resume.json', 'src/types/index.ts', 'Resume');
return defineConfig(({ mode }) => ({
base: '/resume/',
plugins: [preact(), ssr({ prerender: true })],
server: {
port: 3000,
},
build: {
target: 'esnext',
polyfillDynamicImport: false,
},
// We manually add a list of dependencies to be pre-bundled, in order to avoid a page reload at dev start which breaks vike's CI
optimizeDeps: {
include: [
'preact',
'preact/devtools',
'preact/debug',
'preact/jsx-dev-runtime',
'preact/hooks',
],
},
css: {
postcss: postcssConfig,
},
resolve: {
alias: {
'~common': `${__dirname}/src/common`,
'~config': `${__dirname}/config.ts`,
'~data': `${__dirname}/src/data`
},
},
}));
})();