@rsbuild/plugin-assets-retry 0.7.6 → 0.7.8

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.cjs CHANGED
@@ -58,11 +58,12 @@ var AssetsRetryPlugin_exports = {};
58
58
  __export(AssetsRetryPlugin_exports, {
59
59
  AssetsRetryPlugin: () => AssetsRetryPlugin
60
60
  });
61
- var import_node_path, import_shared, _retryOptions, AssetsRetryPlugin;
61
+ var import_node_path, import_core, import_shared, _retryOptions, AssetsRetryPlugin;
62
62
  var init_AssetsRetryPlugin = __esm({
63
63
  "src/AssetsRetryPlugin.ts"() {
64
64
  "use strict";
65
65
  import_node_path = __toESM(require("path"));
66
+ import_core = require("@rsbuild/core");
66
67
  import_shared = require("@rsbuild/shared");
67
68
  AssetsRetryPlugin = class {
68
69
  constructor(options) {
@@ -105,7 +106,7 @@ var init_AssetsRetryPlugin = __esm({
105
106
  if (!this.scriptPath) {
106
107
  this.scriptPath = import_node_path.default.posix.join(
107
108
  this.distDir,
108
- `assets-retry.${"0.7.6"}.js`
109
+ `assets-retry.${"0.7.8"}.js`
109
110
  );
110
111
  }
111
112
  return this.scriptPath;
@@ -144,7 +145,10 @@ var init_AssetsRetryPlugin = __esm({
144
145
  });
145
146
  } else {
146
147
  const publicPath = (0, import_shared.getPublicPathFromCompiler)(compiler);
147
- const url = (0, import_shared.withPublicPath)(await this.getScriptPath(), publicPath);
148
+ const url = (0, import_core.ensureAssetPrefix)(
149
+ await this.getScriptPath(),
150
+ publicPath
151
+ );
148
152
  data.headTags.unshift({
149
153
  ...scriptTag,
150
154
  attributes: {
@@ -188,12 +192,12 @@ ${appendSource}`, "utf-8");
188
192
  throw err;
189
193
  }
190
194
  }
191
- var import_node_path2, import_core, import_shared2, import_serialize_javascript, AsyncChunkRetryPlugin;
195
+ var import_node_path2, import_core2, import_shared2, import_serialize_javascript, AsyncChunkRetryPlugin;
192
196
  var init_AsyncChunkRetryPlugin = __esm({
193
197
  "src/AsyncChunkRetryPlugin.ts"() {
194
198
  "use strict";
195
199
  import_node_path2 = __toESM(require("path"));
196
- import_core = require("@rsbuild/core");
200
+ import_core2 = require("@rsbuild/core");
197
201
  import_shared2 = require("@rsbuild/shared");
198
202
  import_serialize_javascript = __toESM(require("serialize-javascript"));
199
203
  AsyncChunkRetryPlugin = class {
@@ -213,7 +217,7 @@ var init_AsyncChunkRetryPlugin = __esm({
213
217
  ]);
214
218
  }
215
219
  getRawRuntimeRetryCode() {
216
- const { RuntimeGlobals } = import_core.rspack;
220
+ const { RuntimeGlobals } = import_core2.rspack;
217
221
  const filename = "asyncChunkRetry";
218
222
  const runtimeFilePath = import_node_path2.default.join(
219
223
  __dirname,
@@ -254,12 +258,14 @@ var init_AsyncChunkRetryPlugin = __esm({
254
258
  // src/index.ts
255
259
  var src_exports = {};
256
260
  __export(src_exports, {
261
+ PLUGIN_ASSETS_RETRY_NAME: () => PLUGIN_ASSETS_RETRY_NAME,
257
262
  pluginAssetsRetry: () => pluginAssetsRetry
258
263
  });
259
264
  module.exports = __toCommonJS(src_exports);
260
265
  var import_shared3 = require("@rsbuild/shared");
266
+ var PLUGIN_ASSETS_RETRY_NAME = "rsbuild:assets-retry";
261
267
  var pluginAssetsRetry = (options = {}) => ({
262
- name: "rsbuild:assets-retry",
268
+ name: PLUGIN_ASSETS_RETRY_NAME,
263
269
  setup(api) {
264
270
  api.modifyBundlerChain(
265
271
  async (chain, { CHAIN_ID, target, HtmlPlugin, isProd }) => {
@@ -292,5 +298,6 @@ var pluginAssetsRetry = (options = {}) => ({
292
298
  });
293
299
  // Annotate the CommonJS export names for ESM import in node:
294
300
  0 && (module.exports = {
301
+ PLUGIN_ASSETS_RETRY_NAME,
295
302
  pluginAssetsRetry
296
303
  });
package/dist/index.d.ts CHANGED
@@ -65,6 +65,7 @@ type AssetsRetryHookContext = {
65
65
  tagName: string;
66
66
  };
67
67
 
68
+ declare const PLUGIN_ASSETS_RETRY_NAME = "rsbuild:assets-retry";
68
69
  declare const pluginAssetsRetry: (options?: PluginAssetsRetryOptions) => RsbuildPlugin;
69
70
 
70
- export { type PluginAssetsRetryOptions, pluginAssetsRetry };
71
+ export { PLUGIN_ASSETS_RETRY_NAME, type PluginAssetsRetryOptions, pluginAssetsRetry };
package/dist/index.js 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.52.0_eslint@9.4.0_typescript@5.4.5/node_modules/@modern-js/module-tools/shims/esm.js
37
+ // ../../node_modules/.pnpm/@modern-js+module-tools@2.52.0_eslint@9.5.0_typescript@5.4.5/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.52.0_eslint@9.4.0_typescript@5.4.5/node_modules/@modern-js/module-tools/shims/esm.js"() {
42
+ "../../node_modules/.pnpm/@modern-js+module-tools@2.52.0_eslint@9.5.0_typescript@5.4.5/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());
@@ -53,11 +53,11 @@ __export(AssetsRetryPlugin_exports, {
53
53
  AssetsRetryPlugin: () => AssetsRetryPlugin
54
54
  });
55
55
  import path2 from "path";
56
+ import { ensureAssetPrefix } from "@rsbuild/core";
56
57
  import {
57
58
  fse,
58
59
  generateScriptTag,
59
- getPublicPathFromCompiler,
60
- withPublicPath
60
+ getPublicPathFromCompiler
61
61
  } from "@rsbuild/shared";
62
62
  var _retryOptions, AssetsRetryPlugin;
63
63
  var init_AssetsRetryPlugin = __esm({
@@ -105,7 +105,7 @@ var init_AssetsRetryPlugin = __esm({
105
105
  if (!this.scriptPath) {
106
106
  this.scriptPath = path2.posix.join(
107
107
  this.distDir,
108
- `assets-retry.${"0.7.6"}.js`
108
+ `assets-retry.${"0.7.8"}.js`
109
109
  );
110
110
  }
111
111
  return this.scriptPath;
@@ -144,7 +144,10 @@ var init_AssetsRetryPlugin = __esm({
144
144
  });
145
145
  } else {
146
146
  const publicPath = getPublicPathFromCompiler(compiler);
147
- const url = withPublicPath(await this.getScriptPath(), publicPath);
147
+ const url = ensureAssetPrefix(
148
+ await this.getScriptPath(),
149
+ publicPath
150
+ );
148
151
  data.headTags.unshift({
149
152
  ...scriptTag,
150
153
  attributes: {
@@ -255,8 +258,9 @@ var init_AsyncChunkRetryPlugin = __esm({
255
258
  // src/index.ts
256
259
  init_esm();
257
260
  import { getDistPath, isHtmlDisabled } from "@rsbuild/shared";
261
+ var PLUGIN_ASSETS_RETRY_NAME = "rsbuild:assets-retry";
258
262
  var pluginAssetsRetry = (options = {}) => ({
259
- name: "rsbuild:assets-retry",
263
+ name: PLUGIN_ASSETS_RETRY_NAME,
260
264
  setup(api) {
261
265
  api.modifyBundlerChain(
262
266
  async (chain, { CHAIN_ID, target, HtmlPlugin, isProd }) => {
@@ -288,5 +292,6 @@ var pluginAssetsRetry = (options = {}) => ({
288
292
  }
289
293
  });
290
294
  export {
295
+ PLUGIN_ASSETS_RETRY_NAME,
291
296
  pluginAssetsRetry
292
297
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rsbuild/plugin-assets-retry",
3
- "version": "0.7.6",
3
+ "version": "0.7.8",
4
4
  "description": "Assets retry plugin for Rsbuild",
5
5
  "homepage": "https://rsbuild.dev",
6
6
  "repository": {
@@ -24,20 +24,20 @@
24
24
  ],
25
25
  "dependencies": {
26
26
  "serialize-javascript": "^6.0.2",
27
- "@rsbuild/shared": "0.7.6"
27
+ "@rsbuild/shared": "0.7.8"
28
28
  },
29
29
  "devDependencies": {
30
- "@babel/core": "^7.24.6",
31
- "@babel/preset-env": "^7.24.6",
32
- "@babel/preset-typescript": "^7.24.6",
30
+ "@babel/core": "^7.24.7",
31
+ "@babel/preset-env": "^7.24.7",
32
+ "@babel/preset-typescript": "^7.24.7",
33
33
  "@types/serialize-javascript": "^5.0.4",
34
34
  "html-webpack-plugin": "npm:html-rspack-plugin@5.7.2",
35
- "terser": "5.31.0",
35
+ "terser": "5.31.1",
36
36
  "typescript": "^5.4.2",
37
- "@rsbuild/core": "0.7.6"
37
+ "@rsbuild/core": "0.7.8"
38
38
  },
39
39
  "peerDependencies": {
40
- "@rsbuild/core": "^0.7.6"
40
+ "@rsbuild/core": "^0.7.8"
41
41
  },
42
42
  "publishConfig": {
43
43
  "access": "public",