A collection of boilerplate templates for creating Chrome extensions with different tech stacks.
A modern template using React 18 with TypeScript and Tailwind CSS for styling.
- React 18 with TypeScript support
- Tailwind CSS for styling
- Webpack configuration
- ESLint and Prettier setup
- Popup, background, and content script examples
A lightweight template using TypeScript and Tailwind CSS.
- TypeScript support
- Tailwind CSS for styling
- Webpack configuration
- ESLint and Prettier setup
- Popup, background, and content script examples
-
Choose a template from the
templates
directory:react-tailwind/
for React + Tailwind CSStypescript-tailwind/
for TypeScript + Tailwind CSS
-
Copy the template to your new project:
cp -r templates/react-tailwind your-extension-name # or cp -r templates/typescript-tailwind your-extension-name
-
Navigate to your project directory:
cd your-extension-name
-
Install dependencies:
npm install
-
Start development:
npm run dev
-
Build for production:
npm run build
-
Load the extension in Chrome:
- Open Chrome and go to
chrome://extensions/
- Enable "Developer mode"
- Click "Load unpacked"
- Select the
dist
directory
- Open Chrome and go to
Each template follows a similar structure:
├── public/ # Static files
│ ├── manifest.json # Chrome extension manifest
│ ├── popup.html # Popup HTML file
│ └── icons/ # Extension icons
├── src/ # Source files
│ ├── popup.ts(x) # Popup script/component
│ ├── background.ts # Background script
│ ├── content.ts(x) # Content script/component
│ └── index.css # Global styles
├── package.json # Dependencies and scripts
├── webpack.config.cjs # Webpack configuration
├── tsconfig.json # TypeScript configuration
├── tailwind.config.js # Tailwind CSS configuration
└── postcss.config.cjs # PostCSS configuration
Each template includes the following npm scripts:
npm run dev
: Start development mode with hot reloadingnpm run build
: Build for productionnpm run watch
: Watch for changes and rebuildnpm run lint
: Run ESLintnpm run format
: Format code with Prettier
Feel free to:
- Submit issues and enhancement requests
- Create new templates for different tech stacks
- Improve existing templates
- Add new features to templates
This project is licensed under the MIT License - see the LICENSE file for details.