@rsbuild/core 2.3.4 → 2.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.
@@ -1,8 +1,8 @@
1
1
  (() => {
2
2
  var __webpack_modules__ = {
3
- 458: (module, __unused_webpack_exports, __nccwpck_require__) => {
3
+ 655: (module, __unused_webpack_exports, __nccwpck_require__) => {
4
4
  "use strict";
5
- const { HtmlWebpackChildCompiler } = __nccwpck_require__(979);
5
+ const { HtmlWebpackChildCompiler } = __nccwpck_require__(420);
6
6
  const compilerMap = new WeakMap();
7
7
  class CachedChildCompilation {
8
8
  constructor(compiler) {
@@ -41,12 +41,9 @@
41
41
  const latestResult = this.getCompilationResult();
42
42
  const compilationResult = latestResult.compilationResult;
43
43
  return "error" in compilationResult
44
- ? {
45
- mainCompilationHash: latestResult.mainCompilationHash,
46
- error: compilationResult.error,
47
- }
44
+ ? { cached: latestResult.cached, error: compilationResult.error }
48
45
  : {
49
- mainCompilationHash: latestResult.mainCompilationHash,
46
+ cached: latestResult.cached,
50
47
  compiledEntry: compilationResult.compiledEntries[entry],
51
48
  };
52
49
  }
@@ -103,7 +100,7 @@
103
100
  isVerifyingCache: false,
104
101
  entries: [],
105
102
  compiledEntries: [],
106
- mainCompilationHash: "initial",
103
+ cached: false,
107
104
  compilationResult: {
108
105
  dependencies: {
109
106
  fileDependencies: [],
@@ -123,7 +120,6 @@
123
120
  },
124
121
  compiledEntries: {},
125
122
  });
126
- let mainCompilationHashOfLastChildRecompile = "";
127
123
  let previousFileSystemSnapshot;
128
124
  compiler.hooks.make.tapAsync(
129
125
  "PersistentChildCompilerSingletonPlugin",
@@ -147,7 +143,7 @@
147
143
  previousFileSystemSnapshot,
148
144
  mainCompilation,
149
145
  );
150
- let cachedResult = childCompilationResultPromise;
146
+ const cachedResult = childCompilationResultPromise;
151
147
  childCompilationResultPromise = isCacheValidPromise.then(
152
148
  (isCacheValid) => {
153
149
  if (isCacheValid) {
@@ -173,29 +169,17 @@
173
169
  mainCompilation.hooks.additionalAssets.tapAsync(
174
170
  "PersistentChildCompilerSingletonPlugin",
175
171
  (callback) => {
176
- const didRecompilePromise = Promise.all([
177
- childCompilationResultPromise,
178
- cachedResult,
179
- ]).then(
180
- ([childCompilationResult, cachedResult]) =>
181
- cachedResult !== childCompilationResult,
182
- );
183
172
  const handleCompilationDonePromise = Promise.all([
184
173
  childCompilationResultPromise,
185
- didRecompilePromise,
186
- ]).then(([childCompilationResult, didRecompile]) => {
187
- if (didRecompile) {
188
- mainCompilationHashOfLastChildRecompile =
189
- mainCompilation.hash;
190
- }
174
+ isCacheValidPromise,
175
+ ]).then(([childCompilationResult, cached]) => {
191
176
  this.compilationState = {
192
177
  isCompiling: false,
193
178
  isVerifyingCache: false,
194
179
  entries: this.compilationState.entries,
195
180
  compiledEntries: this.compilationState.entries,
196
181
  compilationResult: childCompilationResult,
197
- mainCompilationHash:
198
- mainCompilationHashOfLastChildRecompile,
182
+ cached,
199
183
  };
200
184
  });
201
185
  handleCompilationDonePromise.then(
@@ -254,7 +238,7 @@
254
238
  );
255
239
  }
256
240
  return {
257
- mainCompilationHash: this.compilationState.mainCompilationHash,
241
+ cached: this.compilationState.cached,
258
242
  compilationResult: this.compilationState.compilationResult,
259
243
  };
260
244
  }
@@ -289,13 +273,8 @@
289
273
  (result) => ({
290
274
  compiledEntries: result,
291
275
  dependencies: compiler.fileDependencies,
292
- mainCompilationHash: mainCompilation.hash,
293
- }),
294
- (error) => ({
295
- error,
296
- dependencies: compiler.fileDependencies,
297
- mainCompilationHash: mainCompilation.hash,
298
276
  }),
277
+ (error) => ({ error, dependencies: compiler.fileDependencies }),
299
278
  );
300
279
  }
301
280
  watchFiles(mainCompilation, files) {
@@ -307,7 +286,7 @@
307
286
  }
308
287
  module.exports = { CachedChildCompilation };
309
288
  },
310
- 979: (module) => {
289
+ 420: (module) => {
311
290
  "use strict";
312
291
  class HtmlWebpackChildCompiler {
313
292
  compilationPromise;
@@ -476,7 +455,7 @@
476
455
  }
477
456
  module.exports = { HtmlWebpackChildCompiler };
478
457
  },
479
- 993: (module) => {
458
+ 244: (module) => {
480
459
  "use strict";
481
460
  function none(chunks) {
482
461
  return chunks;
@@ -492,7 +471,7 @@
492
471
  }
493
472
  module.exports = { auto: none, manual, none };
494
473
  },
495
- 816: (module) => {
474
+ 555: (module) => {
496
475
  "use strict";
497
476
  module.exports = function (err) {
498
477
  return {
@@ -516,9 +495,9 @@
516
495
  };
517
496
  };
518
497
  },
519
- 687: (module, __unused_webpack_exports, __nccwpck_require__) => {
498
+ 938: (module, __unused_webpack_exports, __nccwpck_require__) => {
520
499
  "use strict";
521
- const { AsyncSeriesWaterfallHook } = __nccwpck_require__(537);
500
+ const { AsyncSeriesWaterfallHook } = __nccwpck_require__(78);
522
501
  const htmlWebpackPluginHooksMap = new WeakMap();
523
502
  function getHtmlRspackPluginHooks(compilation) {
524
503
  let hooks = htmlWebpackPluginHooksMap.get(compilation);
@@ -542,7 +521,7 @@
542
521
  }
543
522
  module.exports = { getHtmlRspackPluginHooks };
544
523
  },
545
- 302: (module) => {
524
+ 615: (module) => {
546
525
  const voidTags = [
547
526
  "area",
548
527
  "base",
@@ -610,19 +589,19 @@
610
589
  htmlTagObjectToString,
611
590
  };
612
591
  },
613
- 391: (module, __unused_webpack_exports, __nccwpck_require__) => {
592
+ 566: (module, __unused_webpack_exports, __nccwpck_require__) => {
614
593
  "use strict";
615
594
  const promisify = __nccwpck_require__(23).promisify;
616
595
  const vm = __nccwpck_require__(154);
617
596
  const fs = __nccwpck_require__(896);
618
597
  const path = __nccwpck_require__(928);
619
- const { CachedChildCompilation } = __nccwpck_require__(458);
598
+ const { CachedChildCompilation } = __nccwpck_require__(655);
620
599
  const { createHtmlTagObject, htmlTagObjectToString, HtmlTagArray } =
621
- __nccwpck_require__(302);
622
- const prettyError = __nccwpck_require__(816);
623
- const chunkSorter = __nccwpck_require__(993);
600
+ __nccwpck_require__(615);
601
+ const prettyError = __nccwpck_require__(555);
602
+ const chunkSorter = __nccwpck_require__(244);
624
603
  const getHtmlRspackPluginHooks =
625
- __nccwpck_require__(687).getHtmlRspackPluginHooks;
604
+ __nccwpck_require__(938).getHtmlRspackPluginHooks;
626
605
  const WITH_PLACEHOLDER = "function __with_placeholder__";
627
606
  class HtmlRspackPlugin {
628
607
  constructor(userOptions = {}) {
@@ -1274,7 +1253,7 @@
1274
1253
  compilation,
1275
1254
  );
1276
1255
  const templateResult = this.options.templateContent
1277
- ? { mainCompilationHash: compilation.hash }
1256
+ ? { cached: false }
1278
1257
  : childCompilerPlugin.getCompilationEntryResult(
1279
1258
  this.options.template,
1280
1259
  );
@@ -1283,8 +1262,6 @@
1283
1262
  prettyError(templateResult.error).toString(),
1284
1263
  );
1285
1264
  }
1286
- const isCompilationCached =
1287
- templateResult.mainCompilationHash !== compilation.hash;
1288
1265
  const assetsInformationByGroups = this.getAssetsInformationByGroups(
1289
1266
  compilation,
1290
1267
  outputName,
@@ -1295,7 +1272,7 @@
1295
1272
  this.getAssetFiles(assetsInformationByGroups),
1296
1273
  );
1297
1274
  if (
1298
- isCompilationCached &&
1275
+ templateResult.cached &&
1299
1276
  this.options.cache &&
1300
1277
  assetJson.value === newAssetJson
1301
1278
  ) {
@@ -1520,7 +1497,7 @@
1520
1497
  "use strict";
1521
1498
  module.exports = require("vm");
1522
1499
  },
1523
- 537: (__unused_webpack_module, exports) => {
1500
+ 78: (__unused_webpack_module, exports) => {
1524
1501
  "use strict";
1525
1502
  var __nested_webpack_require_18__ = {};
1526
1503
  (() => {
@@ -2445,6 +2422,6 @@
2445
2422
  }
2446
2423
  if (typeof __nccwpck_require__ !== "undefined")
2447
2424
  __nccwpck_require__.ab = __dirname + "/";
2448
- var __webpack_exports__ = __nccwpck_require__(391);
2425
+ var __webpack_exports__ = __nccwpck_require__(566);
2449
2426
  module.exports = __webpack_exports__;
2450
2427
  })();
@@ -1 +1 @@
1
- {"name":"html-rspack-plugin","author":"Jan Nicklas <j.nicklas@me.com> (https://github.com/jantimon)","version":"6.1.11","funding":{"type":"opencollective","url":"https://opencollective.com/html-webpack-plugin"},"license":"MIT","types":"index.d.ts","type":"commonjs"}
1
+ {"name":"html-rspack-plugin","author":"Jan Nicklas <j.nicklas@me.com> (https://github.com/jantimon)","version":"6.1.12","funding":{"type":"opencollective","url":"https://opencollective.com/html-webpack-plugin"},"license":"MIT","types":"index.d.ts","type":"commonjs"}