forked from ClearskyApp06/ClearskyUI
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.mjs
34 lines (32 loc) · 839 Bytes
/
vite.config.mjs
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
// @ts-check
import { env } from 'node:process';
import { resolve, extname, join } from 'node:path';
import { readdirSync } from 'node:fs';
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
function getInputHtmlFiles() {
const srcDir = resolve(__dirname, 'src');
return readdirSync(srcDir)
.filter((file) => extname(file) === '.html')
.map((file) => join(srcDir, file));
}
export default defineConfig({
plugins: [react()],
root: 'src',
build: {
outDir: resolve(__dirname, 'static'),
rollupOptions: {
input: getInputHtmlFiles(),
// output: {
// manualChunks: {
// mui: ['@mui/material'],
// },
// },
},
emptyOutDir: true,
sourcemap: true,
},
define: {
BUILD_COMMIT_HASH: JSON.stringify(env.BUILD_COMMIT_HASH),
},
});