Skip to content

Instantly share code, notes, and snippets.

@paulwongx
Last active June 5, 2023 22:46
Show Gist options
  • Save paulwongx/94091a80d89e9e641f404e36e11d5c22 to your computer and use it in GitHub Desktop.
Save paulwongx/94091a80d89e9e641f404e36e11d5c22 to your computer and use it in GitHub Desktop.
Standard Operating Procedures

Turborepo

Creating a new app with tailwindcss

  1. cd apps
  2. npx create-next-app@latest
  3. Add globals.css inside apps
  4. Change .eslintrc.json to .eslintrc.js
module.exports = {
  root: true,
  extends: ["custom"],
};
  1. Delete .gitignore (only keep one global file)
  2. Update package.json to import from local packages
    1. dependencies
      1. "ui": "*"
    2. devDependencies
      1. "eslint-config-custom": "*",
      2. "tailwind-config": "*",
      3. "tsconfig": "*",
  3. Update tailwind.config.js to include files to compile
/** @type {import('tailwindcss').Config} */
const sharedConfig = require('tailwind-config');

module.exports = {
  ...sharedConfig,
  content: [
    './app/**/*.{js,ts,jsx,tsx,mdx}',
    './components/**/*.{js,ts,jsx,tsx,mdx}',
    '../../packages/ui/**/*.{js,ts,jsx,tsx,mdx}'
  ]
}
  1. Update next.config.js to include files to transpile
/** @type {import('next').NextConfig} */
const nextConfig = {
  reactStrictMode: true,
  transpilePackages: ["ui", "tailwind-config"],
}

module.exports = nextConfig
  1. Update tsconfig.json
{
	"extends": "tsconfig/nextjs.json",
	"compilerOptions": {
		"plugins": [
			{
				"name": "next"
			}
		],
		"paths": {
			"@/*": ["./*"]
		}
	},
	"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
	"exclude": ["node_modules"]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment