Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: compatibility with webpack-subresource-integrity@5.1.0 #452

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Den-dp
Copy link
Contributor

@Den-dp Den-dp commented Dec 15, 2022

BREAKING CHANGE:

  • integrity: true now requires webpack-subresource-integrity>=5.0.0
  • webpack@3 support with its after-emit hook is dropped

Closes: #451

BREAKING CHANGE:
- `integrity: true` now requires `webpack-subresource-integrity`>=`5.0.0`
- webpack@3 support with its `after-emit` hook is dropped

Closes: ztoben#451
compiler.hooks.emit.tapAsync(plugin, emitPlugin)
} else {
compiler.plugin('after-emit', emitPlugin)
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed since old API anyway doesn't have assetEmitted equivalent.

@@ -119,7 +119,7 @@ AssetsWebpackPlugin.prototype = {
if (self.options.includeAllFileTypes || self.options.fileTypes.includes(typeName)) {
const combinedPath = assetPath && assetPath.slice(-1) !== '/' ? `${assetPath}/${asset}` : assetPath + asset
const type = typeof typeMap[typeName]
const compilationAsset = compilation.assets[asset]
const compilationAsset = stats.assets.find(statAsset => statAsset.name === asset)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Such change works for my project, but I wonder when we have more than 1 asset?

hashFuncNames: ['sha384'],
enabled: true
})
new SubresourceIntegrityPlugin()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

integrity feature doesn't work with webpack-subresource-integrity@5.1.0
1 participant