Skip to content

Add in manifest key by name or id chunk #60

Description

@Insidexa
Chunk {
  id: 1,
  ids: [ 1 ],
  debugId: 1002,
  name: 'profile', // by name
  _modules: 
   Set {

Config maybe

{
        filename: 'wmanifest.json',
        manifestVariable: 'webpackManifest',
        inlineManifest: true,
        keyChunk: 'name' // id default
    }

https://github.com/soundcloud/chunk-manifest-webpack-plugin/blob/master/lib/ChunkManifestPlugin.js#L29-L31
var keyChunk = this.keyChunk
c.id replace by c[keyChunk]
In constructor ChunkManifestPlugin add this.keyChunk = options.keyChunk || 'id';

Result of this operation
window.webpackManifest={"restaurantProfile":"restaurantProfile-1a19c34fddd34bea5d68.chunk.js"]

this will help in lazy loading of modules using pure js without dynamic import when we can not specify /* webpackChunkName: "name" */ comments in imports () if dynamic file name
or other situations

I think you understand me

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions