[PR #6131] [MERGED] chore(build): stop shipping production sourcemaps inside the binary #6094

Closed
opened 2026-11-02 04:06:19 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/MHSanaei/3x-ui/pull/6131
Author: @PathGao
Created: 7/29/2026
Status: ✅ Merged
Merged: 7/29/2026
Merged by: @MHSanaei

Base: main ← Head: chore-strip-prod-sourcemaps


📝 Commits (2)

  • 12187a8 chore(build): stop shipping production sourcemaps inside the binary
  • 7a70e65 chore(build): gate production sourcemaps behind XUI_SOURCEMAP

📊 Changes

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

View changed files

📝 frontend/vite.config.js (+7 -1)

📄 Description

Summary

Disable build.sourcemap for the production Vite build. Everything in internal/web/dist is embedded into the Go binary via embed.FS, so the 112 .map files (18MB, 72% of dist) currently ship inside every release download.

Why

Nothing consumes the maps in production: the served pages never reference them and no error-reporting pipeline reads them. npm run dev serves its own sourcemaps regardless of this build flag, so developer experience is unchanged. Anyone needing to debug a production bundle can flip the flag locally — the config comment says so.

Measured: internal/web/dist 25MB → 6.7MB, which comes straight off the embedded payload of every release binary and every panel download/update.

Type of change

  • Build / CI / tooling

Areas affected

  • Frontend (UI / panel pages)

How was this tested?

  • npm run build → zero .map files in dist, panel serves and loads normally from the rebuilt embed.
  • No test/lint/gen surface touched.

Screenshots / recordings

N/A.

Breaking changes

None.

Checklist

  • I tested the change locally and confirmed the described behavior.
  • I added or updated tests for the new behavior (not applicable — build flag)
  • go build ./... and the test suite pass locally.
  • For frontend changes: npm run lint, npm run typecheck, and npm run build pass.
  • I updated the Wiki / README / API docs if user-facing behavior changed (not applicable)
  • My commits follow the project's existing message style.
  • I have no unrelated changes mixed into this PR.

🤖 Generated with Claude Code


🔄 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/MHSanaei/3x-ui/pull/6131 **Author:** [@PathGao](https://github.com/PathGao) **Created:** 7/29/2026 **Status:** ✅ Merged **Merged:** 7/29/2026 **Merged by:** [@MHSanaei](https://github.com/MHSanaei) **Base:** `main` ← **Head:** `chore-strip-prod-sourcemaps` --- ### 📝 Commits (2) - [`12187a8`](https://github.com/MHSanaei/3x-ui/commit/12187a81e5eabde9bbb201407f558e4e06804f8c) chore(build): stop shipping production sourcemaps inside the binary - [`7a70e65`](https://github.com/MHSanaei/3x-ui/commit/7a70e65854751467662c79bf7f35c7c9281cdcb8) chore(build): gate production sourcemaps behind XUI_SOURCEMAP ### 📊 Changes **1 file changed** (+7 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `frontend/vite.config.js` (+7 -1) </details> ### 📄 Description ## Summary Disable `build.sourcemap` for the production Vite build. Everything in `internal/web/dist` is embedded into the Go binary via `embed.FS`, so the 112 `.map` files (18MB, 72% of dist) currently ship inside every release download. ## Why Nothing consumes the maps in production: the served pages never reference them and no error-reporting pipeline reads them. `npm run dev` serves its own sourcemaps regardless of this build flag, so developer experience is unchanged. Anyone needing to debug a production bundle can flip the flag locally — the config comment says so. Measured: `internal/web/dist` 25MB → 6.7MB, which comes straight off the embedded payload of every release binary and every panel download/update. ## Type of change - [x] Build / CI / tooling ## Areas affected - [x] Frontend (UI / panel pages) ## How was this tested? - `npm run build` → zero `.map` files in dist, panel serves and loads normally from the rebuilt embed. - No test/lint/gen surface touched. ## Screenshots / recordings N/A. ## Breaking changes None. ## Checklist - [x] I tested the change locally and confirmed the described behavior. - [x] I added or updated tests for the new behavior (not applicable — build flag) - [x] `go build ./...` and the test suite pass locally. - [x] For frontend changes: `npm run lint`, `npm run typecheck`, and `npm run build` pass. - [x] I updated the Wiki / README / API docs if user-facing behavior changed (not applicable) - [x] My commits follow the project's existing message style. - [x] I have no unrelated changes mixed into this PR. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-02 04:06:19 +07: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
MHSanaei/3x-ui#6094
No description provided.