mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-06-06 13:14:11 +00:00
fix(embed): include underscore-prefixed Vite chunks in dist FS
go:embed silently excludes files whose names start with `_` or `.`, so the `_plugin-vue_export-helper-<hash>.js` chunk that Vite/rolldown emits for @vitejs/plugin-vue was missing from the production binary. First import at runtime hit a 404 and the SPA failed to mount — blank page on every page load, no error in the server logs because the asset 404 was just a static-handler miss. Switched the directive to `//go:embed all:dist` which keeps the same root layout but disables the underscore/dot exclusion rule. Dev mode was unaffected (it serves dist/assets/ from disk, not the embedded FS). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
parent
8cd97654f2
commit
6bdf4bb4a0
1 changed files with 7 additions and 1 deletions
|
|
@ -41,7 +41,13 @@ var i18nFS embed.FS
|
|||
// HTML route is served straight out of this FS — the legacy Go
|
||||
// templates and `web/assets/` tree are gone post-Phase 8.
|
||||
//
|
||||
//go:embed dist/*
|
||||
// `all:` is required so files whose names start with `_` are NOT
|
||||
// silently excluded by go:embed's default rules. Vite/rolldown emits
|
||||
// `_plugin-vue_export-helper-<hash>.js` for the @vitejs/plugin-vue
|
||||
// runtime; without `all:` the chunk would be missing from the binary
|
||||
// at runtime → 404 → blank-page boot failure.
|
||||
//
|
||||
//go:embed all:dist
|
||||
var distFS embed.FS
|
||||
|
||||
var startTime = time.Now()
|
||||
|
|
|
|||
Loading…
Reference in a new issue