@rspack/core 1.4.9 → 1.4.11

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.
@@ -1,10 +1,147 @@
1
1
  /******/ (() => { // webpackBootstrap
2
- /******/ "use strict";
3
2
  /******/ var __webpack_modules__ = ({
4
3
 
4
+ /***/ 137:
5
+ /***/ ((module) => {
6
+
7
+ module.exports = function (glob, opts) {
8
+ if (typeof glob !== 'string') {
9
+ throw new TypeError('Expected a string');
10
+ }
11
+
12
+ var str = String(glob);
13
+
14
+ // The regexp we are building, as a string.
15
+ var reStr = "";
16
+
17
+ // Whether we are matching so called "extended" globs (like bash) and should
18
+ // support single character matching, matching ranges of characters, group
19
+ // matching, etc.
20
+ var extended = opts ? !!opts.extended : false;
21
+
22
+ // When globstar is _false_ (default), '/foo/*' is translated a regexp like
23
+ // '^\/foo\/.*$' which will match any string beginning with '/foo/'
24
+ // When globstar is _true_, '/foo/*' is translated to regexp like
25
+ // '^\/foo\/[^/]*$' which will match any string beginning with '/foo/' BUT
26
+ // which does not have a '/' to the right of it.
27
+ // E.g. with '/foo/*' these will match: '/foo/bar', '/foo/bar.txt' but
28
+ // these will not '/foo/bar/baz', '/foo/bar/baz.txt'
29
+ // Lastely, when globstar is _true_, '/foo/**' is equivelant to '/foo/*' when
30
+ // globstar is _false_
31
+ var globstar = opts ? !!opts.globstar : false;
32
+
33
+ // If we are doing extended matching, this boolean is true when we are inside
34
+ // a group (eg {*.html,*.js}), and false otherwise.
35
+ var inGroup = false;
36
+
37
+ // RegExp flags (eg "i" ) to pass in to RegExp constructor.
38
+ var flags = opts && typeof( opts.flags ) === "string" ? opts.flags : "";
39
+
40
+ var c;
41
+ for (var i = 0, len = str.length; i < len; i++) {
42
+ c = str[i];
43
+
44
+ switch (c) {
45
+ case "/":
46
+ case "$":
47
+ case "^":
48
+ case "+":
49
+ case ".":
50
+ case "(":
51
+ case ")":
52
+ case "=":
53
+ case "!":
54
+ case "|":
55
+ reStr += "\\" + c;
56
+ break;
57
+
58
+ case "?":
59
+ if (extended) {
60
+ reStr += ".";
61
+ break;
62
+ }
63
+
64
+ case "[":
65
+ case "]":
66
+ if (extended) {
67
+ reStr += c;
68
+ break;
69
+ }
70
+
71
+ case "{":
72
+ if (extended) {
73
+ inGroup = true;
74
+ reStr += "(";
75
+ break;
76
+ }
77
+
78
+ case "}":
79
+ if (extended) {
80
+ inGroup = false;
81
+ reStr += ")";
82
+ break;
83
+ }
84
+
85
+ case ",":
86
+ if (inGroup) {
87
+ reStr += "|";
88
+ break;
89
+ }
90
+ reStr += "\\" + c;
91
+ break;
92
+
93
+ case "*":
94
+ // Move over all consecutive "*"'s.
95
+ // Also store the previous and next characters
96
+ var prevChar = str[i - 1];
97
+ var starCount = 1;
98
+ while(str[i + 1] === "*") {
99
+ starCount++;
100
+ i++;
101
+ }
102
+ var nextChar = str[i + 1];
103
+
104
+ if (!globstar) {
105
+ // globstar is disabled, so treat any number of "*" as one
106
+ reStr += ".*";
107
+ } else {
108
+ // globstar is enabled, so determine if this is a globstar segment
109
+ var isGlobstar = starCount > 1 // multiple "*"'s
110
+ && (prevChar === "/" || prevChar === undefined) // from the start of the segment
111
+ && (nextChar === "/" || nextChar === undefined) // to the end of the segment
112
+
113
+ if (isGlobstar) {
114
+ // it's a globstar, so match zero or more path segments
115
+ reStr += "((?:[^/]*(?:\/|$))*)";
116
+ i++; // move over the "/"
117
+ } else {
118
+ // it's not a globstar, so only match one path segment
119
+ reStr += "([^/]*)";
120
+ }
121
+ }
122
+ break;
123
+
124
+ default:
125
+ reStr += c;
126
+ }
127
+ }
128
+
129
+ // When regexp 'g' flag is specified don't
130
+ // constrain the regular expression with ^ & $
131
+ if (!flags || !~flags.indexOf('g')) {
132
+ reStr = "^" + reStr + "$";
133
+ }
134
+
135
+ return new RegExp(reStr, flags);
136
+ };
137
+
138
+
139
+ /***/ }),
140
+
5
141
  /***/ 799:
6
142
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
7
143
 
144
+ "use strict";
8
145
  /*
9
146
  MIT License http://www.opensource.org/licenses/mit-license.php
10
147
  Author Tobias Koppers @sokra
@@ -803,6 +940,7 @@ function ensureFsAccuracy(mtime) {
803
940
  /***/ 308:
804
941
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
805
942
 
943
+ "use strict";
806
944
  /*
807
945
  MIT License http://www.opensource.org/licenses/mit-license.php
808
946
  Author Tobias Koppers @sokra
@@ -917,6 +1055,7 @@ module.exports = LinkResolver;
917
1055
  /***/ 847:
918
1056
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
919
1057
 
1058
+ "use strict";
920
1059
  /*
921
1060
  MIT License http://www.opensource.org/licenses/mit-license.php
922
1061
  Author Tobias Koppers @sokra
@@ -976,6 +1115,7 @@ module.exports.WatcherManager = WatcherManager;
976
1115
  /***/ 935:
977
1116
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
978
1117
 
1118
+ "use strict";
979
1119
  /*
980
1120
  MIT License http://www.opensource.org/licenses/mit-license.php
981
1121
  Author Tobias Koppers @sokra
@@ -1121,6 +1261,7 @@ module.exports = (plan, limit) => {
1121
1261
  /***/ 214:
1122
1262
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
1123
1263
 
1264
+ "use strict";
1124
1265
  /*
1125
1266
  MIT License http://www.opensource.org/licenses/mit-license.php
1126
1267
  Author Tobias Koppers @sokra
@@ -1499,6 +1640,7 @@ exports.watcherLimit = watcherLimit;
1499
1640
  /***/ 882:
1500
1641
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
1501
1642
 
1643
+ "use strict";
1502
1644
  /*
1503
1645
  MIT License http://www.opensource.org/licenses/mit-license.php
1504
1646
  Author Tobias Koppers @sokra
@@ -1508,7 +1650,7 @@ exports.watcherLimit = watcherLimit;
1508
1650
  const getWatcherManager = __nccwpck_require__(847);
1509
1651
  const LinkResolver = __nccwpck_require__(308);
1510
1652
  const EventEmitter = (__nccwpck_require__(434).EventEmitter);
1511
- const globToRegExp = __nccwpck_require__(686);
1653
+ const globToRegExp = __nccwpck_require__(137);
1512
1654
  const watchEventSource = __nccwpck_require__(214);
1513
1655
 
1514
1656
  const EMPTY_ARRAY = [];
@@ -1894,18 +2036,12 @@ class Watchpack extends EventEmitter {
1894
2036
  module.exports = Watchpack;
1895
2037
 
1896
2038
 
1897
- /***/ }),
1898
-
1899
- /***/ 686:
1900
- /***/ ((module) => {
1901
-
1902
- module.exports = require("../glob-to-regexp/index.js");
1903
-
1904
2039
  /***/ }),
1905
2040
 
1906
2041
  /***/ 923:
1907
2042
  /***/ ((module) => {
1908
2043
 
2044
+ "use strict";
1909
2045
  module.exports = require("../graceful-fs/index.js");
1910
2046
 
1911
2047
  /***/ }),
@@ -1913,6 +2049,7 @@ module.exports = require("../graceful-fs/index.js");
1913
2049
  /***/ 434:
1914
2050
  /***/ ((module) => {
1915
2051
 
2052
+ "use strict";
1916
2053
  module.exports = require("events");
1917
2054
 
1918
2055
  /***/ }),
@@ -1920,6 +2057,7 @@ module.exports = require("events");
1920
2057
  /***/ 896:
1921
2058
  /***/ ((module) => {
1922
2059
 
2060
+ "use strict";
1923
2061
  module.exports = require("fs");
1924
2062
 
1925
2063
  /***/ }),
@@ -1927,6 +2065,7 @@ module.exports = require("fs");
1927
2065
  /***/ 857:
1928
2066
  /***/ ((module) => {
1929
2067
 
2068
+ "use strict";
1930
2069
  module.exports = require("os");
1931
2070
 
1932
2071
  /***/ }),
@@ -1934,6 +2073,7 @@ module.exports = require("os");
1934
2073
  /***/ 928:
1935
2074
  /***/ ((module) => {
1936
2075
 
2076
+ "use strict";
1937
2077
  module.exports = require("path");
1938
2078
 
1939
2079
  /***/ })
@@ -64,7 +64,7 @@ export declare class MultiCompiler {
64
64
  * @param handler - signals when the call finishes
65
65
  * @returns a compiler watcher
66
66
  */
67
- watch(watchOptions: WatchOptions, handler: liteTapable.Callback<Error, MultiStats>): MultiWatching;
67
+ watch(watchOptions: WatchOptions | WatchOptions[], handler: liteTapable.Callback<Error, MultiStats>): MultiWatching;
68
68
  /**
69
69
  * @param callback - signals when the call finishes
70
70
  * @param options - additional data like modifiedFiles, removedFiles
@@ -1,5 +1,18 @@
1
1
  export type CollectTypeScriptInfoOptions = {
2
+ /**
3
+ * Whether to collect type exports information for `typeReexportsPresence`.
4
+ * This is used to check type exports of submodules when running in `'tolerant'` mode.
5
+ * @default false
6
+ */
2
7
  typeExports?: boolean;
8
+ /**
9
+ * Whether to collect information about exported `enum`s.
10
+ * - `true` will collect all `enum` information, including `const enum`s and regular `enum`s.
11
+ * - `false` will not collect any `enum` information.
12
+ * - `'const-only'` will gather only `const enum`s, enabling Rspack to perform cross-module
13
+ * inlining optimizations for them.
14
+ * @default false
15
+ */
3
16
  exportedEnum?: boolean | "const-only";
4
17
  };
5
18
  export declare function resolveCollectTypeScriptInfo(options: CollectTypeScriptInfoOptions): {
@@ -16,6 +16,10 @@ export type SwcLoaderOptions = Config & {
16
16
  */
17
17
  rspackExperiments?: {
18
18
  import?: PluginImportOptions;
19
+ /**
20
+ * Collects information from TypeScript's AST for consumption by subsequent Rspack processes,
21
+ * providing better TypeScript development experience and smaller output bundle size.
22
+ */
19
23
  collectTypeScriptInfo?: CollectTypeScriptInfoOptions;
20
24
  };
21
25
  };
@@ -1,10 +1,11 @@
1
1
  import { type BuiltinPlugin, BuiltinPluginName } from "@rspack/binding";
2
- import type { Compiler, Externals } from "..";
2
+ import type { Externals } from "..";
3
3
  import { RspackBuiltinPlugin } from "./base";
4
4
  export declare class ExternalsPlugin extends RspackBuiltinPlugin {
5
+ #private;
5
6
  private type;
6
7
  private externals;
7
8
  name: BuiltinPluginName;
8
9
  constructor(type: string, externals: Externals);
9
- raw(compiler: Compiler): BuiltinPlugin | undefined;
10
+ raw(): BuiltinPlugin | undefined;
10
11
  }
@@ -9,6 +9,10 @@ export declare namespace RsdoctorPluginData {
9
9
  export type RsdoctorPluginOptions = {
10
10
  moduleGraphFeatures?: boolean | Array<"graph" | "ids" | "sources">;
11
11
  chunkGraphFeatures?: boolean | Array<"graph" | "assets">;
12
+ sourceMapFeatures?: {
13
+ module?: boolean;
14
+ cheap?: boolean;
15
+ };
12
16
  };
13
17
  declare const RsdoctorPluginImpl: {
14
18
  new (c?: RsdoctorPluginOptions | undefined): {
@@ -495,7 +495,10 @@ export type ResolveTsConfig = string | {
495
495
  export type ResolveOptions = {
496
496
  /** Path alias */
497
497
  alias?: ResolveAlias;
498
- /** Same as node's [conditionNames](https://nodejs.org/api/packages.html#conditional-exports) for the exports and imports fields in package.json. */
498
+ /**
499
+ * Specifies the condition names used to match entry points in the `exports` field of a package.
500
+ * @link https://nodejs.org/api/packages.html#packages_exports
501
+ */
499
502
  conditionNames?: string[];
500
503
  /**
501
504
  * Parse modules in order.
@@ -82,64 +82,66 @@ let pitch = function(request, _, data) {
82
82
  let options = this.getOptions(), emit = void 0 === options.emit || options.emit, callback = this.async(), filepath = this.resourcePath;
83
83
  this.addDependency(filepath);
84
84
  let { publicPath } = this._compilation.outputOptions;
85
- "string" == typeof options.publicPath ? publicPath = options.publicPath : "function" == typeof options.publicPath && (publicPath = options.publicPath(this.resourcePath, this.rootContext)), "auto" === publicPath && (publicPath = AUTO_PUBLIC_PATH), publicPathForExtract = "string" == typeof publicPath ? /^[a-zA-Z][a-zA-Z\d+\-.]*?:/.test(publicPath) ? publicPath : `${ABSOLUTE_PUBLIC_PATH}${publicPath.replace(/\./g, SINGLE_DOT_PATH_SEGMENT)}` : publicPath, this.importModule(`${this.resourcePath}.webpack[javascript/auto]!=!!!${request}`, {
85
+ "string" == typeof options.publicPath ? publicPath = options.publicPath : "function" == typeof options.publicPath && (publicPath = options.publicPath(this.resourcePath, this.rootContext)), "auto" === publicPath && (publicPath = AUTO_PUBLIC_PATH), publicPathForExtract = "string" == typeof publicPath ? /^[a-zA-Z][a-zA-Z\d+\-.]*?:/.test(publicPath) ? publicPath : `${ABSOLUTE_PUBLIC_PATH}${publicPath.replace(/\./g, SINGLE_DOT_PATH_SEGMENT)}` : publicPath;
86
+ let handleExports = (originalExports)=>{
87
+ let locals, namedExport, esModule = void 0 === options.esModule || options.esModule, dependencies = [];
88
+ try {
89
+ let exports1 = originalExports.__esModule ? originalExports.default : originalExports;
90
+ if (namedExport = originalExports.__esModule && (!originalExports.default || !("locals" in originalExports.default))) for (let key of Object.keys(originalExports))"default" !== key && (locals || (locals = {}), locals[key] = originalExports[key]);
91
+ else locals = exports1?.locals;
92
+ if (Array.isArray(exports1) && emit) {
93
+ let identifierCountMap = new Map();
94
+ dependencies = exports1.map(([id, content, media, sourceMap, supports, layer])=>{
95
+ let context = this.rootContext, count = identifierCountMap.get(id) || 0;
96
+ return identifierCountMap.set(id, count + 1), {
97
+ identifier: id,
98
+ context,
99
+ content,
100
+ media,
101
+ supports,
102
+ layer,
103
+ identifierIndex: count,
104
+ sourceMap: sourceMap ? JSON.stringify(sourceMap) : void 0,
105
+ filepath
106
+ };
107
+ }).filter((item)=>null !== item);
108
+ }
109
+ } catch (e) {
110
+ callback(e);
111
+ return;
112
+ }
113
+ let result = function() {
114
+ if (locals) {
115
+ if (namedExport) {
116
+ let identifiers = Array.from(function*() {
117
+ let identifierId = 0;
118
+ for (let key of Object.keys(locals))identifierId += 1, yield [
119
+ `_${identifierId.toString(16)}`,
120
+ key
121
+ ];
122
+ }()), localsString = identifiers.map(([id, key])=>{
123
+ var value;
124
+ return `\nvar ${id} = ${"function" == typeof (value = locals[key]) ? value.toString() : JSON.stringify(value)};`;
125
+ }).join(""), exportsString = `export { ${identifiers.map(([id, key])=>`${id} as ${JSON.stringify(key)}`).join(", ")} }`;
126
+ return void 0 !== options.defaultExport && options.defaultExport ? `${localsString}\n${exportsString}\nexport default { ${identifiers.map(([id, key])=>`${JSON.stringify(key)}: ${id}`).join(", ")} }\n` : `${localsString}\n${exportsString}\n`;
127
+ }
128
+ return `\n${esModule ? "export default" : "module.exports = "} ${JSON.stringify(locals)};`;
129
+ }
130
+ return esModule ? "\nexport {};" : "";
131
+ }(), resultSource = `// extracted by ${PLUGIN_NAME}`;
132
+ resultSource += this.hot && emit ? hotLoader(result, {
133
+ loaderContext: this,
134
+ options,
135
+ locals: locals
136
+ }) : result, dependencies.length > 0 && this.__internal__setParseMeta(PLUGIN_NAME, JSON.stringify(dependencies)), callback(null, resultSource, void 0, data);
137
+ };
138
+ this.importModule(`${this.resourcePath}.webpack[javascript/auto]!=!!!${request}`, {
86
139
  layer: options.layer,
87
140
  publicPath: publicPathForExtract,
88
141
  baseUri: `${BASE_URI}/`
89
142
  }, (error, exports1)=>{
90
143
  if (error) return void callback(error);
91
- ((originalExports)=>{
92
- let locals, namedExport, esModule = void 0 === options.esModule || options.esModule, dependencies = [];
93
- try {
94
- let exports1 = originalExports.__esModule ? originalExports.default : originalExports;
95
- if (namedExport = originalExports.__esModule && (!originalExports.default || !("locals" in originalExports.default))) for (let key of Object.keys(originalExports))"default" !== key && (locals || (locals = {}), locals[key] = originalExports[key]);
96
- else locals = exports1?.locals;
97
- if (Array.isArray(exports1) && emit) {
98
- let identifierCountMap = new Map();
99
- dependencies = exports1.map(([id, content, media, sourceMap, supports, layer])=>{
100
- let context = this.rootContext, count = identifierCountMap.get(id) || 0;
101
- return identifierCountMap.set(id, count + 1), {
102
- identifier: id,
103
- context,
104
- content,
105
- media,
106
- supports,
107
- layer,
108
- identifierIndex: count,
109
- sourceMap: sourceMap ? JSON.stringify(sourceMap) : void 0,
110
- filepath
111
- };
112
- }).filter((item)=>null !== item);
113
- }
114
- } catch (e) {
115
- callback(e);
116
- return;
117
- }
118
- let result = function() {
119
- if (locals) {
120
- if (namedExport) {
121
- let identifiers = Array.from(function*() {
122
- let identifierId = 0;
123
- for (let key of Object.keys(locals))identifierId += 1, yield [
124
- `_${identifierId.toString(16)}`,
125
- key
126
- ];
127
- }()), localsString = identifiers.map(([id, key])=>{
128
- var value;
129
- return `\nvar ${id} = ${"function" == typeof (value = locals[key]) ? value.toString() : JSON.stringify(value)};`;
130
- }).join(""), exportsString = `export { ${identifiers.map(([id, key])=>`${id} as ${JSON.stringify(key)}`).join(", ")} }`;
131
- return void 0 !== options.defaultExport && options.defaultExport ? `${localsString}\n${exportsString}\nexport default { ${identifiers.map(([id, key])=>`${JSON.stringify(key)}: ${id}`).join(", ")} }\n` : `${localsString}\n${exportsString}\n`;
132
- }
133
- return `\n${esModule ? "export default" : "module.exports = "} ${JSON.stringify(locals)};`;
134
- }
135
- return esModule ? "\nexport {};" : "";
136
- }(), resultSource = `// extracted by ${PLUGIN_NAME}`;
137
- resultSource += this.hot && emit ? hotLoader(result, {
138
- loaderContext: this,
139
- options,
140
- locals: locals
141
- }) : result, dependencies.length > 0 && this.__internal__setParseMeta(PLUGIN_NAME, JSON.stringify(dependencies)), callback(null, resultSource, void 0, data);
142
- })(exports1);
144
+ handleExports(exports1);
143
145
  });
144
146
  }, css_extract_loader = function(content) {
145
147
  if (this._compiler?.options?.experiments?.css && this._module && ("css" === this._module.type || "css/auto" === this._module.type || "css/global" === this._module.type || "css/module" === this._module.type)) return content;
package/dist/index.js CHANGED
@@ -210,9 +210,6 @@ var __webpack_modules__ = {
210
210
  "browserslist-load-config": function(module) {
211
211
  module.exports = require("../compiled/browserslist-load-config/index.js");
212
212
  },
213
- "glob-to-regexp": function(module) {
214
- module.exports = require("../compiled/glob-to-regexp/index.js");
215
- },
216
213
  watchpack: function(module) {
217
214
  module.exports = require("../compiled/watchpack/index.js");
218
215
  },
@@ -292,7 +289,6 @@ for(var __webpack_i__ in (()=>{
292
289
  electron: ()=>electron,
293
290
  ExternalModule: ()=>binding_.ExternalModule,
294
291
  Stats: ()=>Stats,
295
- version: ()=>exports_version,
296
292
  LoaderOptionsPlugin: ()=>LoaderOptionsPlugin,
297
293
  Template: ()=>Template,
298
294
  Compilation: ()=>Compilation,
@@ -307,21 +303,22 @@ for(var __webpack_i__ in (()=>{
307
303
  HotModuleReplacementPlugin: ()=>HotModuleReplacementPlugin,
308
304
  Dependency: ()=>binding_.Dependency,
309
305
  LoaderTargetPlugin: ()=>LoaderTargetPlugin,
310
- sharing: ()=>sharing,
311
306
  container: ()=>container,
312
- sources: ()=>sources,
313
307
  EvalDevToolModulePlugin: ()=>EvalDevToolModulePlugin,
314
308
  SwcJsMinimizerRspackPlugin: ()=>SwcJsMinimizerRspackPlugin,
315
309
  MultiCompiler: ()=>MultiCompiler,
316
310
  EntryOptionPlugin: ()=>lib_EntryOptionPlugin,
317
311
  javascript: ()=>javascript,
312
+ sources: ()=>sources,
318
313
  EvalSourceMapDevToolPlugin: ()=>EvalSourceMapDevToolPlugin,
319
314
  ContextReplacementPlugin: ()=>ContextReplacementPlugin,
320
315
  EnvironmentPlugin: ()=>EnvironmentPlugin,
321
316
  NoEmitOnErrorsPlugin: ()=>NoEmitOnErrorsPlugin,
322
317
  ValidationError: ()=>validate_ValidationError,
323
318
  LightningCssMinimizerRspackPlugin: ()=>LightningCssMinimizerRspackPlugin,
319
+ default: ()=>src_0,
324
320
  web: ()=>web,
321
+ sharing: ()=>sharing,
325
322
  CircularDependencyRspackPlugin: ()=>CircularDependencyRspackPlugin,
326
323
  NormalModule: ()=>binding_.NormalModule,
327
324
  config: ()=>exports_config,
@@ -329,6 +326,7 @@ for(var __webpack_i__ in (()=>{
329
326
  webworker: ()=>webworker,
330
327
  experiments: ()=>exports_experiments,
331
328
  RuntimeModule: ()=>RuntimeModule,
329
+ library: ()=>exports_library,
332
330
  node: ()=>exports_node,
333
331
  HtmlRspackPlugin: ()=>HtmlRspackPlugin,
334
332
  WarnCaseSensitiveModulesPlugin: ()=>WarnCaseSensitiveModulesPlugin,
@@ -338,7 +336,6 @@ for(var __webpack_i__ in (()=>{
338
336
  ProvidePlugin: ()=>ProvidePlugin,
339
337
  rspackVersion: ()=>exports_rspackVersion,
340
338
  DllPlugin: ()=>DllPlugin,
341
- library: ()=>exports_library,
342
339
  CssExtractRspackPlugin: ()=>CssExtractRspackPlugin,
343
340
  DefinePlugin: ()=>DefinePlugin,
344
341
  BannerPlugin: ()=>BannerPlugin,
@@ -348,11 +345,11 @@ for(var __webpack_i__ in (()=>{
348
345
  Module: ()=>binding_.Module,
349
346
  WebpackOptionsApply: ()=>RspackOptionsApply,
350
347
  NormalModuleReplacementPlugin: ()=>NormalModuleReplacementPlugin,
351
- default: ()=>src_0,
352
348
  ExternalsPlugin: ()=>ExternalsPlugin,
353
349
  rspack: ()=>src_rspack,
354
350
  Compiler: ()=>Compiler,
355
- wasm: ()=>exports_wasm
351
+ wasm: ()=>exports_wasm,
352
+ version: ()=>exports_version
356
353
  });
357
354
  var RequestType, StatsErrorCode, _computedKey, _computedKey1, _computedKey2, ArrayQueue_computedKey, browserslistTargetHandler_namespaceObject = {};
358
355
  __webpack_require__.r(browserslistTargetHandler_namespaceObject), __webpack_require__.d(browserslistTargetHandler_namespaceObject, {
@@ -2263,7 +2260,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
2263
2260
  if (!EnableLibraryPlugin_getEnabledTypes(compiler).has(type)) throw Error(`Library type "${type}" is not enabled. EnableLibraryPlugin need to be used to enable this type of library. This usually happens through the "output.enabledLibraryTypes" option. If you are using a function as entry which sets "library", you need to add all potential library types to "output.enabledLibraryTypes". These types are enabled: ${Array.from(EnableLibraryPlugin_getEnabledTypes(compiler)).join(", ")}`);
2264
2261
  }
2265
2262
  raw(compiler) {
2266
- let { type } = this, enabled = EnableLibraryPlugin_getEnabledTypes(compiler);
2263
+ let type = this.type, enabled = EnableLibraryPlugin_getEnabledTypes(compiler);
2267
2264
  if (!enabled.has(type)) return enabled.add(type), createBuiltinPlugin(this.name, type);
2268
2265
  }
2269
2266
  }
@@ -2612,53 +2609,55 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
2612
2609
  }
2613
2610
  static async cleanupJavaScriptTrace() {
2614
2611
  if ("uninitialized" === this.state) throw Error("JavaScriptTracer is not initialized, please call initJavaScriptTrace first");
2615
- this.layer && "off" !== this.state && (await new Promise((resolve, reject)=>{
2612
+ if (!this.layer || "off" === this.state) return;
2613
+ let profileHandler = (err, param)=>{
2614
+ let cpu_profile;
2615
+ if (err ? console.error("Error stopping profiler:", err) : cpu_profile = param.profile, cpu_profile) {
2616
+ let uuid = this.uuid();
2617
+ this.pushEvent({
2618
+ name: "Profile",
2619
+ ph: "P",
2620
+ trackName: "JavaScript CPU Profiler",
2621
+ processName: "JavaScript CPU",
2622
+ uuid,
2623
+ ...this.getCommonEv(),
2624
+ categories: [
2625
+ "disabled-by-default-v8.cpu_profiler"
2626
+ ],
2627
+ args: {
2628
+ data: {
2629
+ startTime: 0
2630
+ }
2631
+ }
2632
+ }), this.pushEvent({
2633
+ name: "ProfileChunk",
2634
+ ph: "P",
2635
+ trackName: "JavaScript CPU Profiler",
2636
+ processName: "JavaScript CPU",
2637
+ ...this.getCommonEv(),
2638
+ categories: [
2639
+ "disabled-by-default-v8.cpu_profiler"
2640
+ ],
2641
+ uuid,
2642
+ args: {
2643
+ data: {
2644
+ cpuProfile: cpu_profile,
2645
+ timeDeltas: cpu_profile.timeDeltas
2646
+ }
2647
+ }
2648
+ });
2649
+ }
2650
+ };
2651
+ await new Promise((resolve, reject)=>{
2616
2652
  this.session.post("Profiler.stop", (err, params)=>{
2617
2653
  if (err) reject(err);
2618
2654
  else try {
2619
- let cpu_profile;
2620
- var err1 = err, param = params;
2621
- if (err1 ? console.error("Error stopping profiler:", err1) : cpu_profile = param.profile, cpu_profile) {
2622
- let uuid = this.uuid();
2623
- this.pushEvent({
2624
- name: "Profile",
2625
- ph: "P",
2626
- trackName: "JavaScript CPU Profiler",
2627
- processName: "JavaScript CPU",
2628
- uuid,
2629
- ...this.getCommonEv(),
2630
- categories: [
2631
- "disabled-by-default-v8.cpu_profiler"
2632
- ],
2633
- args: {
2634
- data: {
2635
- startTime: 0
2636
- }
2637
- }
2638
- }), this.pushEvent({
2639
- name: "ProfileChunk",
2640
- ph: "P",
2641
- trackName: "JavaScript CPU Profiler",
2642
- processName: "JavaScript CPU",
2643
- ...this.getCommonEv(),
2644
- categories: [
2645
- "disabled-by-default-v8.cpu_profiler"
2646
- ],
2647
- uuid,
2648
- args: {
2649
- data: {
2650
- cpuProfile: cpu_profile,
2651
- timeDeltas: cpu_profile.timeDeltas
2652
- }
2653
- }
2654
- });
2655
- }
2656
- resolve();
2655
+ profileHandler(err, params), resolve();
2657
2656
  } catch (err) {
2658
2657
  reject(err);
2659
2658
  }
2660
2659
  });
2661
- }), this.state = "off");
2660
+ }), this.state = "off";
2662
2661
  }
2663
2662
  static getTs() {
2664
2663
  return process.hrtime.bigint() - this.startTime;
@@ -3673,7 +3672,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
3673
3672
  });
3674
3673
  }(rspackExperiments.import || rspackExperiments.pluginImport)), rspackExperiments.collectTypeScriptInfo && (rspackExperiments.collectTypeScriptInfo = {
3675
3674
  typeExports: (options1 = rspackExperiments.collectTypeScriptInfo).typeExports,
3676
- exportedEnum: !0 === options1.exportedEnum ? "all" : !1 === options1.exportedEnum ? "none" : "const-only"
3675
+ exportedEnum: !0 === options1.exportedEnum ? "all" : !1 === options1.exportedEnum || void 0 === options1.exportedEnum ? "none" : "const-only"
3677
3676
  }));
3678
3677
  }
3679
3678
  return options2;
@@ -4008,69 +4007,79 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
4008
4007
  type;
4009
4008
  externals;
4010
4009
  name = binding_.BuiltinPluginName.ExternalsPlugin;
4010
+ #resolveRequestCache = new Map();
4011
4011
  constructor(type, externals){
4012
4012
  super(), this.type = type, this.externals = externals;
4013
4013
  }
4014
- raw(compiler) {
4015
- let { type, externals } = this, raw = {
4014
+ raw() {
4015
+ let type = this.type, externals = this.externals, raw = {
4016
4016
  type,
4017
4017
  externals: (Array.isArray(externals) ? externals : [
4018
4018
  externals
4019
- ]).filter(Boolean).map((item)=>(function(compiler, item) {
4020
- if ("string" == typeof item || item instanceof RegExp) return item;
4021
- if ("function" == typeof item) return async (ctx)=>await new Promise((resolve, reject)=>{
4022
- let data = ctx.data(), promise = item({
4023
- request: data.request,
4024
- dependencyType: data.dependencyType,
4025
- context: data.context,
4026
- contextInfo: {
4027
- issuer: data.contextInfo.issuer,
4028
- issuerLayer: data.contextInfo.issuerLayer ?? null
4029
- },
4030
- getResolve (options) {
4031
- let rawResolve = options ? getRawResolve(options) : void 0, resolve = ctx.getResolve(rawResolve);
4032
- return (context, request, callback)=>{
4033
- if (!callback) return new Promise((res, rej)=>{
4034
- resolve(context, request, (error, text)=>{
4035
- if (error) rej(error);
4036
- else {
4037
- let req = text ? JSON.parse(text) : void 0;
4038
- res(req?.path);
4039
- }
4040
- });
4041
- });
4042
- resolve(context, request, (error, text)=>{
4043
- if (error) callback(error);
4044
- else {
4045
- let req = text ? JSON.parse(text) : void 0;
4046
- callback(null, req?.path ?? !1, req);
4047
- }
4048
- });
4049
- };
4050
- }
4051
- }, (err, result, type)=>{
4052
- err && reject(err), resolve({
4053
- result: getRawExternalItemValueFormFnResult(result),
4054
- externalType: type
4055
- });
4056
- });
4057
- promise?.then ? promise.then((result)=>resolve({
4058
- result: getRawExternalItemValueFormFnResult(result),
4059
- externalType: void 0
4060
- }), (e)=>reject(e)) : 1 === item.length && resolve({
4061
- result: getRawExternalItemValueFormFnResult(promise),
4062
- externalType: void 0
4063
- });
4064
- });
4065
- if ("object" == typeof item) return Object.fromEntries(Object.entries(item).map(([k, v])=>[
4066
- k,
4067
- getRawExternalItemValue(v)
4068
- ]));
4069
- throw TypeError(`Unexpected type of external item: ${typeof item}`);
4070
- })(0, item))
4019
+ ]).filter(Boolean).map((item)=>this.#getRawExternalItem(item))
4071
4020
  };
4072
4021
  return createBuiltinPlugin(this.name, raw);
4073
4022
  }
4023
+ #processResolveResult = (text)=>{
4024
+ if (!text) return;
4025
+ let resolveRequest = this.#resolveRequestCache.get(text);
4026
+ return resolveRequest || (resolveRequest = JSON.parse(text), this.#resolveRequestCache.set(text, resolveRequest)), Object.assign({}, resolveRequest);
4027
+ };
4028
+ #getRawExternalItem = (item)=>{
4029
+ if ("string" == typeof item || item instanceof RegExp) return item;
4030
+ if ("function" == typeof item) {
4031
+ let processResolveResult = this.#processResolveResult;
4032
+ return async (ctx)=>await new Promise((resolve, reject)=>{
4033
+ let data = ctx.data(), promise = item({
4034
+ request: data.request,
4035
+ dependencyType: data.dependencyType,
4036
+ context: data.context,
4037
+ contextInfo: {
4038
+ issuer: data.contextInfo.issuer,
4039
+ issuerLayer: data.contextInfo.issuerLayer ?? null
4040
+ },
4041
+ getResolve (options) {
4042
+ let rawResolve = options ? getRawResolve(options) : void 0, resolve = ctx.getResolve(rawResolve);
4043
+ return (context, request, callback)=>{
4044
+ if (!callback) return new Promise((promiseResolve, promiseReject)=>{
4045
+ resolve(context, request, (error, text)=>{
4046
+ if (error) promiseReject(error);
4047
+ else {
4048
+ let req = processResolveResult(text);
4049
+ promiseResolve(req?.path);
4050
+ }
4051
+ });
4052
+ });
4053
+ resolve(context, request, (error, text)=>{
4054
+ if (error) callback(error);
4055
+ else {
4056
+ let req = processResolveResult(text);
4057
+ callback(null, req?.path ?? !1, req);
4058
+ }
4059
+ });
4060
+ };
4061
+ }
4062
+ }, (err, result, type)=>{
4063
+ err && reject(err), resolve({
4064
+ result: getRawExternalItemValueFormFnResult(result),
4065
+ externalType: type
4066
+ });
4067
+ });
4068
+ promise?.then ? promise.then((result)=>resolve({
4069
+ result: getRawExternalItemValueFormFnResult(result),
4070
+ externalType: void 0
4071
+ }), (e)=>reject(e)) : 1 === item.length && resolve({
4072
+ result: getRawExternalItemValueFormFnResult(promise),
4073
+ externalType: void 0
4074
+ });
4075
+ });
4076
+ }
4077
+ if ("object" == typeof item) return Object.fromEntries(Object.entries(item).map(([k, v])=>[
4078
+ k,
4079
+ getRawExternalItemValue(v)
4080
+ ]));
4081
+ throw TypeError(`Unexpected type of external item: ${typeof item}`);
4082
+ };
4074
4083
  }
4075
4084
  function getRawExternalItemValueFormFnResult(result) {
4076
4085
  return void 0 === result ? result : getRawExternalItemValue(result);
@@ -4142,7 +4151,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
4142
4151
  super(), this.options = options;
4143
4152
  }
4144
4153
  raw(compiler) {
4145
- let { options } = this, lockfileLocation = options.lockfileLocation ?? external_node_path_default().join(compiler.context, compiler.name ? `${compiler.name}.rspack.lock` : "rspack.lock"), cacheLocation = !1 === options.cacheLocation ? void 0 : options.cacheLocation ?? `${lockfileLocation}.data`, raw = {
4154
+ let options = this.options, lockfileLocation = options.lockfileLocation ?? external_node_path_default().join(compiler.context, compiler.name ? `${compiler.name}.rspack.lock` : "rspack.lock"), cacheLocation = !1 === options.cacheLocation ? void 0 : options.cacheLocation ?? `${lockfileLocation}.data`, raw = {
4146
4155
  allowedUris: options.allowedUris,
4147
4156
  lockfileLocation,
4148
4157
  cacheLocation,
@@ -6514,7 +6523,11 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
6514
6523
  "graph",
6515
6524
  "assets"
6516
6525
  ]))
6517
- ]).optional()
6526
+ ]).optional(),
6527
+ sourceMapFeatures: schemas_object({
6528
+ module: schemas_boolean().optional(),
6529
+ cheap: schemas_boolean().optional()
6530
+ }).optional()
6518
6531
  })), getSRIPluginOptionsSchema = memoize(()=>{
6519
6532
  let hashFunctionSchema = schemas_enum([
6520
6533
  "sha256",
@@ -7380,7 +7393,8 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
7380
7393
  }) {
7381
7394
  return validate(c, getRsdoctorPluginSchema), {
7382
7395
  moduleGraphFeatures: c.moduleGraphFeatures ?? !0,
7383
- chunkGraphFeatures: c.chunkGraphFeatures ?? !0
7396
+ chunkGraphFeatures: c.chunkGraphFeatures ?? !0,
7397
+ sourceMapFeatures: c.sourceMapFeatures
7384
7398
  };
7385
7399
  }), RsdoctorPlugin_compilationHooksMap = new WeakMap();
7386
7400
  RsdoctorPluginImpl.getHooks = RsdoctorPluginImpl.getCompilationHooks = (compilation)=>{
@@ -8605,9 +8619,9 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
8605
8619
  let tty = infrastructureLogging.stream.isTTY && "dumb" !== process.env.TERM;
8606
8620
  D(infrastructureLogging, "level", "info"), D(infrastructureLogging, "debug", !1), D(infrastructureLogging, "colors", tty), D(infrastructureLogging, "appendOnly", !tty);
8607
8621
  }, applyExperimentsDefaults = (experiments, { production, development })=>{
8608
- defaults_F(experiments, "cache", ()=>development), D(experiments, "futureDefaults", !1), D(experiments, "lazyCompilation", !1), D(experiments, "asyncWebAssembly", experiments.futureDefaults), D(experiments, "css", !!experiments.futureDefaults || void 0), D(experiments, "layers", !1), D(experiments, "topLevelAwait", !0), D(experiments, "buildHttp", void 0), experiments.buildHttp && "object" == typeof experiments.buildHttp && D(experiments.buildHttp, "upgrade", !1), D(experiments, "incremental", {}), "object" == typeof experiments.incremental && (D(experiments.incremental, "silent", !0), D(experiments.incremental, "make", !0), D(experiments.incremental, "inferAsyncModules", !0), D(experiments.incremental, "providedExports", !0), D(experiments.incremental, "dependenciesDiagnostics", !0), D(experiments.incremental, "sideEffects", !0), D(experiments.incremental, "buildChunkGraph", !0), D(experiments.incremental, "moduleIds", !0), D(experiments.incremental, "chunkIds", !0), D(experiments.incremental, "modulesHashes", !0), D(experiments.incremental, "modulesCodegen", !0), D(experiments.incremental, "modulesRuntimeRequirements", !0), D(experiments.incremental, "chunksRuntimeRequirements", !0), D(experiments.incremental, "chunksHashes", !0), D(experiments.incremental, "chunksRender", !0), D(experiments.incremental, "emitAssets", !0)), D(experiments, "rspackFuture", {}), D(experiments, "parallelCodeSplitting", !0), D(experiments, "parallelLoader", !1), D(experiments, "useInputFileSystem", !1), D(experiments, "inlineConst", !1), D(experiments, "inlineEnum", !1), D(experiments, "typeReexportsPresence", !1);
8622
+ defaults_F(experiments, "cache", ()=>development), D(experiments, "futureDefaults", !1), D(experiments, "lazyCompilation", !1), D(experiments, "asyncWebAssembly", experiments.futureDefaults), D(experiments, "css", !!experiments.futureDefaults || void 0), D(experiments, "layers", !1), D(experiments, "topLevelAwait", !0), D(experiments, "buildHttp", void 0), experiments.buildHttp && "object" == typeof experiments.buildHttp && D(experiments.buildHttp, "upgrade", !1), D(experiments, "incremental", {}), "object" == typeof experiments.incremental && (D(experiments.incremental, "silent", !0), D(experiments.incremental, "make", !0), D(experiments.incremental, "inferAsyncModules", !0), D(experiments.incremental, "providedExports", !0), D(experiments.incremental, "dependenciesDiagnostics", !0), D(experiments.incremental, "sideEffects", !0), D(experiments.incremental, "buildChunkGraph", !0), D(experiments.incremental, "moduleIds", !0), D(experiments.incremental, "chunkIds", !0), D(experiments.incremental, "modulesHashes", !0), D(experiments.incremental, "modulesCodegen", !0), D(experiments.incremental, "modulesRuntimeRequirements", !0), D(experiments.incremental, "chunksRuntimeRequirements", !0), D(experiments.incremental, "chunksHashes", !0), D(experiments.incremental, "chunksRender", !0), D(experiments.incremental, "emitAssets", !0)), D(experiments, "rspackFuture", {}), D(experiments, "parallelCodeSplitting", !1), D(experiments, "parallelLoader", !1), D(experiments, "useInputFileSystem", !1), D(experiments, "inlineConst", !1), D(experiments, "inlineEnum", !1), D(experiments, "typeReexportsPresence", !1);
8609
8623
  }, applybundlerInfoDefaults = (rspackFuture, library)=>{
8610
- "object" == typeof rspackFuture && (D(rspackFuture, "bundlerInfo", {}), "object" == typeof rspackFuture.bundlerInfo && (D(rspackFuture.bundlerInfo, "version", "1.4.9"), D(rspackFuture.bundlerInfo, "bundler", "rspack"), D(rspackFuture.bundlerInfo, "force", !library)));
8624
+ "object" == typeof rspackFuture && (D(rspackFuture, "bundlerInfo", {}), "object" == typeof rspackFuture.bundlerInfo && (D(rspackFuture.bundlerInfo, "version", "1.4.11"), D(rspackFuture.bundlerInfo, "bundler", "rspack"), D(rspackFuture.bundlerInfo, "force", !library)));
8611
8625
  }, applySnapshotDefaults = (_snapshot, _env)=>{}, applyModuleDefaults = (module, { asyncWebAssembly, css, targetProperties, mode, uniqueName })=>{
8612
8626
  var parserOptions;
8613
8627
  if (assertNotNill(module.parser), assertNotNill(module.generator), defaults_F(module.parser, "asset", ()=>({})), assertNotNill(module.parser.asset), defaults_F(module.parser.asset, "dataUrlCondition", ()=>({})), "object" == typeof module.parser.asset.dataUrlCondition && D(module.parser.asset.dataUrlCondition, "maxSize", 8096), defaults_F(module.parser, "javascript", ()=>({})), assertNotNill(module.parser.javascript), D(parserOptions = module.parser.javascript, "dynamicImportMode", "lazy"), D(parserOptions, "dynamicImportPrefetch", !1), D(parserOptions, "dynamicImportPreload", !1), D(parserOptions, "url", !0), D(parserOptions, "exprContextCritical", !0), D(parserOptions, "wrappedContextCritical", !1), D(parserOptions, "wrappedContextRegExp", /.*/), D(parserOptions, "strictExportPresence", !1), D(parserOptions, "requireAsExpression", !0), D(parserOptions, "requireDynamic", !0), D(parserOptions, "requireResolve", !0), D(parserOptions, "importDynamic", !0), D(parserOptions, "worker", [
@@ -9857,7 +9871,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
9857
9871
  this.#binding.resolve(path, request, (error, text)=>{
9858
9872
  if (error) return void callback(error);
9859
9873
  let req = text ? JSON.parse(text) : void 0;
9860
- callback(error, !!req && req.path, req);
9874
+ callback(error, !!req && `${req.path.replace(/#/g, "\u200b#")}${req.query.replace(/#/g, "\u200b#")}${req.fragment}`, req);
9861
9875
  });
9862
9876
  }
9863
9877
  withOptions(options) {
@@ -10237,7 +10251,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
10237
10251
  });
10238
10252
  }
10239
10253
  }
10240
- let CORE_VERSION = "1.4.9", bindingVersionCheck_errorMessage = (coreVersion, expectedCoreVersion)=>process.env.RSPACK_BINDING ? `Unmatched version @rspack/core@${coreVersion} and binding version.
10254
+ let CORE_VERSION = "1.4.11", bindingVersionCheck_errorMessage = (coreVersion, expectedCoreVersion)=>process.env.RSPACK_BINDING ? `Unmatched version @rspack/core@${coreVersion} and binding version.
10241
10255
 
10242
10256
  Help:
10243
10257
  Looks like you are using a custom binding (via environment variable 'RSPACK_BINDING=${process.env.RSPACK_BINDING}').
@@ -10289,11 +10303,11 @@ Help:
10289
10303
  return;
10290
10304
  }
10291
10305
  let finalCallback = (err)=>{
10292
- this.running = !1, this.compiler.running = !1, this.compiler.watching = void 0, this.compiler.watchMode = !1, this.compiler.modifiedFiles = void 0, this.compiler.removedFiles = void 0, this.compiler.fileTimestamps = void 0, this.compiler.contextTimestamps = void 0;
10293
- var err1 = err;
10294
- this.compiler.hooks.watchClose.call();
10295
- let closeCallbacks = this.#closeCallbacks;
10296
- for (let cb of (this.#closeCallbacks = void 0, closeCallbacks))cb(err1);
10306
+ this.running = !1, this.compiler.running = !1, this.compiler.watching = void 0, this.compiler.watchMode = !1, this.compiler.modifiedFiles = void 0, this.compiler.removedFiles = void 0, this.compiler.fileTimestamps = void 0, this.compiler.contextTimestamps = void 0, ((err)=>{
10307
+ this.compiler.hooks.watchClose.call();
10308
+ let closeCallbacks = this.#closeCallbacks;
10309
+ for (let cb of (this.#closeCallbacks = void 0, closeCallbacks))cb(err);
10310
+ })(err);
10297
10311
  };
10298
10312
  this.#closed = !0, this.watcher && (this.watcher.close(), this.watcher = void 0), this.pausedWatcher && (this.pausedWatcher.close(), this.pausedWatcher = void 0), this.compiler.watching = void 0, this.compiler.watchMode = !1, this.#closeCallbacks = [], callback && this.#closeCallbacks.push(callback), this.running ? (this.invalid = !0, this._done = finalCallback) : finalCallback(null);
10299
10313
  }
@@ -11115,18 +11129,7 @@ Help:
11115
11129
  return getCompiler2().__internal__get_compilation_params().normalModuleFactory.hooks.afterResolve;
11116
11130
  }, function(queried) {
11117
11131
  return async function(arg) {
11118
- let data = {
11119
- contextInfo: {
11120
- issuer: arg.issuer,
11121
- issuerLayer: arg.issuerLayer ?? null
11122
- },
11123
- request: arg.request,
11124
- context: arg.context,
11125
- fileDependencies: arg.fileDependencies,
11126
- missingDependencies: arg.missingDependencies,
11127
- contextDependencies: arg.contextDependencies,
11128
- createData: arg.createData
11129
- };
11132
+ let data = JSON.parse(arg);
11130
11133
  return [
11131
11134
  await queried.promise(data),
11132
11135
  data.createData
@@ -11446,7 +11449,7 @@ Help:
11446
11449
  obj.children = this.stats.map((stat, idx)=>{
11447
11450
  let obj = stat.toJson(childOptions.children[idx]), compilationName = stat.compilation.name;
11448
11451
  return obj.name = compilationName && makePathsRelative(childOptions.context, compilationName, stat.compilation.compiler.root), obj;
11449
- }), childOptions.version && (obj.rspackVersion = "1.4.9", obj.version = "5.75.0"), childOptions.hash && (obj.hash = obj.children.map((j)=>j.hash).join(""));
11452
+ }), childOptions.version && (obj.rspackVersion = "1.4.11", obj.version = "5.75.0"), childOptions.hash && (obj.hash = obj.children.map((j)=>j.hash).join(""));
11450
11453
  let mapError = (j, obj)=>({
11451
11454
  ...obj,
11452
11455
  compilerPath: obj.compilerPath ? `${j.name}.${obj.compilerPath}` : j.name
@@ -12346,7 +12349,7 @@ Help:
12346
12349
  object.hash = context.getStatsCompilation(compilation).hash;
12347
12350
  },
12348
12351
  version: (object)=>{
12349
- object.version = "5.75.0", object.rspackVersion = "1.4.9";
12352
+ object.version = "5.75.0", object.rspackVersion = "1.4.11";
12350
12353
  },
12351
12354
  env: (object, _compilation, _context, { _env })=>{
12352
12355
  object.env = _env;
@@ -13960,13 +13963,6 @@ Help:
13960
13963
  log: 2,
13961
13964
  true: 2,
13962
13965
  verbose: 1
13963
- }, stringToRegexp = (ignored)=>{
13964
- if (0 === ignored.length) return;
13965
- let { source } = __webpack_require__("glob-to-regexp")(ignored, {
13966
- globstar: !0,
13967
- extended: !0
13968
- });
13969
- return `${source.slice(0, -1)}(?:$|\\/)`;
13970
13966
  };
13971
13967
  class NativeWatchFileSystem {
13972
13968
  #inner;
@@ -14013,20 +14009,8 @@ Help:
14013
14009
  aggregateTimeout: options.aggregateTimeout,
14014
14010
  pollInterval: "boolean" == typeof options.poll ? 0 : options.poll,
14015
14011
  ignored: ((ignored)=>{
14016
- if (Array.isArray(ignored)) {
14017
- let stringRegexps = ignored.map((i)=>stringToRegexp(i)).filter(Boolean);
14018
- if (0 === stringRegexps.length) return ()=>!1;
14019
- let regexp = new RegExp(stringRegexps.join("|"));
14020
- return (item)=>regexp.test(item.replace(/\\/g, "/"));
14021
- }
14022
- if ("string" == typeof ignored) {
14023
- let stringRegexp = stringToRegexp(ignored);
14024
- if (!stringRegexp) return ()=>!1;
14025
- let regexp = new RegExp(stringRegexp);
14026
- return (item)=>regexp.test(item.replace(/\\/g, "/"));
14027
- }
14028
- if (ignored instanceof RegExp) return (item)=>ignored.test(item.replace(/\\/g, "/"));
14029
- if ("function" == typeof ignored) return (item)=>ignored(item);
14012
+ if (Array.isArray(ignored) || "string" == typeof ignored || ignored instanceof RegExp) return ignored;
14013
+ if ("function" == typeof ignored) throw Error("NativeWatcher does not support using a function for the 'ignored' option");
14030
14014
  if (ignored) throw Error(`Invalid option for 'ignored': ${ignored}`);
14031
14015
  })(options.ignored)
14032
14016
  }, nativeWatcher = new (binding_default()).NativeWatcher(nativeWatcherOptions);
@@ -15746,7 +15730,7 @@ Help:
15746
15730
  let _options = JSON.stringify(options || {});
15747
15731
  return binding_default().transform(source, _options);
15748
15732
  }
15749
- let exports_rspackVersion = "1.4.9", exports_version = "5.75.0", exports_WebpackError = Error, sources = __webpack_require__("webpack-sources"), exports_config = {
15733
+ let exports_rspackVersion = "1.4.11", exports_version = "5.75.0", exports_WebpackError = Error, sources = __webpack_require__("webpack-sources"), exports_config = {
15750
15734
  getNormalizedRspackOptions: getNormalizedRspackOptions,
15751
15735
  applyRspackOptionsDefaults: applyRspackOptionsDefaults,
15752
15736
  getNormalizedWebpackOptions: getNormalizedRspackOptions,
@@ -1,4 +1,4 @@
1
- import type { Tinypool } from "../../compiled/tinypool/dist/index.js" with { "resolution-mode": "import" };
1
+ import type { Tinypool } from "tinypool" with { "resolution-mode": "import" };
2
2
  type RunOptions = Parameters<Tinypool["run"]>[1];
3
3
  export interface WorkerResponseMessage {
4
4
  type: "response";
@@ -17,6 +17,10 @@ export declare const getRsdoctorPluginSchema: () => z.ZodObject<{
17
17
  assets: "assets";
18
18
  graph: "graph";
19
19
  }>>]>>;
20
+ sourceMapFeatures: z.ZodOptional<z.ZodObject<{
21
+ module: z.ZodOptional<z.ZodBoolean>;
22
+ cheap: z.ZodOptional<z.ZodBoolean>;
23
+ }, z.core.$strip>>;
20
24
  }, z.core.$strict>;
21
25
  export declare const getSRIPluginOptionsSchema: () => z.ZodObject<{
22
26
  hashFuncNames: z.ZodOptional<z.ZodTuple<[z.ZodEnum<{
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspack/core",
3
- "version": "1.4.9",
3
+ "version": "1.4.11",
4
4
  "webpackVersion": "5.75.0",
5
5
  "license": "MIT",
6
6
  "description": "The fast Rust-based web bundler with webpack-compatible API",
@@ -37,9 +37,9 @@
37
37
  "directory": "packages/rspack"
38
38
  },
39
39
  "devDependencies": {
40
- "@ast-grep/napi": "^0.38.7",
41
- "@rsbuild/core": "^1.4.6",
42
- "@rslib/core": "0.10.5",
40
+ "@ast-grep/napi": "^0.39.1",
41
+ "@rsbuild/core": "^1.4.10",
42
+ "@rslib/core": "0.11.0",
43
43
  "@swc/types": "0.1.23",
44
44
  "@types/graceful-fs": "4.1.9",
45
45
  "@types/watchpack": "^2.4.4",
@@ -54,13 +54,12 @@
54
54
  "webpack-sources": "3.3.3",
55
55
  "glob-to-regexp": "^0.4.1",
56
56
  "zod": "^3.25.76",
57
- "@types/glob-to-regexp": "^0.4.4",
58
57
  "zod-validation-error": "3.5.3"
59
58
  },
60
59
  "dependencies": {
61
- "@module-federation/runtime-tools": "0.17.0",
60
+ "@module-federation/runtime-tools": "0.17.1",
62
61
  "@rspack/lite-tapable": "1.0.1",
63
- "@rspack/binding": "1.4.9"
62
+ "@rspack/binding": "1.4.11"
64
63
  },
65
64
  "peerDependencies": {
66
65
  "@swc/helpers": ">=0.5.1"
@@ -1,11 +0,0 @@
1
- declare function GlobToRegExp(glob: string, options?: GlobToRegExp.Options): RegExp;
2
-
3
- declare namespace GlobToRegExp {
4
- interface Options {
5
- extended?: boolean | undefined;
6
- globstar?: boolean | undefined;
7
- flags?: string | undefined;
8
- }
9
- }
10
-
11
- export { GlobToRegExp as default };
@@ -1,187 +0,0 @@
1
- /******/ (() => { // webpackBootstrap
2
- /******/ var __webpack_modules__ = ({
3
-
4
- /***/ 137:
5
- /***/ ((module) => {
6
-
7
- module.exports = function (glob, opts) {
8
- if (typeof glob !== 'string') {
9
- throw new TypeError('Expected a string');
10
- }
11
-
12
- var str = String(glob);
13
-
14
- // The regexp we are building, as a string.
15
- var reStr = "";
16
-
17
- // Whether we are matching so called "extended" globs (like bash) and should
18
- // support single character matching, matching ranges of characters, group
19
- // matching, etc.
20
- var extended = opts ? !!opts.extended : false;
21
-
22
- // When globstar is _false_ (default), '/foo/*' is translated a regexp like
23
- // '^\/foo\/.*$' which will match any string beginning with '/foo/'
24
- // When globstar is _true_, '/foo/*' is translated to regexp like
25
- // '^\/foo\/[^/]*$' which will match any string beginning with '/foo/' BUT
26
- // which does not have a '/' to the right of it.
27
- // E.g. with '/foo/*' these will match: '/foo/bar', '/foo/bar.txt' but
28
- // these will not '/foo/bar/baz', '/foo/bar/baz.txt'
29
- // Lastely, when globstar is _true_, '/foo/**' is equivelant to '/foo/*' when
30
- // globstar is _false_
31
- var globstar = opts ? !!opts.globstar : false;
32
-
33
- // If we are doing extended matching, this boolean is true when we are inside
34
- // a group (eg {*.html,*.js}), and false otherwise.
35
- var inGroup = false;
36
-
37
- // RegExp flags (eg "i" ) to pass in to RegExp constructor.
38
- var flags = opts && typeof( opts.flags ) === "string" ? opts.flags : "";
39
-
40
- var c;
41
- for (var i = 0, len = str.length; i < len; i++) {
42
- c = str[i];
43
-
44
- switch (c) {
45
- case "/":
46
- case "$":
47
- case "^":
48
- case "+":
49
- case ".":
50
- case "(":
51
- case ")":
52
- case "=":
53
- case "!":
54
- case "|":
55
- reStr += "\\" + c;
56
- break;
57
-
58
- case "?":
59
- if (extended) {
60
- reStr += ".";
61
- break;
62
- }
63
-
64
- case "[":
65
- case "]":
66
- if (extended) {
67
- reStr += c;
68
- break;
69
- }
70
-
71
- case "{":
72
- if (extended) {
73
- inGroup = true;
74
- reStr += "(";
75
- break;
76
- }
77
-
78
- case "}":
79
- if (extended) {
80
- inGroup = false;
81
- reStr += ")";
82
- break;
83
- }
84
-
85
- case ",":
86
- if (inGroup) {
87
- reStr += "|";
88
- break;
89
- }
90
- reStr += "\\" + c;
91
- break;
92
-
93
- case "*":
94
- // Move over all consecutive "*"'s.
95
- // Also store the previous and next characters
96
- var prevChar = str[i - 1];
97
- var starCount = 1;
98
- while(str[i + 1] === "*") {
99
- starCount++;
100
- i++;
101
- }
102
- var nextChar = str[i + 1];
103
-
104
- if (!globstar) {
105
- // globstar is disabled, so treat any number of "*" as one
106
- reStr += ".*";
107
- } else {
108
- // globstar is enabled, so determine if this is a globstar segment
109
- var isGlobstar = starCount > 1 // multiple "*"'s
110
- && (prevChar === "/" || prevChar === undefined) // from the start of the segment
111
- && (nextChar === "/" || nextChar === undefined) // to the end of the segment
112
-
113
- if (isGlobstar) {
114
- // it's a globstar, so match zero or more path segments
115
- reStr += "((?:[^/]*(?:\/|$))*)";
116
- i++; // move over the "/"
117
- } else {
118
- // it's not a globstar, so only match one path segment
119
- reStr += "([^/]*)";
120
- }
121
- }
122
- break;
123
-
124
- default:
125
- reStr += c;
126
- }
127
- }
128
-
129
- // When regexp 'g' flag is specified don't
130
- // constrain the regular expression with ^ & $
131
- if (!flags || !~flags.indexOf('g')) {
132
- reStr = "^" + reStr + "$";
133
- }
134
-
135
- return new RegExp(reStr, flags);
136
- };
137
-
138
-
139
- /***/ })
140
-
141
- /******/ });
142
- /************************************************************************/
143
- /******/ // The module cache
144
- /******/ var __webpack_module_cache__ = {};
145
- /******/
146
- /******/ // The require function
147
- /******/ function __nccwpck_require__(moduleId) {
148
- /******/ // Check if module is in cache
149
- /******/ var cachedModule = __webpack_module_cache__[moduleId];
150
- /******/ if (cachedModule !== undefined) {
151
- /******/ return cachedModule.exports;
152
- /******/ }
153
- /******/ // Create a new module (and put it into the cache)
154
- /******/ var module = __webpack_module_cache__[moduleId] = {
155
- /******/ // no module.id needed
156
- /******/ // no module.loaded needed
157
- /******/ exports: {}
158
- /******/ };
159
- /******/
160
- /******/ // Execute the module function
161
- /******/ var threw = true;
162
- /******/ try {
163
- /******/ __webpack_modules__[moduleId](module, module.exports, __nccwpck_require__);
164
- /******/ threw = false;
165
- /******/ } finally {
166
- /******/ if(threw) delete __webpack_module_cache__[moduleId];
167
- /******/ }
168
- /******/
169
- /******/ // Return the exports of the module
170
- /******/ return module.exports;
171
- /******/ }
172
- /******/
173
- /************************************************************************/
174
- /******/ /* webpack/runtime/compat */
175
- /******/
176
- /******/ if (typeof __nccwpck_require__ !== 'undefined') __nccwpck_require__.ab = __dirname + "/";
177
- /******/
178
- /************************************************************************/
179
- /******/
180
- /******/ // startup
181
- /******/ // Load entry module and return exports
182
- /******/ // This entry module is referenced by other modules so it can't be inlined
183
- /******/ var __webpack_exports__ = __nccwpck_require__(137);
184
- /******/ module.exports = __webpack_exports__;
185
- /******/
186
- /******/ })()
187
- ;
@@ -1 +0,0 @@
1
- {"name":"glob-to-regexp","author":"Nick Fitzgerald <fitzgen@gmail.com>","version":"0.4.1","license":"BSD-2-Clause","types":"index.d.ts","type":"commonjs"}