react-app-rewire-preact

1.0.1 • Public • Published

Create your React app using create-react-app my-app or use an CRA app

Rewire it

1) Install react-app-rewired + react-app-rewire-preact

npm install react-app-rewired react-app-rewire-preact --save

2) Create a config-overrides.js file in the root directory

const rewirePreact = require('react-app-rewire-preact');
 
/* config-overrides.js */
module.exports = function override(config, env) {
  config = rewirePreact(config, env);
  return config;
}

Sample Structure

+-- your-project
|   +-- config-overrides.js
|   +-- node_modules
|   +-- package.json
|   +-- public
|   +-- README.md
|   +-- src

3) 'Flip' the existing the npm run scripts for start and build

/* package.json */

"scripts": {
    "start": "react-app-rewired start",
    "build": "react-app-rewired build"
  }

4) Start the Dev Server

$ npm run build

Dependencies (2)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i react-app-rewire-preact

    Weekly Downloads

    46

    Version

    1.0.1

    License

    MIT

    Last publish

    Collaborators

    • timarney