-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.js
More file actions
37 lines (35 loc) · 1003 Bytes
/
vite.config.js
File metadata and controls
37 lines (35 loc) · 1003 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
31
32
33
34
35
36
37
import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import { fileURLToPath, URL } from "node:url";
import { readFileSync } from "node:fs";
const packageJson = JSON.parse(
readFileSync(new URL("./package.json", import.meta.url), "utf-8")
);
const appVersion = packageJson.version ?? "0.0.0";
const appReleaseTag = `web-app-v${appVersion}`;
// https://vitejs.dev/config/
export default defineConfig(({ command }) => {
const isDev = command === "serve";
return {
plugins: [vue()],
define: {
__APP_VERSION__: JSON.stringify(appVersion),
__APP_RELEASE_TAG__: JSON.stringify(appReleaseTag),
},
resolve: {
alias: {
"@": fileURLToPath(new URL("./src", import.meta.url)),
},
},
base: isDev ? "./" : "/solid-cockpit/",
build: {
outDir: "dist",
},
server: {
headers: {
"Cross-Origin-Opener-Policy": "same-origin",
"Cross-Origin-Embedder-Policy": "require-corp",
},
},
};
});