Prerequisites
Ensure you have Node.js 22 or higher installed:Build Scripts
The extension provides several build commands for different scenarios:Build for Specific Browser
dist/chrome/ or dist/firefox/.
Build for All Browsers
Generic Build
Watch Mode for Development
During development, use watch mode to automatically rebuild when source files change:src/ directory and triggers a rebuild on any file changes.
Build Process
The build script (scripts/build.js) performs the following steps:
Clean the distribution directory
Empties the target
dist/{browser}/ directory to ensure a fresh buildCopy source files
Copies the following directories to the distribution folder:
popup/- Extension popup UIoptions/- Settings pagecontent/- Content scriptsbackground/- Service workerlib/- Shared utilitiesassets/- Icons and images
Merge manifests
Combines
manifest/base.json with browser-specific manifest (manifest/chrome.json or manifest/firefox.json) using deep mergeDeep Merge Strategy
The build process uses deep merging to combine manifests:Creating Release Zips
To package the extension for distribution:hubspot-devtools-{browser}-{version}.zip
Complete Release Build
For a production release, use the release command:Output Structure
After building, yourdist/ directory will look like:
Manual Installation for Testing
Chrome
Firefox
Troubleshooting
Build Fails
If the build fails, check:- Node.js version is 22 or higher
- Dependencies are installed:
npm install - No syntax errors in source files
Manifest Errors
If you see manifest validation errors:- Verify
manifest/base.jsonhas valid JSON - Check browser-specific manifests for conflicts
- Run validation:
npm run validate:chromeornpm run validate:firefox
Watch Mode Not Triggering
If watch mode doesn’t rebuild on changes:- Ensure you’re editing files in the
src/directory - Check that the file isn’t in
node_modules/ - Restart watch mode with Ctrl+C and run again