Skip to content

Commit

Permalink
build: avoid bundling dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Feb 6, 2025
1 parent a65352f commit de43cd2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion scripts/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ import oxcResolver from "oxc-resolver";
import { rolldown } from "rolldown";
import { builtinModules } from "node:module";

import pkg from "../package.json" with { type: "json" };

const rootDir = fileURLToPath(new URL("../", import.meta.url));

const start = Date.now();
Expand Down Expand Up @@ -155,7 +157,11 @@ async function rolldownBuild(cwd: string, input: string, output: string) {
const res = await rolldown({
cwd,
input: input,
external: [...builtinModules, ...builtinModules.map((m) => `node:${m}`)],
external: [
...builtinModules,
...builtinModules.map((m) => `node:${m}`),
...Object.keys(pkg.dependencies),
],
});
await res.write({ file: output });
await res.close();
Expand Down

0 comments on commit de43cd2

Please sign in to comment.