[bun run] don't parse tsconfig.json for package.json scripts

This commit is contained in:
Jarred Sumner
2023-09-12 01:58:01 -07:00
parent 2b92d94b4d
commit 41237c874a
3 changed files with 7 additions and 2 deletions

View File

@@ -482,6 +482,10 @@ pub const RunCommand = struct {
this_bundler.resolver.care_about_bin_folder = true;
this_bundler.resolver.care_about_scripts = true;
this_bundler.resolver.opts.load_tsconfig_json = false;
this_bundler.options.load_tsconfig_json = false;
this_bundler.configureLinker();
var root_dir_info = this_bundler.resolver.readDirInfo(this_bundler.fs.top_level_dir) catch |err| {
@@ -500,7 +504,7 @@ pub const RunCommand = struct {
} else {
ctx.log.printForLogLevelWithEnableAnsiColors(Output.errorWriter(), false) catch {};
}
Output.prettyErrorln("Error loading current directory", .{});
Output.prettyErrorln("error loading current directory", .{});
Output.flush();
return error.CouldntReadCurrentDirectory;
};

View File

@@ -1419,6 +1419,7 @@ pub const BundleOptions = struct {
transform_options: Api.TransformOptions,
polyfill_node_globals: bool = false,
transform_only: bool = false,
load_tsconfig_json: bool = true,
rewrite_jest_for_tests: bool = false,

View File

@@ -3840,7 +3840,7 @@ pub const Resolver = struct {
}
// Record if this directory has a tsconfig.json or jsconfig.json file
{
if (r.opts.load_tsconfig_json) {
var tsconfig_path: ?string = null;
if (r.opts.tsconfig_override == null) {
if (entries.getComptimeQuery("tsconfig.json")) |lookup| {