Skip to content
Provides a simple, no frills way to integrate react-refresh into your create-react-app using customize-cra.
JavaScript
Branch: master
Clone or download
Latest commit 72f05aa Jan 13, 2020
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore initial import Jan 7, 2020
README.md Update README.md Jan 13, 2020
index.js initial import Jan 7, 2020
package.json 1.0.1 Jan 8, 2020

README.md

Description

Provides a simple, no frills way to integrate react-refresh into your create-react-app using customize-cra and @pmmmwh/react-refresh-webpack-plugin.

Installation

  1. Install dependencies

    npm install -D react-app-rewired customize-cra customize-cra-react-refresh
    
  2. Create or update your config-overrides.js

    const { override } = require("customize-cra");
    const { addReactRefresh } = require("customize-cra-react-refresh");
    
    /* config-overrides.js */
    module.exports = override(addReactRefresh({ disableRefreshCheck: true }));

    Note: disableRefreshCheck: true may be necessary. See #3 for more details.

  3. 'Flip' the existing calls to react-scripts in npm scripts for start, build and test

      /* package.json */
    
      "scripts": {
    -   "start": "react-scripts start",
    +   "start": "react-app-rewired start",
    -   "build": "react-scripts build",
    +   "build": "react-app-rewired build",
    -   "test": "react-scripts test --env=jsdom",
    +   "test": "react-app-rewired test --env=jsdom",
        "eject": "react-scripts eject"
    }

Credits

Original idea based on comment by @drather19.

You can’t perform that action at this time.