webpack-plugin-chunk-manifest

0.1.1 • Public • Published

npm webpack 2 npm

Introduction

Export a JSON file that maps chunk ids to their resulting asset files. This JSON file could be used for prefetch/preload.

Looking to contribute? Pick up an issue!

Documentation

Installation

yarn add --dev webpack-plugin-chunk-manifest

Usage

// File: webpack.config.js
const ChunkManifest = require('webpack-plugin-chunk-manifest');
 
module.exports = {
  ...
  plugins: [
    new ChunkManifest(),
  ],
  ...
}

Options

  • filename: Chunk manifest would be stored in this file. Default: manifest.json
    new ChunkManifest({ filename: 'config/manifest.json' })
  • transform: Transform chunks before storing.
    new ChunkManifest({ 
      tranform (chunks) {
        // Remove manifest.js from chunks.
        Object.keys(chunks).forEach(key => {
          if (/manifest\.js$/.test(chunks[key])) {
            delete chunks[key]
          }
        })
      
        return chunks
      } 
    })

License

MIT

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i webpack-plugin-chunk-manifest

      Weekly Downloads

      0

      Version

      0.1.1

      License

      MIT

      Last publish

      Collaborators

      • znck