Microbundle: esm: What version of Javascript?

Created on 29 May 2020  路  2Comments  路  Source: developit/microbundle

When my modules are compiled to esm. What version of Javascript is that? Is it ES5? How can I find out?

Thanks

Most helpful comment

It's in ES5 because the ecosystem has no standardised way to specify the JS version the code was authored in.

All 2 comments

It's in ES5 because the ecosystem has no standardised way to specify the JS version the code was authored in.

Also of note: the modern format is ESM but using ES2017 ** instead of ES5.

** Specifically, it's the ES2017 features that were implemented in browsers when they shipped <script type=module> support. That means the modern bundle produced by Microbundle should support these browsers without modification:

  • Chrome 61+
  • Firefox 60+
  • Safari 10.3+ (10.1+ mobile)
  • Edge 16+
    (and the Opera/Brave/etc versions corresponding to Chrome 61)

You can read more about why this version choice makes sense at @babel/preset-modules.

Was this page helpful?
0 / 5 - 0 ratings