@rsbuild/plugin-assets-retry 0.3.5 → 0.3.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +29 -0
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +5 -5
package/dist/index.d.ts
CHANGED
|
@@ -2,14 +2,43 @@ import { RsbuildPlugin } from '@rsbuild/core';
|
|
|
2
2
|
import { CrossOrigin } from '@rsbuild/shared';
|
|
3
3
|
|
|
4
4
|
type PluginAssetsRetryOptions = {
|
|
5
|
+
/**
|
|
6
|
+
* The maximum number of retries for a single asset.
|
|
7
|
+
* @default 3
|
|
8
|
+
*/
|
|
5
9
|
max?: number;
|
|
10
|
+
/**
|
|
11
|
+
* Used to specify the HTML tag types that need to be retried.
|
|
12
|
+
* @default ['script', 'link', 'img']
|
|
13
|
+
*/
|
|
6
14
|
type?: string[];
|
|
15
|
+
/**
|
|
16
|
+
* The test function of the asset to be retried.
|
|
17
|
+
*/
|
|
7
18
|
test?: string | ((url: string) => boolean);
|
|
19
|
+
/**
|
|
20
|
+
* Specifies the retry domain when assets fail to load.
|
|
21
|
+
*/
|
|
8
22
|
domain?: string[];
|
|
23
|
+
/**
|
|
24
|
+
* Set the `crossorigin` attribute for tags.
|
|
25
|
+
*/
|
|
9
26
|
crossOrigin?: boolean | CrossOrigin;
|
|
27
|
+
/**
|
|
28
|
+
* Whether to inline the runtime JavaScript code of Assets Retry plugin into the HTML file.
|
|
29
|
+
*/
|
|
10
30
|
inlineScript?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* The callback function when the asset is failed to be retried.
|
|
33
|
+
*/
|
|
11
34
|
onFail?: (options: AssetsRetryHookContext) => void;
|
|
35
|
+
/**
|
|
36
|
+
* The callback function when the asset is being retried.
|
|
37
|
+
*/
|
|
12
38
|
onRetry?: (options: AssetsRetryHookContext) => void;
|
|
39
|
+
/**
|
|
40
|
+
* The callback function when the asset is successfully retried.
|
|
41
|
+
*/
|
|
13
42
|
onSuccess?: (options: AssetsRetryHookContext) => void;
|
|
14
43
|
};
|
|
15
44
|
type AssetsRetryHookContext = {
|
package/dist/index.js
CHANGED
package/dist/index.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsbuild/plugin-assets-retry",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.6",
|
|
4
4
|
"description": "Assets retry plugin for Rsbuild",
|
|
5
5
|
"homepage": "https://rsbuild.dev",
|
|
6
6
|
"repository": {
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
],
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"serialize-javascript": "^6.0.0",
|
|
27
|
-
"@rsbuild/shared": "0.3.
|
|
27
|
+
"@rsbuild/shared": "0.3.6"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@babel/core": "^7.23.2",
|
|
@@ -34,11 +34,11 @@
|
|
|
34
34
|
"html-webpack-plugin": "npm:html-rspack-plugin@5.5.7",
|
|
35
35
|
"terser": "5.27.0",
|
|
36
36
|
"typescript": "^5.3.0",
|
|
37
|
-
"@rsbuild/core": "0.3.
|
|
38
|
-
"@scripts/test-helper": "0.3.
|
|
37
|
+
"@rsbuild/core": "0.3.6",
|
|
38
|
+
"@scripts/test-helper": "0.3.6"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
|
-
"@rsbuild/core": "^0.3.
|
|
41
|
+
"@rsbuild/core": "^0.3.6"
|
|
42
42
|
},
|
|
43
43
|
"publishConfig": {
|
|
44
44
|
"access": "public",
|