@rspack/core 0.5.9-canary-73d1234-20240407005733 → 0.5.9-canary-ba4ea23-20240407091611

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.
@@ -0,0 +1,79 @@
1
+ {
2
+ "title": "Mini CSS Extract Plugin options",
3
+ "type": "object",
4
+ "additionalProperties": false,
5
+ "properties": {
6
+ "filename": {
7
+ "anyOf": [
8
+ {
9
+ "type": "string",
10
+ "absolutePath": false,
11
+ "minLength": 1
12
+ },
13
+ {
14
+ "instanceof": "Function"
15
+ }
16
+ ],
17
+ "description": "This option determines the name of each output CSS file.",
18
+ "link": "https://github.com/webpack-contrib/mini-css-extract-plugin#filename"
19
+ },
20
+ "chunkFilename": {
21
+ "anyOf": [
22
+ {
23
+ "type": "string",
24
+ "absolutePath": false,
25
+ "minLength": 1
26
+ },
27
+ {
28
+ "instanceof": "Function"
29
+ }
30
+ ],
31
+ "description": "This option determines the name of non-entry chunk files.",
32
+ "link": "https://github.com/webpack-contrib/mini-css-extract-plugin#chunkfilename"
33
+ },
34
+ "experimentalUseImportModule": {
35
+ "type": "boolean",
36
+ "description": "Enable the experimental importModule approach instead of using child compilers. This uses less memory and is faster.",
37
+ "link": "https://github.com/webpack-contrib/mini-css-extract-plugin#experimentaluseimportmodule"
38
+ },
39
+ "ignoreOrder": {
40
+ "type": "boolean",
41
+ "description": "Remove Order Warnings.",
42
+ "link": "https://github.com/webpack-contrib/mini-css-extract-plugin#ignoreorder"
43
+ },
44
+ "insert": {
45
+ "description": "Inserts the `link` tag at the given position for non-initial (async) (https://webpack.js.org/concepts/under-the-hood/#chunks) CSS chunks.",
46
+ "link": "https://github.com/webpack-contrib/mini-css-extract-plugin#insert",
47
+ "anyOf": [
48
+ {
49
+ "type": "string"
50
+ },
51
+ {
52
+ "instanceof": "Function"
53
+ }
54
+ ]
55
+ },
56
+ "attributes": {
57
+ "description": "Adds custom attributes to the `link` tag for non-initial (async) (https://webpack.js.org/concepts/under-the-hood/#chunks) CSS chunks.",
58
+ "link": "https://github.com/webpack-contrib/mini-css-extract-plugin#attributes",
59
+ "type": "object"
60
+ },
61
+ "linkType": {
62
+ "anyOf": [
63
+ {
64
+ "enum": ["text/css"]
65
+ },
66
+ {
67
+ "type": "boolean"
68
+ }
69
+ ],
70
+ "description": "This option allows loading asynchronous chunks with a custom link type",
71
+ "link": "https://github.com/webpack-contrib/mini-css-extract-plugin#linktype"
72
+ },
73
+ "runtime": {
74
+ "type": "boolean",
75
+ "description": "Enabled/Disables runtime generation. CSS will be still extracted and can be used for a custom loading methods.",
76
+ "link": "https://github.com/webpack-contrib/mini-css-extract-plugin#noRuntime"
77
+ }
78
+ }
79
+ }
@@ -0,0 +1,5 @@
1
+ import { LoaderContext } from "../..";
2
+ export declare function isAbsolutePath(str: string): boolean;
3
+ export declare function isRelativePath(str: string): boolean;
4
+ export declare function stringifyRequest(loaderContext: LoaderContext, request: string): string;
5
+ export declare function stringifyLocal(value: any): any;
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.stringifyLocal = exports.stringifyRequest = exports.isRelativePath = exports.isAbsolutePath = void 0;
7
+ const path_1 = __importDefault(require("path"));
8
+ function isAbsolutePath(str) {
9
+ return path_1.default.posix.isAbsolute(str) || path_1.default.win32.isAbsolute(str);
10
+ }
11
+ exports.isAbsolutePath = isAbsolutePath;
12
+ const RELATIVE_PATH_REGEXP = /^\.\.?[/\\]/;
13
+ function isRelativePath(str) {
14
+ return RELATIVE_PATH_REGEXP.test(str);
15
+ }
16
+ exports.isRelativePath = isRelativePath;
17
+ function stringifyRequest(loaderContext, request) {
18
+ if (typeof loaderContext.utils !== "undefined" &&
19
+ typeof loaderContext.utils.contextify === "function") {
20
+ return JSON.stringify(loaderContext.utils.contextify(loaderContext.context || loaderContext.rootContext, request));
21
+ }
22
+ const splitted = request.split("!");
23
+ const { context } = loaderContext;
24
+ return JSON.stringify(splitted
25
+ .map(part => {
26
+ // First, separate singlePath from query, because the query might contain paths again
27
+ const splittedPart = part.match(/^(.*?)(\?.*)/);
28
+ const query = splittedPart ? splittedPart[2] : "";
29
+ let singlePath = splittedPart ? splittedPart[1] : part;
30
+ if (isAbsolutePath(singlePath) && context) {
31
+ singlePath = path_1.default.relative(context, singlePath);
32
+ if (isAbsolutePath(singlePath)) {
33
+ // If singlePath still matches an absolute path, singlePath was on a different drive than context.
34
+ // In this case, we leave the path platform-specific without replacing any separators.
35
+ // @see https://github.com/webpack/loader-utils/pull/14
36
+ return singlePath + query;
37
+ }
38
+ if (isRelativePath(singlePath) === false) {
39
+ // Ensure that the relative path starts at least with ./ otherwise it would be a request into the modules directory (like node_modules).
40
+ singlePath = `./${singlePath}`;
41
+ }
42
+ }
43
+ return singlePath.replace(/\\/g, "/") + query;
44
+ })
45
+ .join("!"));
46
+ }
47
+ exports.stringifyRequest = stringifyRequest;
48
+ function stringifyLocal(value) {
49
+ return typeof value === "function" ? value.toString() : JSON.stringify(value);
50
+ }
51
+ exports.stringifyLocal = stringifyLocal;
@@ -52,6 +52,7 @@ export * from "./CopyRspackPlugin";
52
52
  export * from "./SwcJsMinimizerPlugin";
