-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathesbuild.js
More file actions
50 lines (44 loc) · 1.08 KB
/
esbuild.js
File metadata and controls
50 lines (44 loc) · 1.08 KB
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
import esbuild from "esbuild";
import { nodeExternalsPlugin } from "esbuild-node-externals";
const common = {
bundle: true,
format: "esm",
logLevel: "info",
};
const nodeBuild = {
...common,
entryPoints: ["src/index.node.ts"],
outfile: "dist/index.js",
platform: "node",
target: ["node18"],
minify: false,
sourcemap: true,
plugins: [nodeExternalsPlugin()],
};
const vscodeBuild = {
...common,
entryPoints: ["src/index.vscode.ts"],
outfile: "dist/index.vscode.js",
platform: "node",
target: ["node18"],
minify: false,
sourcemap: true,
plugins: [nodeExternalsPlugin()],
};
const cliBuild = {
...common,
entryPoints: ["src/coba.tsx"],
outfile: "dist/coba.js",
platform: "node",
target: ["node20"],
minify: true,
keepNames: true,
sourcemap: false,
plugins: [nodeExternalsPlugin({ allowList: ["@langchain/ollama"] })],
};
await Promise.all([
esbuild.build(nodeBuild),
esbuild.build(vscodeBuild),
esbuild.build(cliBuild),
]);
console.log("Build completed.", process.env.NODE_ENV);