33// this script verifies the exported artifact as a second line of defense:
44// - out/ exists with the expected entry points
55// - no server runtime remnants are present in the artifact
6+ // - the custom domain (CNAME) is pinned and assets resolve from the site root
7+ // — no /RxInferBenchmarks.jl/ project-page prefix, which 404s on the custom
8+ // domain and leaves the page unstyled
69// Exits non-zero when the build is not a pure static export.
7- import { existsSync , readdirSync , statSync } from "node:fs" ;
10+ import { existsSync , readdirSync , readFileSync , statSync } from "node:fs" ;
811import { resolve , dirname , join } from "node:path" ;
912import { fileURLToPath } from "node:url" ;
1013
@@ -15,11 +18,22 @@ const failures = [];
1518if ( ! existsSync ( out ) ) {
1619 fail ( `out/ does not exist — run \`npm run build\` first (output: "export" must be set)` ) ;
1720} else {
18- for ( const required of [ "index.html" , "404.html" , ".nojekyll" ] ) {
21+ for ( const required of [ "index.html" , "404.html" , ".nojekyll" , "CNAME" ] ) {
1922 if ( ! existsSync ( join ( out , required ) ) ) {
2023 failures . push ( `missing required static file: out/${ required } ` ) ;
2124 }
2225 }
26+ // The site is served from the custom domain at the root. A project-page
27+ // basePath/assetPrefix would point assets at /RxInferBenchmarks.jl/_next/...,
28+ // which 404s on benchmarks.rxinfer.com (page renders without styles/JS).
29+ for ( const html of walk ( out ) . filter ( ( f ) => f . endsWith ( ".html" ) ) ) {
30+ if ( readFileSync ( html , "utf8" ) . includes ( "/RxInferBenchmarks.jl/_next/" ) ) {
31+ failures . push (
32+ `asset references a project-page basePath (/RxInferBenchmarks.jl/_next/) in ${ html } — ` +
33+ `the custom domain serves from "/"; remove basePath/assetPrefix in next.config.ts` ,
34+ ) ;
35+ }
36+ }
2337 // Server runtime remnants must never appear in a static export.
2438 const forbidden = [ "server" , "standalone" , "cache" , "BUILD_ID" ] . filter ( ( name ) =>
2539 existsSync ( join ( out , name ) ) ,
0 commit comments