shuizhongyueming / rollup-plugin-output-manifest

Rollup plugin for generating a chunk manifest
25 stars 5 forks source link

Not very usable for chunked output #7

Open zgoda opened 4 years ago

zgoda commented 4 years ago

With config

  input: {
    dashboard: 'src/app/static/js/dashboard.js'
  },
  output: {
    dir: 'src/app/static/dist',
    format: 'es',
    sourcemap: true
  }

I'm getting

{
  "dashboard.js": "dashboard.js"
}

Which is not very usable since I expected to get either a key of my input dict or source path as a key in manifest, but is seems it's some other thing? Since after renaming source file to src/app/static/js/dashboard/index.js the output is exactly the same. What exactly is a key in this dictionary?

lnmp4000 commented 3 years ago

Add a custom filter to the plugin in your rollup config

outputManifest({ filter: () => true }),

That ensured all the chunks were also included e.g.

{
  "edit.js": "edit.98b0ed06.js",
  "home.js": "home.2968c158.js",
  "index.js": "index.js",
  "key.js": "key.23f5f6da.js",
  "paddedBox.js": "paddedBox.7c24159a.js",
  "react.js": "react.f523e8df.js",
  "results.js": "results.6e46a88f.js",
  "service-worker.js": "service-worker.js"
}