@rspack-canary/browser 1.5.8-canary-6c1a40e3-20250925175235 → 1.5.8-canary-15732646-20250926173747

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,9 @@
1
+ export declare const URLPlugin: {
2
+ new (): {
3
+ name: string;
4
+ _args: [];
5
+ affectedHooks: keyof import("..").CompilerHooks | undefined;
6
+ raw(compiler: import("..").Compiler): import("../binding").BuiltinPlugin;
7
+ apply(compiler: import("..").Compiler): void;
8
+ };
9
+ };
@@ -76,6 +76,7 @@ export * from "./SourceMapDevToolPlugin";
76
76
  export * from "./SplitChunksPlugin";
77
77
  export * from "./SubresourceIntegrityPlugin";
78
78
  export * from "./SwcJsMinimizerPlugin";
79
+ export * from "./URLPlugin";
79
80
  export * from "./WarnCaseSensitiveModulesPlugin";
80
81
  export * from "./WebWorkerTemplatePlugin";
81
82
  export * from "./WorkerPlugin";
@@ -727,6 +727,11 @@ export type CssModuleParserOptions = {
727
727
  url?: CssParserUrl;
728
728
  };
729
729
  type ExportsPresence = "error" | "warn" | "auto" | false;
730
+ export type JavascriptParserCommonjsExports = boolean | "skipInEsm";
731
+ export type JavascriptParserCommonjsOption = boolean | {
732
+ /** Controls how CommonJS export mutations are handled. */
733
+ exports?: JavascriptParserCommonjsExports;
734
+ };
730
735
  export type JavascriptParserOptions = {
731
736
  /**
732
737
  * Specifies global mode for dynamic import.
@@ -757,7 +762,7 @@ export type JavascriptParserOptions = {
757
762
  * Enable parsing of new URL() syntax.
758
763
  * @default true
759
764
  * */
760
- url?: "relative" | boolean;
765
+ url?: "relative" | "new-url-relative" | boolean;
761
766
  /**
762
767
  * Enable warnings for full dynamic dependencies
763
768
  * @default true
@@ -795,6 +800,11 @@ export type JavascriptParserOptions = {
795
800
  requireAsExpression?: boolean;
796
801
  requireDynamic?: boolean;
797
802
  requireResolve?: boolean;
803
+ /**
804
+ * CommonJS-specific parser options. `true` enables the default behaviour, `{ exports: 'skipInEsm' }` preserves CommonJS export mutations when executed inside ESM.
805
+ * @default true
806
+ */
807
+ commonjs?: JavascriptParserCommonjsOption;
798
808
  importDynamic?: boolean;
799
809
  /**
800
810
  * Enable magic comments for CommonJS require() expressions.
package/dist/index.mjs CHANGED
@@ -39963,6 +39963,7 @@ function getRawJavascriptParserOptions(parser) {
39963
39963
  requireAsExpression: parser.requireAsExpression,
39964
39964
  requireDynamic: parser.requireDynamic,
39965
39965
  requireResolve: parser.requireResolve,
39966
+ commonjs: parser.commonjs,
39966
39967
  importDynamic: parser.importDynamic,
39967
39968
  commonjsMagicComments: parser.commonjsMagicComments,
39968
39969
  inlineConst: parser.inlineConst,
@@ -45433,6 +45434,7 @@ const SwcJsMinimizerRspackPlugin = (0, builtin_plugin_base.vt)(external_rspack_w
45433
45434
  }
45434
45435
  };
45435
45436
  }, "compilation");
45437
+ const URLPlugin = (0, builtin_plugin_base.vt)(external_rspack_wasi_browser_js_.BuiltinPluginName.URLPlugin, ()=>{});
45436
45438
  const WarnCaseSensitiveModulesPlugin = (0, builtin_plugin_base.vt)(external_rspack_wasi_browser_js_.BuiltinPluginName.WarnCaseSensitiveModulesPlugin, ()=>{}, "compilation");
45437
45439
  function WebWorkerTemplatePlugin_define_property(obj, key, value) {
45438
45440
  if (key in obj) Object.defineProperty(obj, key, {
@@ -46608,7 +46610,7 @@ const applybundlerInfoDefaults = (rspackFuture, library)=>{
46608
46610
  if ("object" == typeof rspackFuture) {
46609
46611
  D(rspackFuture, "bundlerInfo", {});
46610
46612
  if ("object" == typeof rspackFuture.bundlerInfo) {
46611
- D(rspackFuture.bundlerInfo, "version", "1.5.8-canary-6c1a40e3-20250925175235");
46613
+ D(rspackFuture.bundlerInfo, "version", "1.5.8-canary-15732646-20250926173747");
46612
46614
  D(rspackFuture.bundlerInfo, "bundler", "rspack");
46613
46615
  D(rspackFuture.bundlerInfo, "force", !library);
46614
46616
  }
@@ -46628,6 +46630,7 @@ const applyJavascriptParserOptionsDefaults = (parserOptions, { usedExports, inli
46628
46630
  D(parserOptions, "requireAsExpression", true);
46629
46631
  D(parserOptions, "requireDynamic", true);
46630
46632
  D(parserOptions, "requireResolve", true);
46633
+ D(parserOptions, "commonjs", true);
46631
46634
  D(parserOptions, "importDynamic", true);
46632
46635
  D(parserOptions, "worker", [
46633
46636
  "..."
@@ -50708,7 +50711,7 @@ class MultiStats {
50708
50711
  return obj;
50709
50712
  });
50710
50713
  if (childOptions.version) {
50711
- obj.rspackVersion = "1.5.8-canary-6c1a40e3-20250925175235";
50714
+ obj.rspackVersion = "1.5.8-canary-15732646-20250926173747";
50712
50715
  obj.version = "5.75.0";
50713
50716
  }
50714
50717
  if (childOptions.hash) obj.hash = obj.children.map((j)=>j.hash).join("");
@@ -50828,7 +50831,7 @@ function MultiWatching_define_property(obj, key, value) {
50828
50831
  else obj[key] = value;
50829
50832
  return obj;
50830
50833
  }
50831
- class MultiWatching {
50834
+ class MultiWatching_MultiWatching {
50832
50835
  invalidate(callback) {
50833
50836
  if (callback) asyncLib.each(this.watchings, (watching, callback)=>watching.invalidate(callback), callback);
50834
50837
  else for (const watching of this.watchings)watching.invalidate();
@@ -50861,7 +50864,7 @@ class MultiWatching {
50861
50864
  this.compiler = compiler;
50862
50865
  }
50863
50866
  }
50864
- const src_MultiWatching = MultiWatching;
50867
+ const MultiWatching = MultiWatching_MultiWatching;
50865
50868
  function ArrayQueue_define_property(obj, key, value) {
50866
50869
  if (key in obj) Object.defineProperty(obj, key, {
50867
50870
  value: value,
@@ -51038,10 +51041,10 @@ class MultiCompiler {
51038
51041
  if (compiler.watching !== watching) return;
51039
51042
  if (!watching.running) watching.invalidate();
51040
51043
  }, handler);
51041
- this.watching = new src_MultiWatching(watchings, this);
51044
+ this.watching = new MultiWatching(watchings, this);
51042
51045
  return this.watching;
51043
51046
  }
51044
- this.watching = new src_MultiWatching([], this);
51047
+ this.watching = new MultiWatching([], this);
51045
51048
  return this.watching;
51046
51049
  }
51047
51050
  run(callback, options) {
@@ -52015,7 +52018,7 @@ const SIMPLE_EXTRACTORS = {
52015
52018
  },
52016
52019
  version: (object)=>{
52017
52020
  object.version = "5.75.0";
52018
- object.rspackVersion = "1.5.8-canary-6c1a40e3-20250925175235";
52021
+ object.rspackVersion = "1.5.8-canary-15732646-20250926173747";
52019
52022
  },
52020
52023
  env: (object, _compilation, _context, { _env })=>{
52021
52024
  object.env = _env;
@@ -53682,6 +53685,7 @@ class RspackOptionsApply {
53682
53685
  }).apply(compiler);
53683
53686
  }
53684
53687
  new JavascriptModulesPlugin().apply(compiler);
53688
+ new URLPlugin().apply(compiler);
53685
53689
  new JsonModulesPlugin().apply(compiler);
53686
53690
  new AssetModulesPlugin().apply(compiler);
53687
53691
  if (options.experiments.asyncWebAssembly) new AsyncWebAssemblyModulesPlugin().apply(compiler);
@@ -55290,6 +55294,7 @@ const getRspackOptionsSchema = memoize(()=>{
55290
55294
  ]);
55291
55295
  const javascriptParserUrl = union([
55292
55296
  literal("relative"),
55297
+ literal("new-url-relative"),
55293
55298
  schemas_boolean()
55294
55299
  ]);
55295
55300
  const exprContextCritical = schemas_boolean();
@@ -55320,6 +55325,13 @@ const getRspackOptionsSchema = memoize(()=>{
55320
55325
  const requireAsExpression = schemas_boolean();
55321
55326
  const requireDynamic = schemas_boolean();
55322
55327
  const requireResolve = schemas_boolean();
55328
+ const commonjsExports = union([
55329
+ schemas_boolean(),
55330
+ literal("skipInEsm")
55331
+ ]);
55332
+ const commonjs = schemas_boolean().or(strictObject({
55333
+ exports: commonjsExports
55334
+ }).partial());
55323
55335
  const importDynamic = schemas_boolean();
55324
55336
  const commonjsMagicComments = schemas_boolean();
55325
55337
  const inlineConst = schemas_boolean();
@@ -55350,6 +55362,7 @@ const getRspackOptionsSchema = memoize(()=>{
55350
55362
  requireAsExpression: requireAsExpression,
55351
55363
  requireDynamic: requireDynamic,
55352
55364
  requireResolve: requireResolve,
55365
+ commonjs: commonjs,
55353
55366
  importDynamic: importDynamic,
55354
55367
  inlineConst: inlineConst,
55355
55368
  typeReexportsPresence: typeReexportsPresence,
@@ -56469,7 +56482,7 @@ function transformSync(source, options) {
56469
56482
  const _options = JSON.stringify(options || {});
56470
56483
  return external_rspack_wasi_browser_js_["default"].transformSync(source, _options);
56471
56484
  }
56472
- const exports_rspackVersion = "1.5.8-canary-6c1a40e3-20250925175235";
56485
+ const exports_rspackVersion = "1.5.8-canary-15732646-20250926173747";
56473
56486
  const exports_version = "5.75.0";
56474
56487
  const exports_WebpackError = Error;
56475
56488
  const sources = __webpack_require__("../../node_modules/.pnpm/webpack-sources@3.3.3_patch_hash=b2a26650f08a2359d0a3cd81fa6fa272aa7441a28dd7e601792da5ed5d2b4aee/node_modules/webpack-sources/lib/index.js");
@@ -589,6 +589,7 @@ export declare enum BuiltinPluginName {
589
589
  RstestPlugin = 'RstestPlugin',
590
590
  RslibPlugin = 'RslibPlugin',
591
591
  CircularDependencyRspackPlugin = 'CircularDependencyRspackPlugin',
592
+ URLPlugin = 'URLPlugin',
592
593
  JsLoaderRspackPlugin = 'JsLoaderRspackPlugin',
593
594
  LazyCompilationPlugin = 'LazyCompilationPlugin',
594
595
  ModuleInfoHeaderPlugin = 'ModuleInfoHeaderPlugin',
@@ -2285,6 +2286,14 @@ export interface RawIntegrityItem {
2285
2286
  integrity: string
2286
2287
  }
2287
2288
 
2289
+ export declare enum RawJavascriptParserCommonjsExports {
2290
+ SkipInEsm = 'skipInEsm'
2291
+ }
2292
+
2293
+ export interface RawJavascriptParserCommonjsOptions {
2294
+ exports?: boolean | 'skipInEsm'
2295
+ }
2296
+
2288
2297
  export interface RawJavascriptParserOptions {
2289
2298
  dynamicImportMode?: string
2290
2299
  dynamicImportPreload?: string
@@ -2317,27 +2326,28 @@ export interface RawJavascriptParserOptions {
2317
2326
  * @experimental
2318
2327
  */
2319
2328
  requireResolve?: boolean
2320
- /**
2321
- * This option is experimental in Rspack only and subject to change or be removed anytime.
2322
- * @experimental
2323
- */
2324
- importDynamic?: boolean
2325
- commonjsMagicComments?: boolean
2326
- /**
2327
- * This option is experimental in Rspack only and subject to change or be removed anytime.
2328
- * @experimental
2329
- */
2330
- inlineConst?: boolean
2331
- /**
2332
- * This option is experimental in Rspack only and subject to change or be removed anytime.
2333
- * @experimental
2334
- */
2335
- typeReexportsPresence?: string
2336
- /**
2337
- * This option is experimental in Rspack only and subject to change or be removed anytime.
2338
- * @experimental
2339
- */
2340
- jsx?: boolean
2329
+ commonjs?: boolean | { exports?: boolean | 'skipInEsm' }
2330
+ /**
2331
+ * This option is experimental in Rspack only and subject to change or be removed anytime.
2332
+ * @experimental
2333
+ */
2334
+ importDynamic?: boolean
2335
+ commonjsMagicComments?: boolean
2336
+ /**
2337
+ * This option is experimental in Rspack only and subject to change or be removed anytime.
2338
+ * @experimental
2339
+ */
2340
+ inlineConst?: boolean
2341
+ /**
2342
+ * This option is experimental in Rspack only and subject to change or be removed anytime.
2343
+ * @experimental
2344
+ */
2345
+ typeReexportsPresence?: string
2346
+ /**
2347
+ * This option is experimental in Rspack only and subject to change or be removed anytime.
2348
+ * @experimental
2349
+ */
2350
+ jsx?: boolean
2341
2351
  }
2342
2352
 
2343
2353
  export interface RawJsonGeneratorOptions {
@@ -94,6 +94,7 @@ export const JsRspackSeverity = __napiModule.exports.JsRspackSeverity;
94
94
  export const loadBrowserslist = __napiModule.exports.loadBrowserslist;
95
95
  export const minify = __napiModule.exports.minify;
96
96
  export const minifySync = __napiModule.exports.minifySync;
97
+ export const RawJavascriptParserCommonjsExports = __napiModule.exports.RawJavascriptParserCommonjsExports;
97
98
  export const RawRuleSetConditionType = __napiModule.exports.RawRuleSetConditionType;
98
99
  export const registerGlobalTrace = __napiModule.exports.registerGlobalTrace;
99
100
  export const RegisterJsTapKind = __napiModule.exports.RegisterJsTapKind;
Binary file
@@ -735,7 +735,7 @@ export declare const getRspackOptionsSchema: () => z.ZodObject<{
735
735
  high: "high";
736
736
  }>>;
737
737
  importMeta: z.ZodOptional<z.ZodBoolean>;
738
- url: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"relative">, z.ZodBoolean]>>;
738
+ url: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"relative">, z.ZodLiteral<"new-url-relative">, z.ZodBoolean]>>;
739
739
  exprContextCritical: z.ZodOptional<z.ZodBoolean>;
740
740
  wrappedContextCritical: z.ZodOptional<z.ZodBoolean>;
741
741
  unknownContextCritical: z.ZodOptional<z.ZodBoolean>;
@@ -765,6 +765,9 @@ export declare const getRspackOptionsSchema: () => z.ZodObject<{
765
765
  requireAsExpression: z.ZodOptional<z.ZodBoolean>;
766
766
  requireDynamic: z.ZodOptional<z.ZodBoolean>;
767
767
  requireResolve: z.ZodOptional<z.ZodBoolean>;
768
+ commonjs: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodObject<{
769
+ exports: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodLiteral<"skipInEsm">]>>;
770
+ }, z.core.$strict>]>>;
768
771
  importDynamic: z.ZodOptional<z.ZodBoolean>;
769
772
  inlineConst: z.ZodOptional<z.ZodBoolean>;
770
773
  typeReexportsPresence: z.ZodOptional<z.ZodEnum<{
@@ -789,7 +792,7 @@ export declare const getRspackOptionsSchema: () => z.ZodObject<{
789
792
  high: "high";
790
793
  }>>;
791
794
  importMeta: z.ZodOptional<z.ZodBoolean>;
792
- url: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"relative">, z.ZodBoolean]>>;
795
+ url: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"relative">, z.ZodLiteral<"new-url-relative">, z.ZodBoolean]>>;
793
796
  exprContextCritical: z.ZodOptional<z.ZodBoolean>;
