Packaging
How to produce a distributable build and prepare it for submission to the Chrome Web Store (or other MV3-compatible stores).
1. Prepare the Production Build
Run the production build script to generate optimized assets in dist/.
pnpm build:prod
Production build characteristics:
- Minified JavaScript & CSS
- Deterministic filenames (no hashes) for manifest references
- Manifest version automatically injected from
package.json - Icons, locales, and assets copied to the output directory
Verify the build folder looks like:
dist/
├── manifest.json
├── popup.html
├── options.html
├── popup.{js,css}
├── options.{js,css}
├── content.{js,css}
├── static/js/background.js
├── icons/
└── _locales/
2. Validate the Build Locally
- Open
chrome://extensions/ - Enable Developer mode
- Click Load unpacked and select the
dist/directory - Exercise key flows:
- Popup interactions
- Options page updates
- Content script injection
- Background alarms and messaging
- Inspect the console for errors
3. Run Automated Checks
Before packaging, ensure the project passes formatting, tests, and type checks.
pnpm lint
pnpm test
(Optional) Run coverage:
pnpm test:cov
4. Update Version & Changelog
- Bump
versioninpackage.json(semver) - The build pipeline copies this value into
dist/manifest.json - Update
CHANGELOG.mdor release notes document (if applicable)
5. Create the ZIP Archive
Use the dist/ folder contents to generate a ZIP file.
cd dist
zip -r ../chrome-extension-starter-v1.4.0.zip .
cd ..
Guidelines:
- Archive the files inside
dist/, not the folder itself (Chrome expects files at root of zip) - Avoid OS metadata files (e.g.,
.DS_Store)
6. Manual Manifest Review
Open dist/manifest.json and verify:
manifest_versionis3versionmatchespackage.jsonnameanddescriptionpoint to localized strings (__MSG_*__)background.service_workermatches build output (static/js/background.js)- Permissions list is minimal and justified
7. Prepare Store Assets
For Chrome Web Store submission you need:
- 16x16, 48x48, 128x128 icons (already under
public/icons/) - Screenshots (1280x800 recommended)
- Promotional tile (optional)
- Detailed description & feature list
- Privacy policy (if extension collects/stores personal data)
8. Submit to Chrome Web Store
- Visit Chrome Web Store Developer Dashboard
- Create a new item or update an existing one
- Upload the
.zipfile created earlier - Fill in metadata (description, screenshots, category)
- Specify languages supported (matching
_locales) - Provide release notes
- Submit for review
Tips
- Keep permission descriptions clear during submission
- Highlight Manifest V3 compliance
- Mention key technologies (TypeScript, Preact)
9. Edge Add-ons (Optional)
Microsoft Edge supports MV3 packages.
- Go to Edge Add-ons portal
- Upload the same
distzip - Adjust descriptions/screenshots as needed
- Submit for Edge review
10. Post-Release Checklist
- Tag the release in Git (
git tag v1.4.0 && git push origin v1.4.0) - Publish GitHub release notes
- Monitor store feedback and crash reports
- Schedule next iteration (bugfixes, minor updates)
Troubleshooting
| Issue | Fix |
|---|---|
| "Manifest is invalid" | Ensure dist/manifest.json is valid JSON and references existing files |
| "Could not load background script" | Confirm background path matches static/js/background.js |
| "Extension is corrupted" after loading | Rebuild, ensure no absolute paths or symlinks remain |
| Store rejection for permissions | Trim unused permissions and explain required ones in submission |
Automation Ideas
- Add an npm script
pnpm packagethat runs build + zip automatically - Use GitHub Actions to attach the
dist.zipartifact to releases - Validate manifest via
chrome-extension-manifest-validator(community tool) before submission