Start the Development Server
Once you've set up your project, start developing your extension by navigating to your project directory and running:
pnpm dev
# OR
npm run dev
# OR
plasmo dev
Plasmo will create a dev bundle for your extension and a live-reloading development server, automatically updating your extension bundle on file changes and reloading your browser on source code changes. It also prefixes the extension name with DEV |
and makes the icon grayscale to distinguish between development and production extension bundles.
With a specific target
When you're building with Plasmo, you're building a Plasmo extension, rather than a Chrome or Firefox extension. This means that you can build a single extension that works across all supported browsers, with minor tweaks. You can direct Plasmo to build an extension for a specific browser and manifest version by using the --target
flag:
plasmo dev --target=firefox-mv2
The final bundle will be available in the build/firefox-mv2-dev
directory.
For a list of officially supported targets, visit this link.
Without source maps
By default, Plasmo generates source maps for your extension during development. If you need to disable this, you can use the --no-source-maps
flag:
plasmo dev --no-source-maps
This is useful when you have dependencies that don't play well with source maps.