-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.js
41 lines (39 loc) · 1.07 KB
/
vite.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
import { defineConfig } from 'vite'
import dns from 'dns'
import { resolve } from 'path'
import pugRollupPlugin from 'rollup-plugin-pug';
import yamPlugin from '@modyfi/vite-plugin-yaml';
import { plugin as mdPlugin } from 'vite-plugin-markdown';
import { viteStaticCopy } from 'vite-plugin-static-copy';
const __dirname = new URL('.', import.meta.url).pathname;
dns.setDefaultResultOrder('verbatim')
export default defineConfig(({ command, mode, ssrBuild }) => {
const basedir = resolve(__dirname, 'src');
console.debug('vite.config.js', { command, mode, ssrBuild })
return {
mode,
root: basedir,
assetsInclude: ['**/*.svg'],
build: {
outDir: '../_site',
emptyOutDir: true,
rollupOptions: {
input: {
'main': resolve(basedir, 'index.html'),
},
plugins: [
pugRollupPlugin(),
]
}
},
plugins: [
yamPlugin(),
mdPlugin({mode: 'html'}),
viteStaticCopy({
targets: [
{ src: 'assets/fonts/*', dest: '../_site/assets/fonts' },
],
}),
],
}
});