Skip to content

sergey-shpak/parcel-transformer-webextension

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

parcel-transformer-webextension

Parcel plugin to use WebExtension manifest as an entry point (parcel@v2 and json5 supported)

Installation

npm install parcel-transformer-webextension --save-dev

Configuration

Please add following configuration to .parcelrc

{
 "transformers": {
    "manifest.{json5,json}": ["parcel-transformer-webextension"]
  },
  "packagers": {
    "manifest.json": "@parcel/packager-raw-url"
  }
}

Usage

After installing and configuring the plugin, use WebExtension manifest.json as entry point:

parcel src/manifest.json5

Any manifest property (including nested) can be resolved as an asset(html/css/js/png/jpeg), all you need is to provide proper asset path to manifest property, for example:

// other manifest props
"browser_action": {
  "default_icon": "assets/icons/icon48.png",
  "default_popup": "action.html",
  "default_title": "Action!"
}

Btw, the plugin adds json5 support, so comments and other json5 benefits can be used with WebExtension manifest file. Enjoy!

License

Apache 2.0

About

Parcel@v2 Transformer WebExtension

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published