We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 103ba02 commit 48ac290Copy full SHA for 48ac290
1 file changed
tutorial/vite.config.ts
@@ -2,7 +2,30 @@ import { defineConfig } from "vite";
2
import react from "@vitejs/plugin-react";
3
import { VitePluginRadar } from "vite-plugin-radar";
4
5
+// Keep the wallet stack together to avoid Rolldown splitting viem into a runtime cycle.
6
+const web3ChunkPackages = [
7
+ "/@coinbase/",
8
+ "/@reown/",
9
+ "/@safe-global/",
10
+ "/@wagmi/",
11
+ "/@walletconnect/",
12
+ "/ox/",
13
+ "/viem/",
14
+ "/wagmi/",
15
+];
16
+
17
export default defineConfig({
18
+ build: {
19
+ rolldownOptions: {
20
+ output: {
21
+ manualChunks(id) {
22
+ if (id.includes("node_modules") && web3ChunkPackages.some((packageName) => id.includes(packageName))) {
23
+ return "web3";
24
+ }
25
+ },
26
27
28
29
plugins: [
30
react(),
31
VitePluginRadar({
0 commit comments