-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
27 lines (25 loc) · 860 Bytes
/
Copy pathvite.config.ts
File metadata and controls
27 lines (25 loc) · 860 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
import react from "@vitejs/plugin-react";
import { defineConfig, loadEnv } from "vite";
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd(), "");
const commit = env.VITE_GIT_COMMIT || env.GITHUB_SHA || "local";
const version = env.VITE_APP_VERSION || process.env.npm_package_version || "0.1.0";
return {
base: "/mesh-message-drop/",
plugins: [react()],
define: {
__APP_VERSION__: JSON.stringify(version),
__GIT_COMMIT__: JSON.stringify(commit.slice(0, 12)),
},
// file:../mesh-common can resolve React/Yjs from its own node_modules,
// creating duplicate instances. Dedupe forces the app's copy to win.
resolve: {
dedupe: ["react", "react-dom", "yjs", "y-webrtc"],
},
build: {
outDir: "docs",
emptyOutDir: false,
sourcemap: true,
},
};
});