diff options
author | 2022-09-05 23:05:22 -0700 | |
---|---|---|
committer | 2022-09-05 23:05:22 -0700 | |
commit | 11aa17a57cc679d34e8e6f6f7aa665f565cb7305 (patch) | |
tree | ccb9a605cb4bcc42c6b2665ddbf8d04af72d94c7 /src/js_ast.zig | |
parent | d2397b60e79e4386c6a7b7a9783a6f8e379a5ae0 (diff) | |
download | bun-11aa17a57cc679d34e8e6f6f7aa665f565cb7305.tar.gz bun-11aa17a57cc679d34e8e6f6f7aa665f565cb7305.tar.zst bun-11aa17a57cc679d34e8e6f6f7aa665f565cb7305.zip |
Support async `onLoad` callbacks in `Bun.plugin`
Diffstat (limited to 'src/js_ast.zig')
-rw-r--r-- | src/js_ast.zig | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/js_ast.zig b/src/js_ast.zig index 7ff8476ac..30ebffaea 100644 --- a/src/js_ast.zig +++ b/src/js_ast.zig @@ -4391,7 +4391,10 @@ pub const Ast = struct { wrapper_ref: ?Ref = null, require_ref: Ref = Ref.None, + bun_plugin: BunPlugin = .{}, + bundle_namespace_ref: ?Ref = null, + prepend_part: ?Part = null, // These are used when bundling. They are filled in during the parser pass @@ -4520,6 +4523,7 @@ pub const Part = struct { cjs_imports, react_fast_refresh, dirname_filename, + bun_plugin, }; pub const SymbolUseMap = std.ArrayHashMapUnmanaged(Ref, Symbol.Use, RefHashCtx, false); @@ -4750,6 +4754,11 @@ pub fn printmem(comptime format: string, args: anytype) void { Output.print(format, args); } +pub const BunPlugin = struct { + ref: Ref = Ref.None, + hoisted_stmts: std.ArrayListUnmanaged(Stmt) = .{}, +}; + pub const Macro = struct { const JavaScript = @import("javascript_core"); const JSCBase = @import("./bun.js/base.zig"); |