Skip to content

.mjs support #5686

@graingert

Description

@graingert

Do you want to request a feature or report a bug?
Feature request

What is the current behavior?
Can't import .mjs files without extra configuration.

What is the expected behavior?
.jsm nodules are supported 'out of the box' also some changes to the module parsing/resolution apply:

  • require, define and module.exports are ignored and passed through unchanged.
  • can only import cjs exports as esm default export
  • can only import using the file file extension. (All imports must be URLs)

If this is a feature request, what is motivation or use case for changing the behavior?
Comparability with nodejs
Please mention other relevant information such as the browser version, Node.js version, webpack version and Operating System.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions