@rspack/core 0.7.6-canary-1a0d77d-20240627143904 → 1.0.0-alpha.1

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.
Files changed (87) hide show
  1. package/README.md +2 -2
  2. package/compiled/enhanced-resolve/index.js +11 -11
  3. package/compiled/webpack-sources/index.d.ts +130 -0
  4. package/compiled/webpack-sources/index.js +3520 -0
  5. package/compiled/webpack-sources/license +21 -0
  6. package/compiled/webpack-sources/package.json +1 -0
  7. package/dist/Chunk.d.ts +19 -14
  8. package/dist/Chunk.js +22 -17
  9. package/dist/ChunkGraph.d.ts +1 -1
  10. package/dist/ChunkGraph.js +5 -5
  11. package/dist/ChunkGroup.d.ts +17 -7
  12. package/dist/ChunkGroup.js +12 -2
  13. package/dist/Compilation.d.ts +31 -33
  14. package/dist/Compilation.js +33 -53
  15. package/dist/Compiler.d.ts +26 -28
  16. package/dist/Compiler.js +74 -26
  17. package/dist/ContextModuleFactory.d.ts +1 -1
  18. package/dist/ContextModuleFactory.js +1 -1
  19. package/dist/Entrypoint.d.ts +1 -1
  20. package/dist/Entrypoint.js +2 -2
  21. package/dist/Module.d.ts +12 -7
  22. package/dist/Module.js +1 -0
  23. package/dist/MultiCompiler.d.ts +11 -11
  24. package/dist/MultiCompiler.js +30 -13
  25. package/dist/NormalModule.d.ts +7 -4
  26. package/dist/NormalModule.js +27 -11
  27. package/dist/NormalModuleFactory.d.ts +3 -1
  28. package/dist/NormalModuleFactory.js +3 -23
  29. package/dist/ResolverFactory.d.ts +3 -3
  30. package/dist/ResolverFactory.js +1 -1
  31. package/dist/RspackError.d.ts +8 -0
  32. package/dist/RspackError.js +21 -0
  33. package/dist/Stats.d.ts +4 -2
  34. package/dist/Stats.js +6 -0
  35. package/dist/Template.d.ts +1 -1
  36. package/dist/Template.js +2 -2
  37. package/dist/Watching.d.ts +1 -1
  38. package/dist/builtin-loader/swc/index.d.ts +0 -4
  39. package/dist/builtin-loader/swc/index.js +1 -5
  40. package/dist/builtin-loader/swc/preact.d.ts +3 -4
  41. package/dist/builtin-loader/swc/types.d.ts +2 -17
  42. package/dist/builtin-plugin/BundlerInfoRspackPlugin.d.ts +1 -0
  43. package/dist/builtin-plugin/BundlerInfoRspackPlugin.js +1 -0
  44. package/dist/builtin-plugin/JavascriptModulesPlugin.d.ts +1 -1
  45. package/dist/builtin-plugin/JavascriptModulesPlugin.js +1 -1
  46. package/dist/builtin-plugin/LightningCssMiminizerRspackPlugin.js +1 -1
  47. package/dist/builtin-plugin/SplitChunksPlugin.js +11 -2
  48. package/dist/builtin-plugin/SwcJsMinimizerPlugin.d.ts +0 -28
  49. package/dist/builtin-plugin/SwcJsMinimizerPlugin.js +20 -69
  50. package/dist/builtin-plugin/css-extract/index.d.ts +2 -2
  51. package/dist/config/adapter.js +30 -16
  52. package/dist/config/adapterRuleUse.js +0 -11
  53. package/dist/config/defaults.js +22 -30
  54. package/dist/config/normalization.js +13 -5
  55. package/dist/config/zod.d.ts +753 -205
  56. package/dist/config/zod.js +27 -13
  57. package/dist/container/ModuleFederationPlugin.js +1 -1
  58. package/dist/container/default.runtime.js +1 -170
  59. package/dist/exports.d.ts +9 -2
  60. package/dist/exports.js +11 -6
  61. package/dist/lib/Cache.d.ts +3 -3
  62. package/dist/lib/Cache.js +1 -1
  63. package/dist/loader-runner/index.js +37 -12
  64. package/dist/rspack.d.ts +1 -1
  65. package/dist/rspackOptionsApply.js +3 -0
  66. package/dist/stats/DefaultStatsFactoryPlugin.js +35 -11
  67. package/dist/stats/DefaultStatsPrinterPlugin.js +2 -2
  68. package/dist/stats/StatsFactory.d.ts +2 -2
  69. package/dist/stats/StatsFactory.js +12 -12
  70. package/dist/stats/StatsPrinter.d.ts +1 -1
  71. package/dist/stats/StatsPrinter.js +8 -8
  72. package/dist/stats/statsFactoryUtils.d.ts +13 -4
  73. package/dist/util/SplitChunkSize.d.ts +5 -0
  74. package/dist/util/SplitChunkSize.js +18 -0
  75. package/dist/util/index.d.ts +2 -2
  76. package/dist/util/index.js +4 -3
  77. package/dist/util/memoize.js +5 -1
  78. package/dist/util/source.d.ts +1 -1
  79. package/dist/util/source.js +1 -1
  80. package/package.json +14 -9
  81. package/dist/builtin-loader/swc/emotion.d.ts +0 -17
  82. package/dist/builtin-loader/swc/emotion.js +0 -22
  83. package/dist/builtin-loader/swc/relay.d.ts +0 -5
  84. package/dist/builtin-loader/swc/relay.js +0 -48
  85. package/dist/container/default.runtime.d.ts +0 -2
  86. package/dist/lite-tapable/index.d.ts +0 -146
  87. package/dist/lite-tapable/index.js +0 -752
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  <picture>
2
- <source media="(prefers-color-scheme: dark)" srcset="https://lf3-static.bytednsdoc.com/obj/eden-cn/rjhwzy/ljhwZthlaukjlkulzlp/rspack-banner-1610-dark.png">
3
- <img alt="Rspack Banner" src="https://lf3-static.bytednsdoc.com/obj/eden-cn/rjhwzy/ljhwZthlaukjlkulzlp/rspack-banner-1610.png">
2
+ <source media="(prefers-color-scheme: dark)" srcset="https://assets.rspack.dev/rspack/rspack-banner-plain-dark.png">
3
+ <img alt="Rspack Banner" src="https://assets.rspack.dev/rspack/rspack-banner-plain-light.png">
4
4
  </picture>
5
5
 
6
6
  # @rspack/core
@@ -1267,7 +1267,7 @@ module.exports = class DirectoryExistsPlugin {
1267
1267
  const path = __nccwpck_require__(17);
1268
1268
  const DescriptionFileUtils = __nccwpck_require__(702);
1269
1269
  const forEachBail = __nccwpck_require__(266);
1270
- const { processExportsField } = __nccwpck_require__(348);
1270
+ const { processExportsField } = __nccwpck_require__(302);
1271
1271
  const { parseIdentifier } = __nccwpck_require__(780);
1272
1272
  const { checkImportsExportsFieldTarget } = __nccwpck_require__(11);
1273
1273
 
@@ -1563,7 +1563,7 @@ module.exports = class FileExistsPlugin {
1563
1563
  const path = __nccwpck_require__(17);
1564
1564
  const DescriptionFileUtils = __nccwpck_require__(702);
1565
1565
  const forEachBail = __nccwpck_require__(266);
1566
- const { processImportsField } = __nccwpck_require__(348);
1566
+ const { processImportsField } = __nccwpck_require__(302);
1567
1567
  const { parseIdentifier } = __nccwpck_require__(780);
1568
1568
  const { checkImportsExportsFieldTarget } = __nccwpck_require__(11);
1569
1569
 
@@ -2381,7 +2381,7 @@ module.exports = class PnpPlugin {
2381
2381
 
2382
2382
 
2383
2383
 
2384
- const { AsyncSeriesBailHook, AsyncSeriesHook, SyncHook } = __nccwpck_require__(267);
2384
+ const { AsyncSeriesBailHook, AsyncSeriesHook, SyncHook } = __nccwpck_require__(348);
2385
2385
  const createInnerContext = __nccwpck_require__(478);
2386
2386
  const { parseIdentifier } = __nccwpck_require__(780);
2387
2387
  const {
@@ -4545,7 +4545,7 @@ module.exports = mergeExports(resolve, {
4545
4545
 
4546
4546
  /***/ }),
4547
4547
 
4548
- /***/ 348:
4548
+ /***/ 302:
4549
4549
  /***/ ((module) => {
4550
4550
 
4551
4551
  /*
@@ -5489,6 +5489,13 @@ module.exports = require("../graceful-fs/index.js");
5489
5489
 
5490
5490
  /***/ }),
5491
5491
 
5492
+ /***/ 348:
5493
+ /***/ ((module) => {
5494
+
5495
+ module.exports = require("@rspack/lite-tapable");
5496
+
5497
+ /***/ }),
5498
+
5492
5499
  /***/ 17:
5493
5500
  /***/ ((module) => {
5494
5501
 
@@ -5508,13 +5515,6 @@ module.exports = require("pnpapi");
5508
5515
 
5509
5516
  module.exports = require("process");
5510
5517
 
5511
- /***/ }),
5512
-
5513
- /***/ 267:
5514
- /***/ ((module) => {
5515
-
5516
- module.exports = require("tapable");
5517
-
5518
5518
  /***/ })
5519
5519
 
5520
5520
  /******/ });
@@ -0,0 +1,130 @@
1
+ declare class Hash {
2
+ constructor();
3
+
4
+ /**
5
+ * Update hash {@link https://nodejs.org/api/crypto.html#crypto_hash_update_data_inputencoding}
6
+ */
7
+ update(data: string | Buffer, inputEncoding?: string): Hash;
8
+
9
+ /**
10
+ * Calculates the digest {@link https://nodejs.org/api/crypto.html#crypto_hash_digest_encoding}
11
+ */
12
+ digest(encoding?: string): string | Buffer;
13
+ }
14
+
15
+ export type MapOptions = { columns?: boolean; module?: boolean };
16
+
17
+ export type RawSourceMap = {
18
+ version: number;
19
+ sources: string[];
20
+ names: string[];
21
+ sourceRoot?: string;
22
+ sourcesContent?: string[];
23
+ mappings: string;
24
+ file: string;
25
+ };
26
+
27
+ export abstract class Source {
28
+ size(): number;
29
+
30
+ map(options?: MapOptions): RawSourceMap | null;
31
+
32
+ sourceAndMap(options?: MapOptions): {
33
+ source: string | Buffer;
34
+ map: Object;
35
+ };
36
+
37
+ updateHash(hash: Hash): void;
38
+
39
+ source(): string | Buffer;
40
+
41
+ buffer(): Buffer;
42
+ }
43
+
44
+ export class RawSource extends Source {
45
+ constructor(source: string | Buffer, convertToString?: boolean);
46
+
47
+ isBuffer(): boolean;
48
+ }
49
+
50
+ export class OriginalSource extends Source {
51
+ constructor(source: string | Buffer, name: string);
52
+
53
+ getName(): string;
54
+ }
55
+
56
+ export class ReplaceSource extends Source {
57
+ constructor(source: Source, name?: string);
58
+
59
+ replace(start: number, end: number, newValue: string, name?: string): void;
60
+ insert(pos: number, newValue: string, name?: string): void;
61
+
62
+ getName(): string;
63
+ original(): string;
64
+ getReplacements(): {
65
+ start: number;
66
+ end: number;
67
+ content: string;
68
+ insertIndex: number;
69
+ name: string;
70
+ }[];
71
+ }
72
+
73
+ export class SourceMapSource extends Source {
74
+ constructor(
75
+ source: string | Buffer,
76
+ name: string,
77
+ sourceMap: Object | string | Buffer,
78
+ originalSource?: string | Buffer,
79
+ innerSourceMap?: Object | string | Buffer,
80
+ removeOriginalSource?: boolean
81
+ );
82
+
83
+ getArgsAsBuffers(): [
84
+ Buffer,
85
+ string,
86
+ Buffer,
87
+ Buffer | undefined,
88
+ Buffer | undefined,
89
+ boolean
90
+ ];
91
+ }
92
+
93
+ export class ConcatSource extends Source {
94
+ constructor(...args: (string | Source)[]);
95
+
96
+ getChildren(): Source[];
97
+
98
+ add(item: string | Source): void;
99
+ addAllSkipOptimizing(items: Source[]): void;
100
+ }
101
+
102
+ export class PrefixSource extends Source {
103
+ constructor(prefix: string, source: string | Source);
104
+
105
+ original(): Source;
106
+ getPrefix(): string;
107
+ }
108
+
109
+ export class CachedSource extends Source {
110
+ constructor(source: Source);
111
+ constructor(source: Source | (() => Source), cachedData?: any);
112
+
113
+ original(): Source;
114
+ originalLazy(): Source | (() => Source);
115
+ getCachedData(): any;
116
+ }
117
+
118
+ export class SizeOnlySource extends Source {
119
+ constructor(size: number);
120
+ }
121
+
122
+ interface SourceLike {
123
+ source(): string | Buffer;
124
+ }
125
+
126
+ export class CompatSource extends Source {
127
+ constructor(sourceLike: SourceLike);
128
+
129
+ static from(sourceLike: SourceLike): Source;
130
+ }