forked from ecklf/react-native-heroicons
-
Notifications
You must be signed in to change notification settings - Fork 0
/
compile.js
43 lines (35 loc) · 937 Bytes
/
compile.js
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
const { build } = require("esbuild");
const glob = require("tiny-glob");
const fs = require("fs/promises");
(async () => {
// solid
const solidEntryPoints = await glob("./src/solid/*.{ts,tsx}");
await build({
entryPoints: solidEntryPoints,
format: "cjs",
minify: true,
outdir: "./solid",
});
await build({
entryPoints: solidEntryPoints,
format: "esm",
minify: true,
outdir: "./solid/esm",
});
await fs.writeFile("./solid/package.json", `{"module": "./esm/index.js"}`);
// outline
const outlineEntryPoints = await glob("./src/outline/*.{ts,tsx}");
await build({
entryPoints: outlineEntryPoints,
format: "cjs",
minify: true,
outdir: "./outline",
});
await build({
entryPoints: outlineEntryPoints,
format: "esm",
minify: true,
outdir: "./outline/esm",
});
await fs.writeFile("./outline/package.json", `{"module": "./esm/index.js"}`);
})();