gale/scripts/assemble_files.ts

6 lines
485 B
TypeScript

const bundle = await fetch(import.meta.resolve("../dist/core.js")).then(r=>r.text());
const index = await fetch(import.meta.resolve("../dist/index.html")).then(r=>r.text());
export const HTML = index.replace(`</head>`, `<script>${bundle}</script></head>`);
export const Root = import.meta.resolve("../");
export const Load =async(file:string)=> await fetch(Root + file).then(resp=>resp.text());
export const Save =async(text:string, name:string)=> await Deno.writeTextFile(name, text);