Skip to content

fix(optimizer): map relative new URL paths to correct relative file location#21434

Merged
sapphi-red merged 33 commits intovitejs:mainfrom
guyco3:fix-optimize-deps-worker-assets
Jan 26, 2026
Merged

fix(optimizer): map relative new URL paths to correct relative file location#21434
sapphi-red merged 33 commits intovitejs:mainfrom
guyco3:fix-optimize-deps-worker-assets

Conversation

@guyco3
Copy link
Copy Markdown
Contributor

@guyco3 guyco3 commented Jan 17, 2026

fixes. #21422
fixes #8427
fixes #11672
fixes vitejs#362

What is this PR solving?

This PR fixes an issue where Web Workers defined in dependencies using new URL('./worker.js', import.meta.url) fail to load after dependency optimization (Rolldown).

The Problem

In the new dependency optimizer (Rolldown), libraries are bundled into .vite/deps. When a library contains a relative worker constructor, that relative path becomes invalid because the actual worker file remains in the original node_modules directory. Rolldown's internal asset scanner attempts to resolve these paths relative to the new bundle location, leading to "File does not exist" errors and broken worker loading.

The Solution

I added a transform hook to the vite:dep-pre-bundle plugin within rolldownDepPlugin.ts:

  • Correct Relative Path: It detects new URL patterns within optimized dependencies and rebases them to the correct relative paths pointing to the original source file.
  • Rolldown Bypass: It utilizes both /* @vite-ignore */ and string concatenation ('' + import.meta.url) to make the expression dynamic. This effectively "blinds" Rolldown's static analysis scanner, preventing it from incorrectly attempting to bundle the absolute path as a relative asset.
  • Automatic Permissions: It automatically adds the library's asset directory to server.fs.allow, ensuring the dev server permits the browser to fetch the worker via the absolute path.

Unit Test & Housekeeping Updates

  • Snapshot Updates: Updated snapshots in packages/vite/src/node/__tests__/plugins/import.spec.ts to reflect minor formatting changes (tabs to spaces) triggered by the project's Prettier configuration. No logic changes were made to these core tests.
  • Lockfile: Updated pnpm-lock.yaml to the latest format to resolve workspace integrity issues encountered when adding the new playground test package.

How has this been tested?

I added a new test case in the optimize-deps playground:

  1. New Test Package: Created @vitejs/test-dep-with-worker-repro which exports workers from the root and a nested directory.
  2. E2E Test: Added assertions in playground/optimize-deps/__tests__/optimize-deps.spec.ts to verify that worker messages are correctly received in the browser logs during dev mode.

Summary of Changes

File Purpose
rolldownDepPlugin.ts Core Fix: Detects new URL and rebases to absolute paths.
import.spec.ts Maintenance: Updates snapshots to match current project formatting.
pnpm-lock.yaml Integrity: Updates workspace dependencies for the new test.
playground/optimize-deps/... Verification: New E2E test case for the worker fix.

Before vs After Tests

Failed Test Log (Before Fix)
base) guycohen@Guys-MacBook-Air vite % pnpm vitest --config vitest.config.e2e.ts playground/optimize-deps -t "worker"

 DEV  v4.0.17 /Users/guycohen/dev/vite

--------------------------------------------------x

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Failed Tests 1 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯

 FAIL  playground/optimize-deps/__tests__/optimize-deps.spec.ts > should fix standard web worker URLs in optimized dependencies
AssertionError: expected '[vite] connecting...\n%cDownload the …' to match /Message from lib: worker-success/

- Expected: 
/Message from lib: worker-success/

+ Received: 
"[vite] connecting...
%cDownload the React DevTools for a better development experience: https://react.dev/link/react-devtools font-weight:bold
ok
ok
Module \"fs\" has been externalized for browser compatibility. Cannot access \"fs.readFileSync\" in client code. See https://vite.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details.
dep-with-builtin-module-esm TypeError: (0 , import_browser_external_fs.readFileSync) is not a function
    at http://localhost:5173/node_modules/.vite/deps/@vitejs_test-dep-with-builtin-module-esm.js?v=a8c2d33d:8:46
Module \"path\" has been externalized for browser compatibility. Cannot access \"path.join\" in client code. See https://vite.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details.
dep-with-builtin-module-esm TypeError: import_browser_external_path.default.join is not a function
    at http://localhost:5173/node_modules/.vite/deps/@vitejs_test-dep-with-builtin-module-esm.js?v=a8c2d33d:13:39
Module \"fs\" has been externalized for browser compatibility. Cannot access \"fs.readFileSync\" in client code. See https://vite.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details.
Module \"path\" has been externalized for browser compatibility. Cannot access \"path.join\" in client code. See https://vite.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details.
dep-with-builtin-module-cjs TypeError: path.join is not a function
    at http://localhost:5173/node_modules/.vite/deps/@vitejs_test-dep-with-builtin-module-cjs.js?v=e1b01b58:9:8
    at http://localhost:5173/node_modules/.vite/deps/chunk-Dlsxdu6H.js?v=4e0e41d7:9:48
    at http://localhost:5173/node_modules/.vite/deps/@vitejs_test-dep-with-builtin-module-cjs.js?v=e1b01b58:19:16
Module \"fs\" has been externalized for browser compatibility. Cannot access \"fs.readFileSync\" in client code. See https://vite.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details.
[vite] connected.
Failed to load resource: the server responded with a status of 404 (Not Found)"

 ❯ playground/optimize-deps/__tests__/optimize-deps.spec.ts:377:6
    375|   await expect
    376|     .poll(() => browserLogs.join('\n'))
    377|     .toMatch(/Message from lib: worker-success/)
       |      ^
    378|   await expect
    379|     .poll(() => browserLogs.join('\n'))

Caused by: Error: Matcher did not succeed in time.
 ❯ playground/optimize-deps/__tests__/optimize-deps.spec.ts:375:3

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/1]⎯


 Test Files  1 failed | 1 skipped (2)
      Tests  1 failed | 50 skipped (51)
   Start at  15:49:28
   Duration  5.83s (transform 139ms, setup 525ms, import 141ms, tests 3.33s, environment 0ms)

 FAIL  Tests failed. Watching for file changes...
       press h to show help, press q to quit
Test Log (After Fix) ```bash (base) guycohen@Guys-MacBook-Air vite % pnpm vitest --config vitest.config.e2e.ts playground/optimize-deps -t "worker"

DEV v4.0.17 /Users/guycohen/dev/vite

--------------------------------------------------*

Test Files 1 passed | 1 skipped (2)
Tests 1 passed | 50 skipped (51)
Start at 15:46:53
Duration 3.70s (transform 86ms, setup 720ms, import 68ms, tests 883ms, environment 0ms)

PASS Waiting for file changes...
press h to show help, press q to quit

</details>

@guyco3 guyco3 force-pushed the fix-optimize-deps-worker-assets branch 5 times, most recently from e579679 to 160562a Compare January 17, 2026 23:03
@guyco3 guyco3 force-pushed the fix-optimize-deps-worker-assets branch from 160562a to aa501ea Compare January 17, 2026 23:11
@guyco3 guyco3 marked this pull request as ready for review January 17, 2026 23:15
@guyco3 guyco3 marked this pull request as draft January 17, 2026 23:19
@guyco3 guyco3 marked this pull request as ready for review January 17, 2026 23:21
@sapphi-red sapphi-red added the feat: deps optimizer Esbuild Dependencies Optimization label Jan 19, 2026
@guyco3 guyco3 changed the title fix(optimizer): map relative worker paths to absolute FS locations fix(optimizer): map relative worker paths to correct relative file location Jan 20, 2026
@guyco3 guyco3 requested a review from sapphi-red January 20, 2026 09:07
Adds ?url suffix to test assets in the playground to prevent Vite from inlining small files as Base64
…couldn't find way to not get it to get inlined
@guyco3 guyco3 force-pushed the fix-optimize-deps-worker-assets branch from 46af577 to 3750e87 Compare January 20, 2026 23:02
@guyco3
Copy link
Copy Markdown
Contributor Author

guyco3 commented Jan 20, 2026

I've implemented the requested changes

While updating the playground tests, I ran into an issue where the test image was being automatically inlined as a Data URL because of its small size. This made it impossible to verify the rebased file path.

I considered a few options to fix this:

  1. Adding a larger image (>4KB): Decided against this to avoid bloating the repository history with binary data.
  2. Setting assetsInlineLimit: 0: I was concerned this might have unintended side effects on other existing or future tests in the shared optimize-deps playground.

How I proceeded:
I focused the E2E playground tests strictly on Worker assets, which are easy to verify and aren't subject to inlining. However, I have added comprehensive coverage for Images, WASM, and nested asset paths in the unit test suite (rolldownDepPlugin.spec.ts).

Is this test coverage fine, or would it be better if I force the assetsInlineLimit: 0 in the playground config to keep the image playground tests? Or maybe there is a better way...

@sapphi-red
Copy link
Copy Markdown
Member

Thanks for updating!

I think we can copy https://github.com/vitejs/vite/blob/main/playground/assets/nested/asset.png and use it in the playground. It's already included in the repository and git will dedupe it, so it won't bloat the repository.

@guyco3
Copy link
Copy Markdown
Contributor Author

guyco3 commented Jan 21, 2026

oh yeah good suggestion, I forgot git does that. I added the additional check for the image asset in the playground test. I think the PR is ready, open to additional comments/modifications though

@guyco3 guyco3 force-pushed the fix-optimize-deps-worker-assets branch from 36dfb7c to 1774c44 Compare January 21, 2026 09:40
@guyco3 guyco3 force-pushed the fix-optimize-deps-worker-assets branch from 1774c44 to 22a53f2 Compare January 21, 2026 10:01
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Jan 26, 2026

Open in StackBlitz

pnpm add https://pkg.pr.new/vitejs/vite/@vitejs/plugin-legacy@21434
npm i https://pkg.pr.new/vitejs/vite/@vitejs/plugin-legacy@21434
yarn add https://pkg.pr.new/vitejs/vite/@vitejs/[email protected]
pnpm add https://pkg.pr.new/vitejs/vite@21434
npm i https://pkg.pr.new/vitejs/vite@21434
yarn add https://pkg.pr.new/vitejs/[email protected]

commit: 88fa33c

@sapphi-red sapphi-red changed the title fix(optimizer): map relative worker paths to correct relative file location fix(optimizer): map relative new URL paths to correct relative file location Jan 26, 2026
Copy link
Copy Markdown
Member

@sapphi-red sapphi-red left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@sapphi-red
Copy link
Copy Markdown
Member

Just note that this PR does not fix #21422. That one is different from the other ones I linked. It needs to add a library mode specific transform to output new Worker(new URL('...', import.meta.url)) in a bundler-friendly way.

@sapphi-red sapphi-red merged commit ca96cbc into vitejs:main Jan 26, 2026
22 checks passed
Thiladev pushed a commit to Thiladev/effect-fc that referenced this pull request Mar 16, 2026
This PR contains the following updates:

| Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) |
|---|---|---|---|
| [vite](https://vite.dev) ([source](https://github.com/vitejs/vite/tree/HEAD/packages/vite)) | [`^7.3.1` → `^8.0.0`](https://renovatebot.com/diffs/npm/vite/7.3.1/8.0.0) | ![age](https://developer.mend.io/api/mc/badges/age/npm/vite/8.0.0?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/vite/7.3.1/8.0.0?slim=true) |

---

### Release Notes

<details>
<summary>vitejs/vite (vite)</summary>

### [`v8.0.0`](https://github.com/vitejs/vite/blob/HEAD/packages/vite/CHANGELOG.md#800-2026-03-12)

[Compare Source](vitejs/vite@v7.3.1...v8.0.0)

![Vite 8 is here!](../../docs/public/og-image-announcing-vite8.webp)

Today, we're thrilled to announce the release of the next Vite major:

- **[Vite 8.0 announcement blog post](https://vite.dev/blog/announcing-vite8.html)**
- [Docs](https://vite.dev/) (translations: [简体中文](https://cn.vite.dev/), [日本語](https://ja.vite.dev/), [Español](https://es.vite.dev/), [Português](https://pt.vite.dev/), [한국어](https://ko.vite.dev/), [Deutsch](https://de.vite.dev/), [فارسی](https://fa.vite.dev/))
- [Migration Guide](https://vite.dev/guide/migration.html)

##### ⚠ BREAKING CHANGES

- remove `import.meta.hot.accept` resolution fallback ([#&#8203;21382](vitejs/vite#21382))
- update default browser target ([#&#8203;21193](vitejs/vite#21193))
- the epic `rolldown-vite` merge ([#&#8203;21189](vitejs/vite#21189))

##### Features

- update rolldown to 1.0.0-rc.9 ([#&#8203;21813](vitejs/vite#21813)) ([f05be0e](vitejs/vite@f05be0e))
- warn when `vite-tsconfig-paths` plugin is detected ([#&#8203;21781](vitejs/vite#21781)) ([ada493e](vitejs/vite@ada493e))
- **css:** support es2025 build target for lightningcss ([#&#8203;21769](vitejs/vite#21769)) ([08906e7](vitejs/vite@08906e7))
- forward browser console logs and errors to dev server terminal ([#&#8203;20916](vitejs/vite#20916)) ([2540ed0](vitejs/vite@2540ed0))
- update rolldown to 1.0.0-rc.8 ([#&#8203;21790](vitejs/vite#21790)) ([a0c950e](vitejs/vite@a0c950e))
- export `Visitor` and `ESTree` from `rolldown/utils` ([#&#8203;21664](vitejs/vite#21664)) ([45de31e](vitejs/vite@45de31e))
- update rolldown to 1.0.0-rc.6 ([#&#8203;21714](vitejs/vite#21714)) ([37a65f8](vitejs/vite@37a65f8))
- use util.inspect for CLI error display ([#&#8203;21668](vitejs/vite#21668)) ([5f425a9](vitejs/vite@5f425a9))
- update rolldown to 1.0.0-rc.5 ([#&#8203;21660](vitejs/vite#21660)) ([b3ddbc5](vitejs/vite@b3ddbc5))
- update rolldown to 1.0.0-rc.4 ([#&#8203;21617](vitejs/vite#21617)) ([1ee5c7f](vitejs/vite@1ee5c7f))
- **wasm:** add SSR support for `.wasm?init` ([#&#8203;21102](vitejs/vite#21102)) ([216a3b5](vitejs/vite@216a3b5))
- integrate devtools ([#&#8203;21331](vitejs/vite#21331)) ([acbf507](vitejs/vite@acbf507))
- update rolldown to 1.0.0-rc.3 ([#&#8203;21554](vitejs/vite#21554)) ([43358e9](vitejs/vite@43358e9))
- **manifest:** add `assets` field for standalone CSS entry points ([#&#8203;21015](vitejs/vite#21015)) ([f289b9b](vitejs/vite@f289b9b))
- update rolldown to 1.0.0-rc.2 ([#&#8203;21512](vitejs/vite#21512)) ([fa136a9](vitejs/vite@fa136a9))
- **bundled-dev:** support worker in initial bundle ([#&#8203;21415](vitejs/vite#21415)) ([f3d3149](vitejs/vite@f3d3149))
- **dev:** detect port conflicts on wildcard hosts ([#&#8203;21381](vitejs/vite#21381)) ([b0dd5a9](vitejs/vite@b0dd5a9))
- shortcuts case insensitive ([#&#8203;21224](vitejs/vite#21224)) ([7796ade](vitejs/vite@7796ade))
- update rolldown to 1.0.0-rc.1 ([#&#8203;21463](vitejs/vite#21463)) ([ff9dd7f](vitejs/vite@ff9dd7f))
- warn if `envPrefix` contains spaces ([#&#8203;21292](vitejs/vite#21292)) ([9fcde3c](vitejs/vite@9fcde3c))
- update rolldown to 1.0.0-beta.60 ([#&#8203;21408](vitejs/vite#21408)) ([c33aa7c](vitejs/vite@c33aa7c))
- update rolldown to 1.0.0-beta.59 ([#&#8203;21374](vitejs/vite#21374)) ([0037943](vitejs/vite@0037943))
- add `ignoreOutdatedRequests` option to `optimizeDeps` ([#&#8203;21364](vitejs/vite#21364)) ([b2e75aa](vitejs/vite@b2e75aa))
- add ios to default esbuild targets ([#&#8203;21342](vitejs/vite#21342)) ([daae6e9](vitejs/vite@daae6e9))
- update rolldown to 1.0.0-beta.58 ([#&#8203;21354](vitejs/vite#21354)) ([ba40cef](vitejs/vite@ba40cef))
- update rolldown to 1.0.0-beta.57 ([#&#8203;21335](vitejs/vite#21335)) ([d5412ef](vitejs/vite@d5412ef))
- **css:** support es2024 build target for lightningcss ([#&#8203;21294](vitejs/vite#21294)) ([bd33b8e](vitejs/vite@bd33b8e))
- update rolldown to 1.0.0-beta.56 ([#&#8203;21323](vitejs/vite#21323)) ([9847a63](vitejs/vite@9847a63))
- introduce v2 native plugins and enable it by default ([#&#8203;21268](vitejs/vite#21268)) ([42f2ab3](vitejs/vite@42f2ab3))
- **ssr:** avoid errors when rewriting already rewritten stacktrace ([#&#8203;21269](vitejs/vite#21269)) ([98d9a33](vitejs/vite@98d9a33))
- update rolldown to 1.0.0-beta.55 ([#&#8203;21300](vitejs/vite#21300)) ([2c8db85](vitejs/vite@2c8db85))
- update rolldown to 1.0.0-beta.54 ([#&#8203;21267](vitejs/vite#21267)) ([c751172](vitejs/vite@c751172))
- add a warning that is output when a plugin sets esbuild related options ([#&#8203;21218](vitejs/vite#21218)) ([200646b](vitejs/vite@200646b))
- highly experimental full bundle mode ([#&#8203;21235](vitejs/vite#21235)) ([83d8c99](vitejs/vite@83d8c99))
- print esbuild options when both esbuild and oxc options are set ([#&#8203;21216](vitejs/vite#21216)) ([08ae87b](vitejs/vite@08ae87b))
- update default browser target ([#&#8203;21193](vitejs/vite#21193)) ([8c3dd06](vitejs/vite@8c3dd06))
- the epic `rolldown-vite` merge ([#&#8203;21189](vitejs/vite#21189)) ([4a7f8d4](vitejs/vite@4a7f8d4))

##### Bug Fixes

- **deps:** update all non-major dependencies ([#&#8203;21786](vitejs/vite#21786)) ([eaa4352](vitejs/vite@eaa4352))
- use `watch.watcher` instead of `watch.notify` ([#&#8203;21793](vitejs/vite#21793)) ([88953b3](vitejs/vite@88953b3))
- **css:** apply `server.origin` to public file URLs in CSS (fix [#&#8203;18457](vitejs/vite#18457)) ([#&#8203;21697](vitejs/vite#21697)) ([c967f48](vitejs/vite@c967f48))
- **deps:** update all non-major dependencies ([#&#8203;21732](vitejs/vite#21732)) ([5c921ca](vitejs/vite@5c921ca))
- **dev:** disable extglobs for consistency ([#&#8203;21745](vitejs/vite#21745)) ([1958eeb](vitejs/vite@1958eeb))
- **lib:** keep annotation comments for es output ([#&#8203;21740](vitejs/vite#21740)) ([dd3c4f4](vitejs/vite@dd3c4f4))
- **optimizer:** avoid error happening with a package with asset entrypoint ([#&#8203;21766](vitejs/vite#21766)) ([f7e1d07](vitejs/vite@f7e1d07))
- **ssr:** throw friendly error when calling `ssrLoadModule` with non-runnable ssr env ([#&#8203;21739](vitejs/vite#21739)) ([1fa736e](vitejs/vite@1fa736e))
- **types:** remove extends ImportMeta from ModuleRunnerImportMeta ([#&#8203;21710](vitejs/vite#21710)) ([0176d45](vitejs/vite@0176d45))
- **wasm:** reset assetUrlRE.lastIndex before .test() in SSR builds ([#&#8203;21780](vitejs/vite#21780)) ([3a0d8d9](vitejs/vite@3a0d8d9))
- **deps:** update all non-major dependencies ([#&#8203;21691](vitejs/vite#21691)) ([521fdc0](vitejs/vite@521fdc0))
- **optimizer:** avoid duplicate modules when `preserveSymlinks` is enabled ([#&#8203;21720](vitejs/vite#21720)) ([72165e0](vitejs/vite@72165e0))
- **dev:** only treat EADDRINUSE as port conflict in wildcard pre-check ([#&#8203;21642](vitejs/vite#21642)) ([e54e25f](vitejs/vite@e54e25f))
- **dev:** prevent concurrent server restarts ([#&#8203;21636](vitejs/vite#21636)) ([8ce23a3](vitejs/vite@8ce23a3))
- **dev:** return "502 Bad Gateway" on proxy failures instead of 500 ([#&#8203;21652](vitejs/vite#21652)) ([e240df2](vitejs/vite@e240df2))
- clear tsconfig cache only when tsconfig.json is cached ([#&#8203;21622](vitejs/vite#21622)) ([50c9675](vitejs/vite@50c9675))
- **deps:** update all non-major dependencies ([#&#8203;21594](vitejs/vite#21594)) ([becdc5d](vitejs/vite@becdc5d))
- **lib:** CSS injection point error with nested name IIFE output ([#&#8203;21606](vitejs/vite#21606)) ([5003de6](vitejs/vite@5003de6))
- **module-runner:** incorrect column with `sourcemapInterceptor: "prepareStackTrace"` ([#&#8203;21562](vitejs/vite#21562)) ([416c095](vitejs/vite@416c095))
- **module-runner:** prevent crash on negative column in stacktrace ([#&#8203;21585](vitejs/vite#21585)) ([a075590](vitejs/vite@a075590))
- rolldownOptions/rollupOptions merging at environment level ([#&#8203;21612](vitejs/vite#21612)) ([db2ecc7](vitejs/vite@db2ecc7))
- **scanner:** respect tsconfig.json ([#&#8203;21547](vitejs/vite#21547)) ([c6c04db](vitejs/vite@c6c04db))
- avoid registering customization hook for import meta resolver multiple times ([#&#8203;21518](vitejs/vite#21518)) ([8bb3203](vitejs/vite@8bb3203))
- **config:** avoid watching rolldown runtime virtual module ([#&#8203;21545](vitejs/vite#21545)) ([d18b139](vitejs/vite@d18b139))
- **deps:** update all non-major dependencies ([#&#8203;21540](vitejs/vite#21540)) ([9ebaeaa](vitejs/vite@9ebaeaa))
- populate originalFileNames when resolving CSS asset paths ([#&#8203;21542](vitejs/vite#21542)) ([8b47ff7](vitejs/vite@8b47ff7))
- **deps:** update all non-major dependencies ([#&#8203;21488](vitejs/vite#21488)) ([2b32ca2](vitejs/vite@2b32ca2))
- disable `tsconfig` option when loading config ([#&#8203;21517](vitejs/vite#21517)) ([5025c35](vitejs/vite@5025c35))
- **optimizer:** map relative `new URL` paths to correct relative file location ([#&#8203;21434](vitejs/vite#21434)) ([ca96cbc](vitejs/vite@ca96cbc))
- avoid using deprecated `output.inlineDynamicImport` option ([#&#8203;21464](vitejs/vite#21464)) ([471ce62](vitejs/vite@471ce62))
- use separate hook object for each environment ([#&#8203;21472](vitejs/vite#21472)) ([66347f6](vitejs/vite@66347f6))
- **deps:** update all non-major dependencies ([#&#8203;21440](vitejs/vite#21440)) ([1835995](vitejs/vite@1835995))
- **dev:** avoid event emitter leak caused by `server.listen` callback ([#&#8203;21451](vitejs/vite#21451)) ([602d786](vitejs/vite@602d786))
- lazy hook filter should work ([#&#8203;21443](vitejs/vite#21443)) ([bc0c207](vitejs/vite@bc0c207))
- **optimizer:** skip `rolldownCjsExternalPlugin` for `platform: neutral` ([#&#8203;21452](vitejs/vite#21452)) ([d2fc4be](vitejs/vite@d2fc4be))
- **deps:** update all non-major dependencies ([#&#8203;21389](vitejs/vite#21389)) ([30f48df](vitejs/vite@30f48df))
- **deps:** update esbuild peerDependency version ([#&#8203;21398](vitejs/vite#21398)) ([4266c97](vitejs/vite@4266c97))
- **hmr:** trigger prune event when last import is removed ([#&#8203;20781](vitejs/vite#20781)) ([#&#8203;21093](vitejs/vite#21093)) ([7576735](vitejs/vite@7576735))
- **module-runner:** use `process.getBuiltinModule` instead of `import('node:module')` ([#&#8203;21402](vitejs/vite#21402)) ([6633bcb](vitejs/vite@6633bcb))
- support .env file mounts (FIFOs) ([#&#8203;21365](vitejs/vite#21365)) ([6e6f82a](vitejs/vite@6e6f82a))
- **css:** stylus Evaluator support ([#&#8203;21376](vitejs/vite#21376)) ([cf9ace1](vitejs/vite@cf9ace1))
- **deps:** update all non-major dependencies ([#&#8203;21321](vitejs/vite#21321)) ([9bc7c2e](vitejs/vite@9bc7c2e))
- **import-analysis:** avoid cjs interop for built browser external module ([#&#8203;21333](vitejs/vite#21333)) ([dc5a2fb](vitejs/vite@dc5a2fb))
- **worker:** handle `new Worker(..., new URL(import.meta.url))` with trailing comma ([#&#8203;21325](vitejs/vite#21325)) ([4a47241](vitejs/vite@4a47241))
- detect `import.meta.resolve` when formatted across multiple lines ([#&#8203;21312](vitejs/vite#21312)) ([130e718](vitejs/vite@130e718))
- allow no-cors requests for non-script tag requests ([#&#8203;21299](vitejs/vite#21299)) ([ef3d596](vitejs/vite@ef3d596))
- **deps:** update all non-major dependencies ([#&#8203;21285](vitejs/vite#21285)) ([4635b2e](vitejs/vite@4635b2e))
- unreachable error when building with `experimental.bundledDev` is enabled ([#&#8203;21296](vitejs/vite#21296)) ([e81c183](vitejs/vite@e81c183))
- **deps:** update all non-major dependencies ([#&#8203;21231](vitejs/vite#21231)) ([859789c](vitejs/vite@859789c))
- don't strip base from imports ([#&#8203;21221](vitejs/vite#21221)) ([7da742b](vitejs/vite@7da742b))
- allow exiting process before optimizer cleanup is done ([#&#8203;21170](vitejs/vite#21170)) ([55ceffc](vitejs/vite@55ceffc))
- plugin shortcut support ([#&#8203;21211](vitejs/vite#21211)) ([6a3aca0](vitejs/vite@6a3aca0))

##### Performance Improvements

- **ssr:** skip circular import check for already-evaluated modules ([#&#8203;21632](vitejs/vite#21632)) ([235140b](vitejs/vite@235140b))
- use tsconfig cache for oxc transform in dev ([#&#8203;21643](vitejs/vite#21643)) ([57ff177](vitejs/vite@57ff177))

##### Documentation

- bulk of typo fixes ([#&#8203;21507](vitejs/vite#21507)) ([80755da](vitejs/vite@80755da))
- update `build.dynamicImportVarsOptions` ([#&#8203;21477](vitejs/vite#21477)) ([54ce2ed](vitejs/vite@54ce2ed))
- clarify the pronunciation of `vite` in IPA symbols ([#&#8203;21238](vitejs/vite#21238)) ([9b1d4d6](vitejs/vite@9b1d4d6))
- ensure https links ([#&#8203;21266](vitejs/vite#21266)) ([2eb259a](vitejs/vite@2eb259a))

##### Miscellaneous Chores

- **deps-dev:** bump rollup from 4.57.1 to 4.59.0 ([#&#8203;21717](vitejs/vite#21717)) ([25227bb](vitejs/vite@25227bb))
- **deps:** update dependency cac to v7 ([#&#8203;21788](vitejs/vite#21788)) ([44e33ae](vitejs/vite@44e33ae))
- **deps:** update dependency rolldown-plugin-dts to ^0.22.2 ([#&#8203;21731](vitejs/vite#21731)) ([d8ea652](vitejs/vite@d8ea652))
- **deps:** remove `fdir` and `@rollup/plugin-commonjs` ([#&#8203;21639](vitejs/vite#21639)) ([5abffd5](vitejs/vite@5abffd5))
- **deps:** update dependency [@&#8203;rollup/plugin-alias](https://github.com/rollup/plugin-alias) to v6 ([#&#8203;21097](vitejs/vite#21097)) ([44b5bdf](vitejs/vite@44b5bdf))
- fix broken link for future deprecations ([#&#8203;21603](vitejs/vite#21603)) ([25f4501](vitejs/vite@25f4501))
- update `customResolver` deprecation message to mention `enforce: 'pre'` ([#&#8203;21576](vitejs/vite#21576)) ([2ce34d5](vitejs/vite@2ce34d5))
- update rolldown-plugin-dts to 0.22.1 ([#&#8203;21559](vitejs/vite#21559)) ([77aab4b](vitejs/vite@77aab4b))
- **deps:** update dependency rolldown-plugin-dts to ^0.21.8 ([#&#8203;21539](vitejs/vite#21539)) ([33881cb](vitejs/vite@33881cb))
- add missing versions to changelog ([#&#8203;21515](vitejs/vite#21515)) ([4bfb239](vitejs/vite@4bfb239))
- **deps:** update rolldown-related dependencies ([#&#8203;21487](vitejs/vite#21487)) ([5863e51](vitejs/vite@5863e51))
- **deps:** update rolldown-related dependencies ([#&#8203;21390](vitejs/vite#21390)) ([be9dd4e](vitejs/vite@be9dd4e))
- fix typo in plugin.ts comment ([#&#8203;21435](vitejs/vite#21435)) ([d31fc66](vitejs/vite@d31fc66))
- replace caniuse link for ES2024 ([#&#8203;21355](vitejs/vite#21355)) ([2ba4e99](vitejs/vite@2ba4e99))
- cleanup changelog ([#&#8203;21202](vitejs/vite#21202)) ([8c8c56e](vitejs/vite@8c8c56e))
- **deps:** update rolldown-related dependencies ([#&#8203;21230](vitejs/vite#21230)) ([9349446](vitejs/vite@9349446))
- fix spelling error ([#&#8203;21223](vitejs/vite#21223)) ([cc10e20](vitejs/vite@cc10e20))

##### Code Refactoring

- don't add `optimization.inlineConst: { mode: 'smart' }` as it's enabled by default ([#&#8203;21794](vitejs/vite#21794)) ([22b3d11](vitejs/vite@22b3d11))
- enable some native plugins even with enable native plugin false ([#&#8203;21744](vitejs/vite#21744)) ([fc46c79](vitejs/vite@fc46c79))
- avoid deprecated `legalComments` option ([#&#8203;21721](vitejs/vite#21721)) ([e06496e](vitejs/vite@e06496e))
- use `ESTree` types from `rolldown/utils` ([#&#8203;21719](vitejs/vite#21719)) ([9239750](vitejs/vite@9239750))
- deprecate `customResolver` in `resolve.alias` ([#&#8203;21476](vitejs/vite#21476)) ([81275c9](vitejs/vite@81275c9))
- remove unnecessary `@rolldown/pluginutils` ([#&#8203;21560](vitejs/vite#21560)) ([c367b62](vitejs/vite@c367b62))
- enable some native plugins even with enable native plugin false ([#&#8203;21608](vitejs/vite#21608)) ([5a4f692](vitejs/vite@5a4f692))
- use `rolldown/utils` ([#&#8203;21577](vitejs/vite#21577)) ([e56103f](vitejs/vite@e56103f))
- use internal devtools config ([#&#8203;21609](vitejs/vite#21609)) ([9aea20f](vitejs/vite@9aea20f))
- use parseEnv ([#&#8203;21586](vitejs/vite#21586)) ([f859d2c](vitejs/vite@f859d2c))
- **wasm:** remove native wasm helper plugin usage ([#&#8203;21566](vitejs/vite#21566)) ([71a86be](vitejs/vite@71a86be))
- enable some native plugins even with enable native plugin false ([#&#8203;21511](vitejs/vite#21511)) ([b40292c](vitejs/vite@b40292c))
- remove `experimental.enableNativePlugin: 'resolver'` ([#&#8203;21510](vitejs/vite#21510)) ([f9d9213](vitejs/vite@f9d9213))
- use `import.meta.dirname` everywhere ([#&#8203;21509](vitejs/vite#21509)) ([7becf5f](vitejs/vite@7becf5f))
- **optimizer:** simplify `rolldownCjsExternalPlugin` ([#&#8203;21450](vitejs/vite#21450)) ([ebda8fd](vitejs/vite@ebda8fd))
- remove `import.meta.hot.accept` resolution fallback ([#&#8203;21382](vitejs/vite#21382)) ([71d0797](vitejs/vite@71d0797))
- **optimizer:** remove dead code ([#&#8203;21334](vitejs/vite#21334)) ([e9a2cdb](vitejs/vite@e9a2cdb))

##### Tests

- **ssr:** incorrect `handleInvoke` was called in server-worker-runner.invoke test ([#&#8203;21751](vitejs/vite#21751)) ([b95ca22](vitejs/vite@b95ca22))
- add more type tests for `defineConfig` ([#&#8203;21698](vitejs/vite#21698)) ([4fedbbd](vitejs/vite@4fedbbd))
- test case for catching invalid package resolution error ([#&#8203;21601](vitejs/vite#21601)) ([c9b9359](vitejs/vite@c9b9359))
- **bundled-dev:** add worker test cases ([#&#8203;21557](vitejs/vite#21557)) ([569bc98](vitejs/vite@569bc98))

##### Beta Changelogs

##### [8.0.0-beta.18](vitejs/vite@v8.0.0-beta.17...v8.0.0-beta.18) (2026-03-09)

See [8.0.0-beta.18 changelog](https://github.com/vitejs/vite/blob/v8.0.0-beta.18/packages/vite/CHANGELOG.md)

##### [8.0.0-beta.17](vitejs/vite@v8.0.0-beta.16...v8.0.0-beta.17) (2026-03-09)

See [8.0.0-beta.17 changelog](https://github.com/vitejs/vite/blob/v8.0.0-beta.17/packages/vite/CHANGELOG.md)

##### [8.0.0-beta.16](vitejs/vite@v8.0.0-beta.15...v8.0.0-beta.16) (2026-02-27)

See [8.0.0-beta.16 changelog](https://github.com/vitejs/vite/blob/v8.0.0-beta.16/packages/vite/CHANGELOG.md)

##### [8.0.0-beta.15](vitejs/vite@v8.0.0-beta.14...v8.0.0-beta.15) (2026-02-19)

See [8.0.0-beta.15 changelog](https://github.com/vitejs/vite/blob/v8.0.0-beta.15/packages/vite/CHANGELOG.md)

##### [8.0.0-beta.14](vitejs/vite@v8.0.0-beta.13...v8.0.0-beta.14) (2026-02-12)

See [8.0.0-beta.14 changelog](https://github.com/vitejs/vite/blob/v8.0.0-beta.14/packages/vite/CHANGELOG.md)

##### [8.0.0-beta.13](vitejs/vite@v8.0.0-beta.12...v8.0.0-beta.13) (2026-02-05)

See [8.0.0-beta.13 changelog](https://github.com/vitejs/vite/blob/v8.0.0-beta.13/packages/vite/CHANGELOG.md)

##### [8.0.0-beta.12](vitejs/vite@v8.0.0-beta.11...v8.0.0-beta.12) (2026-02-03)

See [8.0.0-beta.12 changelog](https://github.com/vitejs/vite/blob/v8.0.0-beta.12/packages/vite/CHANGELOG.md)

##### [8.0.0-beta.11](vitejs/vite@v8.0.0-beta.10...v8.0.0-beta.11) (2026-01-29)

See [8.0.0-beta.11 changelog](https://github.com/vitejs/vite/blob/v8.0.0-beta.11/packages/vite/CHANGELOG.md)

##### [8.0.0-beta.10](vitejs/vite@v8.0.0-beta.9...v8.0.0-beta.10) (2026-01-24)

See [8.0.0-beta.10 changelog](https://github.com/vitejs/vite/blob/v8.0.0-beta.10/packages/vite/CHANGELOG.md)

##### [8.0.0-beta.9](vitejs/vite@v8.0.0-beta.8...v8.0.0-beta.9) (2026-01-22)

See [8.0.0-beta.9 changelog](https://github.com/vitejs/vite/blob/v8.0.0-beta.9/packages/vite/CHANGELOG.md)

##### [8.0.0-beta.8](vitejs/vite@v8.0.0-beta.7...v8.0.0-beta.8) (2026-01-15)

See [8.0.0-beta.8 changelog](https://github.com/vitejs/vite/blob/v8.0.0-beta.8/packages/vite/CHANGELOG.md)

##### [8.0.0-beta.7](vitejs/vite@v8.0.0-beta.6...v8.0.0-beta.7) (2026-01-08)

See [8.0.0-beta.7 changelog](https://github.com/vitejs/vite/blob/v8.0.0-beta.7/packages/vite/CHANGELOG.md)

##### [8.0.0-beta.6](vitejs/vite@v8.0.0-beta.5...v8.0.0-beta.6) (2026-01-07)

See [8.0.0-beta.6 changelog](https://github.com/vitejs/vite/blob/v8.0.0-beta.6/packages/vite/CHANGELOG.md)

##### [8.0.0-beta.5](vitejs/vite@v8.0.0-beta.4...v8.0.0-beta.5) (2025-12-25)

See [8.0.0-beta.5 changelog](https://github.com/vitejs/vite/blob/v8.0.0-beta.5/packages/vite/CHANGELOG.md)

##### [8.0.0-beta.4](vitejs/vite@v8.0.0-beta.3...v8.0.0-beta.4) (2025-12-22)

See [8.0.0-beta.4 changelog](https://github.com/vitejs/vite/blob/v8.0.0-beta.4/packages/vite/CHANGELOG.md)

##### [8.0.0-beta.3](vitejs/vite@v8.0.0-beta.2...v8.0.0-beta.3) (2025-12-18)

See [8.0.0-beta.3 changelog](https://github.com/vitejs/vite/blob/v8.0.0-beta.3/packages/vite/CHANGELOG.md)

##### [8.0.0-beta.2](vitejs/vite@v8.0.0-beta.1...v8.0.0-beta.2) (2025-12-12)

See [8.0.0-beta.2 changelog](https://github.com/vitejs/vite/blob/v8.0.0-beta.2/packages/vite/CHANGELOG.md)

##### [8.0.0-beta.1](vitejs/vite@v8.0.0-beta.0...v8.0.0-beta.1) (2025-12-08)

See [8.0.0-beta.1 changelog](https://github.com/vitejs/vite/blob/v8.0.0-beta.1/packages/vite/CHANGELOG.md)

##### [8.0.0-beta.0](vitejs/vite@v7.2.4...v8.0.0-beta.0) (2025-12-03)

See [8.0.0-beta.0 changelog](https://github.com/vitejs/vite/blob/v8.0.0-beta.0/packages/vite/CHANGELOG.md)

##### Rolldown-Vite changelogs

See [rolldown-vite changelog](https://github.com/vitejs/rolldown-vite/blob/v7.2.10/packages/vite/CHANGELOG.md)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My42Ni41IiwidXBkYXRlZEluVmVyIjoiNDMuNzYuMiIsInRhcmdldEJyYW5jaCI6Im5leHQiLCJsYWJlbHMiOltdfQ==-->

Reviewed-on: https://git.valverde.cloud/Thilawyn/effect-fc/pulls/37
Co-authored-by: Renovate Bot <[email protected]>
Co-committed-by: Renovate Bot <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat: deps optimizer Esbuild Dependencies Optimization trigger: preview

Projects

None yet

2 participants