mirror of
https://github.com/oven-sh/bun
synced 2026-02-02 15:08:46 +00:00
Introduce high-performance native addon API in Bun.build, starting with build.onBeforeParse hook (#14971)
Co-authored-by: Zack Radisic <56137411+zackradisic@users.noreply.github.com> Co-authored-by: zackradisic <zackradisic@users.noreply.github.com>
This commit is contained in:
@@ -414,6 +414,15 @@ pub fn addBunObject(b: *Build, opts: *BunBuildOptions) *Compile {
|
||||
}
|
||||
addInternalPackages(b, obj, opts);
|
||||
obj.root_module.addImport("build_options", opts.buildOptionsModule(b));
|
||||
|
||||
const translate_plugin_api = b.addTranslateC(.{
|
||||
.root_source_file = b.path("./packages/bun-native-bundler-plugin-api/bundler_plugin.h"),
|
||||
.target = opts.target,
|
||||
.optimize = opts.optimize,
|
||||
.link_libc = true,
|
||||
});
|
||||
obj.root_module.addImport("bun-native-bundler-plugin-api", translate_plugin_api.createModule());
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user