A CLI tool to create a Next.js project with the configurations I prefer.
I had to add/remove/update same files and packages everytime I made a project which added a little friction just to start working on a project. This project aims to remove the friction, but by adding/removing/updating only required files and packages, thus keeping the project simple to start with.
Note: This will not include configurations for packages like Redux, React Query, etc. as they are project specific and should be configured separately.
- Next.js (updates to files)
- TSConfig (with configuration for path aliases)
- ESLint (with prettier plugins)
- Prettier
- TailwindCSS (optional)
- SCSS (optional)
- Clone the project
git clone https://github.com/PiyushPawar17/create-next-project.git
- Move into the project and install it globally
cd create-next-project
npm i -g
- Create a directory with your project and move into it
mkdir my-next-app
cd my-next-app
- Run globally available
cnp
command
cnp [flags]
Command | Description |
---|---|
cnp |
Creates a Next.js project. Adds ESLint and Pretter. Removes api directory, styles for home page. Updates global styles, tsconfig, pages/index.tsx and pages/_app.tsx . |
Flags | Description |
---|---|
--tailwind or -t |
Adds TailwindCSS to the project. Updates global styles to include tailwind utilities. |
--sass or -s |
Adds SCSS to the project. Updates CSS files to SCSS. |
See templates
directory for the current configurations
- Update the file(s) for which you want to use your configuration
- Re-install the project globally using
npm i -g
while been in the project - To add additional templates, add your template file and check
utils/scripts.js
where the logic for using template exist
- Already a lot of packages/templates are available
- It will not be customizable for everyone if they want to customize
Note: The project is only been tested on windows as of now
- If you find any bugs or want to suggest updates to the template, create an issue
- If you want to make a Pull Request, avoid changes to the templates as those are based on my preferences
See License