-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
30 lines (28 loc) · 836 Bytes
/
vite.config.ts
File metadata and controls
30 lines (28 loc) · 836 Bytes
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
import { defineConfig, loadEnv } from "vite";
import preact from "@preact/preset-vite";
import tailwindcss from "@tailwindcss/vite";
import { visualizer } from "rollup-plugin-visualizer";
import cssnano from "cssnano";
// https://vitejs.dev/config/
export default ({ mode }) => {
process.env = { ...process.env, ...loadEnv(mode, process.cwd()) };
return defineConfig({
base: "/",
plugins: [
preact({
prerender: {
enabled: true,
renderTarget: "#root",
},
}),
tailwindcss(),
visualizer({
template: "treemap",
open: true, // Automatically open the report in your browser after build
filename: "stats.html", // Output file name
gzipSize: true, // Show gzip size
brotliSize: true, // Show brotli size
}),
],
});
};