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
If some doesn't have 'import', the tsc doesn't generate Object.defineProperty(exports, "__esModule", { value: true });.
import type looks standing for not generating import or code for module system in js but currently Object.defineProperty(exports, "__esModule", { value: true }); is generated.
🔎 Search Terms
In issues and on Google searched with '__esModule import type' and '__esModule generated even if import type'
🕗 Version & Regression Information
typescript: 4.1.3
This is not a crash
⏯ Playground Link
Please ignore the compile error. I don't know what module can I use on the playground.
I'm pretty sure this is the same as #41513. By having an import statement you're making your file a module, and as a result you have a related exports statement in your compiled file. This behavior was introduced with 4.0, and the old behavior in TypeScript 3.9 is considered a bug.
Bug (or bad specification) Report
If some doesn't have 'import', the tsc doesn't generate
Object.defineProperty(exports, "__esModule", { value: true });
.import type
looks standing for not generating import or code for module system in js but currentlyObject.defineProperty(exports, "__esModule", { value: true });
is generated.🔎 Search Terms
In issues and on Google searched with '__esModule import type' and '__esModule generated even if import type'
🕗 Version & Regression Information
typescript: 4.1.3
⏯ Playground Link
Please ignore the compile error. I don't know what module can I use on the playground.
Playground link with relevant code
💻 Code
🙁 Actual behavior
exports code below:
🙂 Expected behavior
exports code below:
This can be a problem if I want to write ts without tools like WebPack.
The text was updated successfully, but these errors were encountered: