diff --git a/.gitignore b/.gitignore index 6704566..6f5f0b5 100644 --- a/.gitignore +++ b/.gitignore @@ -77,6 +77,7 @@ typings/ # Next.js build output .next +.vercel # Nuxt.js build / generate output .nuxt diff --git a/README.md b/README.md index 670aaf9..c58b8ff 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,54 @@ # next-tailwind-fontawesome An example setup using Next.js, Tailwind CSS and Font Awesome. + +# Development + +To get started with development, follow these steps. + +Install dependencies: + +```bash +yarn +``` + +Start the development server: + +```bash +yarn dev +``` + +Open a browser to http://localhost:3000. As you make changes to the code, the browser will automatically update. + +# Cloudflare + +This project is configured to deploy to Cloudflare Pages Site. + +## Testing + +To test the production build locally, follow these steps. + +Build the website: + +```bash +yarn build:ci +``` + +Run wrangler to browser the website: + +```bash +yarn dev:ci +``` + +Open a browser to http://127.0.0.1:8788. + +# Template + +To use this repository as a template, after creating a new repository, complete the following steps. + +Configure the repository secrets, by going to Settings > Secrets and variables > Actions and adding the `FONTAWESOME_NPM_AUTH_TOKEN` secret. + +Follow the steps at [Cloudflare Docs > Pages > Deploy a Next.js site > Use the Edge Runtime](https://developers.cloudflare.com/pages/framework-guides/deploy-a-nextjs-site/#use-the-edge-runtime), with the following considerations: + +- The Edge Runtime has already been setup on `app/api/features` and `app/ssr`. +- Yarn has been pinned to v1.22.19 using `packageManager` in `package.json`. diff --git a/package.json b/package.json index 0d973e6..655d75a 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,9 @@ }, "scripts": { "build": "next build", + "build:ci": "yarn next-on-pages", "dev": "next dev", + "dev:ci": "npx wrangler pages dev .vercel/output/static --compatibility-flag=nodejs_compat", "lint": "next lint", "pre-commit": "next lint", "prepare": "husky install",