Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[RFC] Migrate webpack-encore to ESM #1312

Open
Milestone
@stof

Description

@stof

More and more npm packages are shipping as ESM. In node, the compatibility between ESM and CommonJS has some limitation:

  • an ES module can import a CommonJS module
  • an ES module can dynamically import a CommonJS module
  • a CommonJS module cannot import an ES module (Node 22 has anexperimental feature allowing it for synchronous object graphs, i.e. ES modules that don't use top-level await)
  • a CommonJS module can dynamically import an ES module throughawait import(...) (but this can only be used in an async context)

Shipping Encore as a CommonJS module means that we cannot upgrade our dependencies to versions that have migrated to ESM (asEncore.getConfig() is a synchronous API, any solution requiring an async context is a no-go).

Migrating to ESM needs to be done in a new major version as it is a BC break for downstream projects. This will require writing thewebpack.config.js file in ESM, either by usingtype=module in the package.json or by usingwebpack.config.mjs instead (which is supported by webpack)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp