This react app intialisation bash shell script automates some of the repetitive tasks that usually follow using the npx-create-react-app command. It features:
-
npx-create-react-app with dynamic app name input - you will be prompted by the script to enter a name for your app
-
Removes App.test.js, logo.svg and serviceworker.js from the
/srcdirectory -
Creates containers, components and redux directories in
/srcdirectory, and an App directory in/src/containers -
Moves App.js and App.css to
/src/containers/App -
Runs the command
code .to open the app root directory in VS Code.
Please note, for the script to open VS Code, you will need to install the code . command in PATH. To do this, please follow these instructions, Launching from the command line.
To use the script, copy the file ReactAppInitialisation.sh from this repo in to the directory where you would like to create the react app.
cd to that directory and run source ReactAppInitialisation.sh.