-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.ts
36 lines (33 loc) · 1.03 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
import process from 'node:process';
import { fileURLToPath, URL } from 'node:url';
import ckeditor5 from '@ckeditor/vite-plugin-ckeditor5';
import { viteSingleFile } from 'vite-plugin-singlefile';
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
const BUILD_VIEWER = process.env.BUILD_TARGET === 'viewer';
// https://vitejs.dev/config/
export default defineConfig({
base: './',
plugins: [
ckeditor5({ theme: require.resolve('@ckeditor/ckeditor5-theme-lark') }),
vue(),
BUILD_VIEWER && viteSingleFile({}),
],
build: {
outDir: BUILD_VIEWER ? 'viewer' : 'dist',
copyPublicDir: !BUILD_VIEWER,
rollupOptions: {
input: BUILD_VIEWER ? {
viewer: fileURLToPath(new URL('./viewer.html', import.meta.url)),
} : {
editor: fileURLToPath(new URL('./index.html', import.meta.url)),
simulator: fileURLToPath(new URL('./simulator.html', import.meta.url)),
},
},
},
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)),
},
},
});