You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Files/modules that only contain interfaces, declarations, or type aliases (no real JS code) still produce *.js files.
One previous solution was to name all interface only files to *.d.ts and subsequently no JS file was generated, BUT neither is a copy of the *.d.ts file in the output directory. Therefore a second task had to be added to copy these files.
Another solution would be to keep all files as *.ts but find and delete empty files but this is tedious and difficult if you have header comments and source maps.
Optimally, *.ts files that simply do not contain any usable/importable JS (totally empty except comments) should have the option to be omitted from output.
The text was updated successfully, but these errors were encountered:
@jwbay thanks. I couldn't find the respective one. We can close this and reopen that.
I know there's "potential" side effects for having a module missing. But the compiler doesn't reference other modules if there's nothing used. It's not a huge issue in the end because it won't end up being used by either a module loader or included in bundles that have tree shaking. It's just more optimal that the TS compiler provide this feature than having to read the AST file and then delete offending files. :/
Files/modules that only contain interfaces, declarations, or type aliases (no real JS code) still produce
*.js
files.One previous solution was to name all interface only files to
*.d.ts
and subsequently no JS file was generated, BUT neither is a copy of the*.d.ts
file in the output directory. Therefore a second task had to be added to copy these files.Another solution would be to keep all files as
*.ts
but find and delete empty files but this is tedious and difficult if you have header comments and source maps.Optimally,
*.ts
files that simply do not contain any usable/importable JS (totally empty except comments) should have the option to be omitted from output.The text was updated successfully, but these errors were encountered: