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.
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.
$ npm install react-app-rewired --save-dev
/* config-overrides.js */
module.exports = function override(config, env) {
//do stuff with the webpack config...
return config;
}
+-- your-project
| +-- config-overrides.js
| +-- node_modules
| +-- package.json
| +-- public
| +-- README.md
| +-- src
Note: You can use one of the default rewires (see the packages dir):
$ npm install --save react-app-rewire-sass
const rewireSass = require('react-app-rewire-sass');
/* config-overrides.js */
module.exports = function override(config, env) {
config = rewireSass(config, env);
return config;
}
/* package.json */
"scripts": {
"start": "react-app-rewired start",
"build": "react-app-rewired build",
"test": "react-app-rewired test --env=jsdom"
}
$ npm start
$ npm run build
#More Info - on Why this project exists.