create script for builing npm package

This commit is contained in:
Robin Chappatte
2024-06-21 22:43:56 +02:00
parent 1fbc9fb00f
commit 7b8fc5d6c5
2 changed files with 18 additions and 0 deletions

17
build-for-npm.ts Normal file
View File

@@ -0,0 +1,17 @@
import { build, emptyDir } from "https://deno.land/x/dnt@0.40.0/mod.ts";
await emptyDir("./npm");
await build({
entryPoints: ["./mod.ts"],
outDir: "./npm",
shims: {
// see JS docs for overview and more options
deno: true,
},
package: {
// package.json properties
name: "result",
version: Deno.args[0],
},
});