[PR #5] [MERGED] fix: inline source content in sourcemaps to prevent missing source warnings #238

Closed
opened 2026-05-06 12:38:42 +02:00 by BreizhHardware · 0 comments

📋 Pull Request Information

Original PR: https://github.com/cloudflare/vinext/pull/5
Author: @threepointone
Created: 2/24/2026
Status: Merged
Merged: 2/24/2026
Merged by: @southpolesteve

Base: mainHead: fix/inline-sourcemap-sources


📝 Commits (1)

  • 747ac78 fix: inline source content in sourcemaps to prevent missing source warnings

📊 Changes

1 file changed (+1 additions, -0 deletions)

View changed files

📝 tsconfig.json (+1 -0)

📄 Description

Problem

When vinext is installed from npm, Vite logs many warnings during dev:

Sourcemap for ".../node_modules/vinext/dist/server/image-optimization.js" points to missing source files
Sourcemap for ".../node_modules/vinext/dist/shims/navigation.js" points to missing source files
...

The published dist/ includes .js.map files that reference the original .ts source files via "sources", but the .ts files aren't included in the npm package.

Fix

Adds "inlineSources": true to tsconfig.json. This tells tsc to embed the original TypeScript source content directly in the .js.map files via sourcesContent, so no separate source files are needed.

Verified: after building, .js.map files now contain sourcesContent with the full original source.

Fixes #2


🔄 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/5 **Author:** [@threepointone](https://github.com/threepointone) **Created:** 2/24/2026 **Status:** ✅ Merged **Merged:** 2/24/2026 **Merged by:** [@southpolesteve](https://github.com/southpolesteve) **Base:** `main` ← **Head:** `fix/inline-sourcemap-sources` --- ### 📝 Commits (1) - [`747ac78`](https://github.com/cloudflare/vinext/commit/747ac780ad9aabc89cebfb0d55e796a63757f233) fix: inline source content in sourcemaps to prevent missing source warnings ### 📊 Changes **1 file changed** (+1 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `tsconfig.json` (+1 -0) </details> ### 📄 Description ## Problem When vinext is installed from npm, Vite logs many warnings during dev: ``` Sourcemap for ".../node_modules/vinext/dist/server/image-optimization.js" points to missing source files Sourcemap for ".../node_modules/vinext/dist/shims/navigation.js" points to missing source files ... ``` The published `dist/` includes `.js.map` files that reference the original `.ts` source files via `"sources"`, but the `.ts` files aren't included in the npm package. ## Fix Adds `"inlineSources": true` to `tsconfig.json`. This tells `tsc` to embed the original TypeScript source content directly in the `.js.map` files via `sourcesContent`, so no separate source files are needed. Verified: after building, `.js.map` files now contain `sourcesContent` with the full original source. Fixes #2 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
BreizhHardware 2026-05-06 12:38:42 +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#238
No description provided.