generated from jogetoss/repo-template
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathvite.config.ts
37 lines (36 loc) · 1.24 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
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import wasm from "vite-plugin-wasm";
import topLevelAwait from "vite-plugin-top-level-await";
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react(), wasm(), topLevelAwait()],
define: { "process.env.NODE_ENV": '"production"' },
/**
* See https://vitejs.dev/config/shared-options.html#base
* Define path for on-demand-loading or loading external resources (e.g.: webassembly modules .wasm).
* Otherwise, defaults to server path (e.g.: http//localhost:8080/).
*/
base: "/jw/plugin/org.joget.cardano.lib.CardanoExplorerLinkFormElement",
build: {
// sourcemap: true,
emptyOutDir: false,
outDir: "target/npm-build-output",
// Library mode since this is not building a web app
lib: {
entry: [
"src/main/frontend/CardanoExplorerButton.tsx",
"src/main/frontend/wallet/CardanoWalletHandler.ts",
],
formats: ["es"],
},
},
optimizeDeps: {
esbuildOptions: {
// Node.js global to browser globalThis
define: {
global: "globalThis",
},
},
},
});