Skip to content

Commit 3073a75

Browse files
authored
fix: update rspackMinVersion to 1.2.4 for SRI support (#5268)
1 parent 37546e1 commit 3073a75

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

packages/core/src/helpers/index.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ export * from './stats';
1919

2020
export { color };
2121

22-
export const rspackMinVersion = '1.0.0';
22+
// `SubresourceIntegrityPlugin` added in Rspack v1.2.4
23+
export const rspackMinVersion = '1.2.4';
2324

2425
export const getNodeEnv = () => process.env.NODE_ENV as string;
2526
export const setNodeEnv = (env: string): void => {
@@ -78,6 +79,11 @@ const compareSemver = (version1: string, version2: string) => {
7879
return 0;
7980
};
8081

82+
/**
83+
* If the application overrides the Rspack version to a lower one,
84+
* we should check that the Rspack version is greater than the minimum
85+
* supported version.
86+
*/
8187
export const isSatisfyRspackVersion = async (
8288
originalVersion: string,
8389
): Promise<boolean> => {

packages/core/tests/rspackVersion.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ describe('rspack version', () => {
66

77
expect(await isSatisfyRspackVersion(rspackMinVersion)).toBeTruthy();
88

9-
expect(await isSatisfyRspackVersion('1.0.0')).toBeTruthy();
9+
expect(await isSatisfyRspackVersion('10.0.0')).toBeTruthy();
1010

1111
expect(
1212
await isSatisfyRspackVersion('0.2.7-canary-efa0dc6-20230817005622'),

0 commit comments

Comments
 (0)