1.8: -m system --outFile foo.js should recognize files without exports as modules #6313
Labels
Declined
The issue was declined as something which matches the TypeScript vision
Suggestion
An idea for TypeScript
Background: I come from tsify, which treats files as modules even if you don't export anything from them, if the file is imported from elsewhere in the project.
I am trying to use the new bundling feature implemented in #5090.
I am doing this:
We have .ts files that don't have any exports; module system is used to impose execution order. E.g.
if a.ts or b.ts doesn't have any exports, System.register() wrapper is not generated for them. Instead, they are dumped to top level of main.js, and are executed immediately when script is loaded.
Proposed solution: promote all files that are imported somewhere to modules, regardless of whether they have exports or not. This is feasible for --outFile, since the compiler has global knowledge of everything that ends up in the emitted output file.
The text was updated successfully, but these errors were encountered: