-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathbuild.ts
More file actions
28 lines (27 loc) · 722 Bytes
/
build.ts
File metadata and controls
28 lines (27 loc) · 722 Bytes
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
import * as esbuild from "esbuild";
import copyPlugin from "esbuild/copy";
import { denoPlugins } from "esbuild/loader";
import { path } from "./deps.ts";
await esbuild.build({
entryPoints: ["./src/main.ts"],
plugins: [
...denoPlugins({
configPath: path.resolve("./deno.jsonc"),
}),
copyPlugin({
baseDir: "./",
baseOutDir: "./dist",
files: [
{ from: ".env.example", to: ".env.example" },
{ from: "scripts/*", to: "scripts/[name][ext]" },
{ from: "static/*", to: "static/[name][ext]" },
],
}),
],
bundle: true,
sourcemap: true,
outfile: "./dist/main.esm.js",
minify: true,
format: "esm",
});
esbuild.stop();