-
Notifications
You must be signed in to change notification settings - Fork 52
Expand file tree
/
Copy pathvite.wallet-config.js
More file actions
69 lines (68 loc) · 2.35 KB
/
Copy pathvite.wallet-config.js
File metadata and controls
69 lines (68 loc) · 2.35 KB
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
import { defineConfig } from "vite";
import path from "path";
import nodePolyfills from "vite-plugin-node-stdlib-browser";
import dts from "vite-plugin-dts";
// https://vite.dev/config/
export default defineConfig({
plugins: [
dts({
insertTypesEntry: true,
tsconfigPath: "./tsconfig.json",
}),
nodePolyfills(),
],
build: {
lib: {
entry: path.resolve(__dirname, "src/sdk-entrypoint/sdk-entrypoint.ts"),
name: "WalletSDK",
formats: ["es", "umd"],
fileName: (format) => `wallet-sdk.${format}.js`,
},
outDir: "wander-connect-sdk/wallet-api-dist",
sourcemap: true,
rollupOptions: {
external: ["webextension-polyfill", "~subscriptions/subscription", "~iframe/plasmo-storage/plasmo-storage.mock"],
output: {
globals: {
"webextension-polyfill": "browser",
"~subscriptions/subscription": "ArConnectSubscription",
"~iframe/plasmo-storage/plasmo-storage.mock": "PlasmoStorageMock",
},
},
treeshake: {
moduleSideEffects: false,
propertyReadSideEffects: false,
},
},
},
define: {
"process.env": {
// DO NOT spread process.env. Manually add those you need.
NODE_ENV: process.env.NODE_ENV || "development",
},
},
resolve: {
alias: {
"~": path.resolve(__dirname, "./src"),
"~api": path.resolve(__dirname, "./src/api"),
"~lib": path.resolve(__dirname, "./src/lib"),
"~utils": path.resolve(__dirname, "./src/utils"),
"~gateways": path.resolve(__dirname, "./src/gateways"),
"~wallets": path.resolve(__dirname, "./src/wallets"),
"~applications": path.resolve(__dirname, "./src/applications"),
"~subscriptions": path.resolve(__dirname, "./src/subscriptions"),
"~iframe": path.resolve(__dirname, "./src/iframe"),
// BE or Embed (iframe) strategies for messaging and chunking:
"~isomorphic-messaging": path.resolve(
__dirname,
"./src/utils/messaging/strategies/iframe/iframe-messaging.strategy.ts",
),
"~isomorphic-chunking": path.resolve(
__dirname,
"./src/utils/messaging/strategies/iframe/iframe-chunking.strategy.ts",
),
// Polyfill `webextension-polyfill` for embedded, as that's not a BE but a regular SPA:
"webextension-polyfill": path.resolve(__dirname, "./src/iframe/browser"),
},
},
});