@rspack/core 1.0.0-alpha.3 → 1.0.0-alpha.5
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/browserslist/index.js +17 -17
- package/compiled/enhanced-resolve/index.js +107 -107
- package/compiled/graceful-fs/index.js +8 -8
- package/compiled/json-parse-even-better-errors/index.js +2 -2
- package/compiled/neo-async/index.js +2 -2
- package/compiled/watchpack/index.js +15 -15
- package/compiled/webpack-sources/index.js +76 -76
- package/compiled/zod/index.js +30 -30
- package/compiled/zod-validation-error/index.js +6 -6
- package/dist/Compilation.js +2 -3
- package/dist/ErrorHelpers.d.ts +16 -7
- package/dist/ErrorHelpers.js +34 -33
- package/dist/ExecuteModulePlugin.js +1 -1
- package/dist/FileSystem.js +6 -6
- package/dist/Module.d.ts +1 -2
- package/dist/Module.js +2 -6
- package/dist/MultiCompiler.js +1 -1
- package/dist/NormalModule.js +6 -6
- package/dist/ResolverFactory.d.ts +5 -1
- package/dist/ResolverFactory.js +7 -1
- package/dist/RuntimeGlobals.js +3 -3
- package/dist/Stats.js +4 -4
- package/dist/Template.js +2 -2
- package/dist/Watching.js +2 -2
- package/dist/builtin-plugin/DefinePlugin.js +2 -2
- package/dist/builtin-plugin/EntryPlugin.js +1 -1
- package/dist/builtin-plugin/SplitChunksPlugin.js +2 -2
- package/dist/builtin-plugin/SwcCssMinimizerPlugin.d.ts +10 -2
- package/dist/builtin-plugin/SwcCssMinimizerPlugin.js +7 -1
- package/dist/builtin-plugin/SwcJsMinimizerPlugin.js +2 -2
- package/dist/builtin-plugin/WorkerPlugin.js +5 -1
- package/dist/builtin-plugin/base.js +1 -1
- package/dist/builtin-plugin/css-extract/loader.js +5 -5
- package/dist/builtin-plugin/css-extract/utils.js +3 -3
- package/dist/builtin-plugin/lazy-compilation/backend.d.ts +3 -3
- package/dist/builtin-plugin/lazy-compilation/backend.js +1 -1
- package/dist/config/adapter.d.ts +1 -1
- package/dist/config/adapter.js +27 -16
- package/dist/config/adapterRuleUse.js +1 -1
- package/dist/config/browserslistTargetHandler.js +2 -2
- package/dist/config/defaults.js +11 -10
- package/dist/config/zod.d.ts +119 -12
- package/dist/config/zod.js +43 -40
- package/dist/container/ModuleFederationPlugin.js +2 -2
- package/dist/lib/EntryOptionPlugin.js +2 -2
- package/dist/lib/WebpackError.js +1 -1
- package/dist/loader-runner/index.js +22 -22
- package/dist/loader-runner/loadLoader.js +1 -1
- package/dist/logging/runtime.js +1 -1
- package/dist/node/NodeWatchFileSystem.js +5 -5
- package/dist/node/nodeConsole.js +1 -1
- package/dist/rspack.js +6 -6
- package/dist/rspackOptionsApply.js +3 -3
- package/dist/sharing/ConsumeSharedPlugin.js +1 -1
- package/dist/stats/DefaultStatsFactoryPlugin.js +285 -50
- package/dist/stats/DefaultStatsPresetPlugin.js +17 -17
- package/dist/stats/DefaultStatsPrinterPlugin.js +2 -2
- package/dist/stats/statsFactoryUtils.d.ts +24 -10
- package/dist/util/bindingVersionCheck.js +6 -6
- package/dist/util/createHash.js +2 -2
- package/dist/util/fs.js +11 -11
- package/dist/util/identifier.d.ts +65 -62
- package/dist/util/identifier.js +30 -55
- package/package.json +6 -3
package/compiled/zod/index.js
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
/******/ "use strict";
|
|
3
3
|
/******/ var __webpack_modules__ = ({
|
|
4
4
|
|
|
5
|
-
/***/
|
|
5
|
+
/***/ 533:
|
|
6
6
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
10
10
|
exports.ZodError = exports.quotelessJson = exports.ZodIssueCode = void 0;
|
|
11
|
-
const util_1 = __nccwpck_require__(
|
|
11
|
+
const util_1 = __nccwpck_require__(276);
|
|
12
12
|
exports.ZodIssueCode = util_1.util.arrayToEnum([
|
|
13
13
|
"invalid_type",
|
|
14
14
|
"invalid_literal",
|
|
@@ -141,7 +141,7 @@ ZodError.create = (issues) => {
|
|
|
141
141
|
|
|
142
142
|
/***/ }),
|
|
143
143
|
|
|
144
|
-
/***/
|
|
144
|
+
/***/ 347:
|
|
145
145
|
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
146
146
|
|
|
147
147
|
|
|
@@ -150,7 +150,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
150
150
|
};
|
|
151
151
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
152
152
|
exports.getErrorMap = exports.setErrorMap = exports.defaultErrorMap = void 0;
|
|
153
|
-
const en_1 = __importDefault(__nccwpck_require__(
|
|
153
|
+
const en_1 = __importDefault(__nccwpck_require__(56));
|
|
154
154
|
exports.defaultErrorMap = en_1.default;
|
|
155
155
|
let overrideErrorMap = en_1.default;
|
|
156
156
|
function setErrorMap(map) {
|
|
@@ -165,7 +165,7 @@ exports.getErrorMap = getErrorMap;
|
|
|
165
165
|
|
|
166
166
|
/***/ }),
|
|
167
167
|
|
|
168
|
-
/***/
|
|
168
|
+
/***/ 961:
|
|
169
169
|
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
170
170
|
|
|
171
171
|
|
|
@@ -180,17 +180,17 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
180
180
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
181
181
|
};
|
|
182
182
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
183
|
-
__exportStar(__nccwpck_require__(
|
|
184
|
-
__exportStar(__nccwpck_require__(
|
|
185
|
-
__exportStar(__nccwpck_require__(
|
|
186
|
-
__exportStar(__nccwpck_require__(
|
|
187
|
-
__exportStar(__nccwpck_require__(
|
|
188
|
-
__exportStar(__nccwpck_require__(
|
|
183
|
+
__exportStar(__nccwpck_require__(347), exports);
|
|
184
|
+
__exportStar(__nccwpck_require__(825), exports);
|
|
185
|
+
__exportStar(__nccwpck_require__(764), exports);
|
|
186
|
+
__exportStar(__nccwpck_require__(276), exports);
|
|
187
|
+
__exportStar(__nccwpck_require__(355), exports);
|
|
188
|
+
__exportStar(__nccwpck_require__(533), exports);
|
|
189
189
|
|
|
190
190
|
|
|
191
191
|
/***/ }),
|
|
192
192
|
|
|
193
|
-
/***/
|
|
193
|
+
/***/ 429:
|
|
194
194
|
/***/ ((__unused_webpack_module, exports) => {
|
|
195
195
|
|
|
196
196
|
|
|
@@ -205,7 +205,7 @@ var errorUtil;
|
|
|
205
205
|
|
|
206
206
|
/***/ }),
|
|
207
207
|
|
|
208
|
-
/***/
|
|
208
|
+
/***/ 825:
|
|
209
209
|
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
210
210
|
|
|
211
211
|
|
|
@@ -214,8 +214,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
214
214
|
};
|
|
215
215
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
216
216
|
exports.isAsync = exports.isValid = exports.isDirty = exports.isAborted = exports.OK = exports.DIRTY = exports.INVALID = exports.ParseStatus = exports.addIssueToContext = exports.EMPTY_PATH = exports.makeIssue = void 0;
|
|
217
|
-
const errors_1 = __nccwpck_require__(
|
|
218
|
-
const en_1 = __importDefault(__nccwpck_require__(
|
|
217
|
+
const errors_1 = __nccwpck_require__(347);
|
|
218
|
+
const en_1 = __importDefault(__nccwpck_require__(56));
|
|
219
219
|
const makeIssue = (params) => {
|
|
220
220
|
const { data, path, errorMaps, issueData } = params;
|
|
221
221
|
const fullPath = [...path, ...(issueData.path || [])];
|
|
@@ -327,7 +327,7 @@ exports.isAsync = isAsync;
|
|
|
327
327
|
|
|
328
328
|
/***/ }),
|
|
329
329
|
|
|
330
|
-
/***/
|
|
330
|
+
/***/ 764:
|
|
331
331
|
/***/ ((__unused_webpack_module, exports) => {
|
|
332
332
|
|
|
333
333
|
|
|
@@ -336,7 +336,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
336
336
|
|
|
337
337
|
/***/ }),
|
|
338
338
|
|
|
339
|
-
/***/
|
|
339
|
+
/***/ 276:
|
|
340
340
|
/***/ ((__unused_webpack_module, exports) => {
|
|
341
341
|
|
|
342
342
|
|
|
@@ -485,7 +485,7 @@ exports.getParsedType = getParsedType;
|
|
|
485
485
|
|
|
486
486
|
/***/ }),
|
|
487
487
|
|
|
488
|
-
/***/
|
|
488
|
+
/***/ 353:
|
|
489
489
|
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
490
490
|
|
|
491
491
|
|
|
@@ -513,21 +513,21 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
513
513
|
};
|
|
514
514
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
515
515
|
exports.z = void 0;
|
|
516
|
-
const z = __importStar(__nccwpck_require__(
|
|
516
|
+
const z = __importStar(__nccwpck_require__(961));
|
|
517
517
|
exports.z = z;
|
|
518
|
-
__exportStar(__nccwpck_require__(
|
|
518
|
+
__exportStar(__nccwpck_require__(961), exports);
|
|
519
519
|
exports["default"] = z;
|
|
520
520
|
|
|
521
521
|
|
|
522
522
|
/***/ }),
|
|
523
523
|
|
|
524
|
-
/***/
|
|
524
|
+
/***/ 56:
|
|
525
525
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
526
526
|
|
|
527
527
|
|
|
528
528
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
529
|
-
const util_1 = __nccwpck_require__(
|
|
530
|
-
const ZodError_1 = __nccwpck_require__(
|
|
529
|
+
const util_1 = __nccwpck_require__(276);
|
|
530
|
+
const ZodError_1 = __nccwpck_require__(533);
|
|
531
531
|
const errorMap = (issue, _ctx) => {
|
|
532
532
|
let message;
|
|
533
533
|
switch (issue.code) {
|
|
@@ -657,18 +657,18 @@ exports["default"] = errorMap;
|
|
|
657
657
|
|
|
658
658
|
/***/ }),
|
|
659
659
|
|
|
660
|
-
/***/
|
|
660
|
+
/***/ 355:
|
|
661
661
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
662
662
|
|
|
663
663
|
|
|
664
664
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
665
665
|
exports.date = exports.boolean = exports.bigint = exports.array = exports.any = exports.coerce = exports.ZodFirstPartyTypeKind = exports.late = exports.ZodSchema = exports.Schema = exports.custom = exports.ZodReadonly = exports.ZodPipeline = exports.ZodBranded = exports.BRAND = exports.ZodNaN = exports.ZodCatch = exports.ZodDefault = exports.ZodNullable = exports.ZodOptional = exports.ZodTransformer = exports.ZodEffects = exports.ZodPromise = exports.ZodNativeEnum = exports.ZodEnum = exports.ZodLiteral = exports.ZodLazy = exports.ZodFunction = exports.ZodSet = exports.ZodMap = exports.ZodRecord = exports.ZodTuple = exports.ZodIntersection = exports.ZodDiscriminatedUnion = exports.ZodUnion = exports.ZodObject = exports.ZodArray = exports.ZodVoid = exports.ZodNever = exports.ZodUnknown = exports.ZodAny = exports.ZodNull = exports.ZodUndefined = exports.ZodSymbol = exports.ZodDate = exports.ZodBoolean = exports.ZodBigInt = exports.ZodNumber = exports.ZodString = exports.ZodType = void 0;
|
|
666
666
|
exports.NEVER = exports["void"] = exports.unknown = exports.union = exports.undefined = exports.tuple = exports.transformer = exports.symbol = exports.string = exports.strictObject = exports.set = exports.record = exports.promise = exports.preprocess = exports.pipeline = exports.ostring = exports.optional = exports.onumber = exports.oboolean = exports.object = exports.number = exports.nullable = exports["null"] = exports.never = exports.nativeEnum = exports.nan = exports.map = exports.literal = exports.lazy = exports.intersection = exports["instanceof"] = exports["function"] = exports["enum"] = exports.effect = exports.discriminatedUnion = void 0;
|
|
667
|
-
const errors_1 = __nccwpck_require__(
|
|
668
|
-
const errorUtil_1 = __nccwpck_require__(
|
|
669
|
-
const parseUtil_1 = __nccwpck_require__(
|
|
670
|
-
const util_1 = __nccwpck_require__(
|
|
671
|
-
const ZodError_1 = __nccwpck_require__(
|
|
667
|
+
const errors_1 = __nccwpck_require__(347);
|
|
668
|
+
const errorUtil_1 = __nccwpck_require__(429);
|
|
669
|
+
const parseUtil_1 = __nccwpck_require__(825);
|
|
670
|
+
const util_1 = __nccwpck_require__(276);
|
|
671
|
+
const ZodError_1 = __nccwpck_require__(533);
|
|
672
672
|
class ParseInputLazyPath {
|
|
673
673
|
constructor(parent, value, path, key) {
|
|
674
674
|
this._cachedPath = [];
|
|
@@ -4201,7 +4201,7 @@ exports.NEVER = parseUtil_1.INVALID;
|
|
|
4201
4201
|
/******/ // startup
|
|
4202
4202
|
/******/ // Load entry module and return exports
|
|
4203
4203
|
/******/ // This entry module is referenced by other modules so it can't be inlined
|
|
4204
|
-
/******/ var __webpack_exports__ = __nccwpck_require__(
|
|
4204
|
+
/******/ var __webpack_exports__ = __nccwpck_require__(353);
|
|
4205
4205
|
/******/ module.exports = __webpack_exports__;
|
|
4206
4206
|
/******/
|
|
4207
4207
|
/******/ })()
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/******/ "use strict";
|
|
3
3
|
/******/ var __webpack_modules__ = ({
|
|
4
4
|
|
|
5
|
-
/***/
|
|
5
|
+
/***/ 479:
|
|
6
6
|
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
7
7
|
|
|
8
8
|
|
|
@@ -32,8 +32,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
32
32
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
33
33
|
exports.isValidationErrorLike = exports.isValidationError = exports.toValidationError = exports.fromZodError = exports.ValidationError = void 0;
|
|
34
34
|
const zod = __importStar(__nccwpck_require__(934));
|
|
35
|
-
const joinPath_1 = __nccwpck_require__(
|
|
36
|
-
const NonEmptyArray_1 = __nccwpck_require__(
|
|
35
|
+
const joinPath_1 = __nccwpck_require__(14);
|
|
36
|
+
const NonEmptyArray_1 = __nccwpck_require__(80);
|
|
37
37
|
class ValidationError extends Error {
|
|
38
38
|
details;
|
|
39
39
|
name;
|
|
@@ -104,7 +104,7 @@ exports.isValidationErrorLike = isValidationErrorLike;
|
|
|
104
104
|
|
|
105
105
|
/***/ }),
|
|
106
106
|
|
|
107
|
-
/***/
|
|
107
|
+
/***/ 80:
|
|
108
108
|
/***/ ((__unused_webpack_module, exports) => {
|
|
109
109
|
|
|
110
110
|
|
|
@@ -118,7 +118,7 @@ exports.isNonEmptyArray = isNonEmptyArray;
|
|
|
118
118
|
|
|
119
119
|
/***/ }),
|
|
120
120
|
|
|
121
|
-
/***/
|
|
121
|
+
/***/ 14:
|
|
122
122
|
/***/ ((__unused_webpack_module, exports) => {
|
|
123
123
|
|
|
124
124
|
|
|
@@ -203,7 +203,7 @@ var exports = __webpack_exports__;
|
|
|
203
203
|
|
|
204
204
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
205
205
|
exports.fromZodError = exports.isValidationErrorLike = exports.isValidationError = exports.toValidationError = exports.ValidationError = void 0;
|
|
206
|
-
var ValidationError_1 = __nccwpck_require__(
|
|
206
|
+
var ValidationError_1 = __nccwpck_require__(479);
|
|
207
207
|
Object.defineProperty(exports, "ValidationError", ({ enumerable: true, get: function () { return ValidationError_1.ValidationError; } }));
|
|
208
208
|
Object.defineProperty(exports, "toValidationError", ({ enumerable: true, get: function () { return ValidationError_1.toValidationError; } }));
|
|
209
209
|
Object.defineProperty(exports, "isValidationError", ({ enumerable: true, get: function () { return ValidationError_1.isValidationError; } }));
|
package/dist/Compilation.js
CHANGED
|
@@ -44,7 +44,7 @@ const liteTapable = __importStar(require("@rspack/lite-tapable"));
|
|
|
44
44
|
const Chunk_1 = require("./Chunk");
|
|
45
45
|
const ChunkGraph_1 = require("./ChunkGraph");
|
|
46
46
|
const Entrypoint_1 = require("./Entrypoint");
|
|
47
|
-
const ErrorHelpers_1 =
|
|
47
|
+
const ErrorHelpers_1 = require("./ErrorHelpers");
|
|
48
48
|
const Module_1 = require("./Module");
|
|
49
49
|
const Stats_1 = require("./Stats");
|
|
50
50
|
const Logger_1 = require("./logging/Logger");
|
|
@@ -513,7 +513,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
|
513
513
|
case Logger_1.LogType.warn:
|
|
514
514
|
case Logger_1.LogType.error:
|
|
515
515
|
case Logger_1.LogType.trace:
|
|
516
|
-
trace = ErrorHelpers_1.
|
|
516
|
+
trace = (0, ErrorHelpers_1.cutOffLoaderExecution)(new Error("Trace").stack)
|
|
517
517
|
.split("\n")
|
|
518
518
|
.slice(3);
|
|
519
519
|
break;
|
|
@@ -522,7 +522,6 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
|
522
522
|
time: Date.now(),
|
|
523
523
|
type,
|
|
524
524
|
args,
|
|
525
|
-
// @ts-expect-error
|
|
526
525
|
trace
|
|
527
526
|
};
|
|
528
527
|
if (this.hooks.log.call(name, logEntry) === undefined) {
|
package/dist/ErrorHelpers.d.ts
CHANGED
|
@@ -1,7 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
/**
|
|
2
|
+
* The following code is modified based on
|
|
3
|
+
* https://github.com/webpack/webpack/blob/4b4ca3b/lib/ErrorHelpers.js
|
|
4
|
+
*
|
|
5
|
+
* MIT Licensed
|
|
6
|
+
* Author Tobias Koppers @sokra
|
|
7
|
+
* Copyright (c) JS Foundation and other contributors
|
|
8
|
+
* https://github.com/webpack/webpack/blob/main/LICENSE
|
|
9
|
+
*/
|
|
10
|
+
export declare const cutOffByFlag: (stack: string, flag: string) => string;
|
|
11
|
+
export declare const cutOffLoaderExecution: (stack: string) => string;
|
|
12
|
+
export declare const cutOffWebpackOptions: (stack: string) => string;
|
|
13
|
+
export declare const cutOffMultilineMessage: (stack: string, message: string) => string;
|
|
14
|
+
export declare const cutOffMessage: (stack: string, message: string) => string;
|
|
15
|
+
export declare const cleanUp: (stack: string, message: string) => string;
|
|
16
|
+
export declare const cleanUpWebpackOptions: (stack: string, message: string) => string;
|
package/dist/ErrorHelpers.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
/**
|
|
2
3
|
* The following code is modified based on
|
|
3
4
|
* https://github.com/webpack/webpack/blob/4b4ca3b/lib/ErrorHelpers.js
|
|
@@ -7,39 +8,36 @@
|
|
|
7
8
|
* Copyright (c) JS Foundation and other contributors
|
|
8
9
|
* https://github.com/webpack/webpack/blob/main/LICENSE
|
|
9
10
|
*/
|
|
10
|
-
"
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.cleanUpWebpackOptions = exports.cleanUp = exports.cutOffMessage = exports.cutOffMultilineMessage = exports.cutOffWebpackOptions = exports.cutOffLoaderExecution = exports.cutOffByFlag = void 0;
|
|
11
13
|
const loaderFlag = "LOADER_EXECUTION";
|
|
12
14
|
const webpackOptionsFlag = "WEBPACK_OPTIONS";
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
stack.length = i;
|
|
15
|
+
const cutOffByFlag = (stack, flag) => {
|
|
16
|
+
const stacks = stack.split("\n");
|
|
17
|
+
for (let i = 0; i < stacks.length; i++) {
|
|
18
|
+
if (stacks[i].includes(flag)) {
|
|
19
|
+
stacks.length = i;
|
|
19
20
|
}
|
|
20
21
|
}
|
|
21
|
-
return
|
|
22
|
+
return stacks.join("\n");
|
|
22
23
|
};
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
// @ts-expect-error
|
|
24
|
+
exports.cutOffByFlag = cutOffByFlag;
|
|
25
|
+
const cutOffLoaderExecution = (stack) => (0, exports.cutOffByFlag)(stack, loaderFlag);
|
|
26
|
+
exports.cutOffLoaderExecution = cutOffLoaderExecution;
|
|
27
|
+
const cutOffWebpackOptions = (stack) => (0, exports.cutOffByFlag)(stack, webpackOptionsFlag);
|
|
28
|
+
exports.cutOffWebpackOptions = cutOffWebpackOptions;
|
|
29
|
+
const cutOffMultilineMessage = (stack, message) => {
|
|
30
|
+
const stacks = stack.split("\n");
|
|
31
|
+
const messages = message.split("\n");
|
|
32
32
|
const result = [];
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
if (!line.includes(message[idx]))
|
|
33
|
+
stacks.forEach((line, idx) => {
|
|
34
|
+
if (!line.includes(messages[idx]))
|
|
36
35
|
result.push(line);
|
|
37
36
|
});
|
|
38
|
-
// @ts-expect-error
|
|
39
37
|
return result.join("\n");
|
|
40
38
|
};
|
|
41
|
-
|
|
42
|
-
|
|
39
|
+
exports.cutOffMultilineMessage = cutOffMultilineMessage;
|
|
40
|
+
const cutOffMessage = (stack, message) => {
|
|
43
41
|
const nextLine = stack.indexOf("\n");
|
|
44
42
|
if (nextLine === -1) {
|
|
45
43
|
return stack === message ? "" : stack;
|
|
@@ -49,15 +47,18 @@ exports.cutOffMessage = (stack, message) => {
|
|
|
49
47
|
return firstLine === message ? stack.slice(nextLine + 1) : stack;
|
|
50
48
|
}
|
|
51
49
|
};
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
50
|
+
exports.cutOffMessage = cutOffMessage;
|
|
51
|
+
const cleanUp = (stack, message) => {
|
|
52
|
+
let str = stack;
|
|
53
|
+
str = (0, exports.cutOffLoaderExecution)(str);
|
|
54
|
+
str = (0, exports.cutOffMessage)(str, message);
|
|
55
|
+
return str;
|
|
57
56
|
};
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
57
|
+
exports.cleanUp = cleanUp;
|
|
58
|
+
const cleanUpWebpackOptions = (stack, message) => {
|
|
59
|
+
let str = stack;
|
|
60
|
+
str = (0, exports.cutOffWebpackOptions)(str);
|
|
61
|
+
str = (0, exports.cutOffMultilineMessage)(str, message);
|
|
62
|
+
return str;
|
|
63
63
|
};
|
|
64
|
+
exports.cleanUpWebpackOptions = cleanUpWebpackOptions;
|
|
@@ -19,7 +19,7 @@ class ExecuteModulePlugin {
|
|
|
19
19
|
fn.call(moduleObject.exports, moduleObject, moduleObject, moduleObject.exports, moduleObject.exports, context.__webpack_require__);
|
|
20
20
|
}
|
|
21
21
|
catch (e) {
|
|
22
|
-
|
|
22
|
+
const err = e instanceof Error ? e : new Error(e);
|
|
23
23
|
err.stack += printGeneratedCodeForStack(moduleObject.id, source);
|
|
24
24
|
throw err;
|
|
25
25
|
}
|
package/dist/FileSystem.js
CHANGED
|
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.ThreadsafeWritableNodeFS = void 0;
|
|
7
|
-
const
|
|
7
|
+
const node_util_1 = __importDefault(require("node:util"));
|
|
8
8
|
const fs_1 = require("./util/fs");
|
|
9
9
|
const memoize_1 = require("./util/memoize");
|
|
10
10
|
const NOOP_FILESYSTEM = {
|
|
@@ -21,11 +21,11 @@ class ThreadsafeWritableNodeFS {
|
|
|
21
21
|
Object.assign(this, NOOP_FILESYSTEM);
|
|
22
22
|
return;
|
|
23
23
|
}
|
|
24
|
-
this.writeFile = (0, memoize_1.memoizeFn)(() =>
|
|
25
|
-
this.removeFile = (0, memoize_1.memoizeFn)(() =>
|
|
26
|
-
this.mkdir = (0, memoize_1.memoizeFn)(() =>
|
|
27
|
-
this.mkdirp = (0, memoize_1.memoizeFn)(() =>
|
|
28
|
-
this.removeDirAll = (0, memoize_1.memoizeFn)(() =>
|
|
24
|
+
this.writeFile = (0, memoize_1.memoizeFn)(() => node_util_1.default.promisify(fs.writeFile.bind(fs)));
|
|
25
|
+
this.removeFile = (0, memoize_1.memoizeFn)(() => node_util_1.default.promisify(fs.unlink.bind(fs)));
|
|
26
|
+
this.mkdir = (0, memoize_1.memoizeFn)(() => node_util_1.default.promisify(fs.mkdir.bind(fs)));
|
|
27
|
+
this.mkdirp = (0, memoize_1.memoizeFn)(() => node_util_1.default.promisify(fs_1.mkdirp.bind(null, fs)));
|
|
28
|
+
this.removeDirAll = (0, memoize_1.memoizeFn)(() => node_util_1.default.promisify(fs_1.rmrf.bind(null, fs)));
|
|
29
29
|
}
|
|
30
30
|
static __to_binding(fs) {
|
|
31
31
|
return new this(fs);
|
package/dist/Module.d.ts
CHANGED
package/dist/Module.js
CHANGED
|
@@ -10,7 +10,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
10
10
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
11
11
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
12
12
|
};
|
|
13
|
-
var _Module_inner, _Module_originalSource, _CodeGenerationResult_inner
|
|
13
|
+
var _Module_inner, _Module_originalSource, _CodeGenerationResult_inner;
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.CodeGenerationResults = exports.CodeGenerationResult = exports.Module = void 0;
|
|
16
16
|
const source_1 = require("./util/source");
|
|
@@ -70,10 +70,6 @@ class CodeGenerationResult {
|
|
|
70
70
|
exports.CodeGenerationResult = CodeGenerationResult;
|
|
71
71
|
_CodeGenerationResult_inner = new WeakMap();
|
|
72
72
|
class CodeGenerationResults {
|
|
73
|
-
constructor(
|
|
74
|
-
_CodeGenerationResults_inner.set(this, void 0);
|
|
75
|
-
__classPrivateFieldSet(this, _CodeGenerationResults_inner, result, "f");
|
|
76
|
-
}
|
|
73
|
+
constructor(_result) { }
|
|
77
74
|
}
|
|
78
75
|
exports.CodeGenerationResults = CodeGenerationResults;
|
|
79
|
-
_CodeGenerationResults_inner = new WeakMap();
|
package/dist/MultiCompiler.js
CHANGED
|
@@ -67,7 +67,7 @@ class MultiCompiler {
|
|
|
67
67
|
};
|
|
68
68
|
this.compilers = compilers;
|
|
69
69
|
this._options = {
|
|
70
|
-
parallelism: options?.parallelism ||
|
|
70
|
+
parallelism: options?.parallelism || Number.POSITIVE_INFINITY
|
|
71
71
|
};
|
|
72
72
|
this.dependencies = new WeakMap();
|
|
73
73
|
this.running = false;
|
package/dist/NormalModule.js
CHANGED
|
@@ -27,7 +27,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
exports.NormalModule = void 0;
|
|
30
|
-
const
|
|
30
|
+
const node_util_1 = __importDefault(require("node:util"));
|
|
31
31
|
const liteTapable = __importStar(require("@rspack/lite-tapable"));
|
|
32
32
|
const Compilation_1 = require("./Compilation");
|
|
33
33
|
const compilationHooksMap = new WeakMap();
|
|
@@ -45,14 +45,14 @@ const deprecateAllProperties = (obj, message, code) => {
|
|
|
45
45
|
if (typeof descriptor.value === "function") {
|
|
46
46
|
Object.defineProperty(newObj, name, {
|
|
47
47
|
...descriptor,
|
|
48
|
-
value:
|
|
48
|
+
value: node_util_1.default.deprecate(descriptor.value, message, code)
|
|
49
49
|
});
|
|
50
50
|
}
|
|
51
51
|
else if (descriptor.get || descriptor.set) {
|
|
52
52
|
Object.defineProperty(newObj, name, {
|
|
53
53
|
...descriptor,
|
|
54
|
-
get: descriptor.get &&
|
|
55
|
-
set: descriptor.set &&
|
|
54
|
+
get: descriptor.get && node_util_1.default.deprecate(descriptor.get, message, code),
|
|
55
|
+
set: descriptor.set && node_util_1.default.deprecate(descriptor.set, message, code)
|
|
56
56
|
});
|
|
57
57
|
}
|
|
58
58
|
else {
|
|
@@ -60,9 +60,9 @@ const deprecateAllProperties = (obj, message, code) => {
|
|
|
60
60
|
Object.defineProperty(newObj, name, {
|
|
61
61
|
configurable: descriptor.configurable,
|
|
62
62
|
enumerable: descriptor.enumerable,
|
|
63
|
-
get:
|
|
63
|
+
get: node_util_1.default.deprecate(() => value, message, code),
|
|
64
64
|
set: descriptor.writable
|
|
65
|
-
?
|
|
65
|
+
? node_util_1.default.deprecate((v) => (value = v), message, code)
|
|
66
66
|
: undefined
|
|
67
67
|
});
|
|
68
68
|
}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import * as binding from "@rspack/binding";
|
|
2
2
|
import { Resolver } from "./Resolver";
|
|
3
|
-
type
|
|
3
|
+
import { type Resolve } from "./config";
|
|
4
|
+
type ResolveOptionsWithDependencyType = Resolve & {
|
|
5
|
+
dependencyCategory?: string;
|
|
6
|
+
resolveToContext?: boolean;
|
|
7
|
+
};
|
|
4
8
|
export declare class ResolverFactory {
|
|
5
9
|
#private;
|
|
6
10
|
static __to_binding(resolver_factory: ResolverFactory): binding.JsResolverFactory;
|
package/dist/ResolverFactory.js
CHANGED
|
@@ -38,6 +38,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
38
38
|
exports.ResolverFactory = void 0;
|
|
39
39
|
const binding = __importStar(require("@rspack/binding"));
|
|
40
40
|
const Resolver_1 = require("./Resolver");
|
|
41
|
+
const config_1 = require("./config");
|
|
41
42
|
class ResolverFactory {
|
|
42
43
|
static __to_binding(resolver_factory) {
|
|
43
44
|
return __classPrivateFieldGet(resolver_factory, _ResolverFactory_binding, "f");
|
|
@@ -47,7 +48,12 @@ class ResolverFactory {
|
|
|
47
48
|
__classPrivateFieldSet(this, _ResolverFactory_binding, new binding.JsResolverFactory(), "f");
|
|
48
49
|
}
|
|
49
50
|
get(type, resolveOptions) {
|
|
50
|
-
const
|
|
51
|
+
const { dependencyCategory, resolveToContext, ...resolve } = resolveOptions || {};
|
|
52
|
+
const binding = __classPrivateFieldGet(this, _ResolverFactory_binding, "f").get(type, {
|
|
53
|
+
...(0, config_1.getRawResolve)(resolve),
|
|
54
|
+
dependencyCategory,
|
|
55
|
+
resolveToContext
|
|
56
|
+
});
|
|
51
57
|
return new Resolver_1.Resolver(binding);
|
|
52
58
|
}
|
|
53
59
|
}
|
package/dist/RuntimeGlobals.js
CHANGED
|
@@ -13,7 +13,7 @@ exports.RuntimeGlobals = exports.__to_binding_runtime_globals = exports.__from_b
|
|
|
13
13
|
const REVERSE_RUNTIME_GLOBALS = new Map();
|
|
14
14
|
function __from_binding_runtime_globals(runtimeRequirements) {
|
|
15
15
|
const res = new Set();
|
|
16
|
-
for (
|
|
16
|
+
for (const flag of runtimeRequirements.value) {
|
|
17
17
|
if (flag in exports.RuntimeGlobals) {
|
|
18
18
|
res.add(exports.RuntimeGlobals[flag]);
|
|
19
19
|
}
|
|
@@ -28,7 +28,7 @@ function __to_binding_runtime_globals(runtimeRequirements) {
|
|
|
28
28
|
const res = {
|
|
29
29
|
value: []
|
|
30
30
|
};
|
|
31
|
-
for (
|
|
31
|
+
for (const flag of Array.from(runtimeRequirements)) {
|
|
32
32
|
const item = REVERSE_RUNTIME_GLOBALS.get(flag);
|
|
33
33
|
if (typeof item === "string") {
|
|
34
34
|
res.value.push(item);
|
|
@@ -352,6 +352,6 @@ exports.RuntimeGlobals = {
|
|
|
352
352
|
*/
|
|
353
353
|
asyncModule: "__webpack_require__.a"
|
|
354
354
|
};
|
|
355
|
-
for (
|
|
355
|
+
for (const entry of Object.entries(exports.RuntimeGlobals)) {
|
|
356
356
|
REVERSE_RUNTIME_GLOBALS.set(entry[1], entry[0]);
|
|
357
357
|
}
|
package/dist/Stats.js
CHANGED
|
@@ -102,7 +102,7 @@ function normalizeStatsPreset(options) {
|
|
|
102
102
|
else if (!options)
|
|
103
103
|
return {};
|
|
104
104
|
else {
|
|
105
|
-
|
|
105
|
+
const obj = { ...presetToOptions(options.preset), ...options };
|
|
106
106
|
delete obj.preset;
|
|
107
107
|
return obj;
|
|
108
108
|
}
|
|
@@ -118,15 +118,15 @@ function presetToOptions(name) {
|
|
|
118
118
|
case "verbose":
|
|
119
119
|
return {
|
|
120
120
|
all: true,
|
|
121
|
-
modulesSpace:
|
|
121
|
+
modulesSpace: Number.POSITIVE_INFINITY
|
|
122
122
|
};
|
|
123
123
|
case "errors-only":
|
|
124
124
|
return {
|
|
125
125
|
all: false,
|
|
126
126
|
errors: true,
|
|
127
127
|
errorsCount: true,
|
|
128
|
-
logging: "error"
|
|
129
|
-
|
|
128
|
+
logging: "error",
|
|
129
|
+
moduleTrace: true
|
|
130
130
|
};
|
|
131
131
|
case "errors-warnings":
|
|
132
132
|
return {
|
package/dist/Template.js
CHANGED
|
@@ -246,8 +246,8 @@ class Template {
|
|
|
246
246
|
* or false if not every module has a number based id
|
|
247
247
|
*/
|
|
248
248
|
static getModulesArrayBounds(modules) {
|
|
249
|
-
let maxId =
|
|
250
|
-
let minId =
|
|
249
|
+
let maxId = Number.NEGATIVE_INFINITY;
|
|
250
|
+
let minId = Number.POSITIVE_INFINITY;
|
|
251
251
|
for (const module of modules) {
|
|
252
252
|
const moduleId = module.id;
|
|
253
253
|
if (typeof moduleId !== "number")
|
package/dist/Watching.js
CHANGED
|
@@ -25,7 +25,7 @@ exports.Watching = void 0;
|
|
|
25
25
|
* Copyright (c) JS Foundation and other contributors
|
|
26
26
|
* https://github.com/webpack/webpack/blob/main/LICENSE
|
|
27
27
|
*/
|
|
28
|
-
const
|
|
28
|
+
const node_assert_1 = __importDefault(require("node:assert"));
|
|
29
29
|
const _1 = require(".");
|
|
30
30
|
class Watching {
|
|
31
31
|
constructor(compiler, watchOptions, handler) {
|
|
@@ -186,7 +186,7 @@ class Watching {
|
|
|
186
186
|
if (error) {
|
|
187
187
|
return handleError(error);
|
|
188
188
|
}
|
|
189
|
-
(0,
|
|
189
|
+
(0, node_assert_1.default)(compilation);
|
|
190
190
|
compilation.startTime = startTime;
|
|
191
191
|
compilation.endTime = Date.now();
|
|
192
192
|
stats = new _1.Stats(compilation);
|
|
@@ -4,7 +4,7 @@ exports.DefinePlugin = void 0;
|
|
|
4
4
|
const binding_1 = require("@rspack/binding");
|
|
5
5
|
const base_1 = require("./base");
|
|
6
6
|
exports.DefinePlugin = (0, base_1.create)(binding_1.BuiltinPluginName.DefinePlugin, function (define) {
|
|
7
|
-
|
|
7
|
+
const supportsBigIntLiteral = this.options.output.environment?.bigIntLiteral ?? false;
|
|
8
8
|
return normalizeValue(define, supportsBigIntLiteral);
|
|
9
9
|
}, "compilation");
|
|
10
10
|
const normalizeValue = (define, supportsBigIntLiteral) => {
|
|
@@ -37,7 +37,7 @@ const normalizeValue = (define, supportsBigIntLiteral) => {
|
|
|
37
37
|
return normalizePrimitive(define);
|
|
38
38
|
}
|
|
39
39
|
else if (define && typeof define === "object") {
|
|
40
|
-
|
|
40
|
+
const keys = Object.keys(define);
|
|
41
41
|
return Object.fromEntries(keys.map(k => [k, normalizeObject(define[k])]));
|
|
42
42
|
}
|
|
43
43
|
else {
|
|
@@ -6,7 +6,7 @@ const config_1 = require("../config");
|
|
|
6
6
|
const util_1 = require("../util");
|
|
7
7
|
const base_1 = require("./base");
|
|
8
8
|
exports.EntryPlugin = (0, base_1.create)(binding_1.BuiltinPluginName.EntryPlugin, (context, entry, options = "") => {
|
|
9
|
-
|
|
9
|
+
const entryOptions = typeof options === "string" ? { name: options } : options;
|
|
10
10
|
return {
|
|
11
11
|
context,
|
|
12
12
|
entry,
|