shellscape / webpack-manifest-plugin

webpack plugin for generating asset manifests
MIT License
1.44k stars 185 forks source link

feat: Group files by entry #183

Closed danpoq closed 3 years ago

danpoq commented 5 years ago

These changes add a new option called groupByEntry.

When enabled the manifest will be grouped by each key in the entry if it's an object.

The following config:

{
  entry: {
    app: './app.js',
    store: './store.js'
  },
  ...
  optimization: {
    splitChunks: { chunks: 'all' }
  }
}

Will produce:

{
  "app": {
    "vendors~app.js": "/style/vendors~app.1234567890.js",
    "app.js": "/style/app.0987654321.js"
  },
  "store": {
    "vendors~app~store.js": "/style/vendors~app~store.1357913579.js",
    "store.js": "/style/store.0246802468.js"
  }
}

Looks like this was actually already suggested in a similar PR by @jacobwindsor https://github.com/danethurber/webpack-manifest-plugin/pull/113#issuecomment-355940245.

Added a unit test that proves that the manifest will match this use case.

shellscape commented 3 years ago

@danpoq Thanks for opening this PR a while back, and I'm sorry that it didn't get attention sooner. We've landed a major refactor in #222 that has resulted in some significant conflicts. Would you be interested in reworking your PR on top of the new codebase?

shellscape commented 3 years ago

Closing as abandoned