A modern template for building Chrome Extensions with Webpack, Bootstrap and good project structure.
- 🚀 Modern Chrome Extension Manifest V3
- ⚡️ Webpack 5 for bundling
- 🎨 Bootstrap 5 for UI components
- 📦 Environment configuration support
- 🔧 Hot reload during development
├── public/ # Static assets
│ ├── assets/ # Images, icons etc
│ ├── manifest.*.json # Environment specific manifests
│ └── style.css # Global styles
├── src/
│ ├── background.js # Service worker
│ ├── content.js # Content script
│ ├── modules/ # Extension pages
│ │ ├── popup/ # Popup UI
│ │ └── setting/ # Settings page
│ ├── services/ # API services
│ └── utils/ # Utility functions
└── webpack.config.js # Build configuration
- Clone this template:
git clone <repository-url>
cd chrome-extension-template
- Install dependencies:
npm install
- Create environment files:
cp .env.example .env.development
cp .env.example .env.production
- Create manifest files:
cp public/manifest.example.json public/manifest.development.json
cp public/manifest.example.json public/manifest.production.json
- Start development:
npm run dev
- Build for production:
npm run build
- Open Chrome and navigate to
chrome://extensions
- Enable "Developer mode"
- Click "Load unpacked" and select the
dist_development
folder
- Edit files in
src/
directory - Webpack will automatically rebuild when files change
- Refresh the extension in Chrome to see changes
- Create new components in
src/modules/
- Update manifest files if needed
- Import and use Bootstrap components
- Add any required permissions to manifest
- Update version in manifest.production.json
- Set production environment variables
- Run build command:
npm run build
- Upload
dist_production
folder to Chrome Web Store
Create two environment files:
.env.development
- Development settings.env.production
- Production settings
Example variables:
API_URL=https://api.example.com
DEBUG=true
Feel free to submit issues and pull requests to improve this template.