-
-
Notifications
You must be signed in to change notification settings - Fork 16
/
vite.config.site.js
60 lines (57 loc) · 1.38 KB
/
vite.config.site.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
52
53
54
55
56
57
58
59
60
import { resolve } from 'path';
import { defineConfig } from 'vite';
import { ViteEjsPlugin } from 'vite-plugin-ejs';
import { TransformEjs } from './src/lib/vite-plugins';
const rootDir = resolve(__dirname, 'src')
const renderData = {
meta: {
title: "jsoncv",
description: "A toolkit for building your CV with JSON and creating stylish HTML/PDF files.",
url: "https://jsoncv.reorx.com",
twitter: {
card: "summary",
username: "novoreorx",
}
},
editorMeta: {
title: "jsoncv Editor",
description: "The online editor of the jsoncv project.",
url: "https://jsoncv.reorx.com/editor/",
twitter: {
card: "summary",
username: "novoreorx",
}
}
}
export default defineConfig({
root: 'src',
build: {
// allows 'import.meta.glob' to work
target: 'esnext',
rollupOptions: {
input: {
main: resolve(rootDir, 'index.html'),
editor: resolve(rootDir, 'editor/index.html'),
preview: resolve(rootDir, 'preview/index.html'),
},
},
},
resolve: {
alias: {
// remove the "Module "fs" has been externalized" warning for ejs
'fs': 'src/lib/fs-polyfill.js',
},
},
plugins: [
TransformEjs(),
ViteEjsPlugin(
renderData,
{
ejs: (viteConfig) => ({
// ejs options goes here.
views: [resolve(__dirname)],
})
}
),
],
})