diff options
author | 2022-04-11 01:44:22 -0700 | |
---|---|---|
committer | 2022-04-11 01:44:22 -0700 | |
commit | c6393bcd27b376ec07d7d9b8606791b4db33fcaf (patch) | |
tree | b4045617da7d25447f75fad3b22fa90a7adf4728 | |
parent | 7d164ad8c7e7718c6a9e77ec8dbfcb86530b000c (diff) | |
download | bun-c6393bcd27b376ec07d7d9b8606791b4db33fcaf.tar.gz bun-c6393bcd27b376ec07d7d9b8606791b4db33fcaf.tar.zst bun-c6393bcd27b376ec07d7d9b8606791b4db33fcaf.zip |
:scissors: dead code
-rw-r--r-- | src/bundler.zig | 3 | ||||
-rw-r--r-- | src/http.zig | 58 |
2 files changed, 12 insertions, 49 deletions
diff --git a/src/bundler.zig b/src/bundler.zig index 6eb2e9d03..486d38595 100644 --- a/src/bundler.zig +++ b/src/bundler.zig @@ -3020,11 +3020,8 @@ pub const Bundler = struct { pub fn buildFile( bundler: *ThisBundler, log: *logger.Log, - _: std.mem.Allocator, path_to_use_: string, - _: string, comptime client_entry_point_enabled: bool, - comptime _: bool, ) !ServeResult { var old_log = bundler.log; diff --git a/src/http.zig b/src/http.zig index 1948cdecf..068bfa356 100644 --- a/src/http.zig +++ b/src/http.zig @@ -2965,8 +2965,7 @@ pub const RequestContext = struct { } if (input_path.len == 0) return ctx.sendNotFound(); - const pathname = Fs.PathName.init(input_path); - const result = ctx.buildFile(input_path, pathname.ext) catch |err| { + const result = ctx.buildFile(input_path) catch |err| { if (err == error.ModuleNotFound) { return try ctx.sendNotFound(); } @@ -3075,7 +3074,6 @@ pub const RequestContext = struct { .GET, .HEAD => { const result = try ctx.buildFile( ctx.url.path["abs:".len..], - ctx.url.extname, ); try @call(.{ .modifier = .always_inline }, RequestContext.renderServeResult, .{ ctx, result }); }, @@ -3129,53 +3127,24 @@ pub const RequestContext = struct { return false; } - pub inline fn buildFile(ctx: *RequestContext, path_name: string, extname: string) !bundler.ServeResult { + pub inline fn buildFile(ctx: *RequestContext, path_name: string) !bundler.ServeResult { if (ctx.bundler.options.isFrontendFrameworkEnabled()) { - if (serve_as_package_path) { - return try ctx.bundler.buildFile( - &ctx.log, - ctx.allocator, - path_name, - extname, - true, - true, - ); - } else { - return try ctx.bundler.buildFile( - &ctx.log, - ctx.allocator, - path_name, - extname, - true, - false, - ); - } + return try ctx.bundler.buildFile( + &ctx.log, + path_name, + true, + ); } else { - if (serve_as_package_path) { - return try ctx.bundler.buildFile( - &ctx.log, - ctx.allocator, - path_name, - extname, - false, - true, - ); - } else { - return try ctx.bundler.buildFile( - &ctx.log, - ctx.allocator, - path_name, - extname, - false, - false, - ); - } + return try ctx.bundler.buildFile( + &ctx.log, + path_name, + false, + ); } } pub fn handleGet(ctx: *RequestContext) !void { const result = try ctx.buildFile( ctx.url.pathWithoutAssetPrefix(ctx.bundler.options.routes.asset_prefix_path), - ctx.url.extname, ); try @call(.{ .modifier = .always_inline }, RequestContext.renderServeResult, .{ ctx, result }); } @@ -3191,7 +3160,6 @@ pub const RequestContext = struct { } } }; -var serve_as_package_path = false; // // u32 == File ID from Watcher // pub const WatcherBuildChannel = sync.Channel(u32, .Dynamic); @@ -3972,8 +3940,6 @@ pub const Server = struct { const tsconfig = dir_info.tsconfig_json orelse return; Analytics.Features.tsconfig = true; - - serve_as_package_path = tsconfig.base_url_for_paths.len > 0 or tsconfig.base_url.len > 0; Analytics.Features.tsconfig_paths = tsconfig.paths.count() > 0; } |