fix(optimizer): skip null-valued exports in expandGlobIds glob resolution#22611
Conversation
The previous test used vi.mock to stub resolvePackageData, but vitest's isolate:false shares the module graph across test files. By the time expandGlobIds.spec.ts runs, packages.ts is already cached, so the mock never intercepts the real call and the function returns [] early. Replace the mock with a real temp-dir fixture: write an actual package.json under a mkdtemp directory, point the config root there, and let resolvePackageData resolve it naturally. Matches the pattern used by other tests in this directory.
fs.mkdtempSync on macOS returns a path under /var/folders/... which is a symlink to /private/var/folders/.... Vite's resolvePackageData uses realpaths internally, so the fixture root mismatched and the test failed only on node-24/macOS CI. Wrap mkdtempSync with fs.realpathSync to normalise the path.
…r, fix comment style Move the temp-dir package setup in expandGlobIds.spec.ts into a committed fixture at packages/vite/src/node/__tests__/fixtures/glob-exports, following the same on-disk layout used by the config/entry and scan-subpath-import-glob fixtures. The test now resolves the fixture root via import.meta.dirname and drops the os.tmpdir/mkdtemp/realpathSync scaffolding entirely. Also change the code comment in optimizer/resolve.ts from the parenthesis-wrapped URL form to a bare URL line as requested in review.
|
Both points addressed in the latest commit. For the comment in resolve.ts, changed it from the parenthesis-wrapped form to a plain bare URL line: For the fixture, moved the setup out of tmpdir entirely and into a committed directory at packages/vite/src/node/tests/fixtures/glob-exports following the same layout as config/entry. The package.json with the null-valued exports sits under glob-exports/node_modules/my-pkg/, and the test now just resolves fixtureRoot via import.meta.dirname and passes it as the config root. No more mkdtemp or cleanup hooks. Tests pass locally with vitest run on the spec file. |
|
Renamed it to resolve.spec.ts to match resolve.ts. The fixture path is relative to import.meta.dirname and the file stayed in the same directory, so nothing else needed to change. |
|
You have not addressed all of my comments. Also, are you using an LLM to make these changes and comments? If you're not going to do this yourself and learn the process of open source, I might as well do all the changes myself. |
|
Sorry, I missed those two. Removed the duplicate test so there is just the one case now, and changed it to == null. Both pushed. |
| datasource | package | from | to | | ---------- | ------- | ------ | ----- | | npm | vite | 8.0.14 | 8.1.0 | ## [v8.1.0](https://github.com/vitejs/vite/blob/HEAD/packages/vite/CHANGELOG.md#810-2026-06-23) ##### Features - extend `server.fs.deny` list with common files ([#22707](vitejs/vite#22707)) ([61ba8fd](vitejs/vite@61ba8fd)) - update rolldown to 1.1.2 ([#22695](vitejs/vite#22695)) ([4f008a6](vitejs/vite@4f008a6)) - use `~` for Rolldown ([#22693](vitejs/vite#22693)) ([9928722](vitejs/vite@9928722)) ##### Bug Fixes - **bundled-dev:** errors should be kept when incremental build fails ([#22617](vitejs/vite#22617)) ([9a0dd48](vitejs/vite@9a0dd48)) - cache falsy values in perEnvironmentState ([#22715](vitejs/vite#22715)) ([0e91e79](vitejs/vite@0e91e79)) - **glob:** respect caseSensitive option in hmr matcher ([#22711](vitejs/vite#22711)) ([65f525e](vitejs/vite@65f525e)) - **html:** omit nonce on import map when cspNonce is unset ([#22713](vitejs/vite#22713)) ([8340bb5](vitejs/vite@8340bb5)) - **optimizer:** skip null-valued exports in expandGlobIds glob resolution ([#22611](vitejs/vite#22611)) ([8b9f5cd](vitejs/vite@8b9f5cd)) - resolved build options should be kept as a getter ([#22691](vitejs/vite#22691)) ([3527191](vitejs/vite@3527191)) - **server:** handle malformed URI in memory files middleware ([#22714](vitejs/vite#22714)) ([df9e0a5](vitejs/vite@df9e0a5)) - use literal envPrefix queries for Vite Task ([#22706](vitejs/vite#22706)) ([da72733](vitejs/vite@da72733)) - warn on deprecated envFile ([#22555](vitejs/vite#22555)) ([ed7b283](vitejs/vite@ed7b283)) ##### Code Refactoring - **client:** inline dev-id value in CSS selector ([#22736](vitejs/vite#22736)) ([57f59bc](vitejs/vite@57f59bc)) - remove unused removeRawQuery util ([#22724](vitejs/vite#22724)) ([403cc60](vitejs/vite@403cc60)) - use `rolldownOptions` property for chunkImportMap ([#22692](vitejs/vite#22692)) ([8e8816c](vitejs/vite@8e8816c)) ## [v8.0.16](https://github.com/vitejs/vite/blob/HEAD/packages/vite/CHANGELOG.md#small-8016-2026-06-01-small) ##### Bug Fixes - **deps:** reject UNC paths for launch-editor-middleware ([#22571](vitejs/vite#22571)) ([50b9512](vitejs/vite@50b9512)) - reject windows alternate paths ([#22572](vitejs/vite#22572)) ([dc245c7](vitejs/vite@dc245c7)) ## [v8.0.15](https://github.com/vitejs/vite/blob/HEAD/packages/vite/CHANGELOG.md#small-8015-2026-06-01-small) ##### Features - send 408 on request timeout ([#22476](vitejs/vite#22476)) ([c85c9ee](vitejs/vite@c85c9ee)) - update rolldown to 1.0.3 ([#22538](vitejs/vite#22538)) ([646dbed](vitejs/vite@646dbed)) ##### Bug Fixes - capitalize error messages and remove spurious space in parse error ([#22488](vitejs/vite#22488)) ([85a0eff](vitejs/vite@85a0eff)) - **deps:** update all non-major dependencies ([#22511](vitejs/vite#22511)) ([2686d7d](vitejs/vite@2686d7d)) - **dev:** fix html-proxy cache key mismatch for /@fs/ HTML paths ([#21762](vitejs/vite#21762)) ([47c4213](vitejs/vite@47c4213)) - **glob:** error on relative glob in virtual module when no files match ([#22497](vitejs/vite#22497)) ([5c8e98f](vitejs/vite@5c8e98f)) - **optimizer:** close the rolldown bundle when write() rejects ([#22528](vitejs/vite#22528)) ([e3cfb9d](vitejs/vite@e3cfb9d)) - **resolve:** provide onWarn for viteResolvePlugin in JS plugin containers ([#22509](vitejs/vite#22509)) ([40985f1](vitejs/vite@40985f1)) ##### Miscellaneous Chores - **deps:** update rolldown-related dependencies ([#22566](vitejs/vite#22566)) ([3052a67](vitejs/vite@3052a67)) ##### Code Refactoring - correct logic in `collectAllModules` function ([#22562](vitejs/vite#22562)) ([6978a9c](vitejs/vite@6978a9c))
| datasource | package | from | to | | ---------- | ------- | ------ | ----- | | npm | vite | 8.0.14 | 8.1.0 | ## [v8.1.0](https://github.com/vitejs/vite/blob/HEAD/packages/vite/CHANGELOG.md#810-2026-06-23) ##### Features - extend `server.fs.deny` list with common files ([#22707](vitejs/vite#22707)) ([61ba8fd](vitejs/vite@61ba8fd)) - update rolldown to 1.1.2 ([#22695](vitejs/vite#22695)) ([4f008a6](vitejs/vite@4f008a6)) - use `~` for Rolldown ([#22693](vitejs/vite#22693)) ([9928722](vitejs/vite@9928722)) ##### Bug Fixes - **bundled-dev:** errors should be kept when incremental build fails ([#22617](vitejs/vite#22617)) ([9a0dd48](vitejs/vite@9a0dd48)) - cache falsy values in perEnvironmentState ([#22715](vitejs/vite#22715)) ([0e91e79](vitejs/vite@0e91e79)) - **glob:** respect caseSensitive option in hmr matcher ([#22711](vitejs/vite#22711)) ([65f525e](vitejs/vite@65f525e)) - **html:** omit nonce on import map when cspNonce is unset ([#22713](vitejs/vite#22713)) ([8340bb5](vitejs/vite@8340bb5)) - **optimizer:** skip null-valued exports in expandGlobIds glob resolution ([#22611](vitejs/vite#22611)) ([8b9f5cd](vitejs/vite@8b9f5cd)) - resolved build options should be kept as a getter ([#22691](vitejs/vite#22691)) ([3527191](vitejs/vite@3527191)) - **server:** handle malformed URI in memory files middleware ([#22714](vitejs/vite#22714)) ([df9e0a5](vitejs/vite@df9e0a5)) - use literal envPrefix queries for Vite Task ([#22706](vitejs/vite#22706)) ([da72733](vitejs/vite@da72733)) - warn on deprecated envFile ([#22555](vitejs/vite#22555)) ([ed7b283](vitejs/vite@ed7b283)) ##### Code Refactoring - **client:** inline dev-id value in CSS selector ([#22736](vitejs/vite#22736)) ([57f59bc](vitejs/vite@57f59bc)) - remove unused removeRawQuery util ([#22724](vitejs/vite#22724)) ([403cc60](vitejs/vite@403cc60)) - use `rolldownOptions` property for chunkImportMap ([#22692](vitejs/vite#22692)) ([8e8816c](vitejs/vite@8e8816c)) ## [v8.0.16](https://github.com/vitejs/vite/blob/HEAD/packages/vite/CHANGELOG.md#small-8016-2026-06-01-small) ##### Bug Fixes - **deps:** reject UNC paths for launch-editor-middleware ([#22571](vitejs/vite#22571)) ([50b9512](vitejs/vite@50b9512)) - reject windows alternate paths ([#22572](vitejs/vite#22572)) ([dc245c7](vitejs/vite@dc245c7)) ## [v8.0.15](https://github.com/vitejs/vite/blob/HEAD/packages/vite/CHANGELOG.md#small-8015-2026-06-01-small) ##### Features - send 408 on request timeout ([#22476](vitejs/vite#22476)) ([c85c9ee](vitejs/vite@c85c9ee)) - update rolldown to 1.0.3 ([#22538](vitejs/vite#22538)) ([646dbed](vitejs/vite@646dbed)) ##### Bug Fixes - capitalize error messages and remove spurious space in parse error ([#22488](vitejs/vite#22488)) ([85a0eff](vitejs/vite@85a0eff)) - **deps:** update all non-major dependencies ([#22511](vitejs/vite#22511)) ([2686d7d](vitejs/vite@2686d7d)) - **dev:** fix html-proxy cache key mismatch for /@fs/ HTML paths ([#21762](vitejs/vite#21762)) ([47c4213](vitejs/vite@47c4213)) - **glob:** error on relative glob in virtual module when no files match ([#22497](vitejs/vite#22497)) ([5c8e98f](vitejs/vite@5c8e98f)) - **optimizer:** close the rolldown bundle when write() rejects ([#22528](vitejs/vite#22528)) ([e3cfb9d](vitejs/vite@e3cfb9d)) - **resolve:** provide onWarn for viteResolvePlugin in JS plugin containers ([#22509](vitejs/vite#22509)) ([40985f1](vitejs/vite@40985f1)) ##### Miscellaneous Chores - **deps:** update rolldown-related dependencies ([#22566](vitejs/vite#22566)) ([3052a67](vitejs/vite@3052a67)) ##### Code Refactoring - correct logic in `collectAllModules` function ([#22562](vitejs/vite#22562)) ([6978a9c](vitejs/vite@6978a9c))
##### [v8.1.5](https://github.com/vitejs/vite/releases/tag/v8.1.5) Please refer to [CHANGELOG.md](https://github.com/vitejs/vite/blob/v8.1.5/packages/vite/CHANGELOG.md) for details. ##### [v8.1.4](https://github.com/vitejs/vite/blob/HEAD/packages/vite/CHANGELOG.md#small-814-2026-07-09-small) ##### Features - **legacy:** prefer oxc as minifier (fix [#21973](vitejs/vite#21973)) ([#22468](vitejs/vite#22468)) ([ab5dafa](vitejs/vite@ab5dafa)) ##### Bug Fixes - **build:** add workaround for building on stackblitz ([#22840](vitejs/vite#22840)) ([575c32c](vitejs/vite@575c32c)) - **build:** keep `import.meta.url` in preload function as-is ([#22839](vitejs/vite#22839)) ([f1f90ed](vitejs/vite@f1f90ed)) - **deps:** update all non-major dependencies ([#22865](vitejs/vite#22865)) ([d4295a9](vitejs/vite@d4295a9)) - **deps:** update rolldown-related dependencies ([#22866](vitejs/vite#22866)) ([7cf07e4](vitejs/vite@7cf07e4)) - **html:** avoid backtracking in import-only check ([#22848](vitejs/vite#22848)) ([b5868c0](vitejs/vite@b5868c0)) - **optimizer:** avoid optimizer run for transform request before init ([#22852](vitejs/vite#22852)) ([72a5e21](vitejs/vite@72a5e21)) - **ssr:** align named export function call stacktrace column with Node ([#22829](vitejs/vite#22829)) ([173a1b6](vitejs/vite@173a1b6)) - strip pure CSS chunk imports when chunkImportMap is enabled ([#22841](vitejs/vite#22841)) ([648bd04](vitejs/vite@648bd04)) ##### Documentation - fix incorrect `@default` for `server.cors` ([#22859](vitejs/vite#22859)) ([70435b2](vitejs/vite@70435b2)) ##### Miscellaneous Chores - **deps:** update dependency postcss-modules to v9 ([#22867](vitejs/vite#22867)) ([a9539d6](vitejs/vite@a9539d6)) ##### Code Refactoring - eliminate ineffectiveDynamicImport warn ([#22876](vitejs/vite#22876)) ([ea22fb3](vitejs/vite@ea22fb3)) ##### Tests - avoid warnings ([#22851](vitejs/vite#22851)) ([af21ab6](vitejs/vite@af21ab6)) ##### Build System - remove the custom onLog function ([#22878](vitejs/vite#22878)) ([2c4a217](vitejs/vite@2c4a217)) - replace deprecated `onwarn` with `onLog` ([#22741](vitejs/vite#22741)) ([c581b55](vitejs/vite@c581b55)) ##### [v8.1.3](https://github.com/vitejs/vite/blob/HEAD/packages/vite/CHANGELOG.md#small-813-2026-07-02-small) ##### Bug Fixes - **css:** inject inlined CSS after the shebang line ([#22717](vitejs/vite#22717)) ([1534d36](vitejs/vite@1534d36)) - **deps:** bump `es-module-lexer` to 2.3.0 ([#22838](vitejs/vite#22838)) ([7103c3a](vitejs/vite@7103c3a)) - preload css for nested dynamic imports ([#22759](vitejs/vite#22759)) ([2c53054](vitejs/vite@2c53054)) - **ssr:** correct stacktrace column position for first line ([#22828](vitejs/vite#22828)) ([c4acd69](vitejs/vite@c4acd69)) ##### [v8.1.2](https://github.com/vitejs/vite/blob/HEAD/packages/vite/CHANGELOG.md#small-812-2026-06-30-small) ##### Bug Fixes - **deps:** revert es-module-lexer to 2.1.0 ([#22827](vitejs/vite#22827)) ([0d3bd7c](vitejs/vite@0d3bd7c)) - restore, "fix: resolve pnpm .modules.yaml from workspace root instead of cwd ([#22757](vitejs/vite#22757))" ([#22825](vitejs/vite#22825)) ([efb98cc](vitejs/vite@efb98cc)) - revert, "fix: escape ids with multiple null bytes ([#22687](vitejs/vite#22687))" ([cccef55](vitejs/vite@cccef55)) - revert, "fix: resolve pnpm .modules.yaml from workspace root instead of cwd ([#22757](vitejs/vite#22757))" ([cf97711](vitejs/vite@cf97711)) ##### [v8.1.1](https://github.com/vitejs/vite/blob/HEAD/packages/vite/CHANGELOG.md#small-811-2026-06-30-small) ##### Features - update dynamic import warning to link to Vite docs ([#22823](vitejs/vite#22823)) ([62bd7af](vitejs/vite@62bd7af)) ##### Bug Fixes - **bundled-dev:** avoid stack overflow on `import.meta.hot.invalidate()` ([#22797](vitejs/vite#22797)) ([709eb8e](vitejs/vite@709eb8e)) - **bundled-dev:** serve assets emitted during HMR/lazy compile ([#22745](vitejs/vite#22745)) ([5876b2c](vitejs/vite@5876b2c)) - **bundledDev:** skip plugin transform hooks for rolldown-lazy stub modules ([#22778](vitejs/vite#22778)) ([8f925e2](vitejs/vite@8f925e2)) - **css:** preserve dollar signs in external `@import` urls with lightningcss ([#22718](vitejs/vite#22718)) ([9fa7ab4](vitejs/vite@9fa7ab4)) - **css:** resolve tsconfig paths in CSS and Sass [@import](https://github.com/import) ([#22775](vitejs/vite#22775)) ([ef0b891](vitejs/vite@ef0b891)) - **deps:** update all non-major dependencies ([#22734](vitejs/vite#22734)) ([e635f49](vitejs/vite@e635f49)) - **deps:** update all non-major dependencies ([#22804](vitejs/vite#22804)) ([8837400](vitejs/vite@8837400)) - **deps:** update rolldown-related dependencies ([#22591](vitejs/vite#22591)) ([2ce6677](vitejs/vite@2ce6677)) - escape ids with multiple null bytes ([#22687](vitejs/vite#22687)) ([833fc30](vitejs/vite@833fc30)) - hide console window when running 'net use' on Windows ([#22698](vitejs/vite#22698)) ([92b63f2](vitejs/vite@92b63f2)) - ignore bundled config temp dir ([#22800](vitejs/vite#22800)) ([043a810](vitejs/vite@043a810)) - invert `esbuild.jsxSideEffects` when converting to `oxc.jsx.pure` ([#22809](vitejs/vite#22809)) ([33895ba](vitejs/vite@33895ba)) - **optimize-deps:** ignore `ERR_CLOSED_SERVER` in scanner ([#22784](vitejs/vite#22784)) ([085a0ab](vitejs/vite@085a0ab)) - **optimizer:** scanner should resolve `input` from `root` ([#22769](vitejs/vite#22769)) ([9722b07](vitejs/vite@9722b07)) - resolve pnpm .modules.yaml from workspace root instead of cwd ([#22757](vitejs/vite#22757)) ([2531ac7](vitejs/vite@2531ac7)) - return sourcemap field from some plugins that were lacking ([#22782](vitejs/vite#22782)) ([7e18bf8](vitejs/vite@7e18bf8)) - **server:** handle malformed URI in indexHtmlMiddleware ([#22781](vitejs/vite#22781)) ([84f5ccc](vitejs/vite@84f5ccc)) ##### Miscellaneous Chores - improve dependency optimizer messages ([#22549](vitejs/vite#22549)) ([092cb3b](vitejs/vite@092cb3b)) ##### Code Refactoring - **css:** remove lightningcss null byte bug workaround ([#22822](vitejs/vite#22822)) ([2dafd3b](vitejs/vite@2dafd3b)) - use pre-defined environments variable to avoid duplicate `Object.values` calls ([#22790](vitejs/vite#22790)) ([1113acf](vitejs/vite@1113acf)) ##### Tests - enable "manual chunk path" test and remove "worker.format error" test ([#22824](vitejs/vite#22824)) ([c088511](vitejs/vite@c088511)) ##### [v8.1.0](https://github.com/vitejs/vite/blob/HEAD/packages/vite/CHANGELOG.md#810-2026-06-23) ##### Features - extend `server.fs.deny` list with common files ([#22707](vitejs/vite#22707)) ([61ba8fd](vitejs/vite@61ba8fd)) - update rolldown to 1.1.2 ([#22695](vitejs/vite#22695)) ([4f008a6](vitejs/vite@4f008a6)) - use `~` for Rolldown ([#22693](vitejs/vite#22693)) ([9928722](vitejs/vite@9928722)) ##### Bug Fixes - **bundled-dev:** errors should be kept when incremental build fails ([#22617](vitejs/vite#22617)) ([9a0dd48](vitejs/vite@9a0dd48)) - cache falsy values in perEnvironmentState ([#22715](vitejs/vite#22715)) ([0e91e79](vitejs/vite@0e91e79)) - **glob:** respect caseSensitive option in hmr matcher ([#22711](vitejs/vite#22711)) ([65f525e](vitejs/vite@65f525e)) - **html:** omit nonce on import map when cspNonce is unset ([#22713](vitejs/vite#22713)) ([8340bb5](vitejs/vite@8340bb5)) - **optimizer:** skip null-valued exports in expandGlobIds glob resolution ([#22611](vitejs/vite#22611)) ([8b9f5cd](vitejs/vite@8b9f5cd)) - resolved build options should be kept as a getter ([#22691](vitejs/vite#22691)) ([3527191](vitejs/vite@3527191)) - **server:** handle malformed URI in memory files middleware ([#22714](vitejs/vite#22714)) ([df9e0a5](vitejs/vite@df9e0a5)) - use literal envPrefix queries for Vite Task ([#22706](vitejs/vite#22706)) ([da72733](vitejs/vite@da72733)) - warn on deprecated envFile ([#22555](vitejs/vite#22555)) ([ed7b283](vitejs/vite@ed7b283)) ##### Code Refactoring - **client:** inline dev-id value in CSS selector ([#22736](vitejs/vite#22736)) ([57f59bc](vitejs/vite@57f59bc)) - remove unused removeRawQuery util ([#22724](vitejs/vite#22724)) ([403cc60](vitejs/vite@403cc60)) - use `rolldownOptions` property for chunkImportMap ([#22692](vitejs/vite#22692)) ([8e8816c](vitejs/vite@8e8816c)) ##### [v8.0.16](https://github.com/vitejs/vite/blob/HEAD/packages/vite/CHANGELOG.md#small-8016-2026-06-01-small) ##### Bug Fixes - **deps:** reject UNC paths for launch-editor-middleware ([#22571](vitejs/vite#22571)) ([50b9512](vitejs/vite@50b9512)) - reject windows alternate paths ([#22572](vitejs/vite#22572)) ([dc245c7](vitejs/vite@dc245c7)) ##### [v8.0.15](https://github.com/vitejs/vite/blob/HEAD/packages/vite/CHANGELOG.md#small-8015-2026-06-01-small) ##### Features - send 408 on request timeout ([#22476](vitejs/vite#22476)) ([c85c9ee](vitejs/vite@c85c9ee)) - update rolldown to 1.0.3 ([#22538](vitejs/vite#22538)) ([646dbed](vitejs/vite@646dbed)) ##### Bug Fixes - capitalize error messages and remove spurious space in parse error ([#22488](vitejs/vite#22488)) ([85a0eff](vitejs/vite@85a0eff)) - **deps:** update all non-major dependencies ([#22511](vitejs/vite#22511)) ([2686d7d](vitejs/vite@2686d7d)) - **dev:** fix html-proxy cache key mismatch for /@fs/ HTML paths ([#21762](vitejs/vite#21762)) ([47c4213](vitejs/vite@47c4213)) - **glob:** error on relative glob in virtual module when no files match ([#22497](vitejs/vite#22497)) ([5c8e98f](vitejs/vite@5c8e98f)) - **optimizer:** close the rolldown bundle when write() rejects ([#22528](vitejs/vite#22528)) ([e3cfb9d](vitejs/vite@e3cfb9d)) - **resolve:** provide onWarn for viteResolvePlugin in JS plugin containers ([#22509](vitejs/vite#22509)) ([40985f1](vitejs/vite@40985f1)) ##### Miscellaneous Chores - **deps:** update rolldown-related dependencies ([#22566](vitejs/vite#22566)) ([3052a67](vitejs/vite@3052a67)) ##### Code Refactoring - correct logic in `collectAllModules` function ([#22562](vitejs/vite#22562)) ([6978a9c](vitejs/vite@6978a9c)) ##### [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)) ##### [v8.0.11](https://github.com/vitejs/vite/blob/HEAD/packages/vite/CHANGELOG.md#small-8011-2026-05-07-small) ##### Features - update rolldown to 1.0.0-rc.18 ([#22360](vitejs/vite#22360)) ([3f80524](vitejs/vite@3f80524)) ##### Bug Fixes - **deps:** update all non-major dependencies ([#22334](vitejs/vite#22334)) ([672c962](vitejs/vite@672c962)) - **deps:** update all non-major dependencies ([#22382](vitejs/vite#22382)) ([5c0cfcb](vitejs/vite@5c0cfcb)) - **glob:** align hmr matcher options with glob enumeration ([#22306](vitejs/vite#22306)) ([30028f9](vitejs/vite@30028f9)) - make separate object instance for each environment ([#22276](vitejs/vite#22276)) ([7c2aa3b](vitejs/vite@7c2aa3b)) ##### Documentation - **create-vite:** list react-compiler templates in README ([#22347](vitejs/vite#22347)) ([7c3a61f](vitejs/vite@7c3a61f)) - explain mergeConfig skips null/undefined ([#22325](vitejs/vite#22325)) ([2151f70](vitejs/vite@2151f70)) - mention native config loader in CLI options ([#22348](vitejs/vite#22348)) ([0420c5d](vitejs/vite@0420c5d)) - update evan's x handle ([640202a](vitejs/vite@640202a)) ##### Miscellaneous Chores - **deps:** update dependency tsdown to ^0.21.10 ([#22333](vitejs/vite#22333)) ([3b51e05](vitejs/vite@3b51e05)) - **deps:** update rolldown-related dependencies ([#22383](vitejs/vite#22383)) ([555ff36](vitejs/vite@555ff36)) - **deps:** update transitive packages to fix npm audit alerts ([#22316](vitejs/vite#22316)) ([86aee62](vitejs/vite@86aee62)) ##### Code Refactoring - devtools integration ([#22312](vitejs/vite#22312)) ([3c8bf06](vitejs/vite@3c8bf06)) - remove unnecessary async ([#22296](vitejs/vite#22296)) ([b31fd35](vitejs/vite@b31fd35)) - show direct path type in bad character warning ([#22339](vitejs/vite#22339)) ([0c162e9](vitejs/vite@0c162e9)) ##### Tests - **create-vite:** use short help alias ([#22389](vitejs/vite#22389)) ([994ab66](vitejs/vite@994ab66)) ##### [v8.0.10](https://github.com/vitejs/vite/blob/HEAD/packages/vite/CHANGELOG.md#small-8010-2026-04-23-small) ##### Features - update rolldown to 1.0.0-rc.17 ([#22299](vitejs/vite#22299)) ([a4d06d9](vitejs/vite@a4d06d9)) ##### Bug Fixes - `hmrClient.logger.debug` and `hmrClient.logger.error` looked different from other HMR logs ([#22147](vitejs/vite#22147)) ([a4d828f](vitejs/vite@a4d828f)) - **css:** show filename in CSS minification warnings for `.css?inline` ([#22292](vitejs/vite#22292)) ([83f0a78](vitejs/vite@83f0a78)) - **optimizer:** allow user transform.target to override default in optimizeDeps ([#22273](vitejs/vite#22273)) ([5c7cec6](vitejs/vite@5c7cec6)) - remove format sniffing module resolution from JS resolver ([#22297](vitejs/vite#22297)) ([b8a21cc](vitejs/vite@b8a21cc)) ##### Code Refactoring - enable some typecheck rules ([#22278](vitejs/vite#22278)) ([9437518](vitejs/vite@9437518)) - typecheck client directory ([#22284](vitejs/vite#22284)) ([40a0847](vitejs/vite@40a0847)) ##### [v8.0.9](https://github.com/vitejs/vite/blob/HEAD/packages/vite/CHANGELOG.md#small-809-2026-04-20-small) ##### Features - update rolldown to 1.0.0-rc.16 ([#22248](vitejs/vite#22248)) ([2947edd](vitejs/vite@2947edd)) ##### Bug Fixes - allow binding when strictPort is set but wildcard port is in use ([#22150](vitejs/vite#22150)) ([dfc8aa5](vitejs/vite@dfc8aa5)) - **build:** emptyOutDir should happen for watch rebuilds ([#22207](vitejs/vite#22207)) ([ee52267](vitejs/vite@ee52267)) - **bundled-dev:** reject requests to HMR patch files in non potentially trustworthy origins ([#22269](vitejs/vite#22269)) ([868f141](vitejs/vite@868f141)) - **css:** use unique key for cssEntriesMap to prevent same-basename collision ([#22039](vitejs/vite#22039)) ([374bb5d](vitejs/vite@374bb5d)) - **deps:** update all non-major dependencies ([#22219](vitejs/vite#22219)) ([4cd0d67](vitejs/vite@4cd0d67)) - **deps:** update all non-major dependencies ([#22268](vitejs/vite#22268)) ([c28e9c1](vitejs/vite@c28e9c1)) - detect Deno workspace root (fix [#22237](vitejs/vite#22237)) ([#22238](vitejs/vite#22238)) ([1b793c0](vitejs/vite@1b793c0)) - **dev:** handle errors in `watchChange` hook ([#22188](vitejs/vite#22188)) ([fc08bda](vitejs/vite@fc08bda)) - **optimizer:** handle more chars that will be sanitized ([#22208](vitejs/vite#22208)) ([3f24533](vitejs/vite@3f24533)) - skip fallback sourcemap generation for `?raw` imports ([#22148](vitejs/vite#22148)) ([3ec9cda](vitejs/vite@3ec9cda)) ##### Documentation - align the descriptions in READMEs ([#22231](vitejs/vite#22231)) ([44c42b9](vitejs/vite@44c42b9)) - fix reuses wording in dev environment comment ([#22173](vitejs/vite#22173)) ([9163412](vitejs/vite@9163412)) - fix wording in sass error comment ([#22214](vitejs/vite#22214)) ([bc5c6a7](vitejs/vite@bc5c6a7)) - update build CLI defaults ([#22261](vitejs/vite#22261)) ([605bb97](vitejs/vite@605bb97)) ##### Miscellaneous Chores - **deps:** update dependency dotenv-expand to v13 ([#22271](vitejs/vite#22271)) ([0a3887d](vitejs/vite@0a3887d)) ##### [v8.0.8](https://github.com/vitejs/vite/blob/HEAD/packages/vite/CHANGELOG.md#small-808-2026-04-09-small) ##### Features - update rolldown to 1.0.0-rc.15 ([#22201](vitejs/vite#22201)) ([6baf587](vitejs/vite@6baf587)) ##### Bug Fixes - avoid `dns.getDefaultResultOrder` temporary ([#22202](vitejs/vite#22202)) ([15f1c15](vitejs/vite@15f1c15)) - **ssr:** class property keys hoisting matching imports ([#22199](vitejs/vite#22199)) ([e137601](vitejs/vite@e137601)) ##### [v8.0.7](https://github.com/vitejs/vite/blob/HEAD/packages/vite/CHANGELOG.md#small-807-2026-04-07-small) ##### Bug Fixes - use sync dns.getDefaultResultOrder instead of dns.promises ([#22185](vitejs/vite#22185)) ([5c05b04](vitejs/vite@5c05b04)) ##### [v8.0.6](https://github.com/vitejs/vite/blob/HEAD/packages/vite/CHANGELOG.md#small-806-2026-04-07-small) ##### Features - update rolldown to 1.0.0-rc.13 ([#22097](vitejs/vite#22097)) ([51d3e48](vitejs/vite@51d3e48)) ##### Bug Fixes - **css:** avoid mutating sass error multiple times ([#22115](vitejs/vite#22115)) ([d5081c2](vitejs/vite@d5081c2)) - **optimize-deps:** hoist CJS interop assignment ([#22156](vitejs/vite#22156)) ([17a8f9e](vitejs/vite@17a8f9e)) ##### Performance Improvements - early return in `getLocalhostAddressIfDiffersFromDNS` when DNS order is `verbatim` ([#22151](vitejs/vite#22151)) ([56ec256](vitejs/vite@56ec256)) ##### Miscellaneous Chores - **create-vite:** remove unnecessary DOM.Iterable ([#22168](vitejs/vite#22168)) ([bdc53ab](vitejs/vite@bdc53ab)) - replace remaining prettier script ([#22179](vitejs/vite#22179)) ([af71fb2](vitejs/vite@af71fb2)) ##### [v8.0.5](https://github.com/vitejs/vite/blob/HEAD/packages/vite/CHANGELOG.md#small-805-2026-04-06-small) ##### Bug Fixes - apply server.fs check to env transport ([#22159](vitejs/vite#22159)) ([f02d9fd](vitejs/vite@f02d9fd)) - avoid path traversal with optimize deps sourcemap handler ([#22161](vitejs/vite#22161)) ([79f002f](vitejs/vite@79f002f)) - check `server.fs` after stripping query as well ([#22160](vitejs/vite#22160)) ([a9a3df2](vitejs/vite@a9a3df2)) - disallow referencing files outside the package from sourcemap ([#22158](vitejs/vite#22158)) ([f05f501](vitejs/vite@f05f501)) ##### [v8.0.4](https://github.com/vitejs/vite/blob/HEAD/packages/vite/CHANGELOG.md#small-804-2026-04-06-small) ##### Features - allow esbuild 0.28 as peer deps ([#22155](vitejs/vite#22155)) ([b0da973](vitejs/vite@b0da973)) - **hmr:** truncate list of files on hmr update ([#21535](vitejs/vite#21535)) ([d00e806](vitejs/vite@d00e806)) - **optimizer:** log when dependency scanning or bundling takes over 1s ([#21797](vitejs/vite#21797)) ([f61a1ab](vitejs/vite@f61a1ab)) ##### Bug Fixes - `hasBothRollupOptionsAndRolldownOptions` should return `false` for proxy case ([#22043](vitejs/vite#22043)) ([99897d2](vitejs/vite@99897d2)) - add types for `vite/modulepreload-polyfill` ([#22126](vitejs/vite#22126)) ([17330d2](vitejs/vite@17330d2)) - **deps:** update all non-major dependencies ([#22073](vitejs/vite#22073)) ([6daa10f](vitejs/vite@6daa10f)) - **deps:** update all non-major dependencies ([#22143](vitejs/vite#22143)) ([22b0166](vitejs/vite@22b0166)) - **resolve:** resolve tsconfig paths starting with `#` ([#22038](vitejs/vite#22038)) ([3460fc5](vitejs/vite@3460fc5)) - **ssr:** use browser platform for webworker SSR builds (fix [#21969](vitejs/vite#21969)) ([#21963](vitejs/vite#21963)) ([364c227](vitejs/vite@364c227)) ##### Documentation - add `environment.fetchModule` documentation ([#22035](vitejs/vite#22035)) ([54229e7](vitejs/vite@54229e7)) ##### Miscellaneous Chores - **deps:** update rolldown-related dependencies ([#21989](vitejs/vite#21989)) ([0ded627](vitejs/vite@0ded627)) ##### Code Refactoring - upgrade to typescript 6 ([#22110](vitejs/vite#22110)) ([cc41398](vitejs/vite@cc41398)) ##### [v8.0.3](https://github.com/vitejs/vite/blob/HEAD/packages/vite/CHANGELOG.md#small-803-2026-03-26-small) ##### Features - update rolldown to 1.0.0-rc.12 ([#22024](vitejs/vite#22024)) ([84164ef](vitejs/vite@84164ef)) ##### Bug Fixes - **html:** cache unfiltered CSS list to prevent missing styles across entries ([#22017](vitejs/vite#22017)) ([5464190](vitejs/vite@5464190)) - **module-runner:** handle non-ascii characters in base64 sourcemaps ([#21985](vitejs/vite#21985)) ([77c95bf](vitejs/vite@77c95bf)) - **module-runner:** skip re-import if the runner is closed ([#22020](vitejs/vite#22020)) ([ee2c2cd](vitejs/vite@ee2c2cd)) - **optimizer:** scan is not resolving sub path import if used in a glob import ([#22018](vitejs/vite#22018)) ([ddfe20d](vitejs/vite@ddfe20d)) - **ssr:** ssrTransform incorrectly rewrites `meta` identifier inside `import.meta` when a binding named `meta` exists ([#22019](vitejs/vite#22019)) ([cff5f0c](vitejs/vite@cff5f0c)) ##### Miscellaneous Chores - **deps:** bump picomatch from 4.0.3 to 4.0.4 ([#22027](vitejs/vite#22027)) ([7e56003](vitejs/vite@7e56003)) ##### Tests - **html:** add tests for `getCssFilesForChunk` ([#22016](vitejs/vite#22016)) ([43fbbf9](vitejs/vite@43fbbf9)) ##### [v8.0.2](https://github.com/vitejs/vite/blob/HEAD/packages/vite/CHANGELOG.md#small-802-2026-03-23-small) ##### Features - update rolldown to 1.0.0-rc.11 ([#21998](vitejs/vite#21998)) ([ff91c31](vitejs/vite@ff91c31)) ##### Bug Fixes - **deps:** update all non-major dependencies ([#21988](vitejs/vite#21988)) ([9b7d150](vitejs/vite@9b7d150)) ##### Miscellaneous Chores - **deps:** update dependency [@vitejs/devtools](https://github.com/vitejs/devtools) to ^0.1.5 ([#21992](vitejs/vite#21992)) ([b2dd65b](vitejs/vite@b2dd65b)) ##### [v8.0.1](https://github.com/vitejs/vite/blob/HEAD/packages/vite/CHANGELOG.md#small-801-2026-03-19-small) ##### Features - update rolldown to 1.0.0-rc.10 ([#21932](vitejs/vite#21932)) ([b3c067d](vitejs/vite@b3c067d)) ##### Bug Fixes - **bundled-dev:** properly disable `inlineConst` optimization ([#21865](vitejs/vite#21865)) ([6d97142](vitejs/vite@6d97142)) - **css:** lightningcss minify failed when `build.target: 'es6'` ([#21933](vitejs/vite#21933)) ([5fcce46](vitejs/vite@5fcce46)) - **deps:** update all non-major dependencies ([#21878](vitejs/vite#21878)) ([6dbbd7f](vitejs/vite@6dbbd7f)) - **dev:** always use ESM Oxc runtime ([#21829](vitejs/vite#21829)) ([d323ed7](vitejs/vite@d323ed7)) - **dev:** handle concurrent restarts in `_createServer` ([#21810](vitejs/vite#21810)) ([40bc729](vitejs/vite@40bc729)) - handle `+` symbol in package subpath exports during dep optimization ([#21886](vitejs/vite#21886)) ([86db93d](vitejs/vite@86db93d)) - improve `no-cors` request block error ([#21902](vitejs/vite#21902)) ([5ba688b](vitejs/vite@5ba688b)) - use precise regexes for transform filter to avoid backtracking ([#21800](vitejs/vite#21800)) ([dbe41bd](vitejs/vite@dbe41bd)) - **worker:** `require(json)` result should not be wrapped ([#21847](vitejs/vite#21847)) ([0672fd2](vitejs/vite@0672fd2)) - **worker:** make worker output consistent with client and SSR ([#21871](vitejs/vite#21871)) ([69454d7](vitejs/vite@69454d7)) ##### Miscellaneous Chores - add changelog rearrange script ([#21835](vitejs/vite#21835)) ([efef073](vitejs/vite@efef073)) - **deps:** bump required `@vitejs/devtools` version to 0.1+ ([#21925](vitejs/vite#21925)) ([12932f5](vitejs/vite@12932f5)) - **deps:** update rolldown-related dependencies ([#21787](vitejs/vite#21787)) ([1af1d3a](vitejs/vite@1af1d3a)) - rearrange 8.0 changelog ([8e05b61](vitejs/vite@8e05b61)) - rearrange 8.0 changelog ([#21834](vitejs/vite#21834)) ([86edeee](vitejs/vite@86edeee)) ##### [v8.0.0](https://github.com/vitejs/vite/blob/HEAD/packages/vite/CHANGELOG.md#800-2026-03-12) ##### Features - update rolldown to 1.0.0-rc.9 ([#21813](vitejs/vite#21813)) ([f05be0e](vitejs/vite@f05be0e)) - warn when `vite-tsconfig-paths` plugin is detected ([#21781](vitejs/vite#21781)) ([ada493e](vitejs/vite@ada493e)) ##### Bug Fixes - **deps:** update all non-major dependencies ([#21786](vitejs/vite#21786)) ([eaa4352](vitejs/vite@eaa4352))
Fixes #22586.
When using glob patterns in
optimizeDeps.include(e.g.my-pkg/*), Vite expands the pattern against the package'sexportsfield. The non-glob path of that expansion unconditionally added every export key to the candidate list, including keys with anullvalue.Per the Node.js docs, a
nullexport value is how packages mark subpaths as intentionally private and unreachable:For example, a package with this in its
package.json:{ "exports": { ".": "./dist/index.js", "./utils": "./dist/utils.js", "./internal": null } }When a user adds
"my-pkg/*"tooptimizeDeps.include, the old code would includemy-pkg/internalin the resolved list. Vite then tries to bundle that path, fails to find a file for it, and throws a build error.The glob branch already handled this correctly by calling
getFirstExportStringValuewhich returnsundefinedfornull, triggering an earlycontinue. The non-glob branch just needed the same null check.The fix is a single guard in
expandGlobIdsinsidepackages/vite/src/node/optimizer/resolve.ts:A unit test is added that confirms null-valued export keys are excluded from the resolved list while non-null ones are still included.