diff options
author | 2021-06-20 18:15:13 -0700 | |
---|---|---|
committer | 2021-06-20 18:15:13 -0700 | |
commit | d09194f05a372e3ed136aa288ae76cae8c1dc641 (patch) | |
tree | ab7e49f9793bc493d89274773d444ac59c0d3163 /src/node_module_bundle.zig | |
parent | 6fbfd696990e77020a3d7359fdcbc3e01de40a60 (diff) | |
download | bun-d09194f05a372e3ed136aa288ae76cae8c1dc641.tar.gz bun-d09194f05a372e3ed136aa288ae76cae8c1dc641.tar.zst bun-d09194f05a372e3ed136aa288ae76cae8c1dc641.zip |
Support live-reload and fallback
Former-commit-id: c3f9d77391589b65951616a632af87107fba469f
Diffstat (limited to 'src/node_module_bundle.zig')
-rw-r--r-- | src/node_module_bundle.zig | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/node_module_bundle.zig b/src/node_module_bundle.zig index 8642336e3..4605df2ef 100644 --- a/src/node_module_bundle.zig +++ b/src/node_module_bundle.zig @@ -36,6 +36,11 @@ pub const NodeModuleBundle = struct { pub const magic_bytes = "#!/usr/bin/env speedy\n\n"; threadlocal var jsbundle_prefix: [magic_bytes.len + 5]u8 = undefined; + // TODO: support preact-refresh, others by not hard coding + pub fn hasFastRefresh(this: *const NodeModuleBundle) bool { + return this.package_name_map.contains("react-refresh"); + } + pub fn loadPackageMap(this: *NodeModuleBundle) !void { this.package_name_map = PackageNameMap.init(this.allocator); var ids = PackageIDMap.init(this.allocator); |