-
Notifications
You must be signed in to change notification settings - Fork 89
/
Copy pathesbuild.config.js
38 lines (35 loc) · 972 Bytes
/
esbuild.config.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
import config from "@stackflow/esbuild-config";
import { context } from "esbuild";
import pkg from "./package.json" assert { type: "json" };
const watch = process.argv.includes("--watch");
const external = Object.keys({
...pkg.dependencies,
...pkg.peerDependencies,
});
Promise.all([
context({
...config({
entryPoints: ["./src/stackflow/stackflow.docs.ts"],
outdir: "./dist/stackflow",
vanillaExtractExternal: ["@seed-design"],
}),
format: "cjs",
external,
}).then((ctx) =>
watch ? ctx.watch() : ctx.rebuild().then(() => ctx.dispose()),
),
context({
...config({
entryPoints: ["./src/stackflow/stackflow.docs.ts"],
outdir: "./dist/stackflow",
vanillaExtractExternal: ["@seed-design"],
}),
format: "esm",
outExtension: {
".js": ".mjs",
},
external,
}).then((ctx) =>
watch ? ctx.watch() : ctx.rebuild().then(() => ctx.dispose()),
),
]).catch(() => process.exit(1));