@rspack/core 0.5.9-canary-ba4ea23-20240407091611 → 0.5.9-canary-5c28140-20240407103120

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.
@@ -168,6 +168,7 @@ export declare class Compilation {
168
168
  __internal__pushNativeDiagnostics(diagnostics: ExternalObject<any>): void;
169
169
  get errors(): {
170
170
  push: (...errs: (Error | JsStatsError | string)[]) => void;
171
+ readonly length: number;
171
172
  [Symbol.iterator](): {
172
173
  next(): {
173
174
  done: boolean;
@@ -275,6 +275,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
275
275
  options.modulesSpace || (context.forToString ? 15 : Infinity);
276
276
  options.ids = optionOrLocalFallback(options.ids, !context.forToString);
277
277
  options.children = optionOrLocalFallback(options.children, !context.forToString);
278
+ options.orphanModules = optionOrLocalFallback(options.orphanModules, context.forToString ? false : true);
278
279
  return options;
279
280
  }
280
281
  createStatsFactory(options) {
@@ -380,6 +381,9 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
380
381
  }
381
382
  }
382
383
  },
384
+ get length() {
385
+ return inner.getStats().getErrors().length;
386
+ },
383
387
  [Symbol.iterator]() {
384
388
  // TODO: this is obviously a bad design, optimize this after finishing angular prototype
385
389
  const errors = inner.getStats().getErrors();
@@ -44,7 +44,9 @@ const pitch = function (request, _, data) {
44
44
  this._compiler.options &&
45
45
  this._compiler.options.experiments &&
46
46
  this._compiler.options.experiments.css) {
47
- this.emitWarning(new Error("You can't use `experiments.css` and `mini-css-extract-plugin` together, please set `experiments.css` to `false`"));
47
+ let e = new Error("You can't use `experiments.css` and `mini-css-extract-plugin` together, please set `experiments.css` to `false`");
48
+ e.stack = undefined;
49
+ this.emitWarning(e);
48
50
  return;
49
51
  }
50
52
  const options = this.getOptions(loader_options_json_1.default);
@@ -104,7 +106,8 @@ const pitch = function (request, _, data) {
104
106
  }
105
107
  if (Array.isArray(exports) && emit) {
106
108
  const identifierCountMap = new Map();
107
- dependencies = exports.map(([id, content, media, sourceMap, supports, layer]) => {
109
+ dependencies = exports
110
+ .map(([id, content, media, sourceMap, supports, layer]) => {
108
111
  let identifier = id;
109
112
  let context = this.rootContext;
110
113
  const count = identifierCountMap.get(identifier) || 0;
@@ -123,7 +126,8 @@ const pitch = function (request, _, data) {
123
126
  undefined,
124
127
  filepath
125
128
  };
126
- });
129
+ })
130
+ .filter(item => item !== null);
127
131
  }
128
132
  }
129
133
  catch (e) {
@@ -3182,6 +3182,7 @@ declare const statsOptions: z.ZodObject<{
3182
3182
  usedExports: z.ZodOptional<z.ZodBoolean>;
3183
3183
  providedExports: z.ZodOptional<z.ZodBoolean>;
3184
3184
  optimizationBailout: z.ZodOptional<z.ZodBoolean>;
3185
+ orphanModules: z.ZodOptional<z.ZodBoolean>;
3185
3186
  }, "strict", z.ZodTypeAny, {
3186
3187
  all?: boolean | undefined;
3187
3188
  preset?: "none" | "normal" | "verbose" | "errors-only" | "errors-warnings" | undefined;
@@ -3217,6 +3218,7 @@ declare const statsOptions: z.ZodObject<{
3217
3218
  usedExports?: boolean | undefined;
3218
3219
  providedExports?: boolean | undefined;
3219
3220
  optimizationBailout?: boolean | undefined;
3221
+ orphanModules?: boolean | undefined;
3220
3222
  }, {
3221
3223
  all?: boolean | undefined;
3222
3224
  preset?: "none" | "normal" | "verbose" | "errors-only" | "errors-warnings" | undefined;
@@ -3252,6 +3254,7 @@ declare const statsOptions: z.ZodObject<{
3252
3254
  usedExports?: boolean | undefined;
3253
3255
  providedExports?: boolean | undefined;
3254
3256
  optimizationBailout?: boolean | undefined;
3257
+ orphanModules?: boolean | undefined;
3255
3258
  }>;
3256
3259
  export type StatsOptions = z.infer<typeof statsOptions>;
3257
3260
  declare const statsValue: z.ZodUnion<[z.ZodUnion<[z.ZodEnum<["none", "errors-only", "errors-warnings", "normal", "verbose"]>, z.ZodBoolean]>, z.ZodObject<{
@@ -3289,6 +3292,7 @@ declare const statsValue: z.ZodUnion<[z.ZodUnion<[z.ZodEnum<["none", "errors-onl
3289
3292
  usedExports: z.ZodOptional<z.ZodBoolean>;
3290
3293
  providedExports: z.ZodOptional<z.ZodBoolean>;
3291
3294
  optimizationBailout: z.ZodOptional<z.ZodBoolean>;
3295
+ orphanModules: z.ZodOptional<z.ZodBoolean>;
3292
3296
  }, "strict", z.ZodTypeAny, {
3293
3297
  all?: boolean | undefined;
3294
3298
  preset?: "none" | "normal" | "verbose" | "errors-only" | "errors-warnings" | undefined;
@@ -3324,6 +3328,7 @@ declare const statsValue: z.ZodUnion<[z.ZodUnion<[z.ZodEnum<["none", "errors-onl
3324
3328
  usedExports?: boolean | undefined;
3325
3329
  providedExports?: boolean | undefined;
3326
3330
  optimizationBailout?: boolean | undefined;
3331
+ orphanModules?: boolean | undefined;
3327
3332
  }, {
3328
3333
  all?: boolean | undefined;
3329
3334
  preset?: "none" | "normal" | "verbose" | "errors-only" | "errors-warnings" | undefined;
@@ -3359,6 +3364,7 @@ declare const statsValue: z.ZodUnion<[z.ZodUnion<[z.ZodEnum<["none", "errors-onl
3359
3364
  usedExports?: boolean | undefined;
3360
3365
  providedExports?: boolean | undefined;
3361
3366
  optimizationBailout?: boolean | undefined;
3367
+ orphanModules?: boolean | undefined;
3362
3368
  }>]>;
3363
3369
  export type StatsValue = z.infer<typeof statsValue>;
3364
3370
  export interface RspackPluginInstance {
@@ -4829,6 +4835,7 @@ export declare const rspackOptions: z.ZodObject<{
4829
4835
  usedExports: z.ZodOptional<z.ZodBoolean>;
4830
4836
  providedExports: z.ZodOptional<z.ZodBoolean>;
4831
4837
  optimizationBailout: z.ZodOptional<z.ZodBoolean>;
4838
+ orphanModules: z.ZodOptional<z.ZodBoolean>;
4832
4839
  }, "strict", z.ZodTypeAny, {
4833
4840
  all?: boolean | undefined;
4834
4841
  preset?: "none" | "normal" | "verbose" | "errors-only" | "errors-warnings" | undefined;
@@ -4864,6 +4871,7 @@ export declare const rspackOptions: z.ZodObject<{
4864
4871
  usedExports?: boolean | undefined;
4865
4872
  providedExports?: boolean | undefined;
4866
4873
  optimizationBailout?: boolean | undefined;
4874
+ orphanModules?: boolean | undefined;
4867
4875
  }, {
4868
4876
  all?: boolean | undefined;
4869
4877
  preset?: "none" | "normal" | "verbose" | "errors-only" | "errors-warnings" | undefined;
@@ -4899,6 +4907,7 @@ export declare const rspackOptions: z.ZodObject<{
4899
4907
  usedExports?: boolean | undefined;
4900
4908
  providedExports?: boolean | undefined;
4901
4909
  optimizationBailout?: boolean | undefined;
4910
+ orphanModules?: boolean | undefined;
4902
4911
  }>]>>;
4903
4912
  snapshot: z.ZodOptional<z.ZodObject<{
4904
4913
  module: z.ZodOptional<z.ZodObject<{
@@ -5935,6 +5944,7 @@ export declare const rspackOptions: z.ZodObject<{
5935
5944
  usedExports?: boolean | undefined;
5936
5945
  providedExports?: boolean | undefined;
5937
5946
  optimizationBailout?: boolean | undefined;
5947
+ orphanModules?: boolean | undefined;
5938
5948
  } | undefined;
5939
5949
  snapshot?: {
5940
5950
  module?: {
@@ -6319,6 +6329,7 @@ export declare const rspackOptions: z.ZodObject<{
6319
6329
  usedExports?: boolean | undefined;
6320
6330
  providedExports?: boolean | undefined;
6321
6331
  optimizationBailout?: boolean | undefined;
6332
+ orphanModules?: boolean | undefined;
6322
6333
  } | undefined;
6323
6334
  snapshot?: {
6324
6335
  module?: {
@@ -626,7 +626,8 @@ const statsOptions = zod_1.z.strictObject({
626
626
  children: zod_1.z.boolean().optional(),
627
627
  usedExports: zod_1.z.boolean().optional(),
628
628
  providedExports: zod_1.z.boolean().optional(),
629
- optimizationBailout: zod_1.z.boolean().optional()
629
+ optimizationBailout: zod_1.z.boolean().optional(),
630
+ orphanModules: zod_1.z.boolean().optional()
630
631
  });
631
632
  const statsValue = zod_1.z
632
633
  .enum(["none", "errors-only", "errors-warnings", "normal", "verbose"])
package/dist/exports.d.ts CHANGED
@@ -261,6 +261,7 @@ export declare const config: {
261
261
  usedExports?: boolean | undefined;
262
262
  providedExports?: boolean | undefined;
263
263
  optimizationBailout?: boolean | undefined;
264
+ orphanModules?: boolean | undefined;
264
265
  } | undefined;
265
266
  snapshot?: {
266
267
  module?: {
@@ -647,6 +648,7 @@ export declare const config: {
647
648
  usedExports?: boolean | undefined;
648
649
  providedExports?: boolean | undefined;
649
650
  optimizationBailout?: boolean | undefined;
651
+ orphanModules?: boolean | undefined;
650
652
  } | undefined;
651
653
  snapshot?: {
652
654
  module?: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspack/core",
3
- "version": "0.5.9-canary-ba4ea23-20240407091611",
3
+ "version": "0.5.9-canary-5c28140-20240407103120",
4
4
  "webpackVersion": "5.75.0",
5
5
  "license": "MIT",
6
6
  "description": "A Fast Rust-based Web Bundler",
@@ -56,8 +56,8 @@
56
56
  "styled-components": "^6.0.8",
57
57
  "terser": "5.27.2",
58
58
  "wast-loader": "^1.11.4",
59
- "@rspack/core": "0.5.9-canary-ba4ea23-20240407091611",
60
- "@rspack/plugin-minify": "^0.5.9-canary-ba4ea23-20240407091611"
59
+ "@rspack/core": "0.5.9-canary-5c28140-20240407103120",
60
+ "@rspack/plugin-minify": "^0.5.9-canary-5c28140-20240407103120"
61
61
  },
62
62
  "dependencies": {
63
63
  "@module-federation/runtime-tools": "0.0.8",
@@ -72,7 +72,7 @@
72
72
  "webpack-sources": "3.2.3",
73
73
  "zod": "^3.21.4",
74
74
  "zod-validation-error": "1.3.1",
75
- "@rspack/binding": "0.5.9-canary-ba4ea23-20240407091611"
75
+ "@rspack/binding": "0.5.9-canary-5c28140-20240407103120"
76
76
  },
77
77
  "peerDependencies": {
78
78
  "@swc/helpers": ">=0.5.1"