Skip to content

Commit d077130

Browse files
authored
refactor(init): avoid network request for downloading of favicon (#2867)
1 parent 7aec5a2 commit d077130

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

init/src/init.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -391,14 +391,12 @@ ${GRADIENT_CSS}`;
391391
<path d="M14.297 16.49c.985-.747 1.644-1.01 2.099-2.526.566.121.841-.08 1.29-.701.324.466 1.657.608 2.453.701-.715.451-1.057.852-1.452 2.106-1.464-.611-3.167-.302-4.39.42Z" fill="#fff"/>
392392
</svg>`;
393393
await writeFile("static/logo.svg", STATIC_LOGO);
394-
395-
try {
396-
const res = await fetch("https://fresh.deno.dev/favicon.ico");
397-
const buf = await res.arrayBuffer();
398-
await writeFile("static/favicon.ico", new Uint8Array(buf));
399-
} catch {
400-
// Skip this and be silent if there is a network issue.
401-
}
394+
await writeFile(
395+
"static/favicon.ico",
396+
await Deno.readFile(
397+
new URL(import.meta.resolve("../../www/static/favicon.ico")),
398+
),
399+
);
402400

403401
const MAIN_TS = `import { App, fsRoutes, staticFiles } from "fresh";
404402
import { define, type State } from "./utils.ts";

0 commit comments

Comments
 (0)