Mirror the URL space in the frontend build layout

Build with assetsDir: '_/assets' so hashed assets land under
frontend-build/_/assets/ and favicon.ico (from frontend/public) at the
build root, then serve the whole build directory at the site root again
(frontend.route(app, "/"), cached="/_/assets/"). The explicit
favicon route is dropped — the Frontend serves it as an ordinary
unhashed (no-cache) file. Manifest paths now carry the _/assets/
prefix, so views.py only prepends a slash.
This commit is contained in:
2026-08-16 16:22:39 +00:00
parent d5e40fba12
commit 508795437f
5 changed files with 30 additions and 30 deletions
+4 -3
View File
@@ -27,10 +27,11 @@ export default defineConfig({
},
},
build: {
// Emit hashed assets at the root of frontend-build so the backend can
// serve them under /_/assets/{file} without a nested /assets directory.
// Mirror the URL space in the build output: hashed files land under
// frontend-build/_/assets/ and the Frontend serves the build directory
// at the site root (frontend/public/favicon.ico -> /favicon.ico).
manifest: true,
assetsDir: '',
assetsDir: '_/assets',
rollupOptions: {
input: {
main: fileURLToPath(new URL('./src/main.js', import.meta.url)),