Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HMR API exist in production build #4300

Closed
Tracked by #4327
JSerFeng opened this issue Oct 11, 2023 · 2 comments
Closed
Tracked by #4327

HMR API exist in production build #4300

JSerFeng opened this issue Oct 11, 2023 · 2 comments
Labels
bug Something isn't working stale team The issue/pr is created by the member of Rspack.

Comments

@JSerFeng
Copy link
Collaborator

System Info

System:
OS: macOS 14.0
CPU: (10) arm64 Apple M1 Max
Memory: 2.40 GB / 64.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 18.14.0 - ~/.nvm/versions/node/v18.14.0/bin/node
Yarn: 1.22.19 - ~/.nvm/versions/node/v18.14.0/bin/yarn
npm: 9.3.1 - ~/.nvm/versions/node/v18.14.0/bin/npm
pnpm: 8.6.9 - ~/.nvm/versions/node/v18.14.0/bin/pnpm
Browsers:
Chrome: 117.0.5938.149
Safari: 17.0
npmPackages:
@rspack/cli: ^0.3.6 => 0.3.6

Details

import.meta.hot and import.meta.webpackHot exist in production build.

input:

if (import.meta.hot) {
  import.meta.hot.accept();
}
if (import.meta.webpackHot) {
  import.meta.webpackHot.accept();
}
if (module.hot) {
  module.hot.accept()
}

webpack output:

if (false) {}
if (false) {}
if (false) {}

rspack output

if (undefined) undefined();
if (import.meta.webpackHot) import.meta.webpackHot.accept();
if (module.hot) module.hot.accept();

Reproduce link

https://github.com/JSerFeng/rspack-issues

Reproduce Steps

pnpm i

see the differences between pnpm run build:webpack and pnpm run build:rspack

@JSerFeng JSerFeng added bug Something isn't working pending triage The issue/PR is currently untouched. labels Oct 11, 2023
@github-actions github-actions bot added the team The issue/pr is created by the member of Rspack. label Oct 11, 2023
@ahabhgk ahabhgk added p2-signifincant and removed pending triage The issue/PR is currently untouched. labels Oct 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working stale team The issue/pr is created by the member of Rspack.
Projects
None yet
Development

No branches or pull requests

3 participants