This repository holds plugins for the development of webextensions using Parcel v2.
Parcel v2 has included support for webextensions. However, we need extra steps for resolving
the manifest.json
. Currently this provides functionality where the manifest.json
is merged with manifest.{NODE_ENV}.json
before building.
For more information about manifest.json, please refer to the MDN docs.
Install via npm:
npm install --save-dev @mgranderath/parcel-config-webextension
or via yarn:
yarn add -D @mgranderath/parcel-config-webextension
This wraps the default webextension config and extends it by using a different resolver for the manifest.json
.
You can bundle webextensions by setting the .parcelrc
to this:
{
"extends": "@mgranderath/parcel-config-webextension"
}
and running a build by targeting the manifest.json
:
parcel build manifest.json
This plugin will try to resolve and merge environment-specific manifest files in the format manifest.${NODE_ENV}.json
.
For example, in development, you can run:
NODE_ENV=development parcel build src/manifest.json
and the plugin will also look for manifest.development.json and merge those keys into the base manifest.