Replicate exe imports in routes and static routes generator

Allow using dependencies added to main exe in views.
This commit is contained in:
Bob Farrell 2024-03-28 19:41:45 +00:00
parent d368850b1c
commit e4709e0c73

View File

@ -148,6 +148,12 @@ pub fn jetzigInit(b: *std.Build, exe: *std.Build.Step.Compile, options: JetzigIn
exe.root_module.addImport("routes", routes_module);
routes_module.addImport("jetzig", jetzig_module);
var it = exe.root_module.import_table.iterator();
while (it.next()) |import| {
routes_module.addImport(import.key_ptr.*, import.value_ptr.*);
exe_static_routes.root_module.addImport(import.key_ptr.*, import.value_ptr.*);
}
exe_static_routes.root_module.addImport("routes", routes_module);
exe_static_routes.root_module.addImport("jetzig", jetzig_module);
exe_static_routes.root_module.addImport("zmpl", zmpl_module);