refactor(glob): do not rewrite import path for absolute base#22310
Merged
sapphi-red merged 3 commits intoMay 18, 2026
Merged
Conversation
6bc79d6 to
b62027d
Compare
…port_path_for_absolute_base
sapphi-red
approved these changes
May 18, 2026
renovate Bot
added a commit
to andrei-picus-tink/auto-renovate
that referenced
this pull request
May 22, 2026
| datasource | package | from | to | | ---------- | ------- | ------ | ------ | | npm | vite | 8.0.11 | 8.0.14 | ## [v8.0.14](https://github.com/vitejs/vite/blob/HEAD/packages/vite/CHANGELOG.md#small-8014-2026-05-21-small) ##### Features - update rolldown to 1.0.2 ([#22484](vitejs/vite#22484)) ([96efc88](vitejs/vite@96efc88)) ##### Bug Fixes - **deps:** update all non-major dependencies ([#22471](vitejs/vite#22471)) ([98b8163](vitejs/vite@98b8163)) - **dev:** handle errors when sending messages to vite server ([#22450](vitejs/vite#22450)) ([e8e9a34](vitejs/vite@e8e9a34)) - **html:** handle trailing slash paths in transformIndexHtml ([#22480](vitejs/vite#22480)) ([5d94d1b](vitejs/vite@5d94d1b)) - **optimizer:** pass oxc jsx options to transformSync in dependency scan ([#22342](vitejs/vite#22342)) ([b3132da](vitejs/vite@b3132da)) ##### Miscellaneous Chores - **deps:** update rolldown-related dependencies ([#22470](vitejs/vite#22470)) ([7cb728e](vitejs/vite@7cb728e)) - remove irrelevant commits from changelog ([2c69495](vitejs/vite@2c69495)) ##### Code Refactoring - **glob:** do not rewrite import path for absolute base ([#22310](vitejs/vite#22310)) ([0ae2844](vitejs/vite@0ae2844)) ##### Tests - **css:** sass does not use main field ([#22449](vitejs/vite#22449)) ([ebf39a0](vitejs/vite@ebf39a0)) ## [v8.0.13](https://github.com/vitejs/vite/blob/HEAD/packages/vite/CHANGELOG.md#small-8013-2026-05-14-small) ##### Features - **bundled-dev:** add lazy bundling support ([#21406](vitejs/vite#21406)) ([4f0949f](vitejs/vite@4f0949f)) - **optimizer:** improve the esbuild plugin converter to pass some properties of build result to `onEnd` ([#22357](vitejs/vite#22357)) ([47071ce](vitejs/vite@47071ce)) - update rolldown to 1.0.1 ([#22444](vitejs/vite#22444)) ([8c766a6](vitejs/vite@8c766a6)) ##### Bug Fixes - **build:** copy public directory after building same environment with `write=false` ([#22328](vitejs/vite#22328)) ([158e8ae](vitejs/vite@158e8ae)) - **css:** await sass/less/styl worker disposal on teardown (fix [#22274](vitejs/vite#22274)) ([#22275](vitejs/vite#22275)) ([b7edcb7](vitejs/vite@b7edcb7)) - **css:** keep deprecated `name`/`originalFileName` in synthetic `assetFileNames` call ([#22439](vitejs/vite#22439)) ([8e59c97](vitejs/vite@8e59c97)) - make `isBundled` per environment ([#22257](vitejs/vite#22257)) ([a576326](vitejs/vite@a576326)) - **ssr:** avoid rewriting labels that collide with imports ([#22451](vitejs/vite#22451)) ([d9b18e0](vitejs/vite@d9b18e0)) ##### Miscellaneous Chores - remove irrelevant commits from changelog ([#22430](vitejs/vite#22430)) ([6ea3838](vitejs/vite@6ea3838)) - update changelog ([#22413](vitejs/vite#22413)) ([fcdc87c](vitejs/vite@fcdc87c)) ## [v8.0.12](https://github.com/vitejs/vite/blob/HEAD/packages/vite/CHANGELOG.md#small-8012-2026-05-11-small) ##### Features - update rolldown to 1.0.0 ([#22401](vitejs/vite#22401)) ([cf0ff41](vitejs/vite@cf0ff41)) ##### Bug Fixes - **create-vite:** pass react framework to TanStack CLI ([#22397](vitejs/vite#22397)) ([18f0f90](vitejs/vite@18f0f90)) - **deps:** update all non-major dependencies ([#22420](vitejs/vite#22420)) ([2be6000](vitejs/vite@2be6000)) - **module-runner:** prevent partial-exports race on concurrent imports of in-flight invalidated re-export chains ([#22369](vitejs/vite#22369)) ([f5a22e6](vitejs/vite@f5a22e6)) - refer to `rolldownOptions` instead of deprecated `rollupOptions` in messages ([#22400](vitejs/vite#22400)) ([b675c7b](vitejs/vite@b675c7b)) - **worker:** apply `build.target` to worker bundle ([#22404](vitejs/vite#22404)) ([3c93fde](vitejs/vite@3c93fde)) - **worker:** forward define to worker bundle transform ([#22408](vitejs/vite#22408)) ([d4838a0](vitejs/vite@d4838a0)) ##### Miscellaneous Chores - **deps:** update dependency eslint-plugin-n to v18 ([#22423](vitejs/vite#22423)) ([2fe7bd2](vitejs/vite@2fe7bd2)) - **deps:** update rolldown-related dependencies ([#22421](vitejs/vite#22421)) ([66b9eb3](vitejs/vite@66b9eb3))
renovate Bot
added a commit
to andrei-picus-tink/auto-renovate
that referenced
this pull request
May 23, 2026
| datasource | package | from | to | | ---------- | ------- | ------ | ------ | | npm | vite | 8.0.11 | 8.0.14 | ## [v8.0.14](https://github.com/vitejs/vite/blob/HEAD/packages/vite/CHANGELOG.md#small-8014-2026-05-21-small) ##### Features - update rolldown to 1.0.2 ([#22484](vitejs/vite#22484)) ([96efc88](vitejs/vite@96efc88)) ##### Bug Fixes - **deps:** update all non-major dependencies ([#22471](vitejs/vite#22471)) ([98b8163](vitejs/vite@98b8163)) - **dev:** handle errors when sending messages to vite server ([#22450](vitejs/vite#22450)) ([e8e9a34](vitejs/vite@e8e9a34)) - **html:** handle trailing slash paths in transformIndexHtml ([#22480](vitejs/vite#22480)) ([5d94d1b](vitejs/vite@5d94d1b)) - **optimizer:** pass oxc jsx options to transformSync in dependency scan ([#22342](vitejs/vite#22342)) ([b3132da](vitejs/vite@b3132da)) ##### Miscellaneous Chores - **deps:** update rolldown-related dependencies ([#22470](vitejs/vite#22470)) ([7cb728e](vitejs/vite@7cb728e)) - remove irrelevant commits from changelog ([2c69495](vitejs/vite@2c69495)) ##### Code Refactoring - **glob:** do not rewrite import path for absolute base ([#22310](vitejs/vite#22310)) ([0ae2844](vitejs/vite@0ae2844)) ##### Tests - **css:** sass does not use main field ([#22449](vitejs/vite#22449)) ([ebf39a0](vitejs/vite@ebf39a0)) ## [v8.0.13](https://github.com/vitejs/vite/blob/HEAD/packages/vite/CHANGELOG.md#small-8013-2026-05-14-small) ##### Features - **bundled-dev:** add lazy bundling support ([#21406](vitejs/vite#21406)) ([4f0949f](vitejs/vite@4f0949f)) - **optimizer:** improve the esbuild plugin converter to pass some properties of build result to `onEnd` ([#22357](vitejs/vite#22357)) ([47071ce](vitejs/vite@47071ce)) - update rolldown to 1.0.1 ([#22444](vitejs/vite#22444)) ([8c766a6](vitejs/vite@8c766a6)) ##### Bug Fixes - **build:** copy public directory after building same environment with `write=false` ([#22328](vitejs/vite#22328)) ([158e8ae](vitejs/vite@158e8ae)) - **css:** await sass/less/styl worker disposal on teardown (fix [#22274](vitejs/vite#22274)) ([#22275](vitejs/vite#22275)) ([b7edcb7](vitejs/vite@b7edcb7)) - **css:** keep deprecated `name`/`originalFileName` in synthetic `assetFileNames` call ([#22439](vitejs/vite#22439)) ([8e59c97](vitejs/vite@8e59c97)) - make `isBundled` per environment ([#22257](vitejs/vite#22257)) ([a576326](vitejs/vite@a576326)) - **ssr:** avoid rewriting labels that collide with imports ([#22451](vitejs/vite#22451)) ([d9b18e0](vitejs/vite@d9b18e0)) ##### Miscellaneous Chores - remove irrelevant commits from changelog ([#22430](vitejs/vite#22430)) ([6ea3838](vitejs/vite@6ea3838)) - update changelog ([#22413](vitejs/vite#22413)) ([fcdc87c](vitejs/vite@fcdc87c)) ## [v8.0.12](https://github.com/vitejs/vite/blob/HEAD/packages/vite/CHANGELOG.md#small-8012-2026-05-11-small) ##### Features - update rolldown to 1.0.0 ([#22401](vitejs/vite#22401)) ([cf0ff41](vitejs/vite@cf0ff41)) ##### Bug Fixes - **create-vite:** pass react framework to TanStack CLI ([#22397](vitejs/vite#22397)) ([18f0f90](vitejs/vite@18f0f90)) - **deps:** update all non-major dependencies ([#22420](vitejs/vite#22420)) ([2be6000](vitejs/vite@2be6000)) - **module-runner:** prevent partial-exports race on concurrent imports of in-flight invalidated re-export chains ([#22369](vitejs/vite#22369)) ([f5a22e6](vitejs/vite@f5a22e6)) - refer to `rolldownOptions` instead of deprecated `rollupOptions` in messages ([#22400](vitejs/vite#22400)) ([b675c7b](vitejs/vite@b675c7b)) - **worker:** apply `build.target` to worker bundle ([#22404](vitejs/vite#22404)) ([3c93fde](vitejs/vite@3c93fde)) - **worker:** forward define to worker bundle transform ([#22408](vitejs/vite#22408)) ([d4838a0](vitejs/vite@d4838a0)) ##### Miscellaneous Chores - **deps:** update dependency eslint-plugin-n to v18 ([#22423](vitejs/vite#22423)) ([2fe7bd2](vitejs/vite@2fe7bd2)) - **deps:** update rolldown-related dependencies ([#22421](vitejs/vite#22421)) ([66b9eb3](vitejs/vite@66b9eb3))
renovate Bot
added a commit
to andrei-picus-tink/auto-renovate
that referenced
this pull request
May 24, 2026
| datasource | package | from | to | | ---------- | ------- | ------ | ------ | | npm | vite | 8.0.11 | 8.0.14 | ## [v8.0.14](https://github.com/vitejs/vite/blob/HEAD/packages/vite/CHANGELOG.md#small-8014-2026-05-21-small) ##### Features - update rolldown to 1.0.2 ([#22484](vitejs/vite#22484)) ([96efc88](vitejs/vite@96efc88)) ##### Bug Fixes - **deps:** update all non-major dependencies ([#22471](vitejs/vite#22471)) ([98b8163](vitejs/vite@98b8163)) - **dev:** handle errors when sending messages to vite server ([#22450](vitejs/vite#22450)) ([e8e9a34](vitejs/vite@e8e9a34)) - **html:** handle trailing slash paths in transformIndexHtml ([#22480](vitejs/vite#22480)) ([5d94d1b](vitejs/vite@5d94d1b)) - **optimizer:** pass oxc jsx options to transformSync in dependency scan ([#22342](vitejs/vite#22342)) ([b3132da](vitejs/vite@b3132da)) ##### Miscellaneous Chores - **deps:** update rolldown-related dependencies ([#22470](vitejs/vite#22470)) ([7cb728e](vitejs/vite@7cb728e)) - remove irrelevant commits from changelog ([2c69495](vitejs/vite@2c69495)) ##### Code Refactoring - **glob:** do not rewrite import path for absolute base ([#22310](vitejs/vite#22310)) ([0ae2844](vitejs/vite@0ae2844)) ##### Tests - **css:** sass does not use main field ([#22449](vitejs/vite#22449)) ([ebf39a0](vitejs/vite@ebf39a0)) ## [v8.0.13](https://github.com/vitejs/vite/blob/HEAD/packages/vite/CHANGELOG.md#small-8013-2026-05-14-small) ##### Features - **bundled-dev:** add lazy bundling support ([#21406](vitejs/vite#21406)) ([4f0949f](vitejs/vite@4f0949f)) - **optimizer:** improve the esbuild plugin converter to pass some properties of build result to `onEnd` ([#22357](vitejs/vite#22357)) ([47071ce](vitejs/vite@47071ce)) - update rolldown to 1.0.1 ([#22444](vitejs/vite#22444)) ([8c766a6](vitejs/vite@8c766a6)) ##### Bug Fixes - **build:** copy public directory after building same environment with `write=false` ([#22328](vitejs/vite#22328)) ([158e8ae](vitejs/vite@158e8ae)) - **css:** await sass/less/styl worker disposal on teardown (fix [#22274](vitejs/vite#22274)) ([#22275](vitejs/vite#22275)) ([b7edcb7](vitejs/vite@b7edcb7)) - **css:** keep deprecated `name`/`originalFileName` in synthetic `assetFileNames` call ([#22439](vitejs/vite#22439)) ([8e59c97](vitejs/vite@8e59c97)) - make `isBundled` per environment ([#22257](vitejs/vite#22257)) ([a576326](vitejs/vite@a576326)) - **ssr:** avoid rewriting labels that collide with imports ([#22451](vitejs/vite#22451)) ([d9b18e0](vitejs/vite@d9b18e0)) ##### Miscellaneous Chores - remove irrelevant commits from changelog ([#22430](vitejs/vite#22430)) ([6ea3838](vitejs/vite@6ea3838)) - update changelog ([#22413](vitejs/vite#22413)) ([fcdc87c](vitejs/vite@fcdc87c)) ## [v8.0.12](https://github.com/vitejs/vite/blob/HEAD/packages/vite/CHANGELOG.md#small-8012-2026-05-11-small) ##### Features - update rolldown to 1.0.0 ([#22401](vitejs/vite#22401)) ([cf0ff41](vitejs/vite@cf0ff41)) ##### Bug Fixes - **create-vite:** pass react framework to TanStack CLI ([#22397](vitejs/vite#22397)) ([18f0f90](vitejs/vite@18f0f90)) - **deps:** update all non-major dependencies ([#22420](vitejs/vite#22420)) ([2be6000](vitejs/vite@2be6000)) - **module-runner:** prevent partial-exports race on concurrent imports of in-flight invalidated re-export chains ([#22369](vitejs/vite#22369)) ([f5a22e6](vitejs/vite@f5a22e6)) - refer to `rolldownOptions` instead of deprecated `rollupOptions` in messages ([#22400](vitejs/vite#22400)) ([b675c7b](vitejs/vite@b675c7b)) - **worker:** apply `build.target` to worker bundle ([#22404](vitejs/vite#22404)) ([3c93fde](vitejs/vite@3c93fde)) - **worker:** forward define to worker bundle transform ([#22408](vitejs/vite#22408)) ([d4838a0](vitejs/vite@d4838a0)) ##### Miscellaneous Chores - **deps:** update dependency eslint-plugin-n to v18 ([#22423](vitejs/vite#22423)) ([2fe7bd2](vitejs/vite@2fe7bd2)) - **deps:** update rolldown-related dependencies ([#22421](vitejs/vite#22421)) ([66b9eb3](vitejs/vite@66b9eb3))
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.
Summary
importPathto/${relative(root, file)}whenoptions.basestarts with/. KeepimportPathas the plain importer-relative path (relative(dir, file)) regardless of whetherbaseis absolute.importPath(the actual module specifier emitted into the generated code) is affected.filePath(the key exposed on the returnedimport.meta.globobject) is unchanged.Why
The removed branch was intended to produce Vite-style absolute-looking specifiers such as
/src/foo.jsthat Vite's resolver would then map back to a real file via itsrootsoption. In practice it has two problems:root. When a glob reaches a sibling directory outside ofroot,relative(root, file)returns something like../basic/dir/a.js— no leading/— so the`/${...}`template produces/../basic/dir/a.js, which only works if the resolver happens to normalize it.rootsoption, whichrolldown_plugin_vite_resolveonly populates whenasSrcistrue. InsidecreateIdResolver(asSrc: false),rootsis empty and a generated/../external/a.jsfails to resolve.Using an importer-relative specifier (
../basic/dir/a.js/./a.js) side-steps both: it's a plain relative path that any resolver handles identically, independent ofasSrc/roots.Behavior change
When
base: '/'is used and the glob matches files outside the importer's directory, the emittedimportPath(the RHS of the generatedimport(...)/ static import) changes from an absolute-looking form to an importer-relative form. The keys on the returnedimport.meta.globobject (filePath) are unchanged, so user-facing lookups remain the same.Related