53
53
  export * from "./SwcCssMinimizerPlugin";
54
54
  export * from "./JsLoaderRspackPlugin";
55
+ export * from "./css-extract";
55
56
  import { RawBuiltins } from "@rspack/binding";
56
57
  import { RspackOptionsNormalized } from "..";
57
58
  export interface Builtins {
@@ -70,6 +70,7 @@ __exportStar(require("./CopyRspackPlugin"), exports);
70
70
  __exportStar(require("./SwcJsMinimizerPlugin"), exports);
71
71
  __exportStar(require("./SwcCssMinimizerPlugin"), exports);
72
72
  __exportStar(require("./JsLoaderRspackPlugin"), exports);
73
+ __exportStar(require("./css-extract"), exports);
73
74
  function resolveTreeShaking(treeShaking, production) {
74
75
  return treeShaking !== undefined
75
76
  ? treeShaking.toString()
@@ -96,8 +96,8 @@ export interface LoaderContext<OptionsType = {}> {
96
96
  getMissingDependencies(): string[];
97
97
  addBuildDependency(file: string): void;
98
98
  importModule(request: string, options: {
99
- publicPath: string;
100
- baseUri: string;
99
+ publicPath?: string;
100
+ baseUri?: string;
101
101
  }, callback: (err?: Error, res?: any) => void): void;
102
102
  fs: any;
103
103
  utils: {
@@ -82,7 +82,11 @@ const applyRspackOptionsDefaults = (options) => {
82
82
  : "var";
83
83
  });
84
84
  applyNodeDefaults(options.node, { targetProperties });
85
- applyOptimizationDefaults(options.optimization, { production, development });
85
+ applyOptimizationDefaults(options.optimization, {
86
+ production,
87
+ development,
88
+ css: options.experiments.css
89
+ });
86
90
  options.resolve = (0, cleverMerge_1.cleverMerge)(getResolveDefaults({
87
91
  targetProperties,
88
92
  mode: options.mode,
@@ -578,7 +582,7 @@ const applyNodeDefaults = (node, { targetProperties }) => {
578
582
  return "warn-mock";
579
583
  });
580
584
  };
581
- const applyOptimizationDefaults = (optimization, { production, development }) => {
585
+ const applyOptimizationDefaults = (optimization, { production, development, css }) => {
582
586
  D(optimization, "removeAvailableModules", true);
583
587
  D(optimization, "removeEmptyChunks", true);
584
588
  D(optimization, "mergeDuplicateChunks", true);
@@ -616,9 +620,7 @@ const applyOptimizationDefaults = (optimization, { production, development }) =>
616
620
  });
617
621
  const { splitChunks } = optimization;
618
622
  if (splitChunks) {
619
- // A(splitChunks, "defaultSizeTypes", () =>
620
- // css ? ["javascript", "css", "unknown"] : ["javascript", "unknown"]
621
- // );
623
+ A(splitChunks, "defaultSizeTypes", () => css ? ["javascript", "css", "unknown"] : ["javascript", "unknown"]);
622
624
  D(splitChunks, "hidePathInfo", production);
623
625
  D(splitChunks, "chunks", "async");
624
626
  // D(splitChunks, "usedExports", optimization.usedExports === true);
@@ -177,6 +177,9 @@ const getNormalizedRspackOptions = (config) => {
177
177
  runtimeChunk: getNormalizedOptimizationRuntimeChunk(optimization.runtimeChunk),
178
178
  splitChunks: nestedConfig(optimization.splitChunks, splitChunks => splitChunks && {
179
179
  ...splitChunks,
180
+ defaultSizeTypes: splitChunks.defaultSizeTypes
181
+ ? [...splitChunks.defaultSizeTypes]
182
+ : ["..."],
180
183
  cacheGroups: cloneObject(splitChunks.cacheGroups)
181
184
  })
182
185
  };
@@ -3380,6 +3380,7 @@ declare const optimizationSplitChunksNameFunction: z.ZodFunction<z.ZodTuple<[z.Z
3380
3380
  export type OptimizationSplitChunksNameFunction = z.infer<typeof optimizationSplitChunksNameFunction>;
3381
3381
  declare const optimizationSplitChunksCacheGroup: z.ZodObject<{
3382
3382
  chunks: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodEnum<["initial", "async", "all"]>, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>, z.ZodFunction<z.ZodTuple<[z.ZodType<Chunk, z.ZodTypeDef, Chunk>], z.ZodUnknown>, z.ZodBoolean>]>>;
3383
+ defaultSizeTypes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
3383
3384
  minChunks: z.ZodOptional<z.ZodNumber>;
3384
3385
  name: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodLiteral<false>]>, z.ZodFunction<z.ZodTuple<[z.ZodOptional<z.ZodType<Module, z.ZodTypeDef, Module>>], z.ZodUnknown>, z.ZodUnknown>]>>;
3385
3386
  minSize: z.ZodOptional<z.ZodNumber>;
@@ -3396,6 +3397,7 @@ declare const optimizationSplitChunksCacheGroup: z.ZodObject<{
3396
3397
  idHint: z.ZodOptional<z.ZodString>;
3397
3398
  }, "strict", z.ZodTypeAny, {
3398
3399
  chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined;
3400
+ defaultSizeTypes?: string[] | undefined;
3399
3401
  minChunks?: number | undefined;
3400
3402
  name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined;
3401
3403
  minSize?: number | undefined;
@@ -3412,6 +3414,7 @@ declare const optimizationSplitChunksCacheGroup: z.ZodObject<{
3412
3414
  idHint?: string | undefined;
3413
3415
  }, {
3414
3416
  chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined;
3417
+ defaultSizeTypes?: string[] | undefined;
3415
3418
  minChunks?: number | undefined;
3416
3419
  name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined;
3417
3420
  minSize?: number | undefined;
@@ -3430,6 +3433,7 @@ declare const optimizationSplitChunksCacheGroup: z.ZodObject<{
3430
3433
  export type OptimizationSplitChunksCacheGroup = z.infer<typeof optimizationSplitChunksCacheGroup>;
3431
3434
  declare const optimizationSplitChunksOptions: z.ZodObject<{
3432
3435
  chunks: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodEnum<["initial", "async", "all"]>, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>, z.ZodFunction<z.ZodTuple<[z.ZodType<Chunk, z.ZodTypeDef, Chunk>], z.ZodUnknown>, z.ZodBoolean>]>>;
3436
+ defaultSizeTypes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
3433
3437
  minChunks: z.ZodOptional<z.ZodNumber>;
3434
3438
  name: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodLiteral<false>]>, z.ZodFunction<z.ZodTuple<[z.ZodOptional<z.ZodType<Module, z.ZodTypeDef, Module>>], z.ZodUnknown>, z.ZodUnknown>]>>;
3435
3439
  minSize: z.ZodOptional<z.ZodNumber>;
@@ -3439,6 +3443,7 @@ declare const optimizationSplitChunksOptions: z.ZodObject<{
3439
3443
  automaticNameDelimiter: z.ZodOptional<z.ZodString>;
3440
3444
  cacheGroups: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodLiteral<false>, z.ZodObject<{
3441
3445
  chunks: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodEnum<["initial", "async", "all"]>, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>, z.ZodFunction<z.ZodTuple<[z.ZodType<Chunk, z.ZodTypeDef, Chunk>], z.ZodUnknown>, z.ZodBoolean>]>>;
3446
+ defaultSizeTypes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
3442
3447
  minChunks: z.ZodOptional<z.ZodNumber>;
3443
3448
  name: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodLiteral<false>]>, z.ZodFunction<z.ZodTuple<[z.ZodOptional<z.ZodType<Module, z.ZodTypeDef, Module>>], z.ZodUnknown>, z.ZodUnknown>]>>;
3444
3449
  minSize: z.ZodOptional<z.ZodNumber>;
@@ -3455,6 +3460,7 @@ declare const optimizationSplitChunksOptions: z.ZodObject<{
3455
3460
  idHint: z.ZodOptional<z.ZodString>;
3456
3461
  }, "strict", z.ZodTypeAny, {
3457
3462
  chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined;
3463
+ defaultSizeTypes?: string[] | undefined;
3458
3464
  minChunks?: number | undefined;
3459
3465
  name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined;
3460
3466
  minSize?: number | undefined;
@@ -3471,6 +3477,7 @@ declare const optimizationSplitChunksOptions: z.ZodObject<{
3471
3477
  idHint?: string | undefined;
3472
3478
  }, {
3473
3479
  chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined;
3480
+ defaultSizeTypes?: string[] | undefined;
3474
3481
  minChunks?: number | undefined;
3475
3482
  name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined;
3476
3483
  minSize?: number | undefined;
@@ -3513,6 +3520,7 @@ declare const optimizationSplitChunksOptions: z.ZodObject<{
3513
3520
  hidePathInfo: z.ZodOptional<z.ZodBoolean>;
3514
3521
  }, "strict", z.ZodTypeAny, {
3515
3522
  chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined;
3523
+ defaultSizeTypes?: string[] | undefined;
3516
3524
  minChunks?: number | undefined;
3517
3525
  name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined;
3518
3526
  minSize?: number | undefined;
@@ -3522,6 +3530,7 @@ declare const optimizationSplitChunksOptions: z.ZodObject<{
3522
3530
  automaticNameDelimiter?: string | undefined;
3523
3531
  cacheGroups?: Record<string, false | {
3524
3532
  chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined;
3533
+ defaultSizeTypes?: string[] | undefined;
3525
3534
  minChunks?: number | undefined;
3526
3535
  name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined;
3527
3536
  minSize?: number | undefined;
@@ -3550,6 +3559,7 @@ declare const optimizationSplitChunksOptions: z.ZodObject<{
3550
3559
  hidePathInfo?: boolean | undefined;
3551
3560
  }, {
3552
3561
  chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined;
3562
+ defaultSizeTypes?: string[] | undefined;
3553
3563
  minChunks?: number | undefined;
3554
3564
  name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined;
3555
3565
  minSize?: number | undefined;
@@ -3559,6 +3569,7 @@ declare const optimizationSplitChunksOptions: z.ZodObject<{
3559
3569
  automaticNameDelimiter?: string | undefined;
3560
3570
  cacheGroups?: Record<string, false | {
3561
3571
  chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined;
3572
+ defaultSizeTypes?: string[] | undefined;
3562
3573
  minChunks?: number | undefined;
3563
3574
  name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined;
3564
3575
  minSize?: number | undefined;
@@ -3595,6 +3606,7 @@ declare const optimization: z.ZodObject<{
3595
3606
  mergeDuplicateChunks: z.ZodOptional<z.ZodBoolean>;
3596
3607
  splitChunks: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<false>, z.ZodObject<{
3597
3608
  chunks: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodEnum<["initial", "async", "all"]>, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>, z.ZodFunction<z.ZodTuple<[z.ZodType<Chunk, z.ZodTypeDef, Chunk>], z.ZodUnknown>, z.ZodBoolean>]>>;
3609
+ defaultSizeTypes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
3598
3610
  minChunks: z.ZodOptional<z.ZodNumber>;
3599
3611
  name: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodLiteral<false>]>, z.ZodFunction<z.ZodTuple<[z.ZodOptional<z.ZodType<Module, z.ZodTypeDef, Module>>], z.ZodUnknown>, z.ZodUnknown>]>>;
3600
3612
  minSize: z.ZodOptional<z.ZodNumber>;
@@ -3604,6 +3616,7 @@ declare const optimization: z.ZodObject<{
3604
3616
  automaticNameDelimiter: z.ZodOptional<z.ZodString>;
3605
3617
  cacheGroups: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodLiteral<false>, z.ZodObject<{
3606
3618
  chunks: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodEnum<["initial", "async", "all"]>, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>, z.ZodFunction<z.ZodTuple<[z.ZodType<Chunk, z.ZodTypeDef, Chunk>], z.ZodUnknown>, z.ZodBoolean>]>>;
3619
+ defaultSizeTypes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
3607
3620
  minChunks: z.ZodOptional<z.ZodNumber>;
3608
3621
  name: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodLiteral<false>]>, z.ZodFunction<z.ZodTuple<[z.ZodOptional<z.ZodType<Module, z.ZodTypeDef, Module>>], z.ZodUnknown>, z.ZodUnknown>]>>;
3609
3622
  minSize: z.ZodOptional<z.ZodNumber>;
@@ -3620,6 +3633,7 @@ declare const optimization: z.ZodObject<{
3620
3633
  idHint: z.ZodOptional<z.ZodString>;
3621
3634
  }, "strict", z.ZodTypeAny, {
3622
3635
  chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined;
3636
+ defaultSizeTypes?: string[] | undefined;
3623
3637
  minChunks?: number | undefined;
3624
3638
  name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined;
3625
3639
  minSize?: number | undefined;
@@ -3636,6 +3650,7 @@ declare const optimization: z.ZodObject<{
3636
3650
  idHint?: string | undefined;
3637
3651
  }, {
3638
3652
  chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined;
3653
+ defaultSizeTypes?: string[] | undefined;
3639
3654
  minChunks?: number | undefined;
3640
3655
  name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined;
3641
3656
  minSize?: number | undefined;
@@ -3678,6 +3693,7 @@ declare const optimization: z.ZodObject<{
3678
3693
  hidePathInfo: z.ZodOptional<z.ZodBoolean>;
3679
3694
  }, "strict", z.ZodTypeAny, {
3680
3695
  chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined;
3696
+ defaultSizeTypes?: string[] | undefined;
3681
3697
  minChunks?: number | undefined;
3682
3698
  name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined;
3683
3699
  minSize?: number | undefined;
@@ -3687,6 +3703,7 @@ declare const optimization: z.ZodObject<{
3687
3703
  automaticNameDelimiter?: string | undefined;
3688
3704
  cacheGroups?: Record<string, false | {
3689
3705
  chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined;
3706
+ defaultSizeTypes?: string[] | undefined;
3690
3707
  minChunks?: number | undefined;
3691
3708
  name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined;
3692
3709
  minSize?: number | undefined;
@@ -3715,6 +3732,7 @@ declare const optimization: z.ZodObject<{
3715
3732
  hidePathInfo?: boolean | undefined;
3716
3733
  }, {
3717
3734
  chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined;
3735
+ defaultSizeTypes?: string[] | undefined;
3718
3736
  minChunks?: number | undefined;
3719
3737
  name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined;
3720
3738
  minSize?: number | undefined;
@@ -3724,6 +3742,7 @@ declare const optimization: z.ZodObject<{
3724
3742
  automaticNameDelimiter?: string | undefined;
3725
3743
  cacheGroups?: Record<string, false | {
3726
3744
  chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined;
3745
+ defaultSizeTypes?: string[] | undefined;
3727
3746
  minChunks?: number | undefined;
3728
3747
  name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined;
3729
3748
  minSize?: number | undefined;
@@ -3776,6 +3795,7 @@ declare const optimization: z.ZodObject<{
3776
3795
  mergeDuplicateChunks?: boolean | undefined;
3777
3796
  splitChunks?: false | {
3778
3797
  chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined;
3798
+ defaultSizeTypes?: string[] | undefined;
3779
3799
  minChunks?: number | undefined;
3780
3800
  name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined;
3781
3801
  minSize?: number | undefined;
@@ -3785,6 +3805,7 @@ declare const optimization: z.ZodObject<{
3785
3805
  automaticNameDelimiter?: string | undefined;
3786
3806
  cacheGroups?: Record<string, false | {
3787
3807
  chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined;
3808
+ defaultSizeTypes?: string[] | undefined;
3788
3809
  minChunks?: number | undefined;
3789
3810
  name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined;
3790
3811
  minSize?: number | undefined;
@@ -3833,6 +3854,7 @@ declare const optimization: z.ZodObject<{
3833
3854
  mergeDuplicateChunks?: boolean | undefined;
3834
3855
  splitChunks?: false | {
3835
3856
  chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined;
3857
+ defaultSizeTypes?: string[] | undefined;
3836
3858
  minChunks?: number | undefined;
3837
3859
  name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined;
3838
3860
  minSize?: number | undefined;
@@ -3842,6 +3864,7 @@ declare const optimization: z.ZodObject<{
3842
3864
  automaticNameDelimiter?: string | undefined;
3843
3865
  cacheGroups?: Record<string, false | {
3844
3866
  chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined;
3867
+ defaultSizeTypes?: string[] | undefined;
3845
3868
  minChunks?: number | undefined;
3846
3869
  name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined;
3847
3870
  minSize?: number | undefined;
@@ -4925,6 +4948,7 @@ export declare const rspackOptions: z.ZodObject<{
4925
4948
  mergeDuplicateChunks: z.ZodOptional<z.ZodBoolean>;
4926
4949
  splitChunks: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<false>, z.ZodObject<{
4927
4950
  chunks: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodEnum<["initial", "async", "all"]>, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>, z.ZodFunction<z.ZodTuple<[z.ZodType<Chunk, z.ZodTypeDef, Chunk>], z.ZodUnknown>, z.ZodBoolean>]>>;
4951
+ defaultSizeTypes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
4928
4952
  minChunks: z.ZodOptional<z.ZodNumber>;
4929
4953
  name: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodLiteral<false>]>, z.ZodFunction<z.ZodTuple<[z.ZodOptional<z.ZodType<Module, z.ZodTypeDef, Module>>], z.ZodUnknown>, z.ZodUnknown>]>>;
4930
4954
  minSize: z.ZodOptional<z.ZodNumber>;
@@ -4934,6 +4958,7 @@ export declare const rspackOptions: z.ZodObject<{
4934
4958
  automaticNameDelimiter: z.ZodOptional<z.ZodString>;
4935
4959
  cacheGroups: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodLiteral<false>, z.ZodObject<{
4936
4960
  chunks: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodEnum<["initial", "async", "all"]>, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>, z.ZodFunction<z.ZodTuple<[z.ZodType<Chunk, z.ZodTypeDef, Chunk>], z.ZodUnknown>, z.ZodBoolean>]>>;
4961
+ defaultSizeTypes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
4937
4962
  minChunks: z.ZodOptional<z.ZodNumber>;
4938
4963
  name: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodLiteral<false>]>, z.ZodFunction<z.ZodTuple<[z.ZodOptional<z.ZodType<Module, z.ZodTypeDef, Module>>], z.ZodUnknown>, z.ZodUnknown>]>>;
4939
4964
  minSize: z.ZodOptional<z.ZodNumber>;
@@ -4950,6 +4975,7 @@ export declare const rspackOptions: z.ZodObject<{
4950
4975
  idHint: z.ZodOptional<z.ZodString>;
4951
4976
  }, "strict", z.ZodTypeAny, {
4952
4977
  chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined;
4978
+ defaultSizeTypes?: string[] | undefined;
4953
4979
  minChunks?: number | undefined;
4954
4980
  name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined;
4955
4981
  minSize?: number | undefined;
@@ -4966,6 +4992,7 @@ export declare const rspackOptions: z.ZodObject<{
4966
4992
  idHint?: string | undefined;
4967
4993
  }, {
4968
4994
  chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined;
4995
+ defaultSizeTypes?: string[] | undefined;
4969
4996
  minChunks?: number | undefined;
4970
4997
  name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined;
4971
4998
  minSize?: number | undefined;
@@ -5008,6 +5035,7 @@ export declare const rspackOptions: z.ZodObject<{
5008
5035
  hidePathInfo: z.ZodOptional<z.ZodBoolean>;
5009
5036
  }, "strict", z.ZodTypeAny, {
5010
5037
  chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined;
5038
+ defaultSizeTypes?: string[] | undefined;
5011
5039
  minChunks?: number | undefined;
5012
5040
  name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined;
5013
5041
  minSize?: number | undefined;
@@ -5017,6 +5045,7 @@ export declare const rspackOptions: z.ZodObject<{
5017
5045
  automaticNameDelimiter?: string | undefined;
5018
5046
  cacheGroups?: Record<string, false | {
5019
5047
  chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined;
5048
+ defaultSizeTypes?: string[] | undefined;
5020
5049
  minChunks?: number | undefined;
5021
5050
  name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined;
5022
5051
  minSize?: number | undefined;
@@ -5045,6 +5074,7 @@ export declare const rspackOptions: z.ZodObject<{
5045
5074
  hidePathInfo?: boolean | undefined;
5046
5075
  }, {
5047
5076
  chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined;
5077
+ defaultSizeTypes?: string[] | undefined;
5048
5078
  minChunks?: number | undefined;
5049
5079
  name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined;
5050
5080
  minSize?: number | undefined;
@@ -5054,6 +5084,7 @@ export declare const rspackOptions: z.ZodObject<{
5054
5084
  automaticNameDelimiter?: string | undefined;
5055
5085
  cacheGroups?: Record<string, false | {
5056
5086
  chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined;
5087
+ defaultSizeTypes?: string[] | undefined;
5057
5088
  minChunks?: number | undefined;
5058
5089
  name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined;
5059
5090
  minSize?: number | undefined;
@@ -5106,6 +5137,7 @@ export declare const rspackOptions: z.ZodObject<{
5106
5137
  mergeDuplicateChunks?: boolean | undefined;
5107
5138
  splitChunks?: false | {
5108
5139
  chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined;
5140
+ defaultSizeTypes?: string[] | undefined;
5109
5141
  minChunks?: number | undefined;
5110
5142
  name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined;
5111
5143
  minSize?: number | undefined;
@@ -5115,6 +5147,7 @@ export declare const rspackOptions: z.ZodObject<{
5115
5147
  automaticNameDelimiter?: string | undefined;
5116
5148
  cacheGroups?: Record<string, false | {
5117
5149
  chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined;
5150
+ defaultSizeTypes?: string[] | undefined;
5118
5151
  minChunks?: number | undefined;
5119
5152
  name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined;
5120
5153
  minSize?: number | undefined;
@@ -5163,6 +5196,7 @@ export declare const rspackOptions: z.ZodObject<{
5163
5196
  mergeDuplicateChunks?: boolean | undefined;
5164
5197
  splitChunks?: false | {
5165
5198
  chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined;
5199
+ defaultSizeTypes?: string[] | undefined;
5166
5200
  minChunks?: number | undefined;
5167
5201
  name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined;
5168
5202
  minSize?: number | undefined;
@@ -5172,6 +5206,7 @@ export declare const rspackOptions: z.ZodObject<{
5172
5206
  automaticNameDelimiter?: string | undefined;
5173
5207
  cacheGroups?: Record<string, false | {
5174
5208
  chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined;
5209
+ defaultSizeTypes?: string[] | undefined;
5175
5210
  minChunks?: number | undefined;
5176
5211
  name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined;
5177
5212
  minSize?: number | undefined;
@@ -5919,6 +5954,7 @@ export declare const rspackOptions: z.ZodObject<{
5919
5954
  mergeDuplicateChunks?: boolean | undefined;
5920
5955
  splitChunks?: false | {
5921
5956
  chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined;
5957
+ defaultSizeTypes?: string[] | undefined;
5922
5958
  minChunks?: number | undefined;
5923
5959
  name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined;
5924
5960
  minSize?: number | undefined;
@@ -5928,6 +5964,7 @@ export declare const rspackOptions: z.ZodObject<{
5928
5964
  automaticNameDelimiter?: string | undefined;
5929
5965
  cacheGroups?: Record<string, false | {
5930
5966
  chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined;
5967
+ defaultSizeTypes?: string[] | undefined;
5931
5968
  minChunks?: number | undefined;
5932
5969
  name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined;
5933
5970
  minSize?: number | undefined;
@@ -6301,6 +6338,7 @@ export declare const rspackOptions: z.ZodObject<{
6301
6338
  mergeDuplicateChunks?: boolean | undefined;
6302
6339
  splitChunks?: false | {
6303
6340
  chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined;
6341
+ defaultSizeTypes?: string[] | undefined;
6304
6342
  minChunks?: number | undefined;
6305
6343
  name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined;
6306
6344
  minSize?: number | undefined;
@@ -6310,6 +6348,7 @@ export declare const rspackOptions: z.ZodObject<{
6310
6348
  automaticNameDelimiter?: string | undefined;
6311
6349
  cacheGroups?: Record<string, false | {
6312
6350
  chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined;
6351
+ defaultSizeTypes?: string[] | undefined;
6313
6352
  minChunks?: number | undefined;
6314
6353
  name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined;
6315
6354
  minSize?: number | undefined;
@@ -662,8 +662,10 @@ const optimizationSplitChunksChunks = zod_1.z
662
662
  .or(zod_1.z.instanceof(RegExp))
663
663
  .or(zod_1.z.function().args(zod_1.z.instanceof(Chunk_1.Chunk)).returns(zod_1.z.boolean()));
664
664
  const optimizationSplitChunksSizes = zod_1.z.number();
665
+ const optimizationSplitChunksDefaultSizeTypes = zod_1.z.array(zod_1.z.string());
665
666
  const sharedOptimizationSplitChunksCacheGroup = {
666
667
  chunks: optimizationSplitChunksChunks.optional(),
668
+ defaultSizeTypes: optimizationSplitChunksDefaultSizeTypes.optional(),
667
669
  minChunks: zod_1.z.number().min(1).optional(),
668
670
  name: optimizationSplitChunksName.optional(),
669
671
  minSize: optimizationSplitChunksSizes.optional(),
package/dist/exports.d.ts CHANGED
@@ -280,6 +280,7 @@ export declare const config: {
280
280
  mergeDuplicateChunks?: boolean | undefined;
281
281
  splitChunks?: false | {
282
282
  chunks?: RegExp | "async" | "initial" | "all" | ((args_0: import("./Chunk").Chunk, ...args_1: unknown[]) => boolean) | undefined;
283
+ defaultSizeTypes?: string[] | undefined;
283
284
  minChunks?: number | undefined;
284
285
  name?: string | false | ((args_0: import("./Module").Module | undefined, ...args_1: unknown[]) => unknown) | undefined;
285
286
  minSize?: number | undefined;
@@ -289,6 +290,7 @@ export declare const config: {
289
290
  automaticNameDelimiter?: string | undefined;
290
291
  cacheGroups?: Record<string, false | {
291
292
  chunks?: RegExp | "async" | "initial" | "all" | ((args_0: import("./Chunk").Chunk, ...args_1: unknown[]) => boolean) | undefined;
293
+ defaultSizeTypes?: string[] | undefined;
292
294
  minChunks?: number | undefined;
293
295
  name?: string | false | ((args_0: import("./Module").Module | undefined, ...args_1: unknown[]) => unknown) | undefined;
294
296
  minSize?: number | undefined;
@@ -664,6 +666,7 @@ export declare const config: {
664
666
  mergeDuplicateChunks?: boolean | undefined;
665
667
  splitChunks?: false | {
666
668
  chunks?: RegExp | "async" | "initial" | "all" | ((args_0: import("./Chunk").Chunk, ...args_1: unknown[]) => boolean) | undefined;
669
+ defaultSizeTypes?: string[] | undefined;
667
670
  minChunks?: number | undefined;
668
671
  name?: string | false | ((args_0: import("./Module").Module | undefined, ...args_1: unknown[]) => unknown) | undefined;
669
672
  minSize?: number | undefined;
@@ -673,6 +676,7 @@ export declare const config: {
673
676
  automaticNameDelimiter?: string | undefined;
674
677
  cacheGroups?: Record<string, false | {
675
678
  chunks?: RegExp | "async" | "initial" | "all" | ((args_0: import("./Chunk").Chunk, ...args_1: unknown[]) => boolean) | undefined;
679
+ defaultSizeTypes?: string[] | undefined;
676
680
  minChunks?: number | undefined;
677
681
  name?: string | false | ((args_0: import("./Module").Module | undefined, ...args_1: unknown[]) => unknown) | undefined;
678
682
  minSize?: number | undefined;
@@ -923,3 +927,4 @@ export { EvalSourceMapDevToolPlugin } from "./builtin-plugin";
923
927
  export type { SourceMapDevToolPluginOptions } from "./builtin-plugin";
924
928
  export { EvalDevToolModulePlugin } from "./builtin-plugin";
925
929
  export type { EvalDevToolModulePluginOptions } from "./builtin-plugin";
930
+ export { CssExtractRspackPlugin } from "./builtin-plugin";
package/dist/exports.js CHANGED
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.EvalDevToolModulePlugin = exports.EvalSourceMapDevToolPlugin = exports.SourceMapDevToolPlugin = exports.CopyRspackPlugin = exports.SwcCssMinimizerRspackPlugin = exports.SwcJsMinimizerRspackPlugin = exports.HtmlRspackPlugin = exports.sharing = exports.container = exports.optimize = exports.webworker = exports.javascript = exports.wasm = exports.library = exports.electron = exports.node = exports.NormalModuleReplacementPlugin = exports.EnvironmentPlugin = exports.LoaderTargetPlugin = exports.LoaderOptionsPlugin = exports.HotModuleReplacementPlugin = exports.ExternalsPlugin = exports.EntryPlugin = exports.ProgressPlugin = exports.DefinePlugin = exports.ProvidePlugin = exports.BannerPlugin = exports.EntryOptionPlugin = exports.experimental_cleanupGlobalTrace = exports.experimental_registerGlobalTrace = exports.util = exports.config = exports.sources = exports.WebpackError = exports.Template = exports.ModuleFilenameHelpers = exports.NormalModule = exports.MultiStats = exports.Stats = exports.RuntimeGlobals = exports.WebpackOptionsApply = exports.RspackOptionsApply = exports.MultiCompiler = exports.Compilation = exports.Compiler = exports.rspackVersion = exports.version = void 0;
6
+ exports.CssExtractRspackPlugin = exports.EvalDevToolModulePlugin = exports.EvalSourceMapDevToolPlugin = exports.SourceMapDevToolPlugin = exports.CopyRspackPlugin = exports.SwcCssMinimizerRspackPlugin = exports.SwcJsMinimizerRspackPlugin = exports.HtmlRspackPlugin = exports.sharing = exports.container = exports.optimize = exports.webworker = exports.javascript = exports.wasm = exports.library = exports.electron = exports.node = exports.NormalModuleReplacementPlugin = exports.EnvironmentPlugin = exports.LoaderTargetPlugin = exports.LoaderOptionsPlugin = exports.HotModuleReplacementPlugin = exports.ExternalsPlugin = exports.EntryPlugin = exports.ProgressPlugin = exports.DefinePlugin = exports.ProvidePlugin = exports.BannerPlugin = exports.EntryOptionPlugin = exports.experimental_cleanupGlobalTrace = exports.experimental_registerGlobalTrace = exports.util = exports.config = exports.sources = exports.WebpackError = exports.Template = exports.ModuleFilenameHelpers = exports.NormalModule = exports.MultiStats = exports.Stats = exports.RuntimeGlobals = exports.WebpackOptionsApply = exports.RspackOptionsApply = exports.MultiCompiler = exports.Compilation = exports.Compiler = exports.rspackVersion = exports.version = void 0;
7
7
  const { version: rspackVersion, webpackVersion } = require("../package.json");
8
8
  exports.rspackVersion = rspackVersion;
9
9
  exports.version = webpackVersion;
@@ -117,3 +117,5 @@ var builtin_plugin_20 = require("./builtin-plugin");
117
117
  Object.defineProperty(exports, "EvalSourceMapDevToolPlugin", { enumerable: true, get: function () { return builtin_plugin_20.EvalSourceMapDevToolPlugin; } });
118
118
  var builtin_plugin_21 = require("./builtin-plugin");
119
119
  Object.defineProperty(exports, "EvalDevToolModulePlugin", { enumerable: true, get: function () { return builtin_plugin_21.EvalDevToolModulePlugin; } });
120
+ var builtin_plugin_22 = require("./builtin-plugin");
121
+ Object.defineProperty(exports, "CssExtractRspackPlugin", { enumerable: true, get: function () { return builtin_plugin_22.CssExtractRspackPlugin; } });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspack/core",
3
- "version": "0.5.9-canary-73d1234-20240407005733",
3
+ "version": "0.5.9-canary-ba4ea23-20240407091611",
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-73d1234-20240407005733",
60
- "@rspack/plugin-minify": "^0.5.9-canary-73d1234-20240407005733"
59
+ "@rspack/core": "0.5.9-canary-ba4ea23-20240407091611",
60
+ "@rspack/plugin-minify": "^0.5.9-canary-ba4ea23-20240407091611"
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-73d1234-20240407005733"
75
+ "@rspack/binding": "0.5.9-canary-ba4ea23-20240407091611"
76
76
  },
77
77
  "peerDependencies": {
78
78
  "@swc/helpers": ">=0.5.1"