Create manifest.config.ts with defineManifest, wire crx({ manifest }) in vite.config.ts
npm run dev (HMR for popup/options/content)
Load in Chrome: chrome://extensions → Load unpacked → select dist/
Development Tips
Task
Method
Debug Popup
Right-click icon → Inspect
Debug Background
Extensions page → Service worker
Debug Content
DevTools console on page
Hot Reload
npm run dev (CRXJS HMR)
Best Practices
Use type-safe messaging
Wrap Chrome APIs in promises
MV3 background is an ephemeral service worker — persist state in chrome.storage, not module globals; use event listeners + alarms, not long-lived timers
Minimize permissions
Scope content-script styles to avoid host-page bleed