@rspack/core 1.4.10 → 1.5.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/compiled/watchpack/index.js +149 -9
- package/dist/Compilation.d.ts +2 -2
- package/dist/Compiler.d.ts +5 -0
- package/dist/MultiCompiler.d.ts +1 -1
- package/dist/NativeWatchFileSystem.d.ts +3 -1
- package/dist/NormalModuleFactory.d.ts +2 -2
- package/dist/Resolver.d.ts +0 -6
- package/dist/ResolverFactory.d.ts +8 -5
- package/dist/VirtualModulesPlugin.d.ts +12 -0
- package/dist/builtin-loader/swc/collectTypeScriptInfo.d.ts +13 -0
- package/dist/builtin-loader/swc/types.d.ts +4 -0
- package/dist/builtin-plugin/APIPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ArrayPushCallbackChunkFormatPlugin.d.ts +1 -1
- package/dist/builtin-plugin/AssetModulesPlugin.d.ts +1 -1
- package/dist/builtin-plugin/AsyncWebAssemblyModulesPlugin.d.ts +1 -1
- package/dist/builtin-plugin/BannerPlugin.d.ts +1 -1
- package/dist/builtin-plugin/BundlerInfoRspackPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ChunkPrefetchPreloadPlugin.d.ts +1 -1
- package/dist/builtin-plugin/CommonJsChunkFormatPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ContextReplacementPlugin.d.ts +1 -1
- package/dist/builtin-plugin/CopyRspackPlugin.d.ts +1 -1
- package/dist/builtin-plugin/CssChunkingPlugin.d.ts +1 -1
- package/dist/builtin-plugin/CssModulesPlugin.d.ts +1 -1
- package/dist/builtin-plugin/DataUriPlugin.d.ts +1 -1
- package/dist/builtin-plugin/DefinePlugin.d.ts +1 -1
- package/dist/builtin-plugin/DllEntryPlugin.d.ts +1 -1
- package/dist/builtin-plugin/DllReferenceAgencyPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ElectronTargetPlugin.d.ts +1 -1
- package/dist/builtin-plugin/EnableChunkLoadingPlugin.d.ts +1 -1
- package/dist/builtin-plugin/EnableWasmLoadingPlugin.d.ts +1 -1
- package/dist/builtin-plugin/EnsureChunkConditionsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/EntryPlugin.d.ts +1 -1
- package/dist/builtin-plugin/EvalDevToolModulePlugin.d.ts +1 -1
- package/dist/builtin-plugin/EvalSourceMapDevToolPlugin.d.ts +1 -1
- package/dist/builtin-plugin/FetchCompileAsyncWasmPlugin.d.ts +1 -1
- package/dist/builtin-plugin/FileUriPlugin.d.ts +1 -1
- package/dist/builtin-plugin/FlagAllModulesAsUsedPlugin.d.ts +1 -1
- package/dist/builtin-plugin/FlagDependencyExportsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/HttpExternalsRspackPlugin.d.ts +1 -1
- package/dist/builtin-plugin/IgnorePlugin.d.ts +1 -1
- package/dist/builtin-plugin/InferAsyncModulesPlugin.d.ts +1 -1
- package/dist/builtin-plugin/JsLoaderRspackPlugin.d.ts +1 -1
- package/dist/builtin-plugin/JsonModulesPlugin.d.ts +1 -1
- package/dist/builtin-plugin/LibManifestPlugin.d.ts +1 -1
- package/dist/builtin-plugin/LightningCssMinimizerRspackPlugin.d.ts +1 -1
- package/dist/builtin-plugin/LimitChunkCountPlugin.d.ts +1 -1
- package/dist/builtin-plugin/MergeDuplicateChunksPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ModuleChunkFormatPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ModuleInfoHeaderPlugin.d.ts +1 -1
- package/dist/builtin-plugin/NamedChunkIdsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/NamedModuleIdsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/NoEmitOnErrorsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/NodeTargetPlugin.d.ts +1 -1
- package/dist/builtin-plugin/OccurrenceChunkIdsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ProgressPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ProvidePlugin.d.ts +1 -1
- package/dist/builtin-plugin/RealContentHashPlugin.d.ts +1 -1
- package/dist/builtin-plugin/RemoveDuplicateModulesPlugin.d.ts +1 -1
- package/dist/builtin-plugin/RemoveEmptyChunksPlugin.d.ts +1 -1
- package/dist/builtin-plugin/RsdoctorPlugin.d.ts +5 -1
- package/dist/builtin-plugin/RslibPlugin.d.ts +1 -1
- package/dist/builtin-plugin/RstestPlugin.d.ts +1 -1
- package/dist/builtin-plugin/RuntimeChunkPlugin.d.ts +1 -1
- package/dist/builtin-plugin/RuntimePlugin.d.ts +1 -1
- package/dist/builtin-plugin/SideEffectsFlagPlugin.d.ts +1 -1
- package/dist/builtin-plugin/SizeLimitsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/SourceMapDevToolPlugin.d.ts +1 -1
- package/dist/builtin-plugin/SubresourceIntegrityPlugin.d.ts +1 -1
- package/dist/builtin-plugin/SwcJsMinimizerPlugin.d.ts +1 -1
- package/dist/builtin-plugin/WarnCaseSensitiveModulesPlugin.d.ts +1 -1
- package/dist/builtin-plugin/base.d.ts +2 -2
- package/dist/builtin-plugin/html-plugin/plugin.d.ts +1 -1
- package/dist/builtin-plugin/lazy-compilation/lazyCompilation.d.ts +1 -1
- package/dist/config/normalization.d.ts +7 -0
- package/dist/config/types.d.ts +19 -5
- package/dist/container/ModuleFederationRuntimePlugin.d.ts +1 -1
- package/dist/cssExtractLoader.js +55 -53
- package/dist/exports.d.ts +9 -1
- package/dist/index.js +313 -234
- package/dist/loader-runner/loadLoader.d.ts +2 -1
- package/dist/loader-runner/service.d.ts +1 -1
- package/dist/loader-runner/utils.d.ts +2 -1
- package/dist/schema/config.d.ts +56 -47
- package/dist/schema/loaders.d.ts +5 -5
- package/dist/schema/plugins.d.ts +14 -10
- package/dist/util/bindingVersionCheck.d.ts +1 -1
- package/dist/util/require.d.ts +3 -0
- package/dist/worker.js +44 -9
- package/module.d.ts +9 -10
- package/package.json +11 -9
- package/compiled/glob-to-regexp/index.d.ts +0 -11
- package/compiled/glob-to-regexp/index.js +0 -187
- package/compiled/glob-to-regexp/package.json +0 -1
package/dist/worker.js
CHANGED
@@ -1,5 +1,30 @@
|
|
1
1
|
"use strict";
|
2
2
|
var __webpack_modules__ = {
|
3
|
+
"./src/swc.ts": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
4
|
+
__webpack_require__.r(__webpack_exports__), __webpack_require__.d(__webpack_exports__, {
|
5
|
+
minify: ()=>minify,
|
6
|
+
minifySync: ()=>minifySync,
|
7
|
+
transform: ()=>transform,
|
8
|
+
transformSync: ()=>transformSync
|
9
|
+
});
|
10
|
+
var _rspack_binding__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("@rspack/binding"), _rspack_binding__WEBPACK_IMPORTED_MODULE_0___default = __webpack_require__.n(_rspack_binding__WEBPACK_IMPORTED_MODULE_0__);
|
11
|
+
async function minify(source, options) {
|
12
|
+
let _options = JSON.stringify(options || {});
|
13
|
+
return _rspack_binding__WEBPACK_IMPORTED_MODULE_0___default().minify(source, _options);
|
14
|
+
}
|
15
|
+
function minifySync(source, options) {
|
16
|
+
let _options = JSON.stringify(options || {});
|
17
|
+
return _rspack_binding__WEBPACK_IMPORTED_MODULE_0___default().minifySync(source, _options);
|
18
|
+
}
|
19
|
+
async function transform(source, options) {
|
20
|
+
let _options = JSON.stringify(options || {});
|
21
|
+
return _rspack_binding__WEBPACK_IMPORTED_MODULE_0___default().transform(source, _options);
|
22
|
+
}
|
23
|
+
function transformSync(source, options) {
|
24
|
+
let _options = JSON.stringify(options || {});
|
25
|
+
return _rspack_binding__WEBPACK_IMPORTED_MODULE_0___default().transformSync(source, _options);
|
26
|
+
}
|
27
|
+
},
|
3
28
|
"./src/util/cleverMerge.ts": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
4
29
|
__webpack_require__.d(__webpack_exports__, {
|
5
30
|
R_: ()=>cleverMerge
|
@@ -386,6 +411,9 @@ var __webpack_modules__ = {
|
|
386
411
|
}
|
387
412
|
};
|
388
413
|
},
|
414
|
+
"@rspack/binding": function(module) {
|
415
|
+
module.exports = require("@rspack/binding");
|
416
|
+
},
|
389
417
|
"node:fs": function(module) {
|
390
418
|
module.exports = require("node:fs");
|
391
419
|
},
|
@@ -437,8 +465,8 @@ for(var __webpack_i__ in (()=>{
|
|
437
465
|
});
|
438
466
|
let external_node_querystring_namespaceObject = require("node:querystring");
|
439
467
|
var RequestType, RequestSyncType, external_node_querystring_default = __webpack_require__.n(external_node_querystring_namespaceObject), external_node_util_ = __webpack_require__("node:util");
|
440
|
-
let external_node_worker_threads_namespaceObject = require("node:worker_threads")
|
441
|
-
var createHash = __webpack_require__("./src/util/createHash.ts");
|
468
|
+
let external_node_worker_threads_namespaceObject = require("node:worker_threads");
|
469
|
+
var binding_ = __webpack_require__("@rspack/binding"), createHash = __webpack_require__("./src/util/createHash.ts");
|
442
470
|
let external_node_path_namespaceObject = require("node:path");
|
443
471
|
var external_node_path_default = __webpack_require__.n(external_node_path_namespaceObject);
|
444
472
|
let WINDOWS_ABS_PATH_REGEXP = /^[a-zA-Z]:[\\/]/, SEGMENTS_SPLIT_REGEXP = /([|!])/, WINDOWS_PATH_SEPARATOR_REGEXP = /\\/g, relativePathToRequest = (relativePath)=>"" === relativePath ? "./." : ".." === relativePath ? "../." : relativePath.startsWith("../") ? relativePath : `./${relativePath}`, absoluteToRequest = (context, maybeAbsolutePath)=>{
|
@@ -531,12 +559,14 @@ for(var __webpack_i__ in (()=>{
|
|
531
559
|
let memoize = (fn)=>{
|
532
560
|
let result, cache = !1, callback = fn;
|
533
561
|
return ()=>(cache || (result = callback(), cache = !0, callback = void 0), result);
|
534
|
-
}
|
562
|
+
};
|
563
|
+
__webpack_require__("node:fs");
|
564
|
+
let LoaderLoadingError = class extends Error {
|
535
565
|
constructor(message){
|
536
566
|
super(message), this.name = "LoaderRunnerError", Error.captureStackTrace(this, this.constructor);
|
537
567
|
}
|
538
568
|
};
|
539
|
-
function loadLoader(loader, callback) {
|
569
|
+
function loadLoader(loader, compiler, callback) {
|
540
570
|
if ("module" === loader.type) try {
|
541
571
|
void 0 === url && (url = __webpack_require__("node:url")), import(url.pathToFileURL(loader.path).toString()).then((module)=>{
|
542
572
|
handleResult(loader, module, callback);
|
@@ -550,7 +580,7 @@ for(var __webpack_i__ in (()=>{
|
|
550
580
|
try {
|
551
581
|
module = require(loader.path);
|
552
582
|
} catch (e) {
|
553
|
-
if (e instanceof Error && "EMFILE" === e.code) return void setImmediate(loadLoader.bind(null, loader, callback));
|
583
|
+
if (e instanceof Error && "EMFILE" === e.code) return void setImmediate(loadLoader.bind(null, loader, compiler, callback));
|
554
584
|
return callback(e);
|
555
585
|
}
|
556
586
|
return handleResult(loader, module, callback);
|
@@ -756,6 +786,11 @@ for(var __webpack_i__ in (()=>{
|
|
756
786
|
createHash: (type)=>(0, createHash.j)(type || loaderContext._compilation.outputOptions.hashFunction)
|
757
787
|
}, loaderContext._compiler = {
|
758
788
|
...loaderContext._compiler,
|
789
|
+
rspack: {
|
790
|
+
experiments: {
|
791
|
+
swc: __webpack_require__("./src/swc.ts")
|
792
|
+
}
|
793
|
+
},
|
759
794
|
webpack: {
|
760
795
|
util: {
|
761
796
|
createHash: __webpack_require__("./src/util/createHash.ts").j,
|
@@ -830,7 +865,7 @@ for(var __webpack_i__ in (()=>{
|
|
830
865
|
});
|
831
866
|
let shouldYieldToMainThread = (currentLoaderObject)=>!!(!currentLoaderObject?.parallel || currentLoaderObject?.request.startsWith("builtin:"));
|
832
867
|
switch(loaderState){
|
833
|
-
case
|
868
|
+
case binding_.JsLoaderState.Pitching:
|
834
869
|
for(; loaderContext.loaderIndex < loaderContext.loaders.length;){
|
835
870
|
let currentLoaderObject = loaderContext.loaders[loaderContext.loaderIndex];
|
836
871
|
if (shouldYieldToMainThread(currentLoaderObject)) break;
|
@@ -838,7 +873,7 @@ for(var __webpack_i__ in (()=>{
|
|
838
873
|
loaderContext.loaderIndex += 1;
|
839
874
|
continue;
|
840
875
|
}
|
841
|
-
await loadLoaderAsync(currentLoaderObject);
|
876
|
+
await loadLoaderAsync(currentLoaderObject, loaderContext._compiler);
|
842
877
|
let fn = currentLoaderObject.pitch;
|
843
878
|
if ((currentLoaderObject.pitchExecuted = !0, fn) && (args = await utils_runSyncOrAsync(fn, loaderContext, [
|
844
879
|
loaderContext.remainingRequest,
|
@@ -846,7 +881,7 @@ for(var __webpack_i__ in (()=>{
|
|
846
881
|
currentLoaderObject.loaderItem.data
|
847
882
|
]) || []).some((value)=>void 0 !== value)) break;
|
848
883
|
}
|
849
|
-
case
|
884
|
+
case binding_.JsLoaderState.Normal:
|
850
885
|
for(; loaderContext.loaderIndex >= 0;){
|
851
886
|
var args1, raw;
|
852
887
|
let currentLoaderObject = loaderContext.loaders[loaderContext.loaderIndex];
|
@@ -855,7 +890,7 @@ for(var __webpack_i__ in (()=>{
|
|
855
890
|
loaderContext.loaderIndex--;
|
856
891
|
continue;
|
857
892
|
}
|
858
|
-
await loadLoaderAsync(currentLoaderObject);
|
893
|
+
await loadLoaderAsync(currentLoaderObject, loaderContext._compiler);
|
859
894
|
let fn = currentLoaderObject.normal;
|
860
895
|
currentLoaderObject.normalExecuted = !0, fn && (args1 = args, !(raw = !!currentLoaderObject.raw) && args1[0] instanceof Uint8Array ? args1[0] = function(buf) {
|
861
896
|
let str = decoder.decode(buf.buffer instanceof SharedArrayBuffer ? Buffer.from(buf) : buf);
|
package/module.d.ts
CHANGED
@@ -111,16 +111,15 @@ declare namespace Rspack {
|
|
111
111
|
onErrored?: (event: ErroredEvent) => void;
|
112
112
|
}
|
113
113
|
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
}
|
114
|
+
type HotUpdateStatus =
|
115
|
+
| "idle"
|
116
|
+
| "check"
|
117
|
+
| "prepare"
|
118
|
+
| "ready"
|
119
|
+
| "dispose"
|
120
|
+
| "apply"
|
121
|
+
| "abort"
|
122
|
+
| "fail";
|
124
123
|
|
125
124
|
interface Hot {
|
126
125
|
accept: {
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@rspack/core",
|
3
|
-
"version": "1.
|
3
|
+
"version": "1.5.0-beta.0",
|
4
4
|
"webpackVersion": "5.75.0",
|
5
5
|
"license": "MIT",
|
6
6
|
"description": "The fast Rust-based web bundler with webpack-compatible API",
|
@@ -27,7 +27,7 @@
|
|
27
27
|
"module.d.ts"
|
28
28
|
],
|
29
29
|
"engines": {
|
30
|
-
"node": ">=
|
30
|
+
"node": ">=18.12.0"
|
31
31
|
},
|
32
32
|
"homepage": "https://rspack.rs",
|
33
33
|
"bugs": "https://github.com/web-infra-dev/rspack/issues",
|
@@ -38,29 +38,30 @@
|
|
38
38
|
},
|
39
39
|
"devDependencies": {
|
40
40
|
"@ast-grep/napi": "^0.39.1",
|
41
|
-
"@rsbuild/core": "^1.4.
|
42
|
-
"@rslib/core": "0.
|
41
|
+
"@rsbuild/core": "^1.4.10",
|
42
|
+
"@rslib/core": "0.11.0",
|
43
43
|
"@swc/types": "0.1.23",
|
44
|
+
"@rsbuild/plugin-node-polyfill": "^1.3.0",
|
44
45
|
"@types/graceful-fs": "4.1.9",
|
45
46
|
"@types/watchpack": "^2.4.4",
|
46
47
|
"browserslist-load-config": "^1.0.0",
|
47
48
|
"enhanced-resolve": "5.18.2",
|
48
49
|
"graceful-fs": "^4.2.11",
|
49
|
-
"
|
50
|
+
"memfs": "4.36.0",
|
51
|
+
"prebundle": "^1.4.1",
|
50
52
|
"tinypool": "^1.1.1",
|
51
53
|
"tsx": "^4.20.3",
|
52
|
-
"typescript": "^5.
|
54
|
+
"typescript": "^5.9.2",
|
53
55
|
"watchpack": "^2.4.4",
|
54
56
|
"webpack-sources": "3.3.3",
|
55
57
|
"glob-to-regexp": "^0.4.1",
|
56
58
|
"zod": "^3.25.76",
|
57
|
-
"@types/glob-to-regexp": "^0.4.4",
|
58
59
|
"zod-validation-error": "3.5.3"
|
59
60
|
},
|
60
61
|
"dependencies": {
|
61
|
-
"@module-federation/runtime-tools": "0.17.
|
62
|
+
"@module-federation/runtime-tools": "0.17.1",
|
62
63
|
"@rspack/lite-tapable": "1.0.1",
|
63
|
-
"@rspack/binding": "1.
|
64
|
+
"@rspack/binding": "1.5.0-beta.0"
|
64
65
|
},
|
65
66
|
"peerDependencies": {
|
66
67
|
"@swc/helpers": ">=0.5.1"
|
@@ -72,6 +73,7 @@
|
|
72
73
|
},
|
73
74
|
"scripts": {
|
74
75
|
"build": "rslib build",
|
76
|
+
"build:browser": "rslib build -c rslib.browser.config.ts",
|
75
77
|
"dev": "rslib build --watch",
|
76
78
|
"doc-coverage": "tsx ./scripts/check-documentation-coverage.ts",
|
77
79
|
"api-extractor": "api-extractor run --verbose",
|
@@ -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"}
|