794
797
  wrappedContextCritical: z.ZodOptional<z.ZodBoolean>;
795
798
  unknownContextCritical: z.ZodOptional<z.ZodBoolean>;
@@ -819,6 +822,9 @@ export declare const getRspackOptionsSchema: () => z.ZodObject<{
819
822
  requireAsExpression: z.ZodOptional<z.ZodBoolean>;
820
823
  requireDynamic: z.ZodOptional<z.ZodBoolean>;
821
824
  requireResolve: z.ZodOptional<z.ZodBoolean>;
825
+ commonjs: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodObject<{
826
+ exports: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodLiteral<"skipInEsm">]>>;
827
+ }, z.core.$strict>]>>;
822
828
  importDynamic: z.ZodOptional<z.ZodBoolean>;
823
829
  inlineConst: z.ZodOptional<z.ZodBoolean>;
824
830
  typeReexportsPresence: z.ZodOptional<z.ZodEnum<{
@@ -843,7 +849,7 @@ export declare const getRspackOptionsSchema: () => z.ZodObject<{
843
849
  high: "high";
844
850
  }>>;
845
851
  importMeta: z.ZodOptional<z.ZodBoolean>;
846
- url: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"relative">, z.ZodBoolean]>>;
852
+ url: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"relative">, z.ZodLiteral<"new-url-relative">, z.ZodBoolean]>>;
847
853
  exprContextCritical: z.ZodOptional<z.ZodBoolean>;
848
854
  wrappedContextCritical: z.ZodOptional<z.ZodBoolean>;
849
855
  unknownContextCritical: z.ZodOptional<z.ZodBoolean>;
@@ -873,6 +879,9 @@ export declare const getRspackOptionsSchema: () => z.ZodObject<{
873
879
  requireAsExpression: z.ZodOptional<z.ZodBoolean>;
874
880
  requireDynamic: z.ZodOptional<z.ZodBoolean>;
875
881
  requireResolve: z.ZodOptional<z.ZodBoolean>;
882
+ commonjs: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodObject<{
883
+ exports: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodLiteral<"skipInEsm">]>>;
884
+ }, z.core.$strict>]>>;
876
885
  importDynamic: z.ZodOptional<z.ZodBoolean>;
877
886
  inlineConst: z.ZodOptional<z.ZodBoolean>;
878
887
  typeReexportsPresence: z.ZodOptional<z.ZodEnum<{
@@ -897,7 +906,7 @@ export declare const getRspackOptionsSchema: () => z.ZodObject<{
897
906
  high: "high";
898
907
  }>>;
899
908
  importMeta: z.ZodOptional<z.ZodBoolean>;
900
- url: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"relative">, z.ZodBoolean]>>;
909
+ url: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"relative">, z.ZodLiteral<"new-url-relative">, z.ZodBoolean]>>;
901
910
  exprContextCritical: z.ZodOptional<z.ZodBoolean>;
902
911
  wrappedContextCritical: z.ZodOptional<z.ZodBoolean>;
903
912
  unknownContextCritical: z.ZodOptional<z.ZodBoolean>;
@@ -927,6 +936,9 @@ export declare const getRspackOptionsSchema: () => z.ZodObject<{
927
936
  requireAsExpression: z.ZodOptional<z.ZodBoolean>;
928
937
  requireDynamic: z.ZodOptional<z.ZodBoolean>;
929
938
  requireResolve: z.ZodOptional<z.ZodBoolean>;
939
+ commonjs: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodObject<{
940
+ exports: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodLiteral<"skipInEsm">]>>;
941
+ }, z.core.$strict>]>>;
930
942
  importDynamic: z.ZodOptional<z.ZodBoolean>;
931
943
  inlineConst: z.ZodOptional<z.ZodBoolean>;
932
944
  typeReexportsPresence: z.ZodOptional<z.ZodEnum<{
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspack-canary/browser",
3
- "version": "1.5.8-canary-6c1a40e3-20250925175235",
3
+ "version": "1.5.8-canary-15732646-20250926173747",
4
4
  "webpackVersion": "5.75.0",
5
5
  "license": "MIT",
6
6
  "description": "Rspack for running in the browser. This is still in early stage and may not follow the semver.",