fix production build

This commit is contained in:
Samuel Newman
2026-05-25 17:20:16 +03:00
parent fd2147919d
commit 2415343512
7 changed files with 91 additions and 67 deletions
+3 -8
View File
@@ -6,17 +6,12 @@ test-coverage.out
/embedr
# Don't accidentally commit JS-generated code
static/js/*.js
static/js/*.map
static/js/*.js.LICENSE.txt
static/js/empty.txt
static/css/*.css
static/css/*.map
static/css/*.css.LICENSE.txt
static/css/empty.txt
static/_expo/
static/assets/
static/media/*.png
static/media/empty.txt
templates/scripts.html
templates/fonts.html
templates/*-embed.html
static/embed/*.html
static/embed/assets/*.js
+2 -2
View File
@@ -260,8 +260,8 @@ func serve(cctx *cli.Context) error {
path := c.Request().URL.Path
maxAge := 1 * (60 * 60) // default is 1 hour
// all assets in /static/js, /static/css, /static/media are content-hashed and can be cached for a long time
if strings.HasPrefix(path, "/static/js/") || strings.HasPrefix(path, "/static/css/") || strings.HasPrefix(path, "/static/media/") {
// all assets in /static/_expo, /static/assets, /static/media are content-hashed and can be cached for a long time
if strings.HasPrefix(path, "/static/_expo/") || strings.HasPrefix(path, "/static/assets/") || strings.HasPrefix(path, "/static/media/") {
maxAge = 365 * (60 * 60 * 24) // 1 year
}
+4 -1
View File
@@ -2,7 +2,10 @@ package bskyweb
import "embed"
//go:embed static/*
// `all:` disables the default exclusion of files/dirs beginning with `_` or `.`,
// which is needed because Metro emits chunks like `__common-...js` and
// `__expo-metro-runtime-...js`.
//go:embed all:static
var StaticFS embed.FS
//go:embed embedr-static/*
View File
+1 -15
View File
@@ -13,7 +13,7 @@
<!-- Hello Humans! API docs at https://atproto.com -->
<link rel="preload" as="font" type="font/woff2" href="{{ staticCDNHost }}/static/media/InterVariable.c504db5c06caaf7cdfba.woff2" crossorigin>
{% include "fonts.html" %}
<style>
/**
@@ -23,20 +23,6 @@
*
* THIS NEEDS TO BE DUPLICATED IN `bskyweb/templates/base.html`
*/
@font-face {
font-family: 'InterVariable';
src: url("{{ staticCDNHost }}/static/media/InterVariable.c504db5c06caaf7cdfba.woff2") format('woff2');
font-weight: 300 1000;
font-style: normal;
font-display: swap;
}
@font-face {
font-family: 'InterVariableItalic';
src: url("{{ staticCDNHost }}/static/media/InterVariable-Italic.01dcbad1bac635f9c9cd.woff2") format('woff2');
font-weight: 300 1000;
font-style: italic;
font-display: swap;
}
html,
body {
margin: 0px;