Skip to content

manifest.json generator can be used not only include all emitted assets but also in multiply compilation cases

Notifications You must be signed in to change notification settings

FlynnLeeGit/webpack-manifest-extra-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

webpack-manifest-extra-plugin

CircleCI

manifest.json generator can be used not only include all emitted assets but also in multiply compilation cases

why?

webpack-manifest-plugin is fine? why another manifest-plugin?

  • can not used in multiply compilation cases, use 'seed' option sometimes it will get wrong file format
  • if you include another plugin that just emit file in webpack compilation, the manifest.json will not find it

how?

after every emit and done,this plugin will find the manifest.json in dist folder,if already has,it will merge old manifest and new manifest to a final file,and you can modify it just by transform function

install

yarn add webpack-manifest-extra-plugin -D
# or
npm install webpack-manifest-extra-plugin -D

use

// webpack.config.js
const WebpackManifestExtraPlugin = require('webpack-manifest-extra-plugin')
{
  //...
  plugins:[
    new WebpackManifestExtraPlugin({
      filename:'manifest.json' // default -> manifest.json,
      verbose: true // default -> true,
      publicPath:'/' // default -> webpack's publicPath config
      transform(manifest){ // manifest.json object && webpack's statsJson object
        // ... your transforms
        return manifest // return
      }
    })
  ]
  //...
}

use in multiply compilation in this example two compilation are all use the default same filename 'manifest.json', so plugin will merge it to one final file

// webpack.config.js
[
  // first
  {
    // ...
    plugins: [new WebpackManifestExtraPlugin()]
    // ...
  },
  // second
  {
    //...
    plugins: [new WebpackManifestExtraPlugin()]
    //...
  }
]

About

manifest.json generator can be used not only include all emitted assets but also in multiply compilation cases

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published