-
Notifications
You must be signed in to change notification settings - Fork 104
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
base: master
Are you sure you want to change the base?
feat: compatibility with webpack-subresource-integrity@5.1.0 #452
Conversation
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) | ||
} |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/waysact/webpack-subresource-integrity/releases/tag/v5.0.0 brings new defaults.
Configuration is not needed anymore, they even recommend using it like that https://github.com/waysact/webpack-subresource-integrity/blob/main/MIGRATE-v1-to-v5.md#new-usage-suggested-defaults-recommended
note that the peerDependency already says |
BREAKING CHANGE:
integrity: true
now requireswebpack-subresource-integrity
>=5.0.0
after-emit
hook is droppedCloses: #451