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@latestnpm create vite@latestpnpm create vite@latestpnpm create vite@latestyarn create viteyarn create viteSvelteKit projects are initialized with:
npm create svelte@latestnpm create svelte@latestpnpm create svelte@latestpnpm create svelte@latestyarn create svelteyarn create svelte- In your new project, petter-init runs:
npm install tailwindcss postcss autoprefixernpm install tailwindcss postcss autoprefixerpnpm install tailwindcss postcss autoprefixerpnpm install tailwindcss postcss autoprefixeryarn install tailwindcss postcss autoprefixeryarn install tailwindcss postcss autoprefixer- Copying necessary template files using
fs.copyFileSyncand removing boilerplate files.