diff options
author | 2021-06-06 18:34:01 -0700 | |
---|---|---|
committer | 2021-06-06 18:34:01 -0700 | |
commit | d49e0a5fa129152c27b70a57d1cc7a2af770577c (patch) | |
tree | 1ac581bda71fec5dfd09a6ab508a1adfca80b358 /src/options.zig | |
parent | e66466cc1a453db1370a199a32729441747761bb (diff) | |
download | bun-d49e0a5fa129152c27b70a57d1cc7a2af770577c.tar.gz bun-d49e0a5fa129152c27b70a57d1cc7a2af770577c.tar.zst bun-d49e0a5fa129152c27b70a57d1cc7a2af770577c.zip |
WIP node module bundles
Former-commit-id: 797b2ff557542e9d318c953b840b102695711888
Diffstat (limited to 'src/options.zig')
-rw-r--r-- | src/options.zig | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/options.zig b/src/options.zig index b68f753a3..fd44c9d0a 100644 --- a/src/options.zig +++ b/src/options.zig @@ -33,9 +33,11 @@ pub fn validatePath(log: *logger.Log, fs: *Fs.FileSystem.Implementation, cwd: st pub fn stringHashMapFromArrays(comptime t: type, allocator: *std.mem.Allocator, keys: anytype, values: anytype) !t { var hash_map = t.init(allocator); - try hash_map.ensureCapacity(@intCast(u32, keys.len)); - for (keys) |key, i| { - try hash_map.put(key, values[i]); + if (keys.len > 0) { + try hash_map.ensureCapacity(@intCast(u32, keys.len)); + for (keys) |key, i| { + try hash_map.put(key, values[i]); + } } return hash_map; @@ -508,6 +510,7 @@ pub const BundleOptions = struct { absolute_url, // omit file extension absolute_path, + package_path, }; pub const Defaults = struct { |