├── README.md └── run.sh /README.md: -------------------------------------------------------------------------------- 1 | ## Create React App - TailwindCSS Starter Generator 2 | A simple shell script that uses create-react-app to create a React Project and configures tailwindcss on top of it. 3 | ### Usage 4 | Clone the repo, or copy the run.sh script and then run with bash or any other shell: 5 | ```bash 6 | bash run.sh name_of_your_project 7 | ``` 8 | ### LICENSE 9 | MIT 10 | -------------------------------------------------------------------------------- /run.sh: -------------------------------------------------------------------------------- 1 | if ! command -v npx 2 | then 3 | echo "npx is required to be installed for this script" 4 | exit 5 | fi 6 | 7 | echo "Creating a new project using create-react-app" 8 | npx create-react-app $1 9 | cd $1 10 | 11 | echo "Adding tailwindcss, postcss and autoprefixer as a dependency" 12 | npm add -D tailwindcss postcss autoprefixer 13 | npx tailwindcss init -p 14 | 15 | echo "Configuring valid files glob for tailwindcss.config.js" 16 | cat < tailwind.config.js 17 | module.exports = { 18 | content: [ 19 | "./src/**/*.{js,jsx,ts,tsx}", 20 | ], 21 | theme: { 22 | extend: {}, 23 | }, 24 | plugins: [], 25 | } 26 | EOT 27 | 28 | echo "Configuring src/index.css" 29 | cat < src/index.css 30 | @tailwind base; 31 | @tailwind components; 32 | @tailwind utilities; 33 | EOT 34 | 35 | sed -i '' 's|||' src/App.js --------------------------------------------------------------------------------