File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ export let assetServer = createAssetServer({
1818 "app/data/**" ,
1919 "app/middleware/**" ,
2020 ] ,
21+ fingerprint : isDevelopment ? undefined : { buildId : getBuildId ( ) } ,
2122 sourceMaps : isDevelopment ? "external" : undefined ,
2223 minify : ! isDevelopment ,
2324 scripts : {
@@ -29,3 +30,13 @@ export let assetServer = createAssetServer({
2930 } ,
3031 watch : false ,
3132} ) ;
33+
34+ function getBuildId ( ) {
35+ let buildId = process . env . ASSET_BUILD_ID || process . env . FLY_IMAGE_REF ;
36+ if ( ! buildId ) {
37+ throw new Error (
38+ "ASSET_BUILD_ID or FLY_IMAGE_REF is required for production asset fingerprinting" ,
39+ ) ;
40+ }
41+ return buildId ;
42+ }
Original file line number Diff line number Diff line change 1818 "push:stage" : " git tag -f stage && git push origin stage -f" ,
1919 "browser" : " playwright-cli" ,
2020 "start" : " cross-env NODE_ENV=production node --import remix/node-tsx server.ts" ,
21- "preview" : " cross-env NODE_ENV=production node --env-file=.env --import remix/node-tsx server.ts" ,
21+ "preview" : " cross-env NODE_ENV=production ASSET_BUILD_ID=local-preview node --env-file=.env --import remix/node-tsx server.ts" ,
2222 "lint" : " oxlint ." ,
2323 "lint:fix" : " oxlint . --fix" ,
2424 "pretest" : " pnpm run build:css" ,
You can’t perform that action at this time.
0 commit comments