feat: support experiments.SubresourceIntegrityPlugin#9171
Merged
LingyuCoder merged 16 commits intomainfrom Feb 14, 2025
Merged
Conversation
✅ Deploy Preview for rspack canceled.
|
CodSpeed Performance ReportMerging #9171 will not alter performanceComparing Summary
|
353f43d to
dc50b27
Compare
LingyuCoder
commented
Feb 13, 2025
LingyuCoder
commented
Feb 13, 2025
experiments.SubresourceIntegrityPlugin
bcae81d to
094b926
Compare
hardfist
reviewed
Feb 14, 2025
hardfist
reviewed
Feb 14, 2025
a8bde99 to
c2dc33d
Compare
c2dc33d to
2344284
Compare
chenjiahan
reviewed
Feb 14, 2025
chenjiahan
reviewed
Feb 14, 2025
d81bc93 to
ff1a2e0
Compare
hardfist
approved these changes
Feb 14, 2025
2 tasks
chenjiahan
pushed a commit
that referenced
this pull request
Feb 14, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
relate to #4381
crates/rspack_plugin_sri, which implements most logic of webpack-subresource-integrity. IfHtmlRspackPluginis used, the native plugin will interact with it directly.packages/rspack/src/builtin-plugin/SubresourceIntegrityPlugin.ts, which will interact withhtml-webpack-pluginif it is used.tests/plugin-test/sri-plugin. If the test case useshtml-webpack-plugin, then it will also be runned withHtmlRspackPlugininstead.rspack.experiments.SubresourceIntegrityPlugin.This pull request introduces the Subresource Integrity (SRI) plugin to the
rspackproject, which ensures that resources loaded by a web application have not been manipulated. The most important changes include the addition of the SRI plugin and its integration into various parts of the codebase.Introduction of SRI Plugin:
rspack_plugin_sriwith its ownCargo.tomland implementation files. This module includes the main logic for the SRI plugin, which computes integrity hashes for assets and integrates with the existing compilation process. [1] [2] [3]Integration with Existing Codebase:
Cargo.toml Updates:
Cargo.tomlfiles in various crates to include the newrspack_plugin_srias a dependency. This ensures that the SRI plugin is available throughout the project. [1] [2]Modifications in
raw_builtins:raw_srimodule and integratedRawSRIPluginOptionsinto the existing structure. This includes updates to theBuiltinPluginNameenum and theBuiltinPluginimplementation to support the new SRI plugin. [1] [2] [3] [4] [5]Configuration Changes:
PUPPETEER_SKIP_DOWNLOADenvironment variable in the.github/workflows/reusable-build.ymlfile, likely to avoid conflicts or unnecessary downloads during the build process.Checklist