timarney / react-app-rewired

Override create-react-app webpack configs without ejecting
MIT License
9.77k stars 425 forks source link

add --help command line flag #578

Closed ZeeD closed 2 years ago

ZeeD commented 2 years ago

this project exposes a cli command react-app-rewired how do you use it? what are the parameters you can pass to configure it?

$ npx react-app-rewired
Unknown script "undefined".
Perhaps you need to update react-scripts?
See: https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md#updating-to-new-releases

$ npx react-app-rewired --help
Unknown script "--help".
Perhaps you need to update react-scripts?
See: https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md#updating-to-new-releases

$ npx react-app-rewired -h
Unknown script "-h".
Perhaps you need to update react-scripts?
See: https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md#updating-to-new-releases

$ npx react-app-rewired /?
Unknown script "/?".
Perhaps you need to update react-scripts?
See: https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md#updating-to-new-releases
dawnmist commented 2 years ago

The project also provides a README file, which has detailed instructions on how to use it. You should start there.

In terms of the actual command line "script" the messages above are talking about, the cli command replaces react-scripts in your project's build, test, and start scripts.

So they become:

scripts: {
  "build": "react-app-rewired build",
  "start": "react-app-rewired start",
  "test": "react-app-rewired test"
}

Note that it does NOT get used for the eject script. The whole point of react-app-rewired is to make it so that you don't have to eject a create-react-app project in order to tweak the webpack/jest configurations.

As far as I am aware, react-app-rewired is required to be installed. I don't believe it actually runs properly from npx, though I may be wrong in that.

ZeeD commented 2 years ago

the project is free software and on github (thanks, btw). I also have had access to the sources and viewed what actually is supported.

but when I run the program I don't want to have the need to look at the sources ... I think at least some support for cli run is needed

timarney commented 2 years ago

Closing this --- trying to keep this repo bare bones i.e it provides access to the config and leaves the rest up to the end user.