Introduction
What is petter-init?
petter-init is a npm package that scaffolds projects, with TailwindCSS configured, and ready-to-code. The tool is supposed to be a better initializer when you want to use TailwindCSS in your projects.
Why petter-init?
TailwindCSS is great for styling your website quickly. However, there are several steps to setting up TailwindCSS before you can start using it. This can be cumbersome in smaller projects, where you might just want to test something.
I decided to create petter-init after getting sick of setting up TailwindCSS for simple applications where I just wanted to try something. To my surprise, Fireship is also tired of configuring TailwindCSS.
How does it work?
petter-init will do the steps listed on tailwindcss framework guides for the selected framework and package manager.
- React and Vue projects are initialized with:
npm create vite@latest
npm create vite@latest
pnpm create vite@latest
pnpm create vite@latest
yarn create vite
yarn create vite
SvelteKit projects are initialized with:
npm create svelte@latest
npm create svelte@latest
pnpm create svelte@latest
pnpm create svelte@latest
yarn create svelte
yarn create svelte
- In your new project, petter-init runs:
npm install tailwindcss postcss autoprefixer
npm install tailwindcss postcss autoprefixer
pnpm install tailwindcss postcss autoprefixer
pnpm install tailwindcss postcss autoprefixer
yarn install tailwindcss postcss autoprefixer
yarn install tailwindcss postcss autoprefixer
- Copying necessary template files using
fs.copyFileSync
and removing boilerplate files.