🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

webpack-assets-manifest

Package Overview
Dependencies
Maintainers
1
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

webpack-assets-manifest

This Webpack plugin will generate a JSON file that matches the original filename with the hashed version.

6.1.0
latest
Source
npm
Version published
Weekly downloads
683K
5.26%
Maintainers
1
Weekly downloads
 
Created

What is webpack-assets-manifest?

The webpack-assets-manifest npm package is a Webpack plugin that generates a JSON file containing the mappings of all your output files. This is particularly useful for cache busting and managing asset paths in your application.

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

Generate Asset Manifest

This feature allows you to generate a JSON file (assets.json) that contains the mappings of your output files. This is useful for keeping track of your assets and their hashed versions.

const WebpackAssetsManifest = require('webpack-assets-manifest');

module.exports = {
  plugins: [
    new WebpackAssetsManifest({
      output: 'assets.json'
    })
  ]
};

Customize Manifest Content

This feature allows you to customize the content of the manifest file. For example, you can modify the paths of JavaScript files to include a specific directory.

const WebpackAssetsManifest = require('webpack-assets-manifest');

module.exports = {
  plugins: [
    new WebpackAssetsManifest({
      customize: (entry, original, manifest, asset) => {
        if (entry.key.endsWith('.js')) {
          entry.value = `/static/js/${entry.value}`;
        }
        return entry;
      }
    })
  ]
};

Integrate with Webpack Dev Server

This feature allows you to integrate the manifest with the Webpack Dev Server. You can serve the manifest file via an endpoint, making it accessible during development.

const WebpackAssetsManifest = require('webpack-assets-manifest');

module.exports = {
  devServer: {
    before: (app, server) => {
      const manifest = server.compiler.options.plugins.find(
        plugin => plugin instanceof WebpackAssetsManifest
      );
      app.get('/assets.json', (req, res) => {
        res.json(manifest.getRawManifest());
      });
    }
  },
  plugins: [
    new WebpackAssetsManifest()
  ]
};

Other packages similar to webpack-assets-manifest

Keywords

webpack-assets-manifest

FAQs

Package last updated on 06 May 2025

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