forked from uvarov-frontend/vanilla-calendar-pro
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.ts
36 lines (33 loc) · 820 Bytes
/
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 { resolve } from 'path';
import { defineConfig } from 'vite';
// eslint-disable-next-line @typescript-eslint/no-var-requires
const pages = require('./get-pages');
const input = pages.reduce((acc: string[], current: string, index: number) => {
acc['0'] = resolve(__dirname, 'demo', 'index.html');
acc[index + 1] = resolve(__dirname, current);
return acc;
}, {});
export default defineConfig({
root: './demo',
build: {
assetsDir: '',
outDir: 'build',
target: 'ES6',
cssCodeSplit: true,
minify: 'terser',
rollupOptions: {
input,
},
},
server: {
port: 5173,
},
resolve: {
alias: {
'@': resolve(__dirname, './'),
'@package': resolve(__dirname, './package'),
'@src': resolve(__dirname, './package/src'),
'@scripts': resolve(__dirname, './package/src/scripts'),
},
},
});