HLS Downloader uses pnpm workspaces and Vite for fast, efficient builds. This guide covers all build commands, variants, and workflows.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/puemos/hls-downloader/llms.txt
Use this file to discover all available pages before exploring further.
Quick reference
Full build
Development mode
Clean artifacts
Component preview
Build commands
Production build
Build all packages and create extension archives:- Cleans previous build artifacts (
pnpm run clean) - Copies assets to
dist/(pnpm run copy-assets) - Builds packages in order (
pnpm run build:packages):core→ TypeScript compilation tolib/design-system→ Vite bundle todist/backgroundandpopupin parallel → Vite bundles todist/
- Creates archives (
pnpm run build:zip):extension-chrome.zipfor Chromium browsersextension-firefox.xpifor Firefox
Output structure
Output structure
After building, you’ll have:
Individual package builds
Build specific packages:Packages must build in dependency order. The
build:packages script handles this automatically.Clean build artifacts
Remove all generated files:dist/directorydist-mv2/anddist-mv3/directories (variant builds)- All
extension-*.zipandextension-*.xpifiles
Manifest variants
HLS Downloader supports both Manifest V2 and V3 to accommodate different browser requirements.Default build (MV2)
The standard build targets Manifest V2:Manifest V2 is used for:
- Firefox (full MV3 support pending)
- Legacy Chromium workflows
- Browsers that support background pages
MV3 build
Build for modern Chromium browsers:manifest.jsonwith version 3 schema- Service worker background script
- Offscreen document for FFmpeg
Manifest V3 is required for:
- Google Chrome (MV2 deprecated)
- Microsoft Edge
- Brave, Arc, Opera, and other Chromium browsers
Variant build scripts
Build specific variants with pre-configured names:build:all command creates:
dist/mv2/→ MV2 extension filesdist/mv3/→ MV3 extension filesextension-mv2-chrome.zipextension-mv2-firefox.xpiextension-mv3-chrome.zip
How build:all works
How build:all works
The
build:all script:- Runs
pnpm run clean - Executes
pnpm run build:mv2→ builds todist/mv2/ - Executes
pnpm run build:mv3→ builds todist/mv3/ - Creates separate archives with
mv2andmv3in filenames
Blocklist variants
For distribution outside official stores, you can build without the domain blocklist:About the blocklist
About the blocklist
Official store releases include a domain blocklist that:
- Respects copyright holder opt-out requests
- Complies with distribution platform policies
- Honors content owner preferences
Development workflows
Watch mode
Automatic rebuild on file changes:core→ TypeScript watch compilationdesign-system→ Vite watchbackground→ Vite watchpopup→ Vite watch
pnpm dev builds for MV3. The output goes to dist/mv3/.
Watch mode internals
Watch mode internals
The Each
dev script uses npm-run-all to run parallel tasks:dev:* script watches its package:dev:core→tsc -wdev:design-system→vite build -wdev:background→vite build -wdev:popup→vite build -w
Load extension in browser
Chrome/Edge/Brave/Arc:
- Open
chrome://extensions/(or equivalent) - Enable “Developer mode”
- Click “Load unpacked”
- Select
dist/mv3/directory
- Open
about:debugging#/runtime/this-firefox - Click “Load Temporary Add-on”
- Select any file in
dist/directory
Component development
Develop UI components in isolation with Storybook:http://localhost:6006 and hot-reloads on changes.
Adding Storybook stories
Adding Storybook stories
Create a The story appears automatically in Storybook.
.stories.tsx file next to your component:Use Storybook to:
- Develop components without running the full extension
- Test different props and states
- Document component APIs
- Catch visual regressions
Build troubleshooting
Error: pnpm not found
Error: pnpm not found
Enable Corepack and install the pinned pnpm version:Verify installation:
Error: Module not found in core package
Error: Module not found in core package
The core package may not be built. Run:Or rebuild everything:
Error: ENOENT when creating zip
Error: ENOENT when creating zip
The
Linux:
Windows: Install via Git for Windows or use WSL
zip command is not found. Install it:macOS: Pre-installed, or use brew install zipLinux:
sudo apt install zip or equivalentWindows: Install via Git for Windows or use WSL
Watch mode not detecting changes
Watch mode not detecting changes
Try restarting the dev server:If issues persist, check that you’re editing source files in
src/, not generated files in dist/ or lib/.Extension not loading in browser
Extension not loading in browser
Ensure you’re loading the correct directory:
- MV3 builds: Load
dist/mv3/ordist/ - MV2 builds: Load
dist/mv2/ordist/
manifest.json exists in the directory you’re loading.For Firefox, try loading the .xpi file instead of the directory.CI/CD considerations
When setting up continuous integration:
- Use
pnpm install --frozen-lockfileto ensure reproducible builds - Run
pnpm testbefore building - Use
pnpm run build:all-variantsto create all distribution packages - Upload
extension-*.zipandextension-*.xpias artifacts
Next steps
Testing
Run tests and generate coverage reports
Contributing
Submit changes following project guidelines