TypeScript: Unnamed default exports don't work with `--t es6 --m commonjs`
Compiling the following code:
"use strict";
export default class {};
Using the command line tsc --t es6 --m commonjs
produces illegal JavaScript:
"use strict";
class {
}
exports.default = default_1
;
I realize this is a weird combination of switches, however it seems necessary to target current versions of Node.js/V8 that don’t yet natively support ES6 modules.
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Comments: 29 (17 by maintainers)
Commits related to this issue
- Fix #5844 - add many new tests covering named/anonymous default exports — committed to weswigham/TypeScript by weswigham 9 years ago
- Merge pull request #5866 from weswigham/unnamed-default-exports Fix #5844 - add many new tests covering named/anonymous default exports — committed to microsoft/TypeScript by weswigham 9 years ago
General questions should be on StackOverflow, Gitter or IRC, but the following works: