[PR #655] [MERGED] Fix tsconfig alias transforms for RSC builds #747

Closed
opened 2026-05-06 13:09:55 +02:00 by BreizhHardware · 0 comments

📋 Pull Request Information

Original PR: https://github.com/cloudflare/vinext/pull/655
Author: @southpolesteve
Created: 3/22/2026
Status: Merged
Merged: 3/22/2026
Merged by: @southpolesteve

Base: mainHead: codex/issue-611-tsconfig-alias-transforms


📝 Commits (2)

  • a2e597d Fix tsconfig alias transforms for RSC builds
  • f4059c3 Fix flaky compressed streaming timing test

📊 Changes

4 files changed (+496 additions, -4 deletions)

View changed files

📝 packages/vinext/src/index.ts (+158 -1)
📝 tests/features.test.ts (+5 -3)
tests/tsconfig-path-alias-build.test.ts (+238 -0)
📝 tests/tsconfig-paths-vite8.test.ts (+95 -0)

📄 Description

Closes #611

Summary

  • materialize simple tsconfig.json/jsconfig.json path aliases into resolve.alias
  • keep that alias materialization available for both Vite 7 and Vite 8 so Vite's build-time transforms can see @/... imports
  • support basic tsconfig extends chains when loading path aliases
  • add regression coverage for Vite 8 alias materialization and a Cloudflare-style production build that ensures raw alias-based import.meta.glob() and dynamic imports are transformed out of the emitted JS

Root cause

vinext already supported tsconfig path resolution for normal imports, but Vite's import.meta.glob() and dynamic import transforms need the alias to be present in resolve.alias during build. Without that, alias-based MDX globs and imports could survive into the RSC/Cloudflare output unchanged and fail at runtime.

Testing

  • vp test run tests/tsconfig-paths-vite8.test.ts tests/tsconfig-path-alias-build.test.ts
  • vp lint packages/vinext/src/index.ts tests/tsconfig-paths-vite8.test.ts tests/tsconfig-path-alias-build.test.ts

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/cloudflare/vinext/pull/655 **Author:** [@southpolesteve](https://github.com/southpolesteve) **Created:** 3/22/2026 **Status:** ✅ Merged **Merged:** 3/22/2026 **Merged by:** [@southpolesteve](https://github.com/southpolesteve) **Base:** `main` ← **Head:** `codex/issue-611-tsconfig-alias-transforms` --- ### 📝 Commits (2) - [`a2e597d`](https://github.com/cloudflare/vinext/commit/a2e597d738ee06a7c32dca92ed7ab69a7956e774) Fix tsconfig alias transforms for RSC builds - [`f4059c3`](https://github.com/cloudflare/vinext/commit/f4059c3de3cb8e22d947553f9a3340c98c4eaf6a) Fix flaky compressed streaming timing test ### 📊 Changes **4 files changed** (+496 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `packages/vinext/src/index.ts` (+158 -1) 📝 `tests/features.test.ts` (+5 -3) ➕ `tests/tsconfig-path-alias-build.test.ts` (+238 -0) 📝 `tests/tsconfig-paths-vite8.test.ts` (+95 -0) </details> ### 📄 Description Closes #611 ## Summary - materialize simple `tsconfig.json`/`jsconfig.json` path aliases into `resolve.alias` - keep that alias materialization available for both Vite 7 and Vite 8 so Vite's build-time transforms can see `@/...` imports - support basic `tsconfig extends` chains when loading path aliases - add regression coverage for Vite 8 alias materialization and a Cloudflare-style production build that ensures raw alias-based `import.meta.glob()` and dynamic imports are transformed out of the emitted JS ## Root cause vinext already supported tsconfig path resolution for normal imports, but Vite's `import.meta.glob()` and dynamic import transforms need the alias to be present in `resolve.alias` during build. Without that, alias-based MDX globs and imports could survive into the RSC/Cloudflare output unchanged and fail at runtime. ## Testing - `vp test run tests/tsconfig-paths-vite8.test.ts tests/tsconfig-path-alias-build.test.ts` - `vp lint packages/vinext/src/index.ts tests/tsconfig-paths-vite8.test.ts tests/tsconfig-path-alias-build.test.ts` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
BreizhHardware 2026-05-06 13:09:55 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/vinext#747
No description provided.