diff --git a/src/cli/run_command.zig b/src/cli/run_command.zig index a09dcb0e8f82d7..6195e22d80ce61 100644 --- a/src/cli/run_command.zig +++ b/src/cli/run_command.zig @@ -1397,6 +1397,10 @@ pub const RunCommand = struct { // setup + if (!ctx.debug.loaded_bunfig) { + bun.CLI.Arguments.loadConfigPath(ctx.allocator, true, "bunfig.toml", ctx, .RunCommand) catch {}; + } + const force_using_bun = ctx.debug.run_in_bun; var ORIGINAL_PATH: string = ""; var this_transpiler: transpiler.Transpiler = undefined; @@ -1404,10 +1408,6 @@ pub const RunCommand = struct { try configurePathForRun(ctx, root_dir_info, &this_transpiler, &ORIGINAL_PATH, root_dir_info.abs_path, force_using_bun); this_transpiler.env.map.put("npm_command", "run-script") catch unreachable; - if (!ctx.debug.loaded_bunfig) { - bun.CLI.Arguments.loadConfigPath(ctx.allocator, true, "bunfig.toml", ctx, .RunCommand) catch {}; - } - // check for empty command if (target_name.len == 0) {