shellscape / webpack-manifest-plugin

webpack plugin for generating asset manifests
MIT License
1.43k stars 186 forks source link

Manifest keys should be based on the output filename rather than the entry name #159

Closed philipwalton closed 3 years ago

philipwalton commented 5 years ago

I ran into an issue today where my output was not what I expected it to be, and I wait to raise it for discussion. In my app I'm using two configs to generate separate .mjs and .es5.js files. The .mjs works as expected, but the .es5.js doesn't.

Here's the relevant part of my config:

entry: {
  'main': './app/scripts/main.js',
},
output: {
  filename: '[name]-[chunkhash:10].es5.js',
}

And this produces a manifest like the following:

{
  "main.js": "/main-dcf074ddfa-es5.js",
  "main.js.map": "/main-dcf074ddfa-es5.js.map",
}

This is unexpected to me. The key from my main script file is main.js, but I expected it to be main.es5.js.

Essentially, I wanted the keys to be the output filename with the hash information removed (as well as any leading -/_/.) but what I actually get is just the entry name plus the file extension.

Since I'm using two configs but building a single manifest, the current behavior produces two entries for main.js, and the second one gets overridden.

philipwalton commented 5 years ago

Possibly related issue: https://github.com/danethurber/webpack-manifest-plugin/issues/110

shellscape commented 3 years ago

Hey all! I've taken over maintenance of the plugin and am doing some housecleaning. For Issues over a year old without a reproduction, we're going to go the route of closing them first. However, they're not dead! If the issue is still pending and still a problem, please reply with a reproduction and we'll reopen post-haste.

Please provide a reproduction by choosing one of the options below:

  1. Using the REPL.it plugin reproduction template at https://repl.it/@shellscape/manifest-plugin-repro
  2. Provide a minimal repository link (Read https://git.io/fNzHA for instructions). Please use NPM for installing dependencies! These may take more time to triage than the other options.

    ⚠️ ZIP Files are unsafe and maintainers will NOT download them.