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

jsn-webpack-extension-manifest-plugin

v0.2.5

Published

Plugin simplifies the development of browser extensions

Downloads

9

Readme

JsnWebpackManifestExtensionPlugin

Should work with webpack >= 4.41.2 and nodejs >= 8.10.0

Plugin simplifies the development of browser extensions

npmnpmnpm node

Install

npm i -D jsn-webpack-extension-manifest-plugin

Description and usage

This plugin allows to use in chrome extension's manifest.json file paths to resources with prefixes @ and @!.

Prefix @ will be resolved during webpack compilation to resource path loaded with file-loader.

Prefix @! will be resolved during webpack compilation to compiled chunk path.

Examples

Project structure:

  • build
  • src
    • client
      • client-script.js
    • hello_world.js
  • manifest.json

Webpack config:

module.exports = {
    entry: {
        helloworld: 'src/hello_world.js'
    },
    output: {
        filename: 'js/[name].build.js',
        path: path.resolve(__dirname, 'build')
    },
    module: {
        rules: [
            {test: /src\/client\/.+\.js$/, use: 'file-loader'}
        ]
    },
    plugins: [
        new JsnWebpackExtensionManifestPlugin({
            manifest: path.resolve(__dirname, 'manifest.json'),
            outputFilename: 'manifest.json',
            useLoader: false
        })
    ]
};

Manifest:

{
  "background": [
    "@!helloworld"
  ],
  "web_accessible_resources": [
    "@src/client/client-script.js"
  ]
}

After compilation manifest will be placed to build directory and resources prefixed with @ or @! will be replaced.

Result manifest.json

{
  "background": [
    "js/helloworld.build.js"
  ],
  "web_accessible_resources": [
    "js/client/c265935b2ca8ab17df005645b08b714c.js"
  ]
}

Plugin options

| Option | Type | Allowed values | Default value | Description | |--------|------|----------------|---------------|-------------| | name (optional) |string| * | | Name of the plugin instance (this will be used to name intermediate js file)| | manifest (required) | string | * | | Absolute path to the manifest file | entryName (optional) | string | * | manifest.json | Entry name for child compiler | | outputFilename (optional) | string | * | manifest.json | Path to the output manifest file relative to output.path of main compiler | | useLoader (optional) | boolean | true, false | true | By default plugin will use file-loader to load all files, but if you already configured loaders for files that will be stated in manifest - you may want to disable this option | | merge (optional) | object, object[] | * | {} | Fields that will be merged into manifest. Make sure that you DO NOT use prefixed with @ or @! paths to resources, because they WILL NOT be processed. If you want to merge into the manifest more than one object - you can pass to this property array of objects |