-
Notifications
You must be signed in to change notification settings - Fork 210
/
vite.config.ts
31 lines (27 loc) · 739 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
import path from "path";
import fs from "fs";
import dns from "dns";
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
// https://vitejs.dev/config/server-options.html#server-host
dns.setDefaultResultOrder("verbatim");
// make sure vite picks up all html files in root, needed for vite build
const allHtmlEntries = fs
.readdirSync(".")
.filter((file) => path.extname(file) === ".html")
.reduce((acc, file) => {
acc[path.basename(file, ".html")] = path.resolve(__dirname, file);
return acc;
}, {});
// https://vitejs.dev/config/
export default defineConfig({
build: {
rollupOptions: {
input: allHtmlEntries,
},
},
plugins: [react()],
server: {
port: 3000,
},
});