Until now it's hard to custom facebookincubator/create-react-app without npm eject
.
-
Add a new folder in your project named
scripts
. -
Put three
.js
files below inscripts
folder. -
Change your
package.json
scripts
section:"scripts": { "start": "node ./scripts/react-scripts.js start", "build": "node ./scripts/react-scripts.js build", "test": "react-scripts test --env=jsdom" }
-
Create
.eslintrc.js
for yourself.
When you run react-scripts start
. react-scripts.js
will find ../scripts/start.js
and run it. This why we put them into scripts
folder.
Before react-scripts.js
run the real start.js
. We require and modify webpack config. That's all we done.
How about react-app-rewired ?