-
Notifications
You must be signed in to change notification settings - Fork 32
Expand file tree
/
Copy pathesbuild.config.mjs
More file actions
51 lines (46 loc) · 915 Bytes
/
esbuild.config.mjs
File metadata and controls
51 lines (46 loc) · 915 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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import { build } from "esbuild";
import { copy } from "esbuild-plugin-copy";
const copyPlugin = copy({
assets: [
{
from: ["./src/register/register-strip.mjs"],
to: ["."],
},
{
from: ["./src/register/register-transform.mjs"],
to: ["."],
},
{
from: ["./lib/LICENSE", "./lib/package.json"],
to: ["."],
},
],
});
await build({
entryPoints: ["src/index.ts"],
bundle: true,
platform: "node",
target: "node22",
outfile: "dist/index.js",
plugins: [copyPlugin],
});
await build({
entryPoints: ["src/errors.ts"],
platform: "node",
target: "node22",
outfile: "dist/errors.js",
});
await build({
entryPoints: ["src/strip-loader.ts"],
bundle: false,
outfile: "dist/strip-loader.js",
platform: "node",
target: "node22",
});
await build({
entryPoints: ["src/transform-loader.ts"],
bundle: false,
outfile: "dist/transform-loader.js",
platform: "node",
target: "node22",
});