Description
I am very green with regard to Typescript (as I have only started converting our Javascript codebase), but have been "bitten" by the same problem described in Issue 41513.
I initially posted a similar question on StackOverflow, and found my own (not-very-elegant) solution.
What I (and apparently others) would really like to see is a compiler switch such as:
tsc --noGeneratedExports
Regardless of the compiler option / switch name, the effect would be that tsc would NOT emit statements such as the following (which appear at the top of a Javascript file):
Object.defineProperty(exports, "__esModule", { value: true });
... or the following, which appear at the end of a Javascript file:
export {};
In both cases above, when trying to load the resulting Javascript LOCALLY (from the file system) -- the browser will throw an exception.
Having a compiler option that outputs Javascript that can be loaded into a browser locally would eliminate the need for a module bundler and/or local web server.
Thanks in advance for your consideration.