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
I dug into Typescript's source-code, and actually, if "target" is set to any of ["es6", "es2015", "es2016", "es2017", "esNext"], then "module" defaults to "es6".
The compiler-options reference page here shows the following: (the third column is for the "default")

This is inaccurate.
I dug into Typescript's source-code, and actually, if "target" is set to any of ["es6", "es2015", "es2016", "es2017", "esNext"], then "module" defaults to "es6".
Here are the files where this can be seen:
Enum declaration: (from: https://github.com/Microsoft/TypeScript/blob/ac72803bb2b299e6b331329a9781cb73cc55c156/src/compiler/core.ts#L1595)
Module default-value logic: (from: https://github.com/Microsoft/TypeScript/blob/73ee2feb51c9b7e24a29eb4cee19d7c14b933065/lib/tsserverlibrary.d.ts#L2117)
So the reference page should be updated to say "target >= ES6", not "target === ES6".
For reference, here is the issue on the ts-loader project where I discovered this mistake: TypeStrong/ts-loader#570 (comment)
The text was updated successfully, but these errors were encountered: