Commit d7a3447
committed
fix(build): externalize packages with import-only exports
`tryResolve` in the externals plugin called exsolve with only nitro's
`exportConditions` (e.g. `production`, `wasm`, `unwasm`, `node`).
exsolve does not implicitly add `import`/`default` when conditions are
explicitly supplied, so packages whose `exports` field only declares
the `import` condition (e.g. `lightningcss`) failed to resolve and
fell through to bundling instead of being traced.
Append `import` to the conditions used for resolving externals so ESM
output matches Node.js runtime resolution.1 parent cf5e878 commit d7a3447
1 file changed
Lines changed: 9 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
48 | 55 | | |
49 | 56 | | |
50 | 57 | | |
51 | 58 | | |
52 | | - | |
| 59 | + | |
53 | 60 | | |
54 | 61 | | |
55 | 62 | | |
| |||
110 | 117 | | |
111 | 118 | | |
112 | 119 | | |
113 | | - | |
| 120 | + | |
114 | 121 | | |
115 | 122 | | |
116 | 123 | | |
| |||
0 commit comments