-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.render.ts
More file actions
37 lines (34 loc) · 1.11 KB
/
vite.config.render.ts
File metadata and controls
37 lines (34 loc) · 1.11 KB
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
import vue from '@vitejs/plugin-vue';
import path from 'path';
import url from 'url';
import { defineConfig } from 'vite';
const projectRoot = path.resolve(path.dirname(url.fileURLToPath(import.meta.url)));
export default defineConfig({
plugins: [vue()],
base: './',
root: path.resolve(projectRoot, 'src/render'),
resolve: {
alias: {
'@': path.resolve(projectRoot, 'src/render'),
'@shared': path.resolve(projectRoot, 'src/shared'),
'@render': path.resolve(projectRoot, 'src/render'),
'@assets': path.resolve(projectRoot, 'src/render/public/assets'),
'@main': path.resolve(projectRoot, 'src/main'),
},
},
//esbuild options for production build
build: {
outDir: path.resolve(projectRoot, 'dist/render'),
emptyOutDir: true,
assetsDir: 'assets',
rollupOptions: {
input: path.resolve(projectRoot, 'src/render/index.html'),
},
sourcemap: false,
minify: 'esbuild',
target: 'esnext',
},
define: {
'process.env.IS_PREACT': 'true',
},
});