8000 GitHub - tw-statics/react-app-rewired: Configure the unconfigurable, override create-react-app webpack configs.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

tw-statics/react-app-rewired

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

59 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-app-rewired

Rewire Your App

Tweak the create-react-app webpack config(s) without using 'eject' and without creating a fork of the react-scripts.

All the benefits of create-react-app without the limitations of "no config". You can add plugins, loaders whatever you need.

All you have to do is create your app using create-react-app and then rewire it.

⚠️ Please Note:

By doing this you're breaking the "guarantees" that CRA provides. That is to say you now "own" the configs. No support will be provided. Proceed with caution.

How to rewire your create-react-app project

1) Install react-app-rewired

$ npm install react-app-rewired --save

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

/* config-overrides.js */
module.exports = function override(config, env) {
  //do stuff with the webpack config...
  return config;
}

View the examples -> MobX using decorators, CSS Modules, Preact, Inferno, Sass etc...

+-- 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 start

5) Build your app

$ npm run build

#Contribute

If you would like to contribute examples / use cases please submit a PR that follows the other examples

#More Info - on Why this project exists.

See: Create React App — But I don’t wanna Eject.

About

Configure the unconfigurable, override create-react-app webpack configs.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%
0