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

webpack-manifest-plugin

Package Overview
Dependencies
Maintainers
2
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

webpack-manifest-plugin

A Webpack Plugin for generating Asset Manifests

  • 5.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
2
Created

What is webpack-manifest-plugin?

The webpack-manifest-plugin is a Webpack plugin that generates an asset manifest file. This manifest maps the original filenames to the output filenames generated by Webpack, which is useful for integrating Webpack with server-side code and caching strategies.

What are webpack-manifest-plugin's main functionalities?

Generate a manifest file

This feature generates a manifest file that maps the original filenames to the output filenames. The 'fileName' option specifies the name of the manifest file, 'basePath' is a path prefix for all keys, and 'publicPath' is a path prefix for all values.

const WebpackManifestPlugin = require('webpack-manifest-plugin');

module.exports = {
  // ... other webpack config settings ...
  plugins: [
    new WebpackManifestPlugin({
      fileName: 'manifest.json',
      basePath: '/app/',
      publicPath: '/public/'
    })
  ]
};

Filter files

This feature allows filtering of files to be included in the manifest based on custom logic. In this example, only JavaScript and CSS files are included.

new WebpackManifestPlugin({
  filter: (file) => {
    // Only include .js and .css files in the manifest
    return file.name.match(/\.(js|css)$/);
  }
});

Customize manifest entries

This feature allows customization of how the manifest entries are generated. In this example, the 'generate' function is used to create a custom structure for the manifest.

new WebpackManifestPlugin({
  generate: (seed, files) => {
    return files.reduce((manifest, file) => {
      manifest[file.name] = file.path;
      return manifest;
    }, seed);
  }
});

Other packages similar to webpack-manifest-plugin

FAQs

Package last updated on 08 Mar 2022

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