@rspack/core 0.5.9-canary-89c5dce-20240402093536 → 0.5.9-canary-5be4c34-20240403005129
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/builtin-plugin/CssModulesPlugin.d.ts +10 -0
- package/dist/builtin-plugin/CssModulesPlugin.js +6 -0
- package/dist/builtin-plugin/index.d.ts +2 -6
- package/dist/builtin-plugin/index.js +1 -15
- package/dist/config/adapter.js +59 -7
- package/dist/config/defaults.js +57 -28
- package/dist/config/zod.d.ts +621 -0
- package/dist/config/zod.js +40 -1
- package/dist/exports.d.ts +46 -0
- package/dist/rspackOptionsApply.js +3 -0
- package/package.json +4 -4
package/dist/config/zod.js
CHANGED
|
@@ -313,6 +313,16 @@ const assetParserDataUrl = assetParserDataUrlOptions;
|
|
|
313
313
|
const assetParserOptions = zod_1.z.strictObject({
|
|
314
314
|
dataUrlCondition: assetParserDataUrl.optional()
|
|
315
315
|
});
|
|
316
|
+
const cssParserNamedExports = zod_1.z.boolean();
|
|
317
|
+
const cssParserOptions = zod_1.z.strictObject({
|
|
318
|
+
namedExports: cssParserNamedExports.optional()
|
|
319
|
+
});
|
|
320
|
+
const cssAutoParserOptions = zod_1.z.strictObject({
|
|
321
|
+
namedExports: cssParserNamedExports.optional()
|
|
322
|
+
});
|
|
323
|
+
const cssModuleParserOptions = zod_1.z.strictObject({
|
|
324
|
+
namedExports: cssParserNamedExports.optional()
|
|
325
|
+
});
|
|
316
326
|
//TODO: "weak", "lazy-once"
|
|
317
327
|
const dynamicImportMode = zod_1.z.enum(["eager", "lazy"]);
|
|
318
328
|
const dynamicImportPreload = zod_1.z.union([zod_1.z.boolean(), zod_1.z.number()]);
|
|
@@ -326,6 +336,9 @@ const javascriptParserOptions = zod_1.z.strictObject({
|
|
|
326
336
|
});
|
|
327
337
|
const parserOptionsByModuleTypeKnown = zod_1.z.strictObject({
|
|
328
338
|
asset: assetParserOptions.optional(),
|
|
339
|
+
css: cssParserOptions.optional(),
|
|
340
|
+
"css/auto": cssAutoParserOptions.optional(),
|
|
341
|
+
"css/module": cssModuleParserOptions.optional(),
|
|
329
342
|
javascript: javascriptParserOptions.optional()
|
|
330
343
|
});
|
|
331
344
|
const parserOptionsByModuleTypeUnknown = zod_1.z.record(zod_1.z.record(zod_1.z.any()));
|
|
@@ -350,10 +363,36 @@ const assetResourceGeneratorOptions = zod_1.z.strictObject({
|
|
|
350
363
|
publicPath: publicPath.optional()
|
|
351
364
|
});
|
|
352
365
|
const assetGeneratorOptions = assetInlineGeneratorOptions.merge(assetResourceGeneratorOptions);
|
|
366
|
+
const cssGeneratorExportsConvention = zod_1.z.enum([
|
|
367
|
+
"as-is",
|
|
368
|
+
"camel-case",
|
|
369
|
+
"camel-case-only",
|
|
370
|
+
"dashes",
|
|
371
|
+
"dashes-only"
|
|
372
|
+
]);
|
|
373
|
+
const cssGeneratorExportsOnly = zod_1.z.boolean();
|
|
374
|
+
const cssGeneratorLocalIdentName = zod_1.z.string();
|
|
375
|
+
const cssGeneratorOptions = zod_1.z.strictObject({
|
|
376
|
+
exportsConvention: cssGeneratorExportsConvention.optional(),
|
|
377
|
+
exportsOnly: cssGeneratorExportsOnly.optional()
|
|
378
|
+
});
|
|
379
|
+
const cssAutoGeneratorOptions = zod_1.z.strictObject({
|
|
380
|
+
exportsConvention: cssGeneratorExportsConvention.optional(),
|
|
381
|
+
exportsOnly: cssGeneratorExportsOnly.optional(),
|
|
382
|
+
localIdentName: cssGeneratorLocalIdentName.optional()
|
|
383
|
+
});
|
|
384
|
+
const cssModuleGeneratorOptions = zod_1.z.strictObject({
|
|
385
|
+
exportsConvention: cssGeneratorExportsConvention.optional(),
|
|
386
|
+
exportsOnly: cssGeneratorExportsOnly.optional(),
|
|
387
|
+
localIdentName: cssGeneratorLocalIdentName.optional()
|
|
388
|
+
});
|
|
353
389
|
const generatorOptionsByModuleTypeKnown = zod_1.z.strictObject({
|
|
354
390
|
asset: assetGeneratorOptions.optional(),
|
|
355
391
|
"asset/inline": assetInlineGeneratorOptions.optional(),
|
|
356
|
-
"asset/resource": assetResourceGeneratorOptions.optional()
|
|
392
|
+
"asset/resource": assetResourceGeneratorOptions.optional(),
|
|
393
|
+
css: cssGeneratorOptions.optional(),
|
|
394
|
+
"css/auto": cssAutoGeneratorOptions.optional(),
|
|
395
|
+
"css/module": cssModuleGeneratorOptions.optional()
|
|
357
396
|
});
|
|
358
397
|
const generatorOptionsByModuleTypeUnknown = zod_1.z.record(zod_1.z.record(zod_1.z.any()));
|
|
359
398
|
const generatorOptionsByModuleType = generatorOptionsByModuleTypeKnown.or(generatorOptionsByModuleTypeUnknown);
|
package/dist/exports.d.ts
CHANGED
|
@@ -345,6 +345,15 @@ export declare const config: {
|
|
|
345
345
|
maxSize?: number | undefined;
|
|
346
346
|
} | undefined;
|
|
347
347
|
} | undefined;
|
|
348
|
+
css?: {
|
|
349
|
+
namedExports?: boolean | undefined;
|
|
350
|
+
} | undefined;
|
|
351
|
+
"css/auto"?: {
|
|
352
|
+
namedExports?: boolean | undefined;
|
|
353
|
+
} | undefined;
|
|
354
|
+
"css/module"?: {
|
|
355
|
+
namedExports?: boolean | undefined;
|
|
356
|
+
} | undefined;
|
|
348
357
|
javascript?: {
|
|
349
358
|
dynamicImportMode?: "eager" | "lazy" | undefined;
|
|
350
359
|
dynamicImportPreload?: number | boolean | undefined;
|
|
@@ -377,6 +386,20 @@ export declare const config: {
|
|
|
377
386
|
filename?: string | undefined;
|
|
378
387
|
publicPath?: string | undefined;
|
|
379
388
|
} | undefined;
|
|
389
|
+
css?: {
|
|
390
|
+
exportsConvention?: "as-is" | "camel-case" | "camel-case-only" | "dashes" | "dashes-only" | undefined;
|
|
391
|
+
exportsOnly?: boolean | undefined;
|
|
392
|
+
} | undefined;
|
|
393
|
+
"css/auto"?: {
|
|
394
|
+
exportsConvention?: "as-is" | "camel-case" | "camel-case-only" | "dashes" | "dashes-only" | undefined;
|
|
395
|
+
exportsOnly?: boolean | undefined;
|
|
396
|
+
localIdentName?: string | undefined;
|
|
397
|
+
} | undefined;
|
|
398
|
+
"css/module"?: {
|
|
399
|
+
exportsConvention?: "as-is" | "camel-case" | "camel-case-only" | "dashes" | "dashes-only" | undefined;
|
|
400
|
+
exportsOnly?: boolean | undefined;
|
|
401
|
+
localIdentName?: string | undefined;
|
|
402
|
+
} | undefined;
|
|
380
403
|
} | undefined;
|
|
381
404
|
noParse?: string | RegExp | ((args_0: string, ...args_1: unknown[]) => boolean) | (string | RegExp | ((args_0: string, ...args_1: unknown[]) => boolean))[] | undefined;
|
|
382
405
|
} | undefined;
|
|
@@ -707,6 +730,15 @@ export declare const config: {
|
|
|
707
730
|
maxSize?: number | undefined;
|
|
708
731
|
} | undefined;
|
|
709
732
|
} | undefined;
|
|
733
|
+
css?: {
|
|
734
|
+
namedExports?: boolean | undefined;
|
|
735
|
+
} | undefined;
|
|
736
|
+
"css/auto"?: {
|
|
737
|
+
namedExports?: boolean | undefined;
|
|
738
|
+
} | undefined;
|
|
739
|
+
"css/module"?: {
|
|
740
|
+
namedExports?: boolean | undefined;
|
|
741
|
+
} | undefined;
|
|
710
742
|
javascript?: {
|
|
711
743
|
dynamicImportMode?: "eager" | "lazy" | undefined;
|
|
712
744
|
dynamicImportPreload?: number | boolean | undefined;
|
|
@@ -739,6 +771,20 @@ export declare const config: {
|
|
|
739
771
|
filename?: string | undefined;
|
|
740
772
|
publicPath?: string | undefined;
|
|
741
773
|
} | undefined;
|
|
774
|
+
css?: {
|
|
775
|
+
exportsConvention?: "as-is" | "camel-case" | "camel-case-only" | "dashes" | "dashes-only" | undefined;
|
|
776
|
+
exportsOnly?: boolean | undefined;
|
|
777
|
+
} | undefined;
|
|
778
|
+
"css/auto"?: {
|
|
779
|
+
exportsConvention?: "as-is" | "camel-case" | "camel-case-only" | "dashes" | "dashes-only" | undefined;
|
|
780
|
+
exportsOnly?: boolean | undefined;
|
|
781
|
+
localIdentName?: string | undefined;
|
|
782
|
+
} | undefined;
|
|
783
|
+
"css/module"?: {
|
|
784
|
+
exportsConvention?: "as-is" | "camel-case" | "camel-case-only" | "dashes" | "dashes-only" | undefined;
|
|
785
|
+
exportsOnly?: boolean | undefined;
|
|
786
|
+
localIdentName?: string | undefined;
|
|
787
|
+
} | undefined;
|
|
742
788
|
} | undefined;
|
|
743
789
|
noParse?: string | RegExp | ((args_0: string, ...args_1: unknown[]) => boolean) | (string | RegExp | ((args_0: string, ...args_1: unknown[]) => boolean))[] | undefined;
|
|
744
790
|
} | undefined;
|
|
@@ -137,6 +137,9 @@ class RspackOptionsApply {
|
|
|
137
137
|
if (options.experiments.asyncWebAssembly) {
|
|
138
138
|
new builtin_plugin_1.AsyncWebAssemblyModulesPlugin().apply(compiler);
|
|
139
139
|
}
|
|
140
|
+
if (options.experiments.css) {
|
|
141
|
+
new builtin_plugin_1.CssModulesPlugin().apply(compiler);
|
|
142
|
+
}
|
|
140
143
|
if (options.experiments.rspackFuture.disableApplyEntryLazily) {
|
|
141
144
|
applyEntryOptions(compiler, options);
|
|
142
145
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rspack/core",
|
|
3
|
-
"version": "0.5.9-canary-
|
|
3
|
+
"version": "0.5.9-canary-5be4c34-20240403005129",
|
|
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/
|
|
60
|
-
"@rspack/
|
|
59
|
+
"@rspack/plugin-minify": "^0.5.9-canary-5be4c34-20240403005129",
|
|
60
|
+
"@rspack/core": "0.5.9-canary-5be4c34-20240403005129"
|
|
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-
|
|
75
|
+
"@rspack/binding": "0.5.9-canary-5be4c34-20240403005129"
|
|
76
76
|
},
|
|
77
77
|
"peerDependencies": {
|
|
78
78
|
"@swc/helpers": ">=0.5.1"
|