Skip to content

Nestjs example configuration error when using build #257

@andrewfung729

Description

@andrewfung729

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",

npm run 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'],
  },

...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions