Commit f43cd86
committed
fix(build): use plugin for local package aliases with bundle: false
esbuild's built-in alias option requires bundle: true, but socket-lib
uses bundle: false (library pattern - outputs individual files). Created
a custom esbuild plugin that intercepts imports and resolves local
package aliases using getLocalPackageAliases().
This preserves the critical local development workflow where all
socket-* repos are checked out side-by-side and changes are picked up
immediately, while maintaining compatibility with esbuild's requirements.
The plugin:
- Only activates when local packages are detected
- Handles both direct imports (@socketsecurity/lib) and subpaths
- Marks resolved paths as external (no bundling)1 parent e6f84fe commit f43cd86
1 file changed
+34
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 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 | + | |
25 | 57 | | |
26 | 58 | | |
27 | 59 | | |
| |||
40 | 72 | | |
41 | 73 | | |
42 | 74 | | |
43 | | - | |
44 | | - | |
| 75 | + | |
| 76 | + | |
45 | 77 | | |
46 | 78 | | |
47 | 79 | | |
| |||
0 commit comments