In the previous article Native ECMAScript modules - the first overview
and the current situation with the native ECMAScript modules implementation:
For now, we have 2 available implementations, which we tried and compared to the bundled module.
The main takeaways, so far, are:
- To execute a script or load an external file and execute it as a module use
.js extension cannot be omitted in the
import (the exact URL should be provided)
- the modules’ scope is not global and
this doesn’t refer to anything
- native modules are in the strict mode by default (not needed to provide
'use strict' anymore)
- module scripts are deferred by default (like
In this article, we are going to understand other differences with the bundled modules,
abilities to interact with the module scripts, how to rewrite Webpack modules to native ES ones
and other tips and tricks.