Position
https://github.com/rspack-contrib/rstack-examples/blob/main/rspack/nestjs/rspack.config.js
How to reproduce
The package.json: "build": "cross-env BUILD=true rspack build",
Error: [HMR] Hot Module Replacement is disabled.
My workarround
build mode does not import @rspack/core/hot/poll?100
const isProduction = process.env.BUILD === 'true';
/** @type {import('@rspack/cli').Configuration} */
const config = {
context: __dirname,
target: 'node',
entry: {
main: isProduction
? './src/main.ts'
: ['@rspack/core/hot/poll?100', './src/main.ts'],
},
...