-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.ts
42 lines (36 loc) · 994 Bytes
/
build.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
import { build, emptyDir } from "@deno/dnt";
await emptyDir("./dist");
interface Config {
name: string;
version: string;
compilerOptions: { [key: string]: boolean };
}
const jsrJson = await Deno.readTextFile("./deno.json");
const config: Config = JSON.parse(jsrJson);
await build({
entryPoints: ["./index.ts"],
outDir: "./dist",
shims: {
deno: true,
},
compilerOptions: config.compilerOptions,
package: {
// package.json properties
name: config.name,
version: config.version,
description: "Typing errors without custom error class.",
license: "MIT",
repository: {
type: "git",
url: "git://github.com/nakanoasaservice/tagged-error.git",
},
bugs: {
url: "https://github.com/nakanoasaservice/tagged-error/issues",
},
},
postBuild() {
// steps to run after building and before running the tests
Deno.copyFileSync("LICENSE", "dist/LICENSE");
Deno.copyFileSync("README.md", "dist/README.md");
},
});