Home > Net >  Difference between module es2015 vs es2020
Difference between module es2015 vs es2020

Time:10-24

What is the difference between module es2015 and es2020 option in tsconfig?

In oher words, is there any difference if I use es2015 modules and configure the module option to es2015 or es2020?

ts-config:

{
/* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */
  module: 'es2015'
}

vs

{
  ...
  "module": "es2020"
  ...
}

I do not want the target or lib difference.

CodePudding user response:

From the documentation for that option:

If you are wondering about the difference between ES2015 (aka ES6) and ES2020, ES2020 adds support for dynamic imports, and import.meta.

  • Related