-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Emit __esModule
for every ES6 module emitted.
#13709
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Export |
so how can I configure to disable this emit? I get errors that exports is not defined. And I also see a few related tickets to other projects where this happens too. |
Dev Team think it works as intended, see the referecned bug for discussion. |
Can the emit be either: Object.defineProperty(exports || {}, "__esModule", { value: true }); or if( typeof exports !== 'undefined' ) Object.defineProperty(exports, "__esModule", { value: true }); ? |
@errorx666 why? |
@RyanCavanaugh I'm using SystemJS with commonjs modules. For a file that has neither imports nor exports, Currently working around this with export = void 0; at the bottom of each file. |
Same here, but I'm using rollup as a bundler. Not all setups result in a variable exports and this just breaks development for me. If I understand correctly this is only there as hack for running Typescript in node.js. And shouldn't it be |
any news on this? I also get the error that exports is not defined in my react app (electron). |
There seems to be a lot of debate on this in various issue threads, but the bottom line is that this change is totally wrecking the ability for a lot of people to upgrade to 2.2.x. If a file has no exports, why is this still being emitted? And if the TS team won't suppress this for files without exports, then at least make the ridiculously simply change to have it emit |
I'm using typescript together with Google Closure Compiler and |
In anticipation for change by the Node CTC to adopt ES6 modules, transpiled modules should all have the flag set. this gives an unambiguous way to know if this is a trsanspiled module of a plain old CJS module.
The text was updated successfully, but these errors were encountered: