-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.js
More file actions
executable file
·32 lines (30 loc) · 809 Bytes
/
Copy pathbuild.js
File metadata and controls
executable file
·32 lines (30 loc) · 809 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
const fs = require("fs-extra");
const { esbuildPluginTsc } = require("esbuild-plugin-tsc");
const _ = require("lodash");
const { build } = require("esbuild");
const glob = require("tiny-glob");
const localPkgJson = fs.readJsonSync("./package.json");
async function main() {
let entryPoints = await glob("./src/**/*", { filesOnly: true });
console.log(entryPoints);
build({
entryPoints: ["./src/index.ts"],
outdir: "out",
bundle: true,
plugins: [],
platform: "node",
minify: false,
target: ["node16"],
format: "cjs",
plugins: [esbuildPluginTsc()],
external: _.difference(
Object.keys({
...(localPkgJson.dependencies || {}),
...(localPkgJson.devDependencies || {}),
...(localPkgJson.peerDependencies || {}),
}),
["is-what"]
),
});
}
main().catch(console.error);