Support reading embedded files in compiled executables (#3405)

* Support reading embedded files in compiled executables

* 💅

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
This commit is contained in:
Jarred Sumner
2023-06-25 16:32:27 -07:00
committed by GitHub
parent 3ed28f2828
commit fdfbb18531
7 changed files with 123 additions and 16 deletions

View File

@@ -593,7 +593,10 @@ pub const VirtualMachine = struct {
pub inline fn nodeFS(this: *VirtualMachine) *Node.NodeFS {
return this.node_fs orelse brk: {
this.node_fs = bun.default_allocator.create(Node.NodeFS) catch unreachable;
this.node_fs.?.* = Node.NodeFS{};
this.node_fs.?.* = Node.NodeFS{
// only used when standalone module graph is enabled
.vm = if (this.standalone_module_graph != null) this else null,
};
break :brk this.node_fs.?;
};
}