Build the Extension
To create a production build:- Clears previous builds - Removes old
extension/distfiles and manifests - Builds with Vite - Compiles Vue components, TypeScript, and styles
- Generates manifest - Creates the appropriate
manifest.jsonfor the target browser
The build process uses Vite with production optimizations including minification, tree-shaking, and code splitting.
Build Output
After building, you’ll find the compiled extension in:What Gets Generated
extension/dist/newtab/- Compiled new tab page with optimized assetsextension/manifest.json- Browser extension manifest file- Minified JavaScript - Optimized and bundled JS files
- Optimized CSS - UnoCSS utilities compiled and minified
Packaging for Distribution
After building, you can package the extension into distributable formats:ZIP
extension.zip for Chrome Web StoreCRX
extension.crx for Chrome manual installationXPI
extension.xpi for Firefox Add-onsIndividual Package Commands
You can also create specific package formats:Testing the Production Build
Before distributing, test the production build locally:Build Configuration
The build process is configured invite.config.ts:
- Output directory:
extension/dist - Source maps: Disabled in production, inline in development
- Asset optimization: Relative paths for cross-browser compatibility
- Auto-imports: Vue Composition API and WebExtension APIs
Troubleshooting
Build fails with TypeScript errors
Run type checking to identify issues:Assets not loading
Ensure you’ve built the extension before packing:Package size too large
Check that you’re not including unnecessary files. The.gitignore and build process should exclude:
node_modules/- Source TypeScript files (
.ts) - Development configuration files
Next Steps
Release Process
Learn how to create releases with automated version bumping and git tagging