diff options
author | 2023-04-18 01:01:31 -0700 | |
---|---|---|
committer | 2023-04-18 01:01:31 -0700 | |
commit | d1de291b2a8cf2b2f4041741b77f12fec6cf40b6 (patch) | |
tree | a601e28005f04040ee226f2ad91cc881321930fc | |
parent | af96e8fcdd08d9bd2e84e7e8cc7fc404d683b4cc (diff) | |
download | bun-d1de291b2a8cf2b2f4041741b77f12fec6cf40b6.tar.gz bun-d1de291b2a8cf2b2f4041741b77f12fec6cf40b6.tar.zst bun-d1de291b2a8cf2b2f4041741b77f12fec6cf40b6.zip |
Fix the extremely annoying `./` requirement in bun build
-rw-r--r-- | src/bundler.zig | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/src/bundler.zig b/src/bundler.zig index 15bd2b584..6cf4ca044 100644 --- a/src/bundler.zig +++ b/src/bundler.zig @@ -404,19 +404,11 @@ pub const Bundler = struct { pub inline fn resolveEntryPoint(bundler: *Bundler, entry_point: string) anyerror!_resolver.Result { return bundler.resolver.resolve(bundler.fs.top_level_dir, entry_point, .entry_point) catch |err| { const has_dot_slash_form = !strings.hasPrefix(entry_point, "./") and brk: { - _ = bundler.resolver.resolve(bundler.fs.top_level_dir, try strings.append(bundler.allocator, "./", entry_point), .entry_point) catch break :brk false; - break :brk true; + return bundler.resolver.resolve(bundler.fs.top_level_dir, try strings.append(bundler.allocator, "./", entry_point), .entry_point) catch break :brk false; }; + _ = has_dot_slash_form; - if (has_dot_slash_form) { - bundler.log.addErrorFmt(null, logger.Loc.Empty, bundler.allocator, "{s} resolving \"{s}\". Did you mean: \"./{s}\"", .{ - @errorName(err), - entry_point, - entry_point, - }) catch unreachable; - } else { - bundler.log.addErrorFmt(null, logger.Loc.Empty, bundler.allocator, "{s} resolving \"{s}\" (entry point)", .{ @errorName(err), entry_point }) catch unreachable; - } + bundler.log.addErrorFmt(null, logger.Loc.Empty, bundler.allocator, "{s} resolving \"{s}\" (entry point)", .{ @errorName(err), entry_point }) catch unreachable; return err; }; |