@rspack/core 0.6.3-canary-bc61872-20240425005651 → 0.6.3-canary-e4fdc75-20240427005559

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.
@@ -32,9 +32,7 @@ class CssExtractRspackPlugin {
32
32
  splitChunks.defaultSizeTypes.push(loader_1.MODULE_TYPE);
33
33
  }
34
34
  }
35
- if (
36
- // @ts-expect-error rspack don't support pathinfo for now
37
- compiler.options.output.pathinfo &&
35
+ if (compiler.options.output.pathinfo &&
38
36
  this.options.pathinfo === undefined) {
39
37
  this.options.pathinfo = true;
40
38
  }
@@ -118,6 +118,7 @@ function getRawOutput(output) {
118
118
  const workerWasmLoading = output.workerWasmLoading;
119
119
  return {
120
120
  path: output.path,
121
+ pathinfo: output.pathinfo,
121
122
  publicPath: output.publicPath,
122
123
  clean: output.clean,
123
124
  assetModuleFilename: output.assetModuleFilename,
@@ -67,6 +67,7 @@ const applyRspackOptionsDefaults = (options) => {
67
67
  (Array.isArray(target) &&
68
68
  target.some(target => target.startsWith("browserslist"))),
69
69
  outputModule: options.experiments.outputModule,
70
+ development,
70
71
  entry: options.entry,
71
72
  futureDefaults
72
73
  });
@@ -88,6 +89,7 @@ const applyRspackOptionsDefaults = (options) => {
88
89
  css: options.experiments.css
89
90
  });
90
91
  options.resolve = (0, cleverMerge_1.cleverMerge)(getResolveDefaults({
92
+ context: options.context,
91
93
  targetProperties,
92
94
  mode: options.mode,
93
95
  css: options.experiments.css
@@ -302,7 +304,7 @@ const applyModuleDefaults = (module, { asyncWebAssembly, css, targetProperties }
302
304
  return rules;
303
305
  });
304
306
  };
305
- const applyOutputDefaults = (output, { context, outputModule, targetProperties: tp, isAffectedByBrowserslist, entry, futureDefaults }) => {
307
+ const applyOutputDefaults = (output, { context, outputModule, targetProperties: tp, isAffectedByBrowserslist, development, entry, futureDefaults }) => {
306
308
  const getLibraryName = (library) => {
307
309
  const libraryName = typeof library === "object" &&
308
310
  library &&
@@ -386,6 +388,7 @@ const applyOutputDefaults = (output, { context, outputModule, targetProperties:
386
388
  D(output, "assetModuleFilename", "[hash][ext][query]");
387
389
  D(output, "webassemblyModuleFilename", "[hash].module.wasm");
388
390
  F(output, "path", () => path_1.default.join(process.cwd(), "dist"));
391
+ F(output, "pathinfo", () => development);
389
392
  D(output, "publicPath", tp && (tp.document || tp.importScripts) ? "auto" : "");
390
393
  D(output, "hashFunction", futureDefaults ? "xxhash64" : "md4");
391
394
  D(output, "hashDigest", "hex");
@@ -675,7 +678,7 @@ const getResolveLoaderDefaults = () => {
675
678
  };
676
679
  // The values are aligned with webpack
677
680
  // https://github.com/webpack/webpack/blob/b9fb99c63ca433b24233e0bbc9ce336b47872c08/lib/config/defaults.js#L1431
678
- const getResolveDefaults = ({ targetProperties, mode, css }) => {
681
+ const getResolveDefaults = ({ context, targetProperties, mode, css }) => {
679
682
  const conditions = ["webpack"];
680
683
  conditions.push(mode === "development" ? "development" : "production");
681
684
  if (targetProperties) {
@@ -716,6 +719,7 @@ const getResolveDefaults = ({ targetProperties, mode, css }) => {
716
719
  extensions: [],
717
720
  aliasFields: [],
718
721
  exportsFields: ["exports"],
722
+ roots: [context],
719
723
  mainFields: ["main"],
720
724
  byDependency: {
721
725
  wasm: esmDeps(),
@@ -27,6 +27,7 @@ export interface EntryDescriptionNormalized {
27
27
  }
28
28
  export interface OutputNormalized {
29
29
  path?: Path;
30
+ pathinfo?: boolean | "verbose";
30
31
  clean?: Clean;
31
32
  publicPath?: PublicPath;
32
33
  filename?: Filename;
@@ -47,6 +47,7 @@ const getNormalizedRspackOptions = (config) => {
47
47
  : undefined;
48
48
  return {
49
49
  path: output.path,
50
+ pathinfo: output.pathinfo,
50
51
  publicPath: output.publicPath,
51
52
  filename: output.filename,
52
53
  clean: output.clean,
@@ -931,6 +931,8 @@ declare const entry: z.ZodUnion<[z.ZodUnion<[z.ZodRecord<z.ZodString, z.ZodUnion
931
931
  export type Entry = z.infer<typeof entry>;
932
932
  declare const path: z.ZodString;
933
933
  export type Path = z.infer<typeof path>;
934
+ declare const pathinfo: z.ZodUnion<[z.ZodBoolean, z.ZodLiteral<"verbose">]>;
935
+ export type Pathinfo = z.infer<typeof pathinfo>;
934
936
  declare const assetModuleFilename: z.ZodString;
935
937
  export type AssetModuleFilename = z.infer<typeof assetModuleFilename>;
936
938
  declare const webassemblyModuleFilename: z.ZodString;
@@ -1003,6 +1005,7 @@ declare const devtoolFallbackModuleFilenameTemplate: z.ZodUnion<[z.ZodString, z.
1003
1005
  export type DevtoolFallbackModuleFilenameTemplate = z.infer<typeof devtoolFallbackModuleFilenameTemplate>;
1004
1006
  declare const output: z.ZodObject<{
1005
1007
  path: z.ZodOptional<z.ZodString>;
1008
+ pathinfo: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodLiteral<"verbose">]>>;
1006
1009
  clean: z.ZodOptional<z.ZodBoolean>;
1007
1010
  publicPath: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"auto">, z.ZodString]>>;
1008
1011
  filename: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodFunction<z.ZodTuple<[z.ZodType<import("@rspack/binding").JsPathData, z.ZodTypeDef, import("@rspack/binding").JsPathData>, z.ZodOptional<z.ZodType<JsAssetInfo, z.ZodTypeDef, JsAssetInfo>>], z.ZodUnknown>, z.ZodString>]>>;
@@ -1150,6 +1153,7 @@ declare const output: z.ZodObject<{
1150
1153
  devtoolFallbackModuleFilenameTemplate: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodFunction<z.ZodTuple<[z.ZodAny], null>, z.ZodAny>]>>;
1151
1154
  }, "strict", z.ZodTypeAny, {
1152
1155
  path?: string | undefined;
1156
+ pathinfo?: boolean | "verbose" | undefined;
1153
1157
  clean?: boolean | undefined;
1154
1158
  publicPath?: string | undefined;
1155
1159
  filename?: string | ((args_0: import("@rspack/binding").JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined;
@@ -1225,6 +1229,7 @@ declare const output: z.ZodObject<{
1225
1229
  devtoolFallbackModuleFilenameTemplate?: string | ((args_0: any) => any) | undefined;
1226
1230
  }, {
1227
1231
  path?: string | undefined;
1232
+ pathinfo?: boolean | "verbose" | undefined;
1228
1233
  clean?: boolean | undefined;
1229
1234
  publicPath?: string | undefined;
1230
1235
  filename?: string | ((args_0: import("@rspack/binding").JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined;
@@ -4774,6 +4779,7 @@ export declare const rspackOptions: z.ZodObject<{
4774
4779
  }>]>>, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>]>>]>>;
4775
4780
  output: z.ZodOptional<z.ZodObject<{
4776
4781
  path: z.ZodOptional<z.ZodString>;
4782
+ pathinfo: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodLiteral<"verbose">]>>;
4777
4783
  clean: z.ZodOptional<z.ZodBoolean>;
4778
4784
  publicPath: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"auto">, z.ZodString]>>;
4779
4785
  filename: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodFunction<z.ZodTuple<[z.ZodType<import("@rspack/binding").JsPathData, z.ZodTypeDef, import("@rspack/binding").JsPathData>, z.ZodOptional<z.ZodType<JsAssetInfo, z.ZodTypeDef, JsAssetInfo>>], z.ZodUnknown>, z.ZodString>]>>;
@@ -4921,6 +4927,7 @@ export declare const rspackOptions: z.ZodObject<{
4921
4927
  devtoolFallbackModuleFilenameTemplate: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodFunction<z.ZodTuple<[z.ZodAny], null>, z.ZodAny>]>>;
4922
4928
  }, "strict", z.ZodTypeAny, {
4923
4929
  path?: string | undefined;
4930
+ pathinfo?: boolean | "verbose" | undefined;
4924
4931
  clean?: boolean | undefined;
4925
4932
  publicPath?: string | undefined;
4926
4933
  filename?: string | ((args_0: import("@rspack/binding").JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined;
@@ -4996,6 +5003,7 @@ export declare const rspackOptions: z.ZodObject<{
4996
5003
  devtoolFallbackModuleFilenameTemplate?: string | ((args_0: any) => any) | undefined;
4997
5004
  }, {
4998
5005
  path?: string | undefined;
5006
+ pathinfo?: boolean | "verbose" | undefined;
4999
5007
  clean?: boolean | undefined;
5000
5008
  publicPath?: string | undefined;
5001
5009
  filename?: string | ((args_0: import("@rspack/binding").JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined;
@@ -6425,6 +6433,7 @@ export declare const rspackOptions: z.ZodObject<{
6425
6433
  }>) | undefined;
6426
6434
  output?: {
6427
6435
  path?: string | undefined;
6436
+ pathinfo?: boolean | "verbose" | undefined;
6428
6437
  clean?: boolean | undefined;
6429
6438
  publicPath?: string | undefined;
6430
6439
  filename?: string | ((args_0: import("@rspack/binding").JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined;
@@ -6838,6 +6847,7 @@ export declare const rspackOptions: z.ZodObject<{
6838
6847
  }>) | undefined;
6839
6848
  output?: {
6840
6849
  path?: string | undefined;
6850
+ pathinfo?: boolean | "verbose" | undefined;
6841
6851
  clean?: boolean | undefined;
6842
6852
  publicPath?: string | undefined;
6843
6853
  filename?: string | ((args_0: import("@rspack/binding").JsPathData, args_1: JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined;
@@ -118,6 +118,7 @@ const entry = entryStatic.or(zod_1.z.function().returns(entryStatic));
118
118
  //#endregion
119
119
  //#region Output
120
120
  const path = zod_1.z.string();
121
+ const pathinfo = zod_1.z.boolean().or(zod_1.z.literal("verbose"));
121
122
  const assetModuleFilename = zod_1.z.string();
122
123
  const webassemblyModuleFilename = zod_1.z.string();
123
124
  const chunkFilename = filename;
@@ -159,6 +160,7 @@ const devtoolModuleFilenameTemplate = zod_1.z.union([
159
160
  const devtoolFallbackModuleFilenameTemplate = devtoolModuleFilenameTemplate;
160
161
  const output = zod_1.z.strictObject({
161
162
  path: path.optional(),
163
+ pathinfo: pathinfo.optional(),
162
164
  clean: clean.optional(),
163
165
  publicPath: publicPath.optional(),
164
166
  filename: filename.optional(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspack/core",
3
- "version": "0.6.3-canary-bc61872-20240425005651",
3
+ "version": "0.6.3-canary-e4fdc75-20240427005559",
4
4
  "webpackVersion": "5.75.0",
5
5
  "license": "MIT",
6
6
  "description": "A Fast Rust-based Web Bundler",
@@ -60,8 +60,8 @@
60
60
  "styled-components": "^6.0.8",
61
61
  "terser": "5.27.2",
62
62
  "wast-loader": "^1.11.4",
63
- "@rspack/core": "0.6.3-canary-bc61872-20240425005651",
64
- "@rspack/plugin-minify": "^0.6.3-canary-bc61872-20240425005651"
63
+ "@rspack/core": "0.6.3-canary-e4fdc75-20240427005559",
64
+ "@rspack/plugin-minify": "^0.6.3-canary-e4fdc75-20240427005559"
65
65
  },
66
66
  "dependencies": {
67
67
  "@module-federation/runtime-tools": "0.1.6",
@@ -75,7 +75,7 @@
75
75
  "webpack-sources": "3.2.3",
76
76
  "zod": "^3.21.4",
77
77
  "zod-validation-error": "1.3.1",
78
- "@rspack/binding": "0.6.3-canary-bc61872-20240425005651"
78
+ "@rspack/binding": "0.6.3-canary-e4fdc75-20240427005559"
79
79
  },
80
80
  "peerDependencies": {
81
81
  "@swc/helpers": ">=0.5.1"
@@ -88,7 +88,6 @@
88
88
  "scripts": {
89
89
  "build": "tsc -b ./tsconfig.build.json",
90
90
  "dev": "tsc -w",
91
- "test": "cross-env NO_COLOR=1 node --expose-gc --max-old-space-size=8192 --experimental-vm-modules ../../node_modules/jest-cli/bin/jest --logHeapUsage",
92
91
  "api-extractor": "api-extractor run --verbose",
93
92
  "api-extractor:ci": "api-extractor run --verbose || diff temp/api.md etc/api.md"
94
93
  }