fix(cd): adding path resolution plugin for scoped fallback#1197
Merged
fix(cd): adding path resolution plugin for scoped fallback#1197
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the Astro/Vite build configuration to correctly resolve Ignite UI packages when only the @infragistics/-scoped variants are installed, matching the existing TypeScript tsconfig.json paths fallback behavior.
Changes:
- Added a custom Vite/Rollup
resolveIdplugin to redirect unscopedigniteui-*imports to@infragistics/igniteui-*when the unscoped package isn’t installed. - Made
optimizeDeps.includedynamically choose the installed package name (unscoped vs scoped) to avoid pre-bundling failures/warnings in scoped-only installs.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
dobromirts
previously approved these changes
Mar 25, 2026
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Fix: Resolve
@infragistics/scoped package aliases for Vite/RollupProblem
The project supports two package installation modes — unscoped (
igniteui-dockmanager) and@infragistics/-scoped (@infragistics/igniteui-dockmanager). Thetsconfig.jsonpathsconfig handles this for the TypeScript language server via ordered fallback arrays, but Vite/Rollup is unaware of this fallback:pathsarray into a Vite alias, so the@infragistics/fallback was silently ignored.Solution
Two changes to
astro.config.mjs:1.
resolveIgniteUiScopedVite pluginAdded a custom Vite plugin that mirrors the tsconfig
pathsfallback logic for Rollup. At startup it checksnode_moduleswithexistsSyncand builds a redirect map — only for packages where the unscoped variant is absent. In theresolveIdhook it delegates tothis.resolve(..., { skipSelf: true })so the scoped name goes through the full Node module resolution pipeline (respectingpackage.jsonexports, subpaths, etc.) rather than being treated as a raw file path.A
resolveIdplugin was chosen overresolve.aliasbecause Astro merges its own Vite config after user config and can overwrite alias arrays, whereas Rollup plugin hooks are always invoked regardless of config merging order.2. Dynamic
optimizeDeps.includeAdded a small
ig(pkg)helper that returns the unscoped or@infragistics/-scoped name based on which is installed. Used it to build theoptimizeDeps.includelist so esbuild's pre-bundling phase also resolves to the correct installed package. Previously the hardcoded unscoped names caused[WARN] Failed to resolve dependencywarnings and a failed pre-bundle pass when only scoped packages were present.Result
@infragistics/-scoped packages installed, matching the existingtsconfig.jsonfallback behaviour.