Disclaimer... this doesn't answer your question specifically, because what you want to do breaks with convention. Even if you manage to do it your way, I think you'll find the pain will outweigh the benefit.
The simplest way is to specify an outDir output directory. Your existing folder structure will be maintained in the output directory, with all the JavaScript and TypeScript kept cleanly separated.
{
"compilerOptions": {
"outDir": "./scripts",
...
}
}
So if you start with:
/component-a
index.ts
/component-b
index.ts
You'll end up with the folders mirrored in the output directory.
/component-a
index.ts
/component-b
index.ts
/scripts
/component-a
index.js
/component-b
index.js
Unless you plan to deploy both (?) you don't normally want the TypeScript and JavaScript intermingled.
tsconfig.jsonfile for each directory... EDIT: no that didn't work...