Skip to content

Provides a simple, no frills way to integrate react-refresh into your create-react-app using customize-cra.

Notifications You must be signed in to change notification settings

esetnik/customize-cra-react-refresh

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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());
  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.

About

Provides a simple, no frills way to integrate react-refresh into your create-react-app using customize-cra.

Resources

Stars

Watchers

Forks

Packages

No packages published