fix(bundle): preserve external workspace packages - #56
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Coverage Report for CI Build 33434036118Coverage increased (+0.5%) to 54.603%Details
Uncovered Changes
Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fcfdb7fa25
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (alias === packageName || alias.startsWith(`${packageName}/`)) { | ||
| delete filteredAliases[alias]; |
There was a problem hiding this comment.
Remove parent aliases for externalized subpaths
When a caller externalizes only a package subpath, such as --externals=@scope/pkg/worker, this condition leaves the generated parent alias @scope/pkg intact. That parent alias also rewrites imports of @scope/pkg/worker, and because esbuild applies alias substitutions before its other path-resolution logic, the requested external rule never sees the original package path and the subpath is bundled. Remove aliases that are ancestors of an external package path as well.
Useful? React with 👍 / 👎.
Goal
Make
ocular-bundle --externalspreserve package boundaries inside vis.gl monorepos. This unblocks replacing tangram.gl's package-local esbuild wrapper withocular-bundle.Changes
Why
Esbuild applies aliases before external package matching. An explicit external such as
@vis.gl/tangram-rendererwas rewritten to its workspace source directory and bundled anyway, defeating bothpackages: externaland--externals.Validation
yarn buildyarn lintyarn test