|
| 1 | +# Development Guide |
| 2 | + |
| 3 | +## Quick Start for Fast Development |
| 4 | + |
| 5 | +### Option 1: Automatic Watch Mode (Recommended) |
| 6 | + |
| 7 | +```bash |
| 8 | +npm run dev:all |
| 9 | +``` |
| 10 | + |
| 11 | +This runs both CSS and JS watchers simultaneously. |
| 12 | + |
| 13 | +### Option 2: Individual Watchers |
| 14 | + |
| 15 | +```bash |
| 16 | +# Terminal 1: Watch Tailwind CSS changes |
| 17 | +npm run dev:css |
| 18 | + |
| 19 | +# Terminal 2: Watch TypeScript/React changes |
| 20 | +npm run dev:fast |
| 21 | +``` |
| 22 | + |
| 23 | +### Option 3: JS Only (if CSS isn't changing) |
| 24 | + |
| 25 | +```bash |
| 26 | +npm run dev:fast |
| 27 | +``` |
| 28 | + |
| 29 | +## How to See Changes |
| 30 | + |
| 31 | +1. **Start the development server** using one of the options above |
| 32 | +2. **Load your extension** in Chrome (chrome://extensions/, enable Developer mode, load unpacked from `dist/` folder) |
| 33 | +3. **Make changes** to your code |
| 34 | +4. **Save the files** - Webpack will automatically rebuild |
| 35 | +5. **Refresh the extension** in Chrome: |
| 36 | + - Go to chrome://extensions/ |
| 37 | + - Click the refresh icon on your extension |
| 38 | + - OR use keyboard shortcut: Ctrl+R (Cmd+R on Mac) while popup is open |
| 39 | + |
| 40 | +## What Gets Rebuilt? |
| 41 | + |
| 42 | +- **CSS changes**: Only Tailwind CSS rebuilds (~100-500ms) |
| 43 | +- **React/TypeScript changes**: Only changed modules rebuild (~1-3s) |
| 44 | +- **Full rebuild**: Only on first run or major config changes |
| 45 | + |
| 46 | +## Chrome Extension Development Tips |
| 47 | + |
| 48 | +1. **Popup changes**: Save → Refresh extension → Click extension icon |
| 49 | +2. **Content script changes**: Save → Refresh extension → Reload Gmail tab |
| 50 | +3. **Background script changes**: Save → Refresh extension |
| 51 | +4. **Manifest changes**: Need to reload extension completely |
| 52 | + |
| 53 | +## Build Commands |
| 54 | + |
| 55 | +- `npm run dev` - Initial CSS build + watch mode |
| 56 | +- `npm run dev:fast` - Watch mode without CSS rebuild |
| 57 | +- `npm run dev:all` - Watch both CSS and JS simultaneously |
| 58 | +- `npm run build` - Production build |
| 59 | +- `npm run type-check` - TypeScript type checking |
| 60 | +- `npm run type-check:watch` - Continuous type checking |
0 commit comments