forked from denoland/deno_graph
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_build_npm.ts
39 lines (36 loc) · 980 Bytes
/
_build_npm.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import { build, emptyDir } from "https://deno.land/x/[email protected]/mod.ts";
await emptyDir("./npm");
Deno.mkdirSync("npm/esm/lib", { recursive: true });
Deno.mkdirSync("npm/script/lib", { recursive: true });
// todo(dsherret): don't include this twice
Deno.copyFileSync(
"lib/deno_graph_wasm_bg.wasm",
"npm/esm/lib/deno_graph_wasm_bg.wasm",
);
Deno.copyFileSync(
"lib/deno_graph_wasm_bg.wasm",
"npm/script/lib/deno_graph_wasm_bg.wasm",
);
await build({
entryPoints: ["./mod.ts"],
outDir: "./npm",
shims: {
deno: true,
undici: true,
},
package: {
name: "@deno/graph",
version: Deno.args[0],
description: "The module graph logic for Deno CLI.",
license: "MIT",
repository: {
type: "git",
url: "git+https://github.com/deno/deno_graph.git",
},
bugs: {
url: "https://github.com/deno/deno_graph/issues",
},
},
});
Deno.copyFileSync("LICENSE", "npm/LICENSE");
Deno.copyFileSync("README.md", "npm/README.md");