-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathvite.config.web.ts
50 lines (47 loc) · 1.44 KB
/
vite.config.web.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import pkg from "./package.json";
import path from "path";
import tsConfig from "./tsconfig.json";
import { sharedViteConfig } from "./vite.shared";
// import mkcert from 'vite-plugin-mkcert'
const OUT_DIR = "dist/titan-reactor";
const TARGET = tsConfig.compilerOptions.target;
// https://vitejs.dev/config/
export default defineConfig((env) => {
return {
...sharedViteConfig(),
define: {
__static: JSON.stringify(env.command === "build" ? "" : "/bundled"),
},
logLevel: "info",
publicDir: "bundled",
build: {
emptyOutDir: true,
outDir: OUT_DIR,
target: TARGET,
rollupOptions: {
input: {
command: path.resolve(__dirname, "./configuration.html"),
index: path.resolve(__dirname, "./index.html"),
},
},
minify: false, //env.command === "build",
sourcemap: false,//env.command === "build",
},
esbuild: {
target: TARGET,
format: "esm",
},
worker: {
format: "es",
},
plugins: [react()],
server: {
host: pkg.debug.env.VITE_DEV_SERVER_HOSTNAME,
port: pkg.debug.env.VITE_DEV_SERVER_PORT,
// https: true,
hmr: false,
}
};
});