diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/bun.js/api/filesystem_router.zig | 4 | ||||
-rw-r--r-- | src/bundler.zig | 9 |
2 files changed, 10 insertions, 3 deletions
diff --git a/src/bun.js/api/filesystem_router.zig b/src/bun.js/api/filesystem_router.zig index d1cec699e..41209f867 100644 --- a/src/bun.js/api/filesystem_router.zig +++ b/src/bun.js/api/filesystem_router.zig @@ -258,7 +258,7 @@ pub const FileSystemRouter = struct { .extensions = if (extensions.items.len > 0) extensions.items else default_extensions, .asset_prefix_path = asset_prefix_slice.slice(), }) catch unreachable; - router.loadRoutes(&log, root_dir_info, Resolver, &vm.bundler.resolver) catch { + router.loadRoutes(&log, root_dir_info, Resolver, &vm.bundler.resolver, router.config.dir) catch { globalThis.throwValue(log.toJS(globalThis, globalThis.allocator(), "loading routes")); origin_str.deinit(); arena.deinit(); @@ -324,7 +324,7 @@ pub const FileSystemRouter = struct { .extensions = allocator.dupe(string, this.router.config.extensions) catch unreachable, .asset_prefix_path = this.router.config.asset_prefix_path, }) catch unreachable; - router.loadRoutes(&log, root_dir_info, Resolver, &vm.bundler.resolver) catch { + router.loadRoutes(&log, root_dir_info, Resolver, &vm.bundler.resolver, router.config.dir) catch { globalThis.throwValue(log.toJS(globalThis, globalThis.allocator(), "loading routes")); arena.deinit(); diff --git a/src/bundler.zig b/src/bundler.zig index 84783cd70..01c23dac0 100644 --- a/src/bundler.zig +++ b/src/bundler.zig @@ -691,6 +691,7 @@ pub const Bundler = struct { dir_info, Resolver, &this.resolver, + this.fs.top_level_dir, ); this.router.?.routes.client_framework_enabled = this.options.isFrontendFrameworkEnabled(); return; @@ -703,7 +704,13 @@ pub const Bundler = struct { this.options.routes.dir = dir_info.abs_path; this.router = try Router.init(this.fs, this.allocator, this.options.routes); - try this.router.?.loadRoutes(this.log, dir_info, Resolver, &this.resolver); + try this.router.?.loadRoutes( + this.log, + dir_info, + Resolver, + &this.resolver, + this.fs.top_level_dir, + ); this.router.?.routes.client_framework_enabled = this.options.isFrontendFrameworkEnabled(); return; } |