The WIP content that was here is now live at http://typescriptlang.org/docs/handbook/modules/introduction.html
-
-
Save andrewbranch/79f872a8b9f0507c9c5f2641cfb3efa6 to your computer and use it in GitHub Desktop.
Module documentation
Thank you very much Andrew! This makes sense now.
See the reference section on nodenext for more details.
The link in this sentence is broken.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If all input sources in any TypeScript program are ESM, then
esModuleInterop
should be irrelevant. However, that’s not necessarily the situation you’re describing. The module system you’re targeting with your build is a bundler that can handle both ESM and CJS (inside dependencies), not a browser that can only handle ESM. If you have any node_modules at all, there’s a very good chance that some of them are CJS, and Vite will convert them to ESM before bundling. What Vite outputs is irrelevant to your TS module-related settings. So yes, you should still setesModuleInterop
in these cases. If you were writing ESM that you were going to ship straight to the browser unprocessed, thenesModuleInterop
would be irrelevant.