npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

web-ext-plugin-cjs

v2.2.2

Published

A webpack plugin for web-ext

Downloads

9

Readme

web-ext-plugin-cjs

A webpack plugin for running web-ext for CommonJS.

This is a fork of https://github.com/hiikezoe/web-ext-webpack-plugin, maintained for CRA-based projects which do not support ES Module syntax (yet).

Basic usage

$ npm install --save-dev web-ext-plugin-cjs

# Or for yarn
$ yarn add -D web-ext-plugin-cjs

webpack.config.mjs

import WebExtPlugin from 'web-ext-plugin-cjs';

module.exports = {
  plugins: [new WebExtPlugin({ sourceDir: 'extension-dist' })],
};

Running webpack by itself will build the extension, effectively running web-ext build on the output of your Webpack build.

To run the extension in a browser (including automatic reloading when using Firefox), i.e. to run web-ext run, you will need to start Webpack in watch mode using webpack -w.

Options

  • artifactsDir (optional) - The folder where artifacts are built stored. Defaults to <sourceDir>/web-ext-artifacts. You typically won't need to alter this.

  • browserConsole (optional) - A boolean indicating if the browser console should be shown on load.

    Defaults to false.

  • buildPackage (optional) - A boolean indicating if a zip file of the extension should be generated.

    The name of the .zip file is taken from the name field in the extension manifest unless outputFilename is set.

    Defaults to false.

  • chromiumBinary (optional) - A path to a specific version of a Chromium browser to run. The value is an absolute path to the browser executable or an alias string.

  • chromiumProfile (optional) - A path to a custom Chromium profile to use.

  • firefox (optional) - A path to a specific version of Firefox to run. The value is an absolute path to the Firefox executable or an alias string.

  • firefoxPreview (optional) - Turn on developer preview features in Firefox. This option accepts multiple values, although it currently only supports the mv3 value, which is also the default value. The mv3 value allows developers to test their extensions with Firefox Manifest Version 3 support (without having to manually flipping the related preferences).

  • firefoxProfile (optional) - A specific Firefox profile to use. This may be either a profile name or the path to a profile directory. If this is not set a new profile is generated each time.

  • keepProfileChanges (optional) - A boolean value indicating if the profile specified by firefoxProfile.

    Defaults to false.

    See the notes for the --keep-profile-changes flag from the web-ext run documentation. Specifically, this should not be used together with a profile you later use for browsing. It is, however, useful if you want to force the profile in a specific location to be written to (e.g. for testing out-of-disk space situations).

  • outputFilename (optional) - The name of the .zip file to write when buildPackage is true.

    If this is not set the name of the .zip file is taken from the name field in the extension manifest.

  • overwriteDest (optional) - A boolean value indicating if the package built when buildPackage is true, should overwrite an existing package at the same location.

    Without this option, web-ext will exit in error if the destination file already exists.

    Defaults to false.

  • profileCreateIfMissing (optional) - A boolean value indicating if the profile specified by firefoxProfile should be created if it does not exist.

    Note that if this is specified, firefoxProfile is treated as meaning a directory path (not a profile name).

    Defaults to false.

  • runLint (optional) - A boolean indicating if web-ext lint should be run as part of building the extension.

    Defaults to true.

  • selfHosted (optional) - If true declares that your extension will be self-hosted and disables lint messages related to hosting on addons.mozilla.org.

    Defaults to false.

  • sourceDir (optional) - The folder where webpack is building your extension to. Typically this will be where you have configured output.path to point to. Relative paths will be resolved relative to the webpack.config.js file.

    Defaults to the same folder as the webpack.config.js file.

  • startUrl (optional) - A URL or array of URLs to load on startup.

  • target (optional) - One of firefox-desktop, firefox-android, or chromium or an array of such values.

    Defaults to firefox-desktop.

    See the documentation for the --target option of web-ext run.