forked from rotorflight/rotorflight-configurator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.mjs
54 lines (50 loc) · 1.24 KB
/
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import pkg from "./package.json" with { type: "json" };
import child_process from "node:child_process";
import path from "node:path";
import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue2";
const commitHash = child_process
.execSync("git rev-parse --short HEAD")
.toString()
.trim();
export default defineConfig({
base: "./",
build: {
outDir: "./bundle",
rollupOptions: {
input: {
"src/main.html": "src/main.html",
"src/main_cordova.html": "src/main_cordova.html",
"src/tabs/receiver_msp.html": "src/tabs/receiver_msp.html",
},
output: {
manualChunks(id) {
if (id.includes("node_modules/three")) {
return "vendor-three";
}
},
},
},
},
plugins: [vue()],
resolve: {
alias: {
"@": path.resolve(import.meta.dirname, "src"),
vue: path.resolve(
import.meta.dirname,
"node_modules/vue/dist/vue.esm.js",
),
},
},
define: {
"process.env.NODE_ENV": JSON.stringify(
process.env.NODE_ENV || "production",
),
__APP_VERSION__: JSON.stringify(pkg.version),
__COMMIT_HASH__: JSON.stringify(commitHash),
},
server: {
port: 5077,
strictPort: true,
},
});