Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@ignsg/web-accessible-resources-webpack-plugin

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ignsg/web-accessible-resources-webpack-plugin

A webpack plugin to populate the web_accessible_resources clause in manifest.json

  • 1.0.1
  • unpublished
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

web-accessible-resources-webpack-plugin

This plugin adds filenames in your webpack to the web_accessible_resources clause in your manifest.json. You don't need to maintain a list of images manually anymore.

This is handy when writing chrome extensions, especially when paired with the manifest package loader.

Install

  • yarn add -D web-accessible-resources-webpack-plugin

Usage

// webpack.config.js

const WebAccessibleResourcesPlugin = require('web-accessible-resources-webpack-plugin')

module.exports = {
  ...
  plugins: [
    new WebAccessibleResourcesPlugin(/\.(png|jpg|gif)$/)
  ]
}

Now images required by your source files will be mentioned in web_accessible_resources.

For more flexibility, you can specify a function instead of the regular expression:

  new WebAccessibleResourcesPlugin( (name) => ['a.jpg', 'b.jpg'].includes(name) )

Output

Example output in your manifest.json:

{
  ...
  "web_accessible_resources": [
    "header.png",
    "landscape.jpg",
    "icon.png"
  ]
}

Contributing

Please file an issue on GitHub.

License

MIT, be free.

Keywords

FAQs

Package last updated on 24 May 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc