ECMAScript modules

The standard JavaScript module system, written with import and export statements, used by browsers and modern tools.

In more detail

ESM stands for ECMAScript modules. Imports are static, so bundlers can see which exports are unused and remove them. Packages often ship ESM files with a .mjs extension alongside CommonJS for older consumers.

Example

import { useState } from "react";

Related terms

Taught in

References