gale/scripts/assemble_files.ts

14 lines
919 B
TypeScript

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);
const index = await Load("index.html");
export const HTML = index.replace(
`</head>`,
`
<style>*{margin:0;padding:0;box-sizing:border-box;}html, body{height:100%;width:100%;font-family:Arial, sans-serif;line-height:1.6;}body{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;}img, video{max-width:100%;height:auto;}a{text-decoration:none;color:inherit;}ul, ol{list-style:none;}button, input, textarea{font-family:inherit;font-size:inherit;line-height:inherit;border:none;background:none;padding:0;margin:0;outline:none;}table{border-collapse:collapse;width:100%;}</style>
<script type="module" src="${Root+"dist/bundle_entry.js?hmr&map"}"></script>
</head>`);