@rsbuild/plugin-assets-retry 0.3.4 → 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 +3 -3
- package/package.json +6 -6
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
|
@@ -34,12 +34,12 @@ var __privateSet = (obj, member, value, setter) => {
|
|
|
34
34
|
return value;
|
|
35
35
|
};
|
|
36
36
|
|
|
37
|
-
// ../../node_modules/.pnpm/@modern-js+module-tools@2.46.
|
|
37
|
+
// ../../node_modules/.pnpm/@modern-js+module-tools@2.46.1_typescript@5.3.2/node_modules/@modern-js/module-tools/shims/esm.js
|
|
38
38
|
import { fileURLToPath } from "url";
|
|
39
39
|
import path from "path";
|
|
40
40
|
var getFilename, getDirname, __dirname;
|
|
41
41
|
var init_esm = __esm({
|
|
42
|
-
"../../node_modules/.pnpm/@modern-js+module-tools@2.46.
|
|
42
|
+
"../../node_modules/.pnpm/@modern-js+module-tools@2.46.1_typescript@5.3.2/node_modules/@modern-js/module-tools/shims/esm.js"() {
|
|
43
43
|
"use strict";
|
|
44
44
|
getFilename = () => fileURLToPath(import.meta.url);
|
|
45
45
|
getDirname = () => path.dirname(getFilename());
|
|
@@ -98,7 +98,7 @@ var init_AssetsRetryPlugin = __esm({
|
|
|
98
98
|
if (!this.scriptPath) {
|
|
99
99
|
this.scriptPath = path2.join(
|
|
100
100
|
this.distDir,
|
|
101
|
-
`assets-retry.${"0.3.
|
|
101
|
+
`assets-retry.${"0.3.6"}.js`
|
|
102
102
|
);
|
|
103
103
|
}
|
|
104
104
|
return this.scriptPath;
|
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",
|
|
@@ -32,13 +32,13 @@
|
|
|
32
32
|
"@babel/preset-typescript": "^7.23.2",
|
|
33
33
|
"@types/serialize-javascript": "^5.0.1",
|
|
34
34
|
"html-webpack-plugin": "npm:html-rspack-plugin@5.5.7",
|
|
35
|
-
"terser": "5.
|
|
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",
|