Propagate Modern.js publicDir assets through sync + Docker build
The config/public/ directory (fonts, images, leaflet icons, favicons) is Modern.js's publicDir convention — copied into dist/standalone/public/ at build time. Two pre-existing gaps caused this to break on the deployed SSR image and any fresh sync: - scripts/sync-to-flights-front.sh did not copy config/ to the target repo, so the flights-front tree was missing /assets/** entirely. - Dockerfile.react only copied src/, skipping config/; pnpm build:standalone ran without a publicDir source. Result was that every /assets/** URL served the SSR HTML index with Content-Type: text/html, producing OTS font-parse errors (sfntVersion 1008821359 == '<!DT') and silently broken images. Fix mirrors what was applied ad-hoc in Aeroflot.Flights.Front; this makes future syncs and Docker builds carry the assets automatically.
This commit is contained in:
@@ -35,6 +35,10 @@ echo "2/5 Copying source files..."
|
||||
cp -r "$SRC_DIR/src" "$TARGET_DIR/src"
|
||||
cp -r "$SRC_DIR/tests" "$TARGET_DIR/tests"
|
||||
cp -r "$SRC_DIR/scripts" "$TARGET_DIR/scripts"
|
||||
# Modern.js publicDir — fonts, images, leaflet icons, favicons. Copied to
|
||||
# dist/standalone/public/ at build time. Without these the app serves the
|
||||
# SPA index for /assets/** and breaks @font-face, img references, tile icons.
|
||||
cp -r "$SRC_DIR/config" "$TARGET_DIR/config"
|
||||
cp "$SRC_DIR/package.json" "$TARGET_DIR/package.json"
|
||||
cp "$SRC_DIR/pnpm-lock.yaml" "$TARGET_DIR/pnpm-lock.yaml"
|
||||
cp "$SRC_DIR/tsconfig.json" "$TARGET_DIR/tsconfig.json"
|
||||
@@ -45,6 +49,7 @@ cp "$SRC_DIR/playwright.config.ts" "$TARGET_DIR/playwright.config.ts"
|
||||
cp "$SRC_DIR/eslint.config.js" "$TARGET_DIR/eslint.config.js"
|
||||
cp "$SRC_DIR/Makefile" "$TARGET_DIR/Makefile"
|
||||
cp "$SRC_DIR/CLAUDE.md" "$TARGET_DIR/CLAUDE.md"
|
||||
cp "$SRC_DIR/AGENTS.md" "$TARGET_DIR/AGENTS.md"
|
||||
|
||||
# Dockerfile — use the SSR-specific one
|
||||
cp "$SRC_DIR/Dockerfile.react" "$TARGET_DIR/Dockerfile"
|
||||
|
||||
Reference in New Issue
Block a user