generated from halo-dev/theme-modern-starter
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathvite.config.ts
36 lines (34 loc) · 1013 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 PurgeIcons from "vite-plugin-purge-icons";
import { defineConfig } from "vite";
import { fileURLToPath } from "url";
import path from "path";
export default ({ mode }: { mode: string }) => {
const isProduction = mode === "production";
return defineConfig({
root: "./src",
base: isProduction ? "/themes/theme-terminal/assets/dist/" : "",
plugins: [PurgeIcons()],
define: {
"process.env": process.env,
},
build: {
manifest: isProduction,
minify: isProduction,
rollupOptions: {
input: path.resolve(__dirname, "src/main.ts"),
output: {
entryFileNames: "[name].js",
chunkFileNames: "[name].js",
assetFileNames: "[name][extname]",
},
treeshake: false,
preserveEntrySignatures: "allow-extension",
},
outDir: fileURLToPath(new URL("./templates/assets/dist", import.meta.url)),
emptyOutDir: true,
},
server: {
origin: "http://localhost:5173",
},
});
};