f409a9edd7
- Bundle 31 JS files → single app.{hash}.js (oxc minifier)
- Bundle 36 CSS files → single app.{hash}.css (lightningcss)
- Resolve CSS @import chains at build time
- Inline theme-init.js to eliminate render-blocking script
- Minify all individual JS/CSS/JSON assets in static-dist/
- Auto-update Service Worker cache manifest with bundle hashes
- FNV hash-based cache-busting filenames
Results: 88 → 12 requests, 640 kB → 96.5 kB transferred (-85%)
Build modes:
- Debug: copies HTML to OUT_DIR, serves original static/
- Release: generates static-dist/ with processed assets
Also:
- Update Dockerfile to include build.rs in cacher stage
- Serve static-dist/ in release Docker builds
- Remove host static/ bind mount from docker-compose
- Switch include_str!() to OUT_DIR for all HTML pages
80 lines
1.2 KiB
Plaintext
Executable File
80 lines
1.2 KiB
Plaintext
Executable File
# Generated by Cargo
|
|
/target/
|
|
**/target/
|
|
|
|
# Processed static assets (generated by build.rs in release mode)
|
|
/static-dist/
|
|
|
|
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
|
|
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
|
|
# Cargo.lock
|
|
|
|
# These are backup files generated by rustfmt
|
|
**/*.rs.bk
|
|
|
|
# MSVC Windows builds of rustc generate these, which store debugging information
|
|
*.pdb
|
|
|
|
# Rust debug symbols
|
|
*.dSYM/
|
|
*.su
|
|
*.idb
|
|
|
|
# Build cache (keep .cargo/config.toml for project build settings)
|
|
.cargo/*
|
|
!.cargo/config.toml
|
|
|
|
# Visual Studio Code directory
|
|
.vscode/
|
|
|
|
# JetBrains IDEs
|
|
.idea/
|
|
|
|
# MacOS specific
|
|
.DS_Store
|
|
.AppleDouble
|
|
.LSOverride
|
|
|
|
# Linux specific
|
|
*~
|
|
.directory
|
|
.Trash-*
|
|
|
|
# Windows specific
|
|
Thumbs.db
|
|
ehthumbs.db
|
|
Desktop.ini
|
|
|
|
# Node.js (if used for frontend)
|
|
node_modules/
|
|
npm-debug.log
|
|
|
|
# Environment variables
|
|
.env
|
|
.env.local
|
|
.env.development.local
|
|
.env.test.local
|
|
.env.production.local
|
|
|
|
# Log files
|
|
*.log
|
|
logs/
|
|
|
|
# Storage data (user files, blobs — never commit)
|
|
storage/
|
|
|
|
# TLS certificates and private keys — NEVER commit
|
|
*.pem
|
|
*.key
|
|
*.p12
|
|
*.pfx
|
|
*.crt
|
|
*.csr
|
|
|
|
# Temporary files
|
|
*.tmp
|
|
*.bak
|
|
*.swp
|
|
*.swo
|
|
nohup.out
|