Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add in manifest key by name or id chunk #60

Open
Insidexa opened this issue Jul 1, 2018 · 0 comments
Open

Add in manifest key by name or id chunk #60

Insidexa opened this issue Jul 1, 2018 · 0 comments

Comments

@Insidexa
Copy link

Insidexa commented Jul 1, 2018

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

@Insidexa Insidexa changed the title Add in manifest key by name chunk Add in manifest key by name or id chunk Jul 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant