Home

Awesome

๐Ÿ™‹โ€โ™‚๏ธ Made by @thekitze

Other projects:

<a href="https://zerotoshipped.com"><img style="width:450px" src="https://i.ibb.co/WKQPDv5/twitter-image.jpg" alt="Zero To Shipped"></a>


โš ๏ธ This repo is deprecated.

Please use react-app-rewired if you want to customize CRA 1.
Please use customize-cra if you want to customize CRA 2.

โ˜ข custom-react-scripts โ˜ข

Latest version of original react-scripts: 1.1.14

โš ๏ธ Disclaimer:

This is not a fork of create-react-app. It's just a fork of react-scripts with simple babel/webpack modifications that can toggle extra features.

The reason for this fork's existence is explained better in this Medium article.

๐Ÿ’กFeatures:

*the features are optional and can be turned on/off individually

โ”How to use it

create-react-app my-app --scripts-version custom-react-scripts

Modify the .env file in the root of the generated project, and add any of the configuration options below ๐Ÿ‘‡ to enable that feature.

The generated project comes with every option turned on by default, but you can remove them at any time by removing the options from the .env file.

Adding to an existing project

npm uninstall --save react-scripts;
npm install --save custom-react-scripts;

Add a .env. file with the desired features.

๐Ÿ“ Configuration options

Styling

Note: to use modules the file must be named in the following format: $name.module.$preprocessorName.

For example styles.module.css or header.module.sass or footer.module.less, etc. Files that are not prefixed with module will be parsed normally.

Babel

Other

๐Ÿค” Why?

The create-react-app app doesn't allow user configuration and modifications for few reasons:

But people still want to use some of these features, and they're either ejecting their CRA app, or just don't use create-react-app because they're just missing X feature.

So instead of searching npm for a react-scripts fork with the X feature you need, this fork provides support for all of these extra features with simply adding a line in the .env config.

How does it work?

The CRA team recently added support for an .env file in the root of the generated CRA project.

From the original readme:

To define permanent environment vairables, create a file called .env in the root of your project: REACT_APP_SECRET_CODE=abcdef

I just added support for extra environment variables that actually turn on certain plugins, babel plugins, presets, and loaders in the webpack and babel configs of react-scripts.

Future plans

I will put all of my efforts into supporting this fork to be always on par with features with the newest create-react-app and react-scripts versions.