Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Turbopack dev/build: Ignore empty tsconfig/jsconfig #69795

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions test/turbopack-build-tests-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -12686,10 +12686,10 @@
"runtimeError": false
},
"test/integration/jsconfig-empty/test/index.test.js": {
"passed": [],
"failed": [
"passed": [
"Empty JSConfig Support production mode should compile successfully"
],
"failed": [],
"pending": [],
"flakey": [],
"runtimeError": false
Expand Down Expand Up @@ -15264,11 +15264,10 @@
"tsconfig.json verifier allows you to set target mode",
"tsconfig.json verifier allows you to set verbatimModuleSyntax true via extends without adding isolatedModules",
"tsconfig.json verifier allows you to set verbatimModuleSyntax true without adding isolatedModules",
"tsconfig.json verifier creates compilerOptions when you extend another config"
],
"failed": [
"tsconfig.json verifier creates compilerOptions when you extend another config",
"tsconfig.json verifier Works with an empty tsconfig.json (docs)"
],
"failed": [],
"pending": [
"tsconfig.json verifier allows you to skip moduleResolution, esModuleInterop and resolveJsonModule when using \"module: preserve\""
],
Expand Down
7 changes: 7 additions & 0 deletions turbopack/crates/turbopack-resolve/src/typescript.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@ pub async fn read_tsconfigs(
let mut configs = Vec::new();
let resolve_options = json_only(resolve_options);
loop {
// tsc ignores empty config files.
if let FileContent::Content(file) = &*data.await? {
if file.content().is_empty() {
break;
}
}

let parsed_data = data.parse_json_with_comments();
match &*parsed_data.await? {
FileJsonContent::Unparseable(e) => {
Expand Down
Loading