Bug Report
🔎 Search Terms
preProcessFile template string conditional expression
🕗 Version & Regression Information
- This is the behavior in every version I tried.
💻 Code
a ? `&${a}` : `#${b}`;
`import("${moduleSpecifier}").${id}`;
🙁 Actual behavior
{
referencedFiles: [],
typeReferenceDirectives: [],
libReferenceDirectives: [],
importedFiles: [ { fileName: '${moduleSpecifier}', pos: 32, end: 50 } ],
isLibFile: false,
ambientExternalModules: undefined
}
🙂 Expected behavior
{
referencedFiles: [],
typeReferenceDirectives: [],
libReferenceDirectives: [],
importedFiles: [],
isLibFile: false,
ambientExternalModules: undefined
}
This is somewhat similar to #47597 or #30878. I found this while fixing monaco for the module transform, which has a higher emit target that enables template strings. See: https://github.com/microsoft/TypeScript-Make-Monaco-Builds/actions/runs/3187364358/jobs/5198859864#step:7:343