Skip to content

Commit

Permalink
chore: add cjs build setup
Browse files Browse the repository at this point in the history
  • Loading branch information
ice-chillios committed Feb 12, 2025
1 parent b79c3d0 commit cbff77f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tools/builder/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export async function buildPackage({
}: Omit<BuildConfig, "entrypoints"> & {
entrypoints?: string[];
} = {}) {
const result = await Bun.build({
const buildOptions: BuildConfig = {
entrypoints,
outdir: "./dist",
minify: process.env.DEBUG !== "true",
Expand All @@ -16,7 +16,13 @@ export async function buildPackage({
splitting: true,
plugins: [...(plugins || [])],
...rest,
});
};

const result = await Bun.build(buildOptions);
// const resultCJS = await Bun.build({
// ...buildOptions,
// format: "cjs",
// });

if (!result.success) {
throw new AggregateError(result.logs, "Build failed");
Expand Down

0 comments on commit cbff77f

Please sign in to comment.