-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild_npm.ts
47 lines (43 loc) · 1.27 KB
/
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
40
41
42
43
44
45
46
47
// ex. scripts/build_npm.ts
import { build, emptyDir } from "https://deno.land/x/[email protected]/mod.ts"
// import { copy } from "https://deno.land/[email protected]/fs/mod.ts"
await emptyDir("npm")
await build({
entryPoints: ["./mod.ts"],
outDir: "./npm",
shims: {
// see JS docs for overview and more options
deno: "dev",
blob: true,
crypto: true,
custom: [
{
package: {
name: "textencoder-ponyfill",
version: "1.0.2",
},
globalNames: ["TextEncoder", "TextDecoder"],
},
],
},
test: false,
rootTestDir: "./test",
package: {
// package.json properties
name: "rough_iptc",
version: Deno.args[0],
description: "Get IPTC data from PNG image",
license: "MIT",
repository: {
type: "git",
url: "git+https://github.com/ai-art-club/iptc.git",
},
bugs: {
url: "https://github.com/ai-art-club/iptc/issues",
},
},
})
// post build steps
Deno.copyFileSync("LICENSE", "npm/LICENSE")
Deno.copyFileSync("README.md", "npm/README.md")
await Deno.writeTextFile("npm/.npmignore", "esm/testdata/\nscript/test/\n", { append: true })