[PR #196] fix: extract webpack resolve.alias from next.config plugins (#177) #380

Open
opened 2026-05-06 12:39:30 +02:00 by BreizhHardware · 0 comments

📋 Pull Request Information

Original PR: https://github.com/cloudflare/vinext/pull/196
Author: @SeolJaeHyeok
Created: 2/28/2026
Status: 🔄 Open

Base: mainHead: fix/next-intl-webpack-aliases


📝 Commits (3)

  • e9228d1 fix: extract webpack resolve.alias from next.config plugins (#177)
  • 9fef35f test: add next-intl ecosystem tests and extractWebpackAliases unit tests
  • 6c0c0e7 docs: add ecosystem library compatibility section to README

📊 Changes

12 files changed (+319 additions, -11 deletions)

View changed files

📝 .agents/skills/migrate-to-vinext/references/compatibility.md (+1 -1)
📝 README.md (+21 -0)
📝 packages/vinext/src/check.ts (+1 -1)
📝 packages/vinext/src/config/next-config.ts (+81 -2)
📝 packages/vinext/src/index.ts (+12 -1)
📝 tests/ecosystem.test.ts (+46 -0)
📝 tests/fixtures/ecosystem/next-intl/app/[locale]/layout.tsx (+2 -2)
📝 tests/fixtures/ecosystem/next-intl/app/[locale]/page.tsx (+2 -0)
📝 tests/fixtures/ecosystem/next-intl/i18n/request.ts (+4 -4)
tests/fixtures/ecosystem/next-intl/next.config.ts (+24 -0)
📝 tests/fixtures/ecosystem/next-intl/vite.config.ts (+3 -0)
📝 tests/shims.test.ts (+122 -0)

📄 Description

Summary

  • next-intl's createNextIntlPlugin / withNextIntl registers "next-intl/config" → user's i18n/request.ts via webpack resolve.alias
  • Since vinext ignores webpack config, this alias was never applied — next-intl/config resolved to a stub that throws "Couldn't find next-intl config file"
  • Fix: probe config.webpack() with the real project root to extract string-valued aliases, then merge them into Vite's resolve.alias (vinext's own shims
    always take precedence)
  • Suppresses the spurious "webpack not yet supported" warning when alias extraction succeeds

Fixes #177


🔄 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/196 **Author:** [@SeolJaeHyeok](https://github.com/SeolJaeHyeok) **Created:** 2/28/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/next-intl-webpack-aliases` --- ### 📝 Commits (3) - [`e9228d1`](https://github.com/cloudflare/vinext/commit/e9228d1e5ff10ba4ba510382cc382fc89c920079) fix: extract webpack resolve.alias from next.config plugins (#177) - [`9fef35f`](https://github.com/cloudflare/vinext/commit/9fef35f435cab91c68761ab628a5f83b6cd9e325) test: add next-intl ecosystem tests and extractWebpackAliases unit tests - [`6c0c0e7`](https://github.com/cloudflare/vinext/commit/6c0c0e785d8090cde4462663c49d01a5b3fca416) docs: add ecosystem library compatibility section to README ### 📊 Changes **12 files changed** (+319 additions, -11 deletions) <details> <summary>View changed files</summary> 📝 `.agents/skills/migrate-to-vinext/references/compatibility.md` (+1 -1) 📝 `README.md` (+21 -0) 📝 `packages/vinext/src/check.ts` (+1 -1) 📝 `packages/vinext/src/config/next-config.ts` (+81 -2) 📝 `packages/vinext/src/index.ts` (+12 -1) 📝 `tests/ecosystem.test.ts` (+46 -0) 📝 `tests/fixtures/ecosystem/next-intl/app/[locale]/layout.tsx` (+2 -2) 📝 `tests/fixtures/ecosystem/next-intl/app/[locale]/page.tsx` (+2 -0) 📝 `tests/fixtures/ecosystem/next-intl/i18n/request.ts` (+4 -4) ➕ `tests/fixtures/ecosystem/next-intl/next.config.ts` (+24 -0) 📝 `tests/fixtures/ecosystem/next-intl/vite.config.ts` (+3 -0) 📝 `tests/shims.test.ts` (+122 -0) </details> ### 📄 Description ## Summary - next-intl's createNextIntlPlugin / withNextIntl registers "next-intl/config" → user's i18n/request.ts via webpack resolve.alias - Since vinext ignores webpack config, this alias was never applied — next-intl/config resolved to a stub that throws "Couldn't find next-intl config file" - Fix: probe config.webpack() with the real project root to extract string-valued aliases, then merge them into Vite's resolve.alias (vinext's own shims always take precedence) - Suppresses the spurious "webpack not yet supported" warning when alias extraction succeeds Fixes #177 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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#380
No description provided.