@rsbuild/plugin-assets-retry 0.0.20 → 0.0.22

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.js CHANGED
@@ -53,13 +53,12 @@ var AssetsRetryPlugin_exports = {};
53
53
  __export(AssetsRetryPlugin_exports, {
54
54
  AssetsRetryPlugin: () => AssetsRetryPlugin
55
55
  });
56
- var import_path, import_webpack_sources, import_fs_extra, import_shared, _retryOptions, AssetsRetryPlugin;
56
+ var import_path, import_webpack_sources, import_shared, _retryOptions, AssetsRetryPlugin;
57
57
  var init_AssetsRetryPlugin = __esm({
58
58
  "src/AssetsRetryPlugin.ts"() {
59
59
  "use strict";
60
60
  import_path = __toESM(require("path"));
61
- import_webpack_sources = require("webpack-sources");
62
- import_fs_extra = require("@rsbuild/shared/fs-extra");
61
+ import_webpack_sources = __toESM(require("@rsbuild/shared/webpack-sources"));
63
62
  import_shared = require("@rsbuild/shared");
64
63
  AssetsRetryPlugin = class {
65
64
  constructor(options) {
@@ -80,7 +79,7 @@ var init_AssetsRetryPlugin = __esm({
80
79
  async getRetryCode() {
81
80
  const { default: serialize } = await import("serialize-javascript");
82
81
  const runtimeFilePath = import_path.default.join(__dirname, "./runtime.js");
83
- const runtimeCode = await import_fs_extra.fs.readFile(runtimeFilePath, "utf-8");
82
+ const runtimeCode = await import_shared.fse.readFile(runtimeFilePath, "utf-8");
84
83
  return `(function(){${runtimeCode};init(${serialize(
85
84
  __privateGet(this, _retryOptions)
86
85
  )});})()`;
@@ -104,7 +103,7 @@ var init_AssetsRetryPlugin = __esm({
104
103
  },
105
104
  async (assets) => {
106
105
  const scriptPath = await this.getScriptPath();
107
- assets[scriptPath] = new import_webpack_sources.RawSource(
106
+ assets[scriptPath] = new import_webpack_sources.default.RawSource(
108
107
  await this.getRetryCode(),
109
108
  false
110
109
  );
package/dist/index.mjs CHANGED
@@ -54,9 +54,9 @@ __export(AssetsRetryPlugin_exports, {
54
54
  AssetsRetryPlugin: () => AssetsRetryPlugin
55
55
  });
56
56
  import path2 from "path";
57
- import { RawSource } from "webpack-sources";
58
- import { fs } from "@rsbuild/shared/fs-extra";
57
+ import WebpackSources from "@rsbuild/shared/webpack-sources";
59
58
  import {
59
+ fse,
60
60
  withPublicPath,
61
61
  generateScriptTag,
62
62
  getRsbuildVersion,
@@ -88,7 +88,7 @@ var init_AssetsRetryPlugin = __esm({
88
88
  async getRetryCode() {
89
89
  const { default: serialize } = await import("serialize-javascript");
90
90
  const runtimeFilePath = path2.join(__dirname, "./runtime.js");
91
- const runtimeCode = await fs.readFile(runtimeFilePath, "utf-8");
91
+ const runtimeCode = await fse.readFile(runtimeFilePath, "utf-8");
92
92
  return `(function(){${runtimeCode};init(${serialize(
93
93
  __privateGet(this, _retryOptions)
94
94
  )});})()`;
@@ -112,7 +112,7 @@ var init_AssetsRetryPlugin = __esm({
112
112
  },
113
113
  async (assets) => {
114
114
  const scriptPath = await this.getScriptPath();
115
- assets[scriptPath] = new RawSource(
115
+ assets[scriptPath] = new WebpackSources.RawSource(
116
116
  await this.getRetryCode(),
117
117
  false
118
118
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rsbuild/plugin-assets-retry",
3
- "version": "0.0.20",
3
+ "version": "0.0.22",
4
4
  "description": "Assets retry plugin for Rsbuild",
5
5
  "homepage": "https://rsbuild.dev",
6
6
  "repository": {
@@ -23,19 +23,18 @@
23
23
  ],
24
24
  "dependencies": {
25
25
  "serialize-javascript": "^6.0.0",
26
- "webpack-sources": "^3.2.3",
27
- "@rsbuild/shared": "0.0.20"
26
+ "@rsbuild/shared": "0.0.22"
28
27
  },
29
28
  "devDependencies": {
30
29
  "@babel/core": "^7.23.2",
31
30
  "@babel/preset-env": "^7.23.2",
32
31
  "@babel/preset-typescript": "^7.23.2",
33
32
  "@types/serialize-javascript": "^5.0.1",
34
- "html-webpack-plugin": "npm:html-rspack-plugin@5.5.4",
33
+ "html-webpack-plugin": "npm:html-rspack-plugin@5.5.5",
35
34
  "terser": "5.19.2",
36
35
  "typescript": "^5.2.2",
37
- "@rsbuild/test-helper": "0.0.20",
38
- "@rsbuild/core": "0.0.20"
36
+ "@rsbuild/core": "0.0.22",
37
+ "@rsbuild/test-helper": "0.0.22"
39
38
  },
40
39
  "publishConfig": {
41
40
  "access": "public",