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

feat(sample): add hmr with esm example#16078

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
shash-hq wants to merge1 commit intonestjs:master
base:master
Choose a base branch
Loading
fromshash-hq:fix/hmr-esm-support

Conversation

@shash-hq
Copy link
Contributor

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Other (Sample)

What is the current behavior?

Currently, there is no example showing how to configure Hot Module Replacement (HMR) in a project using ESM ("type": "module"). When users attempt to standard HMR recipe, they encounterrequire is not defined in ES module scope because the CLI usesrequire to load the webpack configuration.

Issue Number:#14331

What is the new behavior?

This PR addssample/36-hmr-esm, which demonstrates the correct configuration for HMR with ESM:

  1. Using"type": "module" inpackage.json.
  2. Renaming the configuration file towebpack-hmr.config.cjs to allowrequire via CommonJS.
  3. Configuringoutput.filename: 'main.cjs' in webpack to ensure correct runtime execution.

Does this PR introduce a breaking change?

  • Yes
  • No

@coveralls
Copy link

Pull Request Test Coverage Report forBuild 679b9e76-c7f0-409b-804d-eb7b51a7f2d0

Details

  • 0 of0 changed or added relevant lines in0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at89.666%

TotalsCoverage Status
Change from baseBuild eaf9b6b0-1f07-466d-8da5-2f41241edd3c:0.0%
Covered Lines:7401
Relevant Lines:8254

💛 -Coveralls

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@shash-hq@coveralls@kamilmysliwiec

[8]ページ先頭

©2009-2025 Movatter.jp