-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.ts
35 lines (32 loc) · 867 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
import * as esbuild from "npm:[email protected]";
import { denoPlugins } from "jsr:@luca/esbuild-deno-loader@^0.11";
import { emptyDir } from "jsr:@std/fs/empty-dir";
import { resolve, toFileUrl } from "jsr:@std/path";
import packageJson from "./package.json" with { type: "json" };
await emptyDir("./dist");
const result = await esbuild.build<esbuild.BuildOptions>({
plugins: [
...denoPlugins({
loader: "portable",
importMapURL: toFileUrl(resolve("./deno.jsonc")).toString(),
}),
],
platform: "browser",
entryPoints: { "docsify-kroki": "./src/index.ts" },
outdir: "./dist/",
bundle: true,
minify: true,
banner: {
js: `
/*!
* docsify-kroki
* v${packageJson.version}
* https://github.com/zuisong/docsify-kroki
* (c) 2020-${new Date().getFullYear()} zuisong
* MIT license
*/
`.trim(),
},
format: "esm",
});
esbuild.stop();