https://github.com/acehubert/react-scripts-configs
override react-scripts config
https://github.com/acehubert/react-scripts-configs
override react-scripts
Last synced: 11 months ago
JSON representation
override react-scripts config
- Host: GitHub
- URL: https://github.com/acehubert/react-scripts-configs
- Owner: aceHubert
- License: mit
- Created: 2018-05-18T09:53:50.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-10-16T02:54:35.000Z (over 7 years ago)
- Last Synced: 2024-08-09T18:56:25.595Z (over 1 year ago)
- Topics: override, react-scripts
- Homepage:
- Size: 8.79 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# react-scripts-configs
override react-scripts config
## Installation
```bash
yarn add react-scripts-configs
```
### Usage
add "override-config.js" and "override-paths.js" to root directory
```bash
//override-config.js
//or
//override-config.dev.js/override-config.prod.js/override-config.test.js
module.exports = (config, env) => {
//env:development | production | test
if(env==='test'){
//JestConfig
return config
}
//WebpackConfig
return config;
}
```
```bash
//override-paths.js
module.exports = (paths)=>{
//appBuild: 'build',
//appPublic: 'public',
//appHtml: 'public/index.html',
//appIndexJs: 'src/index.js',
//appPackageJson: 'package.json',
//appSrc: 'src',
return paths;
}
```
then update "scripts" section in package.json
```bash
//package.json
"scripts": {
"start": "react-scripts-configs start",
"build": "react-scripts-configs build",
"test": "react-scripts-configs test",
}
```
## LICENSE
[MIT](https://choosealicense.com/licenses/mit/)