peerigon / extract-loader

webpack loader to extract HTML and CSS from the bundle
The Unlicense
317 stars 74 forks source link

Use unique placeholders for each match #83

Closed vseventer closed 4 years ago

vseventer commented 4 years ago

Fixes #54 #57 #80 by generating a new placeholder for each dependency, rather than using a single one for the entire module.

The undefined issue was caused by the module cache returning the previously generated placeholder, but not adding to newDependencies. Hence a mismatch between number of newDependencies and extractedDependencyContent appeared, causing undefined to be returned once we ran out of newDependencies. By using unique placeholders, this is no longer an issue.

vseventer commented 4 years ago

@jhnns Any chance of getting this merged?

jannikkeye commented 4 years ago

Sorry for the late response. I'm going to go ahead an merge this as I didn't see any issues and it seems to be a requested thing.

Thank you for the contribution :)

Released in 3.2.0