Commit dbdca1e
authored
fix(builder): use terser minification to preserve wagmi TLA initialization (#320)
esbuild's minification reorders statements in a way that breaks Top-Level
Await (TLA) initialization in wagmi connectors, causing runtime errors like
"Cannot set properties of undefined (setting 'type')" in production builds.
Changes:
- Remove wagmi from manualChunks (code splitting exacerbates TLA issues)
- Set build target to esnext to preserve native TLA syntax
- Switch from esbuild to terser for minification (preserves TLA order)
- Configure terser to not mangle top-level names
This fixes EVM and Polkadot adapters failing to load networks in Docker/
production builds while working correctly in development mode.1 parent 772e590 commit dbdca1e
1 file changed
Lines changed: 15 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
374 | 374 | | |
375 | 375 | | |
376 | 376 | | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
377 | 380 | | |
378 | 381 | | |
379 | 382 | | |
380 | 383 | | |
381 | | - | |
382 | | - | |
383 | 384 | | |
384 | 385 | | |
385 | 386 | | |
| |||
393 | 394 | | |
394 | 395 | | |
395 | 396 | | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
396 | 400 | | |
397 | | - | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
398 | 410 | | |
399 | 411 | | |
400 | 412 | | |
| |||
0 commit comments