New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

webpack-webmanifest-loader

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

webpack-webmanifest-loader

Minimalistic webpack loader to generate webmanifest file (and process icons URLs)

  • 2.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
712
decreased by-18.07%
Maintainers
1
Weekly downloads
 
Created
Source

webpack-webmanifest-loader

Minimalistic webpack loader to generate webmanifest file (and process icons URLs).

  • Compatible with webpack 5 only (5.1+ required).
  • Zero dependency.
  • Cache busting support.

Getting Started

npm install -D webpack-webmanifest-loader
manifest.webmanifest
{
  "name": "HackerWeb",
  "icons": [
    {
      "src": "../images/touch/homescreen48.png",
      "sizes": "48x48",
      "type": "image/png"
    }
  ]
}
index.html
<head>
  <title>Example</title>
  <link rel="manifest" href="<%= require('../layout/base/manifest.webmanifest') %>" />
</head>

Then add the loader to your webpack config. For example:

webpack.config.js
module.exports = {
  module: {
    rules: [
      {
        test: /\.(png|svg|webp|jpg|jpeg)$/i,
        type: 'asset/resource',
      },
      {
        test: /\.webmanifest$/i,
        use: 'webpack-webmanifest-loader',
        type: 'asset/resource',
      },
    ],
  },
};

With the default options, the example above will create a [contenthash].webmanifest file in the output directory for the build.

{
  "name": "HackerWeb",
  "icons": [
    {
      "src": "[contenthash].[ext]",
      "sizes": "48x48",
      "type": "image/png"
    },
  ],
}

FAQs

Package last updated on 03 Aug 2021

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