Repository navigation
fix(vite): preserve package imports during vendor bundling - #11565
Merged
NathanWalker merged 2 commits intoOct 22, 2026
Merged
Conversation
Let esbuild resolve # specifiers in the importing package scope instead of probing them from the app scope and stubbing valid imports. Closes NativeScript#11564.
|
View your CI Pipeline Execution ↗ for commit 97a8eff
💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗ ☁️ Nx Cloud last updated this comment at |
commit: |
NathanWalker
approved these changes
Oct 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Checklist
What is the current behavior?
Valid package-internal imports such as Octane's
#octane/dist/signal-actions/graphbecome throwing optional-dependency stubs. The plugin probes them with a project-scopedrequire.resolve; itspathsoption does not switch the package imports scope to the importer.What is the new behavior?
Let
#specifiers fall through to esbuild to resolve the importer'spackage.jsonimports map. Closes #11564.The regression bundles a fixture through the actual plugin and evaluates it:
#internalexports42, while an absent optional dependency still throws and triggers itstry/catchfallback. It fails before the guard change and passes afterward.Validation: all 1,900 tests pass with
cd packages/vite && npx vitest run; changed-file ESLint and formatting pass.npx nx run vite:testhas five existingtypescript-optional.spec.tsfailures;vite:linthas three existing errors inconfiguration/base.tsandhmr/server/css-device-module.ts. Both failures were reproduced with the original source. No simulator required.