jamesjieye / html-webpack-exclude-assets-plugin

Add the ability to exclude assets based on RegExp patterns
MIT License
52 stars 14 forks source link

Fix interop with other plugins #8

Closed pluma closed 7 years ago

pluma commented 7 years ago

When using this plugin with other plugins attaching to the same hooks, the callback result will become the htmlPluginData object for the next plugin, so unmodified properties need to be copied or they will be lost.

I ran into this problem when using html-webpack-inline-source-plugin, which suffers from the same bug. Patching this in both plugins solved the issue.

See also the corresponding issue on the other repo. I'm not sure what these plugins are based on but I'm suspecting at some point someone blindly copied what the html-webpack-plugin unit tests are doing without consulting the actual implementation.

pluma commented 7 years ago

This PR includes the fix from https://github.com/jamesjieye/html-webpack-exclude-assets-plugin/pull/7 but suffers from the same failing tests (though it does not modify the tests like #7 did so maybe there are other reasons for that).

jamesjieye commented 7 years ago

@pluma The Travis build failed with node 0.12. This is caused by the style-loader's 0.13.2 release, which upgraded the loader-utils to 1.0.2. And loader-utils 1.0.2 only supports node engines +4.

And because of that, the html-webpack-exclude-assets-plugin can only supports node v4+.

pluma commented 7 years ago

Sweet. Thanks a ton!