📤 Deep resolve promises in objects.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

19 lines
582 B

// ex. scripts/build_npm.ts
import { build, emptyDir } from "https://deno.land/x/dnt@0.33.1/mod.ts";
import pkg from "./package.json" assert { type: "json" };
await emptyDir("./npm");
await build(
Object.assign({
entryPoints: ["./index.ts"],
outDir: "./npm",
shims: { deno: { test: true } },
package: Object.assign(pkg, { version: Deno.args[0] }),
}),
);
// post build steps
Deno.copyFileSync("LICENSE", "npm/LICENSE");
Deno.copyFileSync("README.md", "npm/README.md");
Deno.writeTextFileSync("npm/script/index.js", "module.exports = promiseObject;", { append: true });