feat(web): improve web build configuration and accessibility
- Add source maps and web renderer build arguments with defaults - Configure Caddy with CSP headers, cache policies, and service worker handling - Defer loading of import screen for performance optimization - Add semantic labels to icons for accessibility - Update web index.html with Swedish language, meta tags, and description - Add robots.txt and lighthouse configuration - Add new planning documents and archive entries
This commit is contained in:
+14
-5
@@ -14,11 +14,20 @@ RUN flutter gen-l10n
|
||||
# Run tests
|
||||
RUN flutter test
|
||||
|
||||
# Inject API base URL at build time via --dart-define.
|
||||
# Default to same-origin /api to avoid mixed-content in HTTPS deployments.
|
||||
ARG API_BASE_URL=/api
|
||||
RUN flutter build web --release \
|
||||
--dart-define=API_BASE_URL=${API_BASE_URL}
|
||||
# Inject API base URL at build time via --dart-define.
|
||||
# Default to same-origin /api to avoid mixed-content in HTTPS deployments.
|
||||
ARG API_BASE_URL=/api
|
||||
ARG SOURCE_MAPS=false
|
||||
ARG WEB_RENDERER=auto
|
||||
RUN set -eux; \
|
||||
build_args="--release --dart-define=API_BASE_URL=${API_BASE_URL}"; \
|
||||
if [ "${SOURCE_MAPS}" = "false" ]; then \
|
||||
build_args="${build_args} --no-source-maps"; \
|
||||
fi; \
|
||||
if [ "${WEB_RENDERER}" != "auto" ]; then \
|
||||
build_args="${build_args} --web-renderer=${WEB_RENDERER}"; \
|
||||
fi; \
|
||||
flutter build web ${build_args}
|
||||
|
||||
# Stage 2 – Serve with Caddy
|
||||
FROM caddy:alpine AS runner
|
||||
|
||||
Reference in New Issue
Block a user