@rspack/core 1.4.10 → 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
  };
@@ -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;
@@ -4013,7 +4012,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
4013
4012
  super(), this.type = type, this.externals = externals;
4014
4013
  }
4015
4014
  raw() {
4016
- let { type, externals } = this, raw = {
4015
+ let type = this.type, externals = this.externals, raw = {
4017
4016
  type,
4018
4017
  externals: (Array.isArray(externals) ? externals : [
4019
4018
  externals
@@ -4152,7 +4151,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
4152
4151
  super(), this.options = options;
4153
4152
  }
4154
4153
  raw(compiler) {
4155
- 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 = {
4156
4155
  allowedUris: options.allowedUris,
4157
4156
  lockfileLocation,
4158
4157
  cacheLocation,
@@ -6524,7 +6523,11 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
6524
6523
  "graph",
6525
6524
  "assets"
6526
6525
  ]))
6527
- ]).optional()
6526
+ ]).optional(),
6527
+ sourceMapFeatures: schemas_object({
6528
+ module: schemas_boolean().optional(),
6529
+ cheap: schemas_boolean().optional()
6530
+ }).optional()
6528
6531
  })), getSRIPluginOptionsSchema = memoize(()=>{
6529
6532
  let hashFunctionSchema = schemas_enum([
6530
6533
  "sha256",
@@ -7390,7 +7393,8 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
7390
7393
  }) {
7391
7394
  return validate(c, getRsdoctorPluginSchema), {
7392
7395
  moduleGraphFeatures: c.moduleGraphFeatures ?? !0,
7393
- chunkGraphFeatures: c.chunkGraphFeatures ?? !0
7396
+ chunkGraphFeatures: c.chunkGraphFeatures ?? !0,
7397
+ sourceMapFeatures: c.sourceMapFeatures
7394
7398
  };
7395
7399
  }), RsdoctorPlugin_compilationHooksMap = new WeakMap();
7396
7400
  RsdoctorPluginImpl.getHooks = RsdoctorPluginImpl.getCompilationHooks = (compilation)=>{
@@ -8615,9 +8619,9 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
8615
8619
  let tty = infrastructureLogging.stream.isTTY && "dumb" !== process.env.TERM;
8616
8620
  D(infrastructureLogging, "level", "info"), D(infrastructureLogging, "debug", !1), D(infrastructureLogging, "colors", tty), D(infrastructureLogging, "appendOnly", !tty);
8617
8621
  }, applyExperimentsDefaults = (experiments, { production, development })=>{
8618
- 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);
8619
8623
  }, applybundlerInfoDefaults = (rspackFuture, library)=>{
8620
- "object" == typeof rspackFuture && (D(rspackFuture, "bundlerInfo", {}), "object" == typeof rspackFuture.bundlerInfo && (D(rspackFuture.bundlerInfo, "version", "1.4.10"), 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)));
8621
8625
  }, applySnapshotDefaults = (_snapshot, _env)=>{}, applyModuleDefaults = (module, { asyncWebAssembly, css, targetProperties, mode, uniqueName })=>{
8622
8626
  var parserOptions;
8623
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", [
@@ -9867,7 +9871,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
9867
9871
  this.#binding.resolve(path, request, (error, text)=>{
9868
9872
  if (error) return void callback(error);
9869
9873
  let req = text ? JSON.parse(text) : void 0;
9870
- callback(error, !!req && req.path, req);
9874
+ callback(error, !!req && `${req.path.replace(/#/g, "\u200b#")}${req.query.replace(/#/g, "\u200b#")}${req.fragment}`, req);
9871
9875
  });
9872
9876
  }
9873
9877
  withOptions(options) {
@@ -10247,7 +10251,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
10247
10251
  });
10248
10252
  }
10249
10253
  }
10250
- let CORE_VERSION = "1.4.10", 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.
10251
10255
 
10252
10256
  Help:
10253
10257
  Looks like you are using a custom binding (via environment variable 'RSPACK_BINDING=${process.env.RSPACK_BINDING}').
@@ -10299,11 +10303,11 @@ Help:
10299
10303
  return;
10300
10304
  }
10301
10305
  let finalCallback = (err)=>{
10302
- 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;
10303
- var err1 = err;
10304
- this.compiler.hooks.watchClose.call();
10305
- let closeCallbacks = this.#closeCallbacks;
10306
- 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);
10307
10311
  };
10308
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);
10309
10313
  }
@@ -11445,7 +11449,7 @@ Help:
11445
11449
  obj.children = this.stats.map((stat, idx)=>{
11446
11450
  let obj = stat.toJson(childOptions.children[idx]), compilationName = stat.compilation.name;
11447
11451
  return obj.name = compilationName && makePathsRelative(childOptions.context, compilationName, stat.compilation.compiler.root), obj;
11448
- }), childOptions.version && (obj.rspackVersion = "1.4.10", 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(""));
11449
11453
  let mapError = (j, obj)=>({
11450
11454
  ...obj,
11451
11455
  compilerPath: obj.compilerPath ? `${j.name}.${obj.compilerPath}` : j.name
@@ -12345,7 +12349,7 @@ Help:
12345
12349
  object.hash = context.getStatsCompilation(compilation).hash;
12346
12350
  },
12347
12351
  version: (object)=>{
12348
- object.version = "5.75.0", object.rspackVersion = "1.4.10";
12352
+ object.version = "5.75.0", object.rspackVersion = "1.4.11";
12349
12353
  },
12350
12354
  env: (object, _compilation, _context, { _env })=>{
12351
12355
  object.env = _env;
@@ -13959,13 +13963,6 @@ Help:
13959
13963
  log: 2,
13960
13964
  true: 2,
13961
13965
  verbose: 1
13962
- }, stringToRegexp = (ignored)=>{
13963
- if (0 === ignored.length) return;
13964
- let { source } = __webpack_require__("glob-to-regexp")(ignored, {
13965
- globstar: !0,
13966
- extended: !0
13967
- });
13968
- return `${source.slice(0, -1)}(?:$|\\/)`;
13969
13966
  };
13970
13967
  class NativeWatchFileSystem {
13971
13968
  #inner;
@@ -14012,20 +14009,8 @@ Help:
14012
14009
  aggregateTimeout: options.aggregateTimeout,
14013
14010
  pollInterval: "boolean" == typeof options.poll ? 0 : options.poll,
14014
14011
  ignored: ((ignored)=>{
14015
- if (Array.isArray(ignored)) {
14016
- let stringRegexps = ignored.map((i)=>stringToRegexp(i)).filter(Boolean);
14017
- if (0 === stringRegexps.length) return ()=>!1;
14018
- let regexp = new RegExp(stringRegexps.join("|"));
14019
- return (item)=>regexp.test(item.replace(/\\/g, "/"));
14020
- }
14021
- if ("string" == typeof ignored) {
14022
- let stringRegexp = stringToRegexp(ignored);
14023
- if (!stringRegexp) return ()=>!1;
14024
- let regexp = new RegExp(stringRegexp);
14025
- return (item)=>regexp.test(item.replace(/\\/g, "/"));
14026
- }
14027
- if (ignored instanceof RegExp) return (item)=>ignored.test(item.replace(/\\/g, "/"));
14028
- 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");
14029
14014
  if (ignored) throw Error(`Invalid option for 'ignored': ${ignored}`);
14030
14015
  })(options.ignored)
14031
14016
  }, nativeWatcher = new (binding_default()).NativeWatcher(nativeWatcherOptions);
@@ -15745,7 +15730,7 @@ Help:
15745
15730
  let _options = JSON.stringify(options || {});
15746
15731
  return binding_default().transform(source, _options);
15747
15732
  }
15748
- let exports_rspackVersion = "1.4.10", 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 = {
15749
15734
  getNormalizedRspackOptions: getNormalizedRspackOptions,
15750
15735
  applyRspackOptionsDefaults: applyRspackOptionsDefaults,
15751
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.10",
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",
@@ -38,8 +38,8 @@
38
38
  },
39
39
  "devDependencies": {
40
40
  "@ast-grep/napi": "^0.39.1",
41
- "@rsbuild/core": "^1.4.6",
42
- "@rslib/core": "0.10.5",
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.10"
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"}