File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -33,16 +33,27 @@ function llamaCppBuildPlugin() {
3333 return ;
3434 }
3535
36- // Read, normalize line endings, and prefix with guide banner
3736 let content = readFileSync ( indexPath , 'utf-8' ) ;
3837
38+ const faviconPath = resolve ( 'static/favicon.svg' ) ;
39+ if ( existsSync ( faviconPath ) ) {
40+ const faviconContent = readFileSync ( faviconPath , 'utf-8' ) ;
41+ const faviconBase64 = Buffer . from ( faviconContent ) . toString ( 'base64' ) ;
42+ const faviconDataUrl = `data:image/svg+xml;base64,${ faviconBase64 } ` ;
43+
44+ content = content . replace (
45+ / h r e f = " [ ^ " ] * f a v i c o n \. s v g " / g,
46+ `href="${ faviconDataUrl } "`
47+ ) ;
48+
49+ console . log ( '✓ Inlined favicon.svg as base64 data URL' ) ;
50+ }
51+
3952 content = content . replace ( / \r / g, '' ) ;
4053 content = GUIDE_FOR_FRONTEND + '\n' + content ;
4154
42- // Gzip with fflate (level 9) and normalize header for reproducibility
4355 const compressed = fflate . gzipSync ( Buffer . from ( content , 'utf-8' ) , { level : 9 } ) ;
4456
45- // Zero gzip mtime and OS bytes for deterministic output
4657 compressed [ 0x4 ] = 0 ;
4758 compressed [ 0x5 ] = 0 ;
4859 compressed [ 0x6 ] = 0 ;
You can’t perform that action at this time.
0 commit comments