Skip to content

Make web-test-runner and web-dev-server pure ESM packages #1642

Open
@web-padawan

Description

@web-padawan

Motivation

Once Node.js 16 becomes LTS, it will become a third LTS version with native ES modules support.

Some maintainers have already started migrating their packages to be pure ES modules.
See the gist for an explanation of what it a pure ESM package.

In practice, it means that we drop support for CommonJS and drop support for older node versions (10.x).

Dependencies

Making @web packages pure ES modules would enable us to use dependencies that are pure ES modules too:

There might be other dependencies that get major bumps with dropping support for CommonJS in future.

Proposed solution

  1. Update "exports" field to remove "require" entrypoints for all affected packages
  2. Add "type": "module" to package.json to indicate packages are pure ES modules
  3. Maybe also a few other tweaks, see How can I move my CommonJS project to ESM?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions