mirror of
https://github.com/earendil-works/pi.git
synced 2026-09-28 05:54:43 +08:00
feat(coding-agent): reduce bundled startup work
This commit is contained in:
@@ -17,6 +17,7 @@ const banner = {
|
||||
};
|
||||
const allowedExternalPackages = new Set([
|
||||
"@silvia-odwyer/photon-node",
|
||||
"jiti",
|
||||
// Optional native accelerators. Their callers fall back to JavaScript when absent.
|
||||
"bufferutil",
|
||||
"utf-8-validate",
|
||||
@@ -24,6 +25,13 @@ const allowedExternalPackages = new Set([
|
||||
"supports-color",
|
||||
]);
|
||||
|
||||
const lazyJitiPlugin = {
|
||||
name: "lazy-jiti-transform",
|
||||
setup(build) {
|
||||
build.onResolve({ filter: /^jiti\/static$/ }, () => ({ external: true, path: "jiti" }));
|
||||
},
|
||||
};
|
||||
|
||||
function commonBuildOptions() {
|
||||
return {
|
||||
absWorkingDir: repoRoot,
|
||||
@@ -38,6 +46,10 @@ function commonBuildOptions() {
|
||||
minifySyntax: true,
|
||||
minifyWhitespace: true,
|
||||
platform: "node",
|
||||
// The source uses jiti/static so Bun embeds its Babel transform. The Node
|
||||
// package can use regular jiti from its direct dependency and load Babel
|
||||
// only when an extension actually needs transformation.
|
||||
plugins: [lazyJitiPlugin],
|
||||
sourcemap: false,
|
||||
target: "node22.19",
|
||||
// Do not apply the monorepo's source-oriented path aliases while bundling
|
||||
|
||||
Reference in New Issue
Block a user