Naming conflicts in the manifest for output chunks are handled by checking if the name-part of the output file name is chunk. For sourcemaps, the double extension (.js.map) will mean that chunk names will be e.g. chunk.js and the comparison fails, causing duplicate keys.
Fixes the continued issues mentioned in the comments on #22 after it was closed.
Solution
Parse the name twice (!!), which will leave normal names untouched, but remove "double extension" names like .js.map or .min.css.
It's a bit of a weird solution, but felt like the most efficient approach if wanting to avoid having to hard-code extension and create a more general solution.
Note: Chunk hashes change in the test, which I assume is on account of the sourcemapping-URL being present in the file contents. I haven't verified this though.
Problem
Naming conflicts in the manifest for output chunks are handled by checking if the name-part of the output file name is
chunk
. For sourcemaps, the double extension (.js.map
) will mean that chunk names will be e.g.chunk.js
and the comparison fails, causing duplicate keys.Fixes the continued issues mentioned in the comments on #22 after it was closed.
Solution
Parse the name twice (!!), which will leave normal names untouched, but remove "double extension" names like
.js.map
or.min.css
. It's a bit of a weird solution, but felt like the most efficient approach if wanting to avoid having to hard-code extension and create a more general solution.Note: Chunk hashes change in the test, which I assume is on account of the sourcemapping-URL being present in the file contents. I haven't verified this though.