-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathesbuild.cjs
31 lines (27 loc) · 1.01 KB
/
esbuild.cjs
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
const esbuild = require("esbuild");
const { nativeNodeModulesPlugin } = require("esbuild-native-node-modules-plugin");
//const { dtsPlugin } = require("esbuild-plugin-d.ts");
const esbuildOptions = {
entryPoints: ["./src/app/cli/index.ts"],
bundle: true,
outdir: "build-es", //outfile: "sshell.js", // can use only dir or name
plugins: [nativeNodeModulesPlugin],
platform: 'node',
target: 'esnext',
treeShaking: true,
//minify: true,
};
esbuild.build(esbuildOptions).catch(() => process.exit(1));
// const esbuildLib = {
// entryPoints: ["./src/app/api/index.ts"],
// bundle: true,
// outdir: "dist",
// plugins: [nativeNodeModulesPlugin, dtsPlugin()],
// external: ['ssh2-sftp-client'],
// platform: 'node',
// format: 'esm',
// target: 'esnext',
// treeShaking: true,
// //minify: true,
// };
// esbuild.build(esbuildLib).catch(() => process.exit(1)); // TODO: this is really slow, and doesn't build the single d.ts file