numical / script-ext-html-webpack-plugin

Enhances html-webpack-plugin functionality with different deployment options for your scripts including 'async', 'preload', 'prefetch', 'defer', 'module', custom attributes, and inlining.
MIT License
588 stars 105 forks source link

Preloads are incompatible with webpack-subresource-integrity #55

Closed dantman closed 4 years ago

dantman commented 5 years ago

The preloads in this plugin are incompatible with webpack-subresource-integrity (SriPlugin).

The SriPlugin adds integrity attributes to chunks and expects you to set WebPack's output.crossOriginLoading to anonymous.

However none of the attributes added to the script are used when creating the preload. As a result Chrome fetches the script twice.

Even if you use a custom attribute to force this plugin to set the crossorigin is should automatically know about, it still loads twice because the integrity also needs to be copied to the preload. Which can't be done manually because the integrity is a generated hash and can't be known ahead of time.

amits-dev commented 4 years ago

Is there any update/workaround for this?

numical commented 4 years ago

Hello - I'm sorry to say that this plugin is no longer being maintained. I have tried to close all issues ahead of doing this but instead have found that the issue list just keeps growing. I simply do not have the time to keep up. Sorry. Please keep an eye on the README where I will record anyone who forks this repo with the intention to supporting it in the future.