Commit ccf9d2b
committed
fix(build/externals): honor thin wrappers for .js-suffixed subpaths
`bundlePackage` appended `.js` unconditionally when computing the
`src/external/{packageName}.js` wrapper path. For subpaths whose literal
name already ends in `.js` (e.g. `@npmcli/package-json/lib/read-package.js`
— the package's own exports map uses that literal path), this produced
`src/external/@npmcli/package-json/lib/read-package.js.js`, which
doesn't exist. `existsSync` returned false and the bundler silently
skipped the hand-written wrapper, bundling upstream directly. Any
customization intended for the wrapper layer (custom re-exports,
additional stubs) was invisibly discarded. Strips an existing `.js`
before appending so both subpath styles resolve to the same wrapper.1 parent bcbdc86 commit ccf9d2b
1 file changed
Lines changed: 9 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
53 | 55 | | |
54 | 56 | | |
55 | 57 | | |
| |||
0 commit comments