-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathvite.config.ts
45 lines (40 loc) · 1.03 KB
/
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
37
38
39
40
41
42
43
44
45
import { execSync } from "child_process";
import react from "@vitejs/plugin-react";
import { defineConfig } from "vite";
import checker from "vite-plugin-checker";
import { nodePolyfills } from "vite-plugin-node-polyfills";
import svgr from "vite-plugin-svgr";
import tsconfigPaths from "vite-tsconfig-paths";
import getConfig from "./script/getConfig";
const OUT_DIR = "build";
const COMMIT_HASH = execSync("git rev-parse --short HEAD").toString().trim();
// https://vitejs.dev/config/
export default defineConfig({
build: {
outDir: OUT_DIR,
},
define: {
"process.env.__COMMIT_HASH__": JSON.stringify(COMMIT_HASH),
},
plugins: [
getConfig(),
nodePolyfills({
globals: {
Buffer: true,
},
}),
react({
babel: {
plugins: ["@emotion/babel-plugin"],
},
}),
tsconfigPaths(),
checker({ typescript: true }),
svgr(),
],
// It should help resolve issues with linking the SDK
//
// optimizeDeps: {
// exclude: ["@compolabs/spark-orderbook-ts-sdk"],
// },
});