fix(packaging): use runtime filename for reproducible plugin bundles
This commit is contained in:
1 parent
3c1237ff31
commit
9d895866e6
3 files changed
+9
-2
No files matched your search
@@ -20,6 +20,7 @@ function run(args) {
|
||||
const mcpOutput = resolve(root, "dist/mcp/server.js");
|
||||
mkdirSync(dirname(mcpOutput), { recursive: true });
|
||||
// The shared CLI uses bun:sqlite; the plugin manifest must use this runtime too.
|
||||
run(["build", "src/server.ts", "--minify", "--target=bun", "--outfile", mcpOutput]);
|
||||
// Embedded CommonJS loaders must use the bundle path, not the build host's absolute checkout path.
|
||||
run(["build", "src/server.ts", "--minify", "--target=bun", "--define", "__filename=import.meta.path", "--outfile", mcpOutput]);
|
||||
writeFileSync(mcpOutput, readFileSync(mcpOutput, "utf8").replace(/[ \t]+$/gm, ""));
|
||||
console.log(`✓ Successfully bundled MCP server: ${mcpOutput}`);
|
||||
Reference in new issue
Block a user