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
.jsfiles below inscriptsfolder. -
Change your
package.jsonscriptssection:"scripts": { "start": "node ./scripts/react-scripts.js start", "build": "node ./scripts/react-scripts.js build", "test": "react-scripts test --env=jsdom" }
-
Create
.eslintrc.jsfor 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 ?