You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
statue/_build.ts

15 lines
528 B
TypeScript

import { bundle } from "./build_deps/emit.ts";
import { ensureDir } from "./build_deps/fs.ts";
export const build = async (sourceMap = false) => {
const b = await bundle("frontend/main.ts", {
compilerOptions: {
inlineSourceMap: sourceMap,
},
});
await ensureDir("./build");
await Deno.writeTextFile("./build/frontend.ts", `export const frontend = ${JSON.stringify(b.code)};`);
await Deno.writeTextFile("./build/style.ts", `export const style = ${JSON.stringify(await Deno.readTextFile("frontend/style.css"))}`)
};