Nx: HMR for @nrwl/react

Created on 24 Sep 2019  路  7Comments  路  Source: nrwl/nx

How to enable HMR for @nrwl/react. Is it possible to achieve it without custom webpack.config.json? (Like in Angular)

There should be something in docs for HMR.

In workspace.json "hmr": true

"serve": {
          "builder": "@nrwl/web:dev-server",
          "options": {
            "hmr": true,
            "buildTarget": "testapp:build"
          },
          "configurations": {
            "production": {
              "buildTarget": "testapp:build:production"
            }
          }

Expected Behavior

module.hot should not be undefined

Current Behavior

HMR doesn麓t work.

Context

    "@nrwl/cypress": "8.5.1",
    "@nrwl/eslint-plugin-nx": "8.5.1",
    "@nrwl/jest": "8.5.1",
    "@nrwl/react": "8.5.1",
    "@nrwl/web": "8.5.1",
    "@nrwl/workspace": "8.5.1",
react feature

Most helpful comment

So, as...

We have decided to wait until there is a webpack solution for React Fast Refresh solution for Webpack and we'll implement HMR for our React projects with that when it arrives

All 7 comments

Hi, sorry about this.

This was mislabeled as stale. We are testing ways to mark _not reproducible_ issues as stale so that we can focus on actionable items but our initial experiment was too broad and unintentionally labeled this issue as stale.

So, as...

We have decided to wait until there is a webpack solution for React Fast Refresh solution for Webpack and we'll implement HMR for our React projects with that when it arrives

Makes sense! Thx

Hi @BigAB! Seems like webpack is now supported 馃槃 . Here is a copy-paste of the current state in https://github.com/gaearon/react-hot-loader

Thanks!

Create react app 4.0 now also released with Fast Refresh using this plugin: https://github.com/pmmmwh/react-refresh-webpack-plugin/issues/1

any update on this?

@BigAB Wondering if there is any news here? This would be a great improvement for the nrwl react community 馃檪

Thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

SWGeekPD picture SWGeekPD  路  3Comments

Koslun picture Koslun  路  3Comments

danieldanielecki picture danieldanielecki  路  3Comments

vimalraj-a picture vimalraj-a  路  3Comments

zachnewburgh picture zachnewburgh  路  3Comments