diff --git a/packages/bundler-webpack/compiled/webpack/index.js b/packages/bundler-webpack/compiled/webpack/index.js index 96ca95ebf419..d5855214351e 100644 --- a/packages/bundler-webpack/compiled/webpack/index.js +++ b/packages/bundler-webpack/compiled/webpack/index.js @@ -1,7 +1,7 @@ /******/ (function() { // webpackBootstrap /******/ var __webpack_modules__ = ({ -/***/ 72363: +/***/ 16128: /***/ (function(__unused_webpack_module, exports) { "use strict"; @@ -13,12 +13,13 @@ Object.defineProperty(exports, "__esModule", ({ exports.cloneNode = cloneNode; function cloneNode(n) { + // $FlowIgnore return Object.assign({}, n); } /***/ }), -/***/ 51606: +/***/ 75974: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; @@ -114,11 +115,12 @@ Object.defineProperty(exports, "moduleContextFromModuleAST", ({ } })); -var _nodes = __webpack_require__(2073); +var _nodes = __webpack_require__(65513); Object.keys(_nodes).forEach(function (key) { if (key === "default" || key === "__esModule") return; if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; + if (key in exports && exports[key] === _nodes[key]) return; Object.defineProperty(exports, key, { enumerable: true, get: function get() { @@ -127,17 +129,18 @@ Object.keys(_nodes).forEach(function (key) { }); }); -var _nodeHelpers = __webpack_require__(21801); +var _nodeHelpers = __webpack_require__(37772); -var _traverse = __webpack_require__(36767); +var _traverse = __webpack_require__(58234); -var _signatures = __webpack_require__(58430); +var _signatures = __webpack_require__(51806); -var _utils = __webpack_require__(18945); +var _utils = __webpack_require__(73549); Object.keys(_utils).forEach(function (key) { if (key === "default" || key === "__esModule") return; if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; + if (key in exports && exports[key] === _utils[key]) return; Object.defineProperty(exports, key, { enumerable: true, get: function get() { @@ -146,13 +149,13 @@ Object.keys(_utils).forEach(function (key) { }); }); -var _clone = __webpack_require__(72363); +var _clone = __webpack_require__(16128); -var _astModuleToModuleContext = __webpack_require__(77980); +var _astModuleToModuleContext = __webpack_require__(30385); /***/ }), -/***/ 21801: +/***/ 37772: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; @@ -170,9 +173,9 @@ exports.funcParam = funcParam; exports.indexLiteral = indexLiteral; exports.memIndexLiteral = memIndexLiteral; -var _helperNumbers = __webpack_require__(53854); +var _helperNumbers = __webpack_require__(21074); -var _nodes = __webpack_require__(2073); +var _nodes = __webpack_require__(65513); function numberLiteralFromRaw(rawValue) { var instructionType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "i32"; @@ -266,7 +269,7 @@ function memIndexLiteral(value) { /***/ }), -/***/ 93814: +/***/ 89754: /***/ (function(__unused_webpack_module, exports) { "use strict"; @@ -277,7 +280,11 @@ Object.defineProperty(exports, "__esModule", ({ })); exports.createPath = createPath; -function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function findParent(_ref, cb) { var parentPath = _ref.parentPath; @@ -407,7 +414,7 @@ function createPathOperations(context) { } function createPath(context) { - var path = _extends({}, context); // $FlowIgnore + var path = _objectSpread({}, context); // $FlowIgnore Object.assign(path, createPathOperations(path)); // $FlowIgnore @@ -417,7 +424,7 @@ function createPath(context) { /***/ }), -/***/ 2073: +/***/ 65513: /***/ (function(__unused_webpack_module, exports) { "use strict"; @@ -476,7 +483,7 @@ exports.internalEndAndReturn = internalEndAndReturn; exports.assertInternalCallExtern = exports.assertInternalGoto = exports.assertInternalBrUnless = exports.assertFunc = exports.assertByteArray = exports.assertCallIndirectInstruction = exports.assertCallInstruction = exports.assertBlockInstruction = exports.assertIdentifier = exports.assertProgram = exports.assertSignature = exports.assertLimit = exports.assertModuleExport = exports.assertModuleExportDescr = exports.assertModuleImport = exports.assertFuncImportDescr = exports.assertMemory = exports.assertTable = exports.assertGlobal = exports.assertData = exports.assertBlockComment = exports.assertLeadingComment = exports.assertGlobalType = exports.assertStart = exports.assertTypeInstruction = exports.assertValtypeLiteral = exports.assertIndexInFuncSection = exports.assertElem = exports.assertFloatLiteral = exports.assertLongNumberLiteral = exports.assertNumberLiteral = exports.assertStringLiteral = exports.assertIfInstruction = exports.assertInstr = exports.assertLoopInstruction = exports.assertProducerMetadataVersionedName = exports.assertProducerMetadata = exports.assertProducersSectionMetadata = exports.assertSectionMetadata = exports.assertQuoteModule = exports.assertBinaryModule = exports.assertLocalNameMetadata = exports.assertFunctionNameMetadata = exports.assertModuleNameMetadata = exports.assertModuleMetadata = exports.assertModule = exports.isIntrinsic = exports.isImportDescr = exports.isNumericLiteral = exports.isExpression = exports.isInstruction = exports.isBlock = exports.isNode = exports.isInternalEndAndReturn = exports.isInternalCallExtern = exports.isInternalGoto = exports.isInternalBrUnless = exports.isFunc = exports.isByteArray = exports.isCallIndirectInstruction = exports.isCallInstruction = exports.isBlockInstruction = exports.isIdentifier = exports.isProgram = exports.isSignature = exports.isLimit = exports.isModuleExport = exports.isModuleExportDescr = exports.isModuleImport = exports.isFuncImportDescr = exports.isMemory = exports.isTable = exports.isGlobal = exports.isData = exports.isBlockComment = exports.isLeadingComment = exports.isGlobalType = exports.isStart = exports.isTypeInstruction = exports.isValtypeLiteral = exports.isIndexInFuncSection = exports.isElem = exports.isFloatLiteral = exports.isLongNumberLiteral = exports.isNumberLiteral = exports.isStringLiteral = exports.isIfInstruction = exports.isInstr = exports.isLoopInstruction = exports.isProducerMetadataVersionedName = exports.isProducerMetadata = exports.isProducersSectionMetadata = exports.isSectionMetadata = exports.isQuoteModule = exports.isBinaryModule = exports.isLocalNameMetadata = exports.isFunctionNameMetadata = exports.isModuleNameMetadata = exports.isModuleMetadata = exports.isModule = void 0; exports.nodeAndUnionTypes = exports.unionTypesMap = exports.assertInternalEndAndReturn = void 0; -function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } +function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } // THIS FILE IS AUTOGENERATED // see scripts/generateNodeUtils.js @@ -1568,7 +1575,7 @@ exports.nodeAndUnionTypes = nodeAndUnionTypes; /***/ }), -/***/ 58430: +/***/ 51806: /***/ (function(__unused_webpack_module, exports) { "use strict"; @@ -1606,7 +1613,7 @@ var controlInstructions = { br: sign([u32], []), br_if: sign([u32], []), br_table: sign(vector(u32), []), - return: sign([], []), + "return": sign([], []), call: sign([u32], []), call_indirect: sign([u32], []) }; @@ -1782,7 +1789,7 @@ exports.signatures = signatures; /***/ }), -/***/ 77980: +/***/ 30385: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; @@ -1794,7 +1801,7 @@ Object.defineProperty(exports, "__esModule", ({ exports.moduleContextFromModuleAST = moduleContextFromModuleAST; exports.ModuleContext = void 0; -var _nodes = __webpack_require__(2073); +var _nodes = __webpack_require__(65513); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } @@ -1883,9 +1890,7 @@ function moduleContextFromModuleAST(m) { */ -var ModuleContext = -/*#__PURE__*/ -function () { +var ModuleContext = /*#__PURE__*/function () { function ModuleContext() { _classCallCheck(this, ModuleContext); @@ -1898,7 +1903,7 @@ function () { this.locals = []; this.labels = []; - this.return = []; + this["return"] = []; this.debugName = "unknown"; this.start = null; } @@ -1930,7 +1935,7 @@ function () { value: function newContext(debugName, expectedResult) { this.locals = []; this.labels = [expectedResult]; - this.return = expectedResult; + this["return"] = expectedResult; this.debugName = debugName; } /** @@ -1939,15 +1944,16 @@ function () { }, { key: "addFunction", - value: function addFunction(func - /*: Func*/ - ) { - // eslint-disable-next-line prefer-const + value: function addFunction(func) { + /* eslint-disable */ + // $FlowIgnore var _ref = func.signature || {}, _ref$params = _ref.params, args = _ref$params === void 0 ? [] : _ref$params, _ref$results = _ref.results, result = _ref$results === void 0 ? [] : _ref$results; + /* eslint-enable */ + args = args.map(function (arg) { return arg.valtype; @@ -1958,6 +1964,7 @@ function () { }); if (typeof func.name !== "undefined") { + // $FlowIgnore this.funcsOffsetByIdentifier[func.name.value] = this.funcs.length - 1; } } @@ -2111,13 +2118,12 @@ function () { throw new Error('typeof name === "string"' + " error: " + (undefined || "unknown")); } + // $FlowIgnore return this.globalsOffsetByIdentifier[name]; } }, { key: "defineGlobal", - value: function defineGlobal(global - /*: Global*/ - ) { + value: function defineGlobal(global) { var type = global.globalType.valtype; var mutability = global.globalType.mutability; this.globals.push({ @@ -2126,6 +2132,7 @@ function () { }); if (typeof global.name !== "undefined") { + // $FlowIgnore this.globalsOffsetByIdentifier[global.name.value] = this.globals.length - 1; } } @@ -2178,7 +2185,7 @@ exports.ModuleContext = ModuleContext; /***/ }), -/***/ 36767: +/***/ 58234: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; @@ -2189,9 +2196,9 @@ Object.defineProperty(exports, "__esModule", ({ })); exports.traverse = traverse; -var _nodePath = __webpack_require__(93814); +var _nodePath = __webpack_require__(89754); -var _nodes = __webpack_require__(2073); +var _nodes = __webpack_require__(65513); // recursively walks the AST starting at the given node. The callback is invoked for // and object that has a 'type' property. @@ -2290,7 +2297,7 @@ function traverse(node, visitors) { /***/ }), -/***/ 18945: +/***/ 73549: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; @@ -2316,19 +2323,29 @@ exports.getFunctionBeginingByteOffset = getFunctionBeginingByteOffset; exports.getEndBlockByteOffset = getEndBlockByteOffset; exports.getStartBlockByteOffset = getStartBlockByteOffset; -var _signatures = __webpack_require__(58430); +var _signatures = __webpack_require__(51806); + +var _traverse = __webpack_require__(58234); + +var _helperWasmBytecode = _interopRequireWildcard(__webpack_require__(13345)); + +function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } -var _traverse = __webpack_require__(36767); +function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; } -var _helperWasmBytecode = _interopRequireWildcard(__webpack_require__(10845)); +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function _sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } -function _slicedToArray(arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return _sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } } +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } -function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } +function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } + +function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } + +function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function isAnonymous(ident) { return ident.raw === ""; @@ -2390,8 +2407,8 @@ function sortSectionMetadata(m) { m.metadata.sections.sort(function (a, b) { - var aId = _helperWasmBytecode.default.sections[a.section]; - var bId = _helperWasmBytecode.default.sections[b.section]; + var aId = _helperWasmBytecode["default"].sections[a.section]; + var bId = _helperWasmBytecode["default"].sections[b.section]; if (typeof aId !== "number" || typeof bId !== "number") { throw new Error("Section id not found"); @@ -2441,8 +2458,7 @@ function assertHasLoc(n) { function getEndOfSection(s) { assertHasLoc(s.size); - return s.startOffset + s.size.value + ( // $FlowIgnore - s.size.loc.end.column - s.size.loc.start.column); + return s.startOffset + s.size.value + (s.size.loc.end.column - s.size.loc.start.column); } function shiftLoc(node, delta) { @@ -2603,7 +2619,7 @@ function getStartBlockByteOffset(n) { /***/ }), -/***/ 53310: +/***/ 24160: /***/ (function(__unused_webpack_module, exports) { "use strict"; @@ -2659,76 +2675,92 @@ function parse(input) { /***/ }), -/***/ 80102: +/***/ 2292: /***/ (function(__unused_webpack_module, exports) { "use strict"; +function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + Object.defineProperty(exports, "__esModule", ({ value: true })); exports.LinkError = exports.CompileError = exports.RuntimeError = void 0; -function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } -function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } + +function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } + +function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); } + +function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } + +function _wrapNativeSuper(Class) { var _cache = typeof Map === "function" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== "function") { throw new TypeError("Super expression must either be null or a function"); } if (typeof _cache !== "undefined") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); } + +function _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); } + +function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } + +function _isNativeFunction(fn) { return Function.toString.call(fn).indexOf("[native code]") !== -1; } -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } +function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } -var RuntimeError = -/*#__PURE__*/ -function (_Error) { +function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } + +var RuntimeError = /*#__PURE__*/function (_Error) { _inherits(RuntimeError, _Error); + var _super = _createSuper(RuntimeError); + function RuntimeError() { _classCallCheck(this, RuntimeError); - return _possibleConstructorReturn(this, (RuntimeError.__proto__ || Object.getPrototypeOf(RuntimeError)).apply(this, arguments)); + return _super.apply(this, arguments); } return RuntimeError; -}(Error); +}( /*#__PURE__*/_wrapNativeSuper(Error)); exports.RuntimeError = RuntimeError; -var CompileError = -/*#__PURE__*/ -function (_Error2) { +var CompileError = /*#__PURE__*/function (_Error2) { _inherits(CompileError, _Error2); + var _super2 = _createSuper(CompileError); + function CompileError() { _classCallCheck(this, CompileError); - return _possibleConstructorReturn(this, (CompileError.__proto__ || Object.getPrototypeOf(CompileError)).apply(this, arguments)); + return _super2.apply(this, arguments); } return CompileError; -}(Error); +}( /*#__PURE__*/_wrapNativeSuper(Error)); exports.CompileError = CompileError; -var LinkError = -/*#__PURE__*/ -function (_Error3) { +var LinkError = /*#__PURE__*/function (_Error3) { _inherits(LinkError, _Error3); + var _super3 = _createSuper(LinkError); + function LinkError() { _classCallCheck(this, LinkError); - return _possibleConstructorReturn(this, (LinkError.__proto__ || Object.getPrototypeOf(LinkError)).apply(this, arguments)); + return _super3.apply(this, arguments); } return LinkError; -}(Error); +}( /*#__PURE__*/_wrapNativeSuper(Error)); exports.LinkError = LinkError; /***/ }), -/***/ 68159: +/***/ 1874: /***/ (function(__unused_webpack_module, exports) { "use strict"; @@ -2741,7 +2773,17 @@ exports.overrideBytesInBuffer = overrideBytesInBuffer; exports.makeBuffer = makeBuffer; exports.fromHexdump = fromHexdump; -function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } +function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } + +function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } + +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } + +function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } + +function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } + +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } function concatUint8Arrays() { for (var _len = arguments.length, arrays = new Array(_len), _key = 0; _key < _len; _key++) { @@ -2754,8 +2796,8 @@ function concatUint8Arrays() { var result = new Uint8Array(totalLength); var offset = 0; - for (var _i = 0; _i < arrays.length; _i++) { - var arr = arrays[_i]; + for (var _i = 0, _arrays = arrays; _i < _arrays.length; _i++) { + var arr = _arrays[_i]; if (arr instanceof Uint8Array === false) { throw new Error("arr must be of type Uint8Array"); @@ -2785,6 +2827,7 @@ function makeBuffer() { splitedBytes[_key2] = arguments[_key2]; } + // $FlowIgnore var bytes = [].concat.apply([], splitedBytes); return new Uint8Array(bytes).buffer; } @@ -2813,7 +2856,7 @@ function fromHexdump(str) { /***/ }), -/***/ 53854: +/***/ 21074: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; @@ -2830,17 +2873,17 @@ exports.parse64I = parse64I; exports.isInfLiteral = isInfLiteral; exports.isNanLiteral = isNanLiteral; -var _long = _interopRequireDefault(__webpack_require__(33527)); +var _long2 = _interopRequireDefault(__webpack_require__(33527)); -var _floatingPointHexParser = _interopRequireDefault(__webpack_require__(53310)); +var _floatingPointHexParser = _interopRequireDefault(__webpack_require__(24160)); -var _helperApiError = __webpack_require__(80102); +var _helperApiError = __webpack_require__(2292); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } function parse32F(sourceString) { if (isHexLiteral(sourceString)) { - return (0, _floatingPointHexParser.default)(sourceString); + return (0, _floatingPointHexParser["default"])(sourceString); } if (isInfLiteral(sourceString)) { @@ -2856,7 +2899,7 @@ function parse32F(sourceString) { function parse64F(sourceString) { if (isHexLiteral(sourceString)) { - return (0, _floatingPointHexParser.default)(sourceString); + return (0, _floatingPointHexParser["default"])(sourceString); } if (isInfLiteral(sourceString)) { @@ -2868,7 +2911,7 @@ function parse64F(sourceString) { } if (isHexLiteral(sourceString)) { - return (0, _floatingPointHexParser.default)(sourceString); + return (0, _floatingPointHexParser["default"])(sourceString); } return parseFloat(sourceString); @@ -2899,19 +2942,20 @@ function parseU32(sourceString) { } function parse64I(sourceString) { - var long; + // $FlowIgnore + var _long; if (isHexLiteral(sourceString)) { - long = _long.default.fromString(sourceString, false, 16); + _long = _long2["default"].fromString(sourceString, false, 16); } else if (isDecimalExponentLiteral(sourceString)) { throw new Error("This number literal format is yet to be implemented."); } else { - long = _long.default.fromString(sourceString); + _long = _long2["default"].fromString(sourceString); } return { - high: long.high, - low: long.low + high: _long.high, + low: _long.low }; } @@ -2936,7 +2980,7 @@ function isHexLiteral(sourceString) { /***/ }), -/***/ 10845: +/***/ 13345: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; @@ -2953,7 +2997,7 @@ Object.defineProperty(exports, "getSectionForNode", ({ })); exports["default"] = void 0; -var _section = __webpack_require__(56874); +var _section = __webpack_require__(1119); var illegalop = "illegal"; var magicModuleHeader = [0x00, 0x61, 0x73, 0x6d]; @@ -3011,7 +3055,7 @@ var types = { var exportTypes = { 0x00: "Func", 0x01: "Table", - 0x02: "Mem", + 0x02: "Memory", 0x03: "Global" }; var exportTypesByName = invertMap(exportTypes); @@ -3043,18 +3087,18 @@ var globalTypesByString = invertMap(globalTypes); var importTypes = { 0x00: "func", 0x01: "table", - 0x02: "mem", + 0x02: "memory", 0x03: "global" }; var sections = { custom: 0, type: 1, - import: 2, + "import": 2, func: 3, table: 4, memory: 5, global: 6, - export: 7, + "export": 7, start: 8, element: 9, code: 10, @@ -3349,7 +3393,7 @@ exports["default"] = _default; /***/ }), -/***/ 56874: +/***/ 1119: /***/ (function(__unused_webpack_module, exports) { "use strict"; @@ -3394,7 +3438,7 @@ function getSectionForNode(n) { /***/ }), -/***/ 29945: +/***/ 2340: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; @@ -3405,22 +3449,24 @@ Object.defineProperty(exports, "__esModule", ({ })); exports.createEmptySection = createEmptySection; -var _wasmGen = __webpack_require__(37576); +var _wasmGen = __webpack_require__(2554); -var _helperBuffer = __webpack_require__(68159); +var _helperBuffer = __webpack_require__(1874); -var _helperWasmBytecode = _interopRequireDefault(__webpack_require__(10845)); +var _helperWasmBytecode = _interopRequireDefault(__webpack_require__(13345)); -var t = _interopRequireWildcard(__webpack_require__(51606)); +var t = _interopRequireWildcard(__webpack_require__(75974)); -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } +function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; } + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } -function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } +function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function findLastSection(ast, forSection) { - var targetSectionId = _helperWasmBytecode.default.sections[forSection]; // $FlowIgnore: metadata can not be empty + var targetSectionId = _helperWasmBytecode["default"].sections[forSection]; // $FlowIgnore: metadata can not be empty var moduleSections = ast.body[0].metadata.sections; var lastSection; @@ -3433,7 +3479,7 @@ function findLastSection(ast, forSection) { continue; } - var sectionId = _helperWasmBytecode.default.sections[section.section]; + var sectionId = _helperWasmBytecode["default"].sections[section.section]; if (targetSectionId > lastId && targetSectionId < sectionId) { return lastSection; @@ -3522,7 +3568,7 @@ function createEmptySection(ast, uint8Buffer, section) { /***/ }), -/***/ 91360: +/***/ 906: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; @@ -3556,15 +3602,15 @@ Object.defineProperty(exports, "removeSections", ({ } })); -var _resize = __webpack_require__(36937); +var _resize = __webpack_require__(40972); -var _create = __webpack_require__(29945); +var _create = __webpack_require__(2340); -var _remove = __webpack_require__(28531); +var _remove = __webpack_require__(5450); /***/ }), -/***/ 28531: +/***/ 5450: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; @@ -3575,9 +3621,9 @@ Object.defineProperty(exports, "__esModule", ({ })); exports.removeSections = removeSections; -var _ast = __webpack_require__(51606); +var _ast = __webpack_require__(75974); -var _helperBuffer = __webpack_require__(68159); +var _helperBuffer = __webpack_require__(1874); function removeSections(ast, uint8Buffer, section) { var sectionMetadatas = (0, _ast.getSectionMetadatas)(ast, section); @@ -3616,7 +3662,7 @@ function removeSections(ast, uint8Buffer, section) { /***/ }), -/***/ 36937: +/***/ 40972: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; @@ -3628,11 +3674,11 @@ Object.defineProperty(exports, "__esModule", ({ exports.resizeSectionByteSize = resizeSectionByteSize; exports.resizeSectionVecSize = resizeSectionVecSize; -var _wasmGen = __webpack_require__(37576); +var _wasmGen = __webpack_require__(2554); -var _ast = __webpack_require__(51606); +var _ast = __webpack_require__(75974); -var _helperBuffer = __webpack_require__(68159); +var _helperBuffer = __webpack_require__(1874); function resizeSectionByteSize(ast, uint8Buffer, section, deltaBytes) { var sectionMetadata = (0, _ast.getSectionMetadata)(ast, section); @@ -3713,7 +3759,7 @@ function resizeSectionVecSize(ast, uint8Buffer, section, deltaElements) { /***/ }), -/***/ 34903: +/***/ 71140: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; @@ -3772,7 +3818,7 @@ function decodeF64(bytes) { /***/ }), -/***/ 30945: +/***/ 40885: /***/ (function(__unused_webpack_module, exports) { "use strict"; @@ -3935,7 +3981,7 @@ function highOrder(bit, buffer) { /***/ }), -/***/ 38569: +/***/ 2438: /***/ (function(__unused_webpack_module, exports) { "use strict"; @@ -4178,7 +4224,7 @@ function writeUInt64(value, buffer) { /***/ }), -/***/ 58646: +/***/ 64034: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; @@ -4196,9 +4242,9 @@ exports.encodeI32 = encodeI32; exports.encodeI64 = encodeI64; exports.MAX_NUMBER_OF_BYTE_U64 = exports.MAX_NUMBER_OF_BYTE_U32 = void 0; -var _leb = _interopRequireDefault(__webpack_require__(92691)); +var _leb = _interopRequireDefault(__webpack_require__(12218)); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } /** * According to https://webassembly.github.io/spec/core/binary/values.html#binary-int @@ -4215,36 +4261,36 @@ var MAX_NUMBER_OF_BYTE_U64 = 10; exports.MAX_NUMBER_OF_BYTE_U64 = MAX_NUMBER_OF_BYTE_U64; function decodeInt64(encodedBuffer, index) { - return _leb.default.decodeInt64(encodedBuffer, index); + return _leb["default"].decodeInt64(encodedBuffer, index); } function decodeUInt64(encodedBuffer, index) { - return _leb.default.decodeUInt64(encodedBuffer, index); + return _leb["default"].decodeUInt64(encodedBuffer, index); } function decodeInt32(encodedBuffer, index) { - return _leb.default.decodeInt32(encodedBuffer, index); + return _leb["default"].decodeInt32(encodedBuffer, index); } function decodeUInt32(encodedBuffer, index) { - return _leb.default.decodeUInt32(encodedBuffer, index); + return _leb["default"].decodeUInt32(encodedBuffer, index); } function encodeU32(v) { - return _leb.default.encodeUInt32(v); + return _leb["default"].encodeUInt32(v); } function encodeI32(v) { - return _leb.default.encodeInt32(v); + return _leb["default"].encodeInt32(v); } function encodeI64(v) { - return _leb.default.encodeInt64(v); + return _leb["default"].encodeInt64(v); } /***/ }), -/***/ 92691: +/***/ 12218: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; @@ -4259,6 +4305,8 @@ function encodeI64(v) { */ +function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + Object.defineProperty(exports, "__esModule", ({ value: true })); @@ -4266,13 +4314,15 @@ exports["default"] = void 0; var _long = _interopRequireDefault(__webpack_require__(33527)); -var bits = _interopRequireWildcard(__webpack_require__(30945)); +var bits = _interopRequireWildcard(__webpack_require__(40885)); -var bufs = _interopRequireWildcard(__webpack_require__(38569)); +var bufs = _interopRequireWildcard(__webpack_require__(2438)); -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } +function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; } + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } /* * Module variables @@ -4500,9 +4550,16 @@ function encodeInt64(num) { } function decodeInt64(encodedBuffer, index) { - var result = decodeIntBuffer(encodedBuffer, index); + var result = decodeIntBuffer(encodedBuffer, index); // sign-extend if necessary + + var length = result.value.length; + + if (result.value[length - 1] >> 7) { + result.value = bufs.resize(result.value, 8); + result.value.fill(255, length); + } - var value = _long.default.fromBytesLE(result.value, false); + var value = _long["default"].fromBytesLE(result.value, false); bufs.free(result.value); return { @@ -4555,7 +4612,7 @@ function encodeUInt64(num) { function decodeUInt64(encodedBuffer, index) { var result = decodeUIntBuffer(encodedBuffer, index); - var value = _long.default.fromBytesLE(result.value, true); + var value = _long["default"].fromBytesLE(result.value, true); bufs.free(result.value); return { @@ -4583,7 +4640,7 @@ exports["default"] = _default; /***/ }), -/***/ 33919: +/***/ 13867: /***/ (function(__unused_webpack_module, exports) { "use strict"; @@ -4594,10 +4651,6 @@ Object.defineProperty(exports, "__esModule", ({ })); exports.decode = decode; -function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } - -function _toArray(arr) { return Array.isArray(arr) ? arr : Array.from(arr); } - function con(b) { if ((b & 0xc0) === 0x80) { return b & 0x3f; @@ -4621,78 +4674,54 @@ function decode(bytes) { } function _decode(bytes) { - if (bytes.length === 0) { - return []; - } - /** - * 1 byte - */ + var result = []; - - { - var _bytes = _toArray(bytes), - b1 = _bytes[0], - bs = _bytes.slice(1); + while (bytes.length > 0) { + var b1 = bytes[0]; if (b1 < 0x80) { - return [code(0x0, b1)].concat(_toConsumableArray(_decode(bs))); + result.push(code(0x0, b1)); + bytes = bytes.slice(1); + continue; } if (b1 < 0xc0) { throw new Error("invalid UTF-8 encoding"); } - } - /** - * 2 bytes - */ - { - var _bytes2 = _toArray(bytes), - _b = _bytes2[0], - b2 = _bytes2[1], - _bs = _bytes2.slice(2); + var b2 = bytes[1]; - if (_b < 0xe0) { - return [code(0x80, ((_b & 0x1f) << 6) + con(b2))].concat(_toConsumableArray(_decode(_bs))); + if (b1 < 0xe0) { + result.push(code(0x80, ((b1 & 0x1f) << 6) + con(b2))); + bytes = bytes.slice(2); + continue; } - } - /** - * 3 bytes - */ - { - var _bytes3 = _toArray(bytes), - _b2 = _bytes3[0], - _b3 = _bytes3[1], - b3 = _bytes3[2], - _bs2 = _bytes3.slice(3); + var b3 = bytes[2]; - if (_b2 < 0xf0) { - return [code(0x800, ((_b2 & 0x0f) << 12) + (con(_b3) << 6) + con(b3))].concat(_toConsumableArray(_decode(_bs2))); + if (b1 < 0xf0) { + result.push(code(0x800, ((b1 & 0x0f) << 12) + (con(b2) << 6) + con(b3))); + bytes = bytes.slice(3); + continue; } - } - /** - * 4 bytes - */ - { - var _bytes4 = _toArray(bytes), - _b4 = _bytes4[0], - _b5 = _bytes4[1], - _b6 = _bytes4[2], - b4 = _bytes4[3], - _bs3 = _bytes4.slice(4); + var b4 = bytes[3]; - if (_b4 < 0xf8) { - return [code(0x10000, (((_b4 & 0x07) << 18) + con(_b5) << 12) + (con(_b6) << 6) + con(b4))].concat(_toConsumableArray(_decode(_bs3))); + if (b1 < 0xf8) { + result.push(code(0x10000, (((b1 & 0x07) << 18) + con(b2) << 12) + (con(b3) << 6) + con(b4))); + bytes = bytes.slice(4); + continue; } + + throw new Error("invalid UTF-8 encoding"); } - throw new Error("invalid UTF-8 encoding"); + + return result; } /***/ }), -/***/ 65053: +/***/ 40620: /***/ (function(__unused_webpack_module, exports) { "use strict"; @@ -4703,9 +4732,23 @@ Object.defineProperty(exports, "__esModule", ({ })); exports.encode = encode; -function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } +function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } -function _toArray(arr) { return Array.isArray(arr) ? arr : Array.from(arr); } +function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } + +function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } + +function _toArray(arr) { return _arrayWithHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableRest(); } + +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } + +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } + +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } + +function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } + +function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } function con(n) { return 0x80 | n & 0x3f; @@ -4752,7 +4795,7 @@ function _encode(arr) { /***/ }), -/***/ 70308: +/***/ 52263: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; @@ -4774,13 +4817,13 @@ Object.defineProperty(exports, "encode", ({ } })); -var _decoder = __webpack_require__(33919); +var _decoder = __webpack_require__(13867); -var _encoder = __webpack_require__(65053); +var _encoder = __webpack_require__(40620); /***/ }), -/***/ 94808: +/***/ 82783: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; @@ -4791,21 +4834,29 @@ Object.defineProperty(exports, "__esModule", ({ })); exports.applyOperations = applyOperations; -var _wasmGen = __webpack_require__(37576); +var _wasmGen = __webpack_require__(2554); + +var _encoder = __webpack_require__(35890); -var _encoder = __webpack_require__(17494); +var _ast = __webpack_require__(75974); -var _ast = __webpack_require__(51606); +var _helperWasmSection = __webpack_require__(906); -var _helperWasmSection = __webpack_require__(91360); +var _helperBuffer = __webpack_require__(1874); -var _helperBuffer = __webpack_require__(68159); +var _helperWasmBytecode = __webpack_require__(13345); -var _helperWasmBytecode = __webpack_require__(10845); +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } -function _sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function _slicedToArray(arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return _sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } } +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } + +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } + +function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } + +function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } function shiftLocNodeByDelta(node, delta) { (0, _ast.assertHasLoc)(node); // $FlowIgnore: assertHasLoc ensures that @@ -4868,8 +4919,7 @@ function applyUpdate(ast, uint8Buffer, _ref) { */ - var deltaBytes = replacementByteArray.length - ( // $FlowIgnore: assertHasLoc ensures that - oldNode.loc.end.column - oldNode.loc.start.column); // Init location informations + var deltaBytes = replacementByteArray.length - (oldNode.loc.end.column - oldNode.loc.start.column); // Init location informations newNode.loc = { start: { @@ -5098,12 +5148,14 @@ function applyOperations(ast, uint8Buffer, ops) { /***/ }), -/***/ 43089: +/***/ 78069: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; +function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + Object.defineProperty(exports, "__esModule", ({ value: true })); @@ -5112,19 +5164,27 @@ exports.editWithAST = editWithAST; exports.add = add; exports.addWithAST = addWithAST; -var _wasmParser = __webpack_require__(74102); +var _wasmParser = __webpack_require__(34214); + +var _ast = __webpack_require__(75974); + +var _clone = __webpack_require__(16128); + +var _wasmOpt = __webpack_require__(29476); + +var _helperWasmBytecode = _interopRequireWildcard(__webpack_require__(13345)); -var _ast = __webpack_require__(51606); +var _apply = __webpack_require__(82783); -var _clone = __webpack_require__(72363); +function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } -var _wasmOpt = __webpack_require__(67590); +function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; } -var _helperWasmBytecode = _interopRequireWildcard(__webpack_require__(10845)); +function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; } -var _apply = __webpack_require__(94808); +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } function hashNode(node) { return JSON.stringify(node); @@ -5137,35 +5197,26 @@ function preprocess(ab) { function sortBySectionOrder(nodes) { var originalOrder = new Map(); - var _iteratorNormalCompletion = true; - var _didIteratorError = false; - var _iteratorError = undefined; + + var _iterator = _createForOfIteratorHelper(nodes), + _step; try { - for (var _iterator = nodes[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { - var _node = _step.value; - originalOrder.set(_node, originalOrder.size); + for (_iterator.s(); !(_step = _iterator.n()).done;) { + var node = _step.value; + originalOrder.set(node, originalOrder.size); } } catch (err) { - _didIteratorError = true; - _iteratorError = err; + _iterator.e(err); } finally { - try { - if (!_iteratorNormalCompletion && _iterator.return != null) { - _iterator.return(); - } - } finally { - if (_didIteratorError) { - throw _iteratorError; - } - } + _iterator.f(); } nodes.sort(function (a, b) { var sectionA = (0, _helperWasmBytecode.getSectionForNode)(a); var sectionB = (0, _helperWasmBytecode.getSectionForNode)(b); - var aId = _helperWasmBytecode.default.sections[sectionA]; - var bId = _helperWasmBytecode.default.sections[sectionB]; + var aId = _helperWasmBytecode["default"].sections[sectionA]; + var bId = _helperWasmBytecode["default"].sections[sectionB]; if (typeof aId !== "number" || typeof bId !== "number") { throw new Error("Section id not found"); @@ -5238,12 +5289,14 @@ function addWithAST(ast, ab, newNodes) { /***/ }), -/***/ 17494: +/***/ 35890: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; +function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + Object.defineProperty(exports, "__esModule", ({ value: true })); @@ -5270,21 +5323,33 @@ exports.encodeFuncBody = encodeFuncBody; exports.encodeIndexInFuncSection = encodeIndexInFuncSection; exports.encodeElem = encodeElem; -var leb = _interopRequireWildcard(__webpack_require__(58646)); +var leb = _interopRequireWildcard(__webpack_require__(64034)); -var ieee754 = _interopRequireWildcard(__webpack_require__(34903)); +var ieee754 = _interopRequireWildcard(__webpack_require__(71140)); -var utf8 = _interopRequireWildcard(__webpack_require__(70308)); +var utf8 = _interopRequireWildcard(__webpack_require__(52263)); -var _helperWasmBytecode = _interopRequireDefault(__webpack_require__(10845)); +var _helperWasmBytecode = _interopRequireDefault(__webpack_require__(13345)); -var _index = __webpack_require__(37576); +var _index = __webpack_require__(2554); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } +function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } -function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } +function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; } + +function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } + +function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } + +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } + +function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } + +function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } + +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } function assertNotIdentifierNode(n) { if (n.type === "Identifier") { @@ -5293,13 +5358,13 @@ function assertNotIdentifierNode(n) { } function encodeVersion(v) { - var bytes = _helperWasmBytecode.default.moduleVersion; + var bytes = _helperWasmBytecode["default"].moduleVersion; bytes[0] = v; return bytes; } function encodeHeader() { - return _helperWasmBytecode.default.magicModuleHeader; + return _helperWasmBytecode["default"].magicModuleHeader; } function encodeU32(v) { @@ -5328,27 +5393,27 @@ function encodeI64(v) { function encodeVec(elements) { var size = encodeU32(elements.length); - return _toConsumableArray(size).concat(_toConsumableArray(elements)); + return [].concat(_toConsumableArray(size), _toConsumableArray(elements)); } function encodeValtype(v) { - var byte = _helperWasmBytecode.default.valtypesByString[v]; + var _byte = _helperWasmBytecode["default"].valtypesByString[v]; - if (typeof byte === "undefined") { + if (typeof _byte === "undefined") { throw new Error("Unknown valtype: " + v); } - return parseInt(byte, 10); + return parseInt(_byte, 10); } function encodeMutability(v) { - var byte = _helperWasmBytecode.default.globalTypesByString[v]; + var _byte2 = _helperWasmBytecode["default"].globalTypesByString[v]; - if (typeof byte === "undefined") { + if (typeof _byte2 === "undefined") { throw new Error("Unknown mutability: " + v); } - return parseInt(byte, 10); + return parseInt(_byte2, 10); } function encodeUTF8Vec(str) { @@ -5424,7 +5489,7 @@ function encodeModuleImport(n) { function encodeSectionMetadata(n) { var out = []; - var sectionId = _helperWasmBytecode.default.sections[n.section]; + var sectionId = _helperWasmBytecode["default"].sections[n.section]; if (typeof sectionId === "undefined") { throw new Error("Unknown section: " + n.section); @@ -5468,7 +5533,7 @@ function encodeCallIndirectInstruction(n) { function encodeModuleExport(n) { var out = []; assertNotIdentifierNode(n.descr.id); - var exportTypeByteString = _helperWasmBytecode.default.exportTypesByName[n.descr.exportType]; + var exportTypeByteString = _helperWasmBytecode["default"].exportTypesByName[n.descr.exportType]; if (typeof exportTypeByteString === "undefined") { throw new Error("Unknown export of type: " + n.descr.exportType); @@ -5501,14 +5566,15 @@ function encodeInstr(n) { instructionName = "".concat(n.object, ".").concat(String(n.id)); } - var byteString = _helperWasmBytecode.default.symbolsByName[instructionName]; + var byteString = _helperWasmBytecode["default"].symbolsByName[instructionName]; if (typeof byteString === "undefined") { throw new Error("encodeInstr: unknown instruction " + JSON.stringify(instructionName)); } - var byte = parseInt(byteString, 10); - out.push(byte); + var _byte3 = parseInt(byteString, 10); + + out.push(_byte3); if (n.args) { n.args.forEach(function (arg) { @@ -5594,7 +5660,7 @@ function encodeElem(n) { out.push.apply(out, _toConsumableArray(encodeExpr(n.offset))); // $FlowIgnore var funcs = n.funcs.reduce(function (acc, x) { - return _toConsumableArray(acc).concat(_toConsumableArray(encodeU32(x.value))); + return [].concat(_toConsumableArray(acc), _toConsumableArray(encodeU32(x.value))); }, []); out.push.apply(out, _toConsumableArray(encodeVec(funcs))); return out; @@ -5602,21 +5668,25 @@ function encodeElem(n) { /***/ }), -/***/ 37576: +/***/ 2554: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; +function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + Object.defineProperty(exports, "__esModule", ({ value: true })); exports.encodeNode = encodeNode; exports.encodeU32 = void 0; -var encoder = _interopRequireWildcard(__webpack_require__(17494)); +var encoder = _interopRequireWildcard(__webpack_require__(35890)); -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } +function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } + +function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; } function encodeNode(n) { switch (n.type) { @@ -5673,46 +5743,62 @@ exports.encodeU32 = encodeU32; /***/ }), -/***/ 67590: +/***/ 29476: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; +function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + Object.defineProperty(exports, "__esModule", ({ value: true })); exports.shrinkPaddedLEB128 = shrinkPaddedLEB128; -var _wasmParser = __webpack_require__(74102); +var _wasmParser = __webpack_require__(34214); -var _leb = __webpack_require__(51103); - -function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } +var _leb = __webpack_require__(87609); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } -function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } + +function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } + +function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); } + +function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } + +function _wrapNativeSuper(Class) { var _cache = typeof Map === "function" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== "function") { throw new TypeError("Super expression must either be null or a function"); } if (typeof _cache !== "undefined") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); } + +function _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); } -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } +function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } -var OptimizerError = -/*#__PURE__*/ -function (_Error) { +function _isNativeFunction(fn) { return Function.toString.call(fn).indexOf("[native code]") !== -1; } + +function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + +function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } + +var OptimizerError = /*#__PURE__*/function (_Error) { _inherits(OptimizerError, _Error); + var _super = _createSuper(OptimizerError); + function OptimizerError(name, initalError) { var _this; _classCallCheck(this, OptimizerError); - _this = _possibleConstructorReturn(this, (OptimizerError.__proto__ || Object.getPrototypeOf(OptimizerError)).call(this, "Error while optimizing: " + name + ": " + initalError.message)); + _this = _super.call(this, "Error while optimizing: " + name + ": " + initalError.message); _this.stack = initalError.stack; return _this; } return OptimizerError; -}(Error); +}( /*#__PURE__*/_wrapNativeSuper(Error)); var decoderOpts = { ignoreCodeSection: true, @@ -5730,7 +5816,7 @@ function shrinkPaddedLEB128(uint8Buffer) { /***/ }), -/***/ 51103: +/***/ 87609: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; @@ -5741,11 +5827,11 @@ Object.defineProperty(exports, "__esModule", ({ })); exports.shrinkPaddedLEB128 = shrinkPaddedLEB128; -var _ast = __webpack_require__(51606); +var _ast = __webpack_require__(75974); -var _encoder = __webpack_require__(17494); +var _encoder = __webpack_require__(35890); -var _helperBuffer = __webpack_require__(68159); +var _helperBuffer = __webpack_require__(1874); function shiftFollowingSections(ast, _ref, deltaInSizeEncoding) { var section = _ref.section; @@ -5793,34 +5879,48 @@ function shrinkPaddedLEB128(ast, uint8Buffer) { /***/ }), -/***/ 14222: +/***/ 25524: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; +function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + Object.defineProperty(exports, "__esModule", ({ value: true })); exports.decode = decode; -var _helperApiError = __webpack_require__(80102); +var _helperApiError = __webpack_require__(2292); -var ieee754 = _interopRequireWildcard(__webpack_require__(34903)); +var ieee754 = _interopRequireWildcard(__webpack_require__(71140)); -var utf8 = _interopRequireWildcard(__webpack_require__(70308)); +var utf8 = _interopRequireWildcard(__webpack_require__(52263)); -var t = _interopRequireWildcard(__webpack_require__(51606)); +var t = _interopRequireWildcard(__webpack_require__(75974)); -var _leb = __webpack_require__(58646); +var _leb = __webpack_require__(64034); -var _helperWasmBytecode = _interopRequireDefault(__webpack_require__(10845)); +var _helperWasmBytecode = _interopRequireDefault(__webpack_require__(13345)); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } + +function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; } -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } +function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } -function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } +function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } + +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } + +function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } + +function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } + +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } function toHex(n) { return "0x" + Number(n).toString(16); @@ -6082,7 +6182,7 @@ function decode(ab, opts) { var header = readBytes(4); - if (byteArrayEq(_helperWasmBytecode.default.magicModuleHeader, header) === false) { + if (byteArrayEq(_helperWasmBytecode["default"].magicModuleHeader, header) === false) { throw new _helperApiError.CompileError("magic header not detected"); } @@ -6097,7 +6197,7 @@ function decode(ab, opts) { var version = readBytes(4); - if (byteArrayEq(_helperWasmBytecode.default.moduleVersion, version) === false) { + if (byteArrayEq(_helperWasmBytecode["default"].moduleVersion, version) === false) { throw new _helperApiError.CompileError("unknown binary version"); } @@ -6118,10 +6218,11 @@ function decode(ab, opts) { var elements = []; for (var i = 0; i < length; i++) { - var byte = readByte(); + var _byte = readByte(); + eatBytes(1); - var value = cast(byte); - dump([byte], value); + var value = cast(_byte); + dump([_byte], value); if (typeof value === "undefined") { throw new _helperApiError.CompileError("Internal failure: parseVec could not cast the value"); @@ -6146,10 +6247,10 @@ function decode(ab, opts) { var type = readByte(); eatBytes(1); - if (type == _helperWasmBytecode.default.types.func) { + if (type == _helperWasmBytecode["default"].types.func) { dump([type], "func"); var paramValtypes = parseVec(function (b) { - return _helperWasmBytecode.default.valtypes[b]; + return _helperWasmBytecode["default"].valtypes[b]; }); var params = paramValtypes.map(function (v) { return t.funcParam( @@ -6157,7 +6258,7 @@ function decode(ab, opts) { v); }); var result = parseVec(function (b) { - return _helperWasmBytecode.default.valtypes[b]; + return _helperWasmBytecode["default"].valtypes[b]; }); typeInstructionNodes.push(function () { var endLoc = getPosition(); @@ -6205,7 +6306,7 @@ function decode(ab, opts) { var descrTypeByte = readByte(); eatBytes(1); - var descrType = _helperWasmBytecode.default.importTypes[descrTypeByte]; + var descrType = _helperWasmBytecode["default"].importTypes[descrTypeByte]; dump([descrTypeByte], "import kind"); if (typeof descrType === "undefined") { @@ -6238,7 +6339,7 @@ function decode(ab, opts) { state.globalsInModule.push(globalNode); } else if (descrType === "table") { importDescr = parseTableType(i); - } else if (descrType === "mem") { + } else if (descrType === "memory") { var memoryNode = parseMemoryType(0); state.memoriesInModule.push(memoryNode); importDescr = memoryNode; @@ -6310,7 +6411,7 @@ function decode(ab, opts) { var id = void 0, signature = void 0; - if (_helperWasmBytecode.default.exportTypes[typeIndex] === "Func") { + if (_helperWasmBytecode["default"].exportTypes[typeIndex] === "Func") { var func = state.functionsInModule[index]; if (typeof func === "undefined") { @@ -6319,7 +6420,7 @@ function decode(ab, opts) { id = t.numberLiteralFromRaw(index, String(index)); signature = func.signature; - } else if (_helperWasmBytecode.default.exportTypes[typeIndex] === "Table") { + } else if (_helperWasmBytecode["default"].exportTypes[typeIndex] === "Table") { var table = state.tablesInModule[index]; if (typeof table === "undefined") { @@ -6328,7 +6429,7 @@ function decode(ab, opts) { id = t.numberLiteralFromRaw(index, String(index)); signature = null; - } else if (_helperWasmBytecode.default.exportTypes[typeIndex] === "Mem") { + } else if (_helperWasmBytecode["default"].exportTypes[typeIndex] === "Memory") { var memNode = state.memoriesInModule[index]; if (typeof memNode === "undefined") { @@ -6337,7 +6438,7 @@ function decode(ab, opts) { id = t.numberLiteralFromRaw(index, String(index)); signature = null; - } else if (_helperWasmBytecode.default.exportTypes[typeIndex] === "Global") { + } else if (_helperWasmBytecode["default"].exportTypes[typeIndex] === "Global") { var global = state.globalsInModule[index]; if (typeof global === "undefined") { @@ -6354,7 +6455,7 @@ function decode(ab, opts) { var endLoc = getPosition(); state.elementsInExportSection.push({ name: name.value, - type: _helperWasmBytecode.default.exportTypes[typeIndex], + type: _helperWasmBytecode["default"].exportTypes[typeIndex], signature: signature, id: id, index: index, @@ -6398,7 +6499,7 @@ function decode(ab, opts) { dump([localCount], "num local"); var valtypeByte = readByte(); eatBytes(1); - var type = _helperWasmBytecode.default.valtypes[valtypeByte]; + var type = _helperWasmBytecode["default"].valtypes[valtypeByte]; var args = []; for (var _i2 = 0; _i2 < localCount; _i2++) { @@ -6445,7 +6546,7 @@ function decode(ab, opts) { eatBytes(1); } - var instruction = _helperWasmBytecode.default.symbolsByByte[instructionByte]; + var instruction = _helperWasmBytecode["default"].symbolsByByte[instructionByte]; if (typeof instruction === "undefined") { throw new _helperApiError.CompileError("Unexpected instruction: " + toHex(instructionByte)); @@ -6472,13 +6573,14 @@ function decode(ab, opts) { } var args = []; + var namedArgs = void 0; if (instruction.name === "loop") { var _startLoc7 = getPosition(); var blocktypeByte = readByte(); eatBytes(1); - var blocktype = _helperWasmBytecode.default.blockTypes[blocktypeByte]; + var blocktype = _helperWasmBytecode["default"].blockTypes[blocktypeByte]; dump([blocktypeByte], "blocktype"); if (typeof blocktype === "undefined") { @@ -6503,7 +6605,7 @@ function decode(ab, opts) { var _blocktypeByte = readByte(); eatBytes(1); - var _blocktype = _helperWasmBytecode.default.blockTypes[_blocktypeByte]; + var _blocktype = _helperWasmBytecode["default"].blockTypes[_blocktypeByte]; dump([_blocktypeByte], "blocktype"); if (typeof _blocktype === "undefined") { @@ -6542,7 +6644,7 @@ function decode(ab, opts) { var _blocktypeByte2 = readByte(); eatBytes(1); - var _blocktype2 = _helperWasmBytecode.default.blockTypes[_blocktypeByte2]; + var _blocktype2 = _helperWasmBytecode["default"].blockTypes[_blocktypeByte2]; dump([_blocktypeByte2], "blocktype"); if (typeof _blocktype2 === "undefined") { @@ -6641,6 +6743,8 @@ function decode(ab, opts) { var _offset2 = offsetu32.value; eatBytes(offsetu32.nextIndex); dump([_offset2], "offset"); + if (namedArgs === undefined) namedArgs = {}; + namedArgs.offset = t.numberLiteralFromRaw(_offset2); } } else if (instructionByte >= 0x41 && instructionByte <= 0x44) { /** @@ -6740,14 +6844,14 @@ function decode(ab, opts) { if (typeof instruction.object === "string") { var _node3 = function () { var endLoc = getPosition(); - return t.withLoc(t.objectInstruction(instruction.name, instruction.object, args), endLoc, _startLoc6); + return t.withLoc(t.objectInstruction(instruction.name, instruction.object, args, namedArgs), endLoc, _startLoc6); }(); code.push(_node3); } else { var _node4 = function () { var endLoc = getPosition(); - return t.withLoc(t.instruction(instruction.name, args), endLoc, _startLoc6); + return t.withLoc(t.instruction(instruction.name, args, namedArgs), endLoc, _startLoc6); }(); code.push(_node4); @@ -6766,15 +6870,15 @@ function decode(ab, opts) { if (limitType === 0x01 || limitType === 0x03 // shared limits ) { - var u32min = readU32(); - min = parseInt(u32min.value); - eatBytes(u32min.nextIndex); - dump([min], "min"); - var u32max = readU32(); - max = parseInt(u32max.value); - eatBytes(u32max.nextIndex); - dump([max], "max"); - } + var u32min = readU32(); + min = parseInt(u32min.value); + eatBytes(u32min.nextIndex); + dump([min], "min"); + var u32max = readU32(); + max = parseInt(u32max.value); + eatBytes(u32max.nextIndex); + dump([max], "max"); + } if (limitType === 0x00) { var _u32min = readU32(); @@ -6793,7 +6897,7 @@ function decode(ab, opts) { var elementTypeByte = readByte(); eatBytes(1); dump([elementTypeByte], "element type"); - var elementType = _helperWasmBytecode.default.tableTypes[elementTypeByte]; + var elementType = _helperWasmBytecode["default"].tableTypes[elementTypeByte]; if (typeof elementType === "undefined") { throw new _helperApiError.CompileError("Unknown element type in table: " + toHex(elementType)); @@ -6807,7 +6911,7 @@ function decode(ab, opts) { function parseGlobalType() { var valtypeByte = readByte(); eatBytes(1); - var type = _helperWasmBytecode.default.valtypes[valtypeByte]; + var type = _helperWasmBytecode["default"].valtypes[valtypeByte]; dump([valtypeByte], type); if (typeof type === "undefined") { @@ -6816,7 +6920,7 @@ function decode(ab, opts) { var globalTypeByte = readByte(); eatBytes(1); - var globalType = _helperWasmBytecode.default.globalTypes[globalTypeByte]; + var globalType = _helperWasmBytecode["default"].globalTypes[globalTypeByte]; dump([globalTypeByte], "global type (".concat(globalType, ")")); if (typeof globalType === "undefined") { @@ -7122,10 +7226,10 @@ function decode(ab, opts) { var sectionId = readByte(); eatBytes(1); - if (sectionId >= sectionIndex || sectionIndex === _helperWasmBytecode.default.sections.custom) { + if (sectionId >= sectionIndex || sectionIndex === _helperWasmBytecode["default"].sections.custom) { sectionIndex = sectionId + 1; } else { - if (sectionId !== _helperWasmBytecode.default.sections.custom) throw new _helperApiError.CompileError("Unexpected section: " + toHex(sectionId)); + if (sectionId !== _helperWasmBytecode["default"].sections.custom) throw new _helperApiError.CompileError("Unexpected section: " + toHex(sectionId)); } var nextSectionIndex = sectionIndex; @@ -7141,7 +7245,7 @@ function decode(ab, opts) { }(); switch (sectionId) { - case _helperWasmBytecode.default.sections.type: + case _helperWasmBytecode["default"].sections.type: { dumpSep("section Type"); dump([sectionId], "section code"); @@ -7153,22 +7257,19 @@ function decode(ab, opts) { var numberOfTypes = _u.value; eatBytes(_u.nextIndex); - - var _metadata = t.sectionMetadata("type", startOffset, sectionSizeInBytesNode, function () { + var metadata = t.sectionMetadata("type", startOffset, sectionSizeInBytesNode, function () { var endLoc = getPosition(); return t.withLoc(t.numberLiteralFromRaw(numberOfTypes), endLoc, _startLoc13); }()); - - var _nodes = parseTypeSection(numberOfTypes); - + var nodes = parseTypeSection(numberOfTypes); return { - nodes: _nodes, - metadata: _metadata, + nodes: nodes, + metadata: metadata, nextSectionIndex: nextSectionIndex }; } - case _helperWasmBytecode.default.sections.table: + case _helperWasmBytecode["default"].sections.table: { dumpSep("section Table"); dump([sectionId], "section code"); @@ -7182,21 +7283,21 @@ function decode(ab, opts) { eatBytes(_u2.nextIndex); dump([numberOfTable], "num tables"); - var _metadata2 = t.sectionMetadata("table", startOffset, sectionSizeInBytesNode, function () { + var _metadata = t.sectionMetadata("table", startOffset, sectionSizeInBytesNode, function () { var endLoc = getPosition(); return t.withLoc(t.numberLiteralFromRaw(numberOfTable), endLoc, _startLoc14); }()); - var _nodes2 = parseTableSection(numberOfTable); + var _nodes = parseTableSection(numberOfTable); return { - nodes: _nodes2, - metadata: _metadata2, + nodes: _nodes, + metadata: _metadata, nextSectionIndex: nextSectionIndex }; } - case _helperWasmBytecode.default.sections.import: + case _helperWasmBytecode["default"].sections["import"]: { dumpSep("section Import"); dump([sectionId], "section code"); @@ -7209,21 +7310,21 @@ function decode(ab, opts) { eatBytes(numberOfImportsu32.nextIndex); dump([numberOfImports], "number of imports"); - var _metadata3 = t.sectionMetadata("import", startOffset, sectionSizeInBytesNode, function () { + var _metadata2 = t.sectionMetadata("import", startOffset, sectionSizeInBytesNode, function () { var endLoc = getPosition(); return t.withLoc(t.numberLiteralFromRaw(numberOfImports), endLoc, _startLoc15); }()); - var _nodes3 = parseImportSection(numberOfImports); + var _nodes2 = parseImportSection(numberOfImports); return { - nodes: _nodes3, - metadata: _metadata3, + nodes: _nodes2, + metadata: _metadata2, nextSectionIndex: nextSectionIndex }; } - case _helperWasmBytecode.default.sections.func: + case _helperWasmBytecode["default"].sections.func: { dumpSep("section Function"); dump([sectionId], "section code"); @@ -7235,21 +7336,21 @@ function decode(ab, opts) { var numberOfFunctions = numberOfFunctionsu32.value; eatBytes(numberOfFunctionsu32.nextIndex); - var _metadata4 = t.sectionMetadata("func", startOffset, sectionSizeInBytesNode, function () { + var _metadata3 = t.sectionMetadata("func", startOffset, sectionSizeInBytesNode, function () { var endLoc = getPosition(); return t.withLoc(t.numberLiteralFromRaw(numberOfFunctions), endLoc, _startLoc16); }()); parseFuncSection(numberOfFunctions); - var _nodes4 = []; + var _nodes3 = []; return { - nodes: _nodes4, - metadata: _metadata4, + nodes: _nodes3, + metadata: _metadata3, nextSectionIndex: nextSectionIndex }; } - case _helperWasmBytecode.default.sections.export: + case _helperWasmBytecode["default"].sections["export"]: { dumpSep("section Export"); dump([sectionId], "section code"); @@ -7262,21 +7363,21 @@ function decode(ab, opts) { var numberOfExport = _u3.value; eatBytes(_u3.nextIndex); - var _metadata5 = t.sectionMetadata("export", startOffset, sectionSizeInBytesNode, function () { + var _metadata4 = t.sectionMetadata("export", startOffset, sectionSizeInBytesNode, function () { var endLoc = getPosition(); return t.withLoc(t.numberLiteralFromRaw(numberOfExport), endLoc, _startLoc17); }()); parseExportSection(numberOfExport); - var _nodes5 = []; + var _nodes4 = []; return { - nodes: _nodes5, - metadata: _metadata5, + nodes: _nodes4, + metadata: _metadata4, nextSectionIndex: nextSectionIndex }; } - case _helperWasmBytecode.default.sections.code: + case _helperWasmBytecode["default"].sections.code: { dumpSep("section Code"); dump([sectionId], "section code"); @@ -7289,7 +7390,7 @@ function decode(ab, opts) { var numberOfFuncs = _u4.value; eatBytes(_u4.nextIndex); - var _metadata6 = t.sectionMetadata("code", startOffset, sectionSizeInBytesNode, function () { + var _metadata5 = t.sectionMetadata("code", startOffset, sectionSizeInBytesNode, function () { var endLoc = getPosition(); return t.withLoc(t.numberLiteralFromRaw(numberOfFuncs), endLoc, _startLoc18); }()); @@ -7301,31 +7402,31 @@ function decode(ab, opts) { parseCodeSection(numberOfFuncs); } - var _nodes6 = []; + var _nodes5 = []; return { - nodes: _nodes6, - metadata: _metadata6, + nodes: _nodes5, + metadata: _metadata5, nextSectionIndex: nextSectionIndex }; } - case _helperWasmBytecode.default.sections.start: + case _helperWasmBytecode["default"].sections.start: { dumpSep("section Start"); dump([sectionId], "section code"); dump([sectionSizeInBytes], "section size"); - var _metadata7 = t.sectionMetadata("start", startOffset, sectionSizeInBytesNode); + var _metadata6 = t.sectionMetadata("start", startOffset, sectionSizeInBytesNode); - var _nodes7 = [parseStartSection()]; + var _nodes6 = [parseStartSection()]; return { - nodes: _nodes7, - metadata: _metadata7, + nodes: _nodes6, + metadata: _metadata6, nextSectionIndex: nextSectionIndex }; } - case _helperWasmBytecode.default.sections.element: + case _helperWasmBytecode["default"].sections.element: { dumpSep("section Element"); dump([sectionId], "section code"); @@ -7337,21 +7438,21 @@ function decode(ab, opts) { var numberOfElements = numberOfElementsu32.value; eatBytes(numberOfElementsu32.nextIndex); - var _metadata8 = t.sectionMetadata("element", startOffset, sectionSizeInBytesNode, function () { + var _metadata7 = t.sectionMetadata("element", startOffset, sectionSizeInBytesNode, function () { var endLoc = getPosition(); return t.withLoc(t.numberLiteralFromRaw(numberOfElements), endLoc, _startLoc19); }()); - var _nodes8 = parseElemSection(numberOfElements); + var _nodes7 = parseElemSection(numberOfElements); return { - nodes: _nodes8, - metadata: _metadata8, + nodes: _nodes7, + metadata: _metadata7, nextSectionIndex: nextSectionIndex }; } - case _helperWasmBytecode.default.sections.global: + case _helperWasmBytecode["default"].sections.global: { dumpSep("section Global"); dump([sectionId], "section code"); @@ -7363,21 +7464,21 @@ function decode(ab, opts) { var numberOfGlobals = numberOfGlobalsu32.value; eatBytes(numberOfGlobalsu32.nextIndex); - var _metadata9 = t.sectionMetadata("global", startOffset, sectionSizeInBytesNode, function () { + var _metadata8 = t.sectionMetadata("global", startOffset, sectionSizeInBytesNode, function () { var endLoc = getPosition(); return t.withLoc(t.numberLiteralFromRaw(numberOfGlobals), endLoc, _startLoc20); }()); - var _nodes9 = parseGlobalSection(numberOfGlobals); + var _nodes8 = parseGlobalSection(numberOfGlobals); return { - nodes: _nodes9, - metadata: _metadata9, + nodes: _nodes8, + metadata: _metadata8, nextSectionIndex: nextSectionIndex }; } - case _helperWasmBytecode.default.sections.memory: + case _helperWasmBytecode["default"].sections.memory: { dumpSep("section Memory"); dump([sectionId], "section code"); @@ -7390,27 +7491,27 @@ function decode(ab, opts) { var _numberOfElements = _numberOfElementsu.value; eatBytes(_numberOfElementsu.nextIndex); - var _metadata10 = t.sectionMetadata("memory", startOffset, sectionSizeInBytesNode, function () { + var _metadata9 = t.sectionMetadata("memory", startOffset, sectionSizeInBytesNode, function () { var endLoc = getPosition(); return t.withLoc(t.numberLiteralFromRaw(_numberOfElements), endLoc, _startLoc21); }()); - var _nodes10 = parseMemorySection(_numberOfElements); + var _nodes9 = parseMemorySection(_numberOfElements); return { - nodes: _nodes10, - metadata: _metadata10, + nodes: _nodes9, + metadata: _metadata9, nextSectionIndex: nextSectionIndex }; } - case _helperWasmBytecode.default.sections.data: + case _helperWasmBytecode["default"].sections.data: { dumpSep("section Data"); dump([sectionId], "section code"); dump([sectionSizeInBytes], "section size"); - var _metadata11 = t.sectionMetadata("data", startOffset, sectionSizeInBytesNode); + var _metadata10 = t.sectionMetadata("data", startOffset, sectionSizeInBytesNode); var _startLoc22 = getPosition(); @@ -7419,7 +7520,7 @@ function decode(ab, opts) { var _numberOfElements2 = _numberOfElementsu2.value; eatBytes(_numberOfElementsu2.nextIndex); - _metadata11.vectorOfSize = function () { + _metadata10.vectorOfSize = function () { var endLoc = getPosition(); return t.withLoc(t.numberLiteralFromRaw(_numberOfElements2), endLoc, _startLoc22); }(); @@ -7432,26 +7533,26 @@ function decode(ab, opts) { dumpSep("ignore data (" + sectionSizeInBytes + " bytes)"); return { nodes: [], - metadata: _metadata11, + metadata: _metadata10, nextSectionIndex: nextSectionIndex }; } else { - var _nodes11 = parseDataSection(_numberOfElements2); + var _nodes10 = parseDataSection(_numberOfElements2); return { - nodes: _nodes11, - metadata: _metadata11, + nodes: _nodes10, + metadata: _metadata10, nextSectionIndex: nextSectionIndex }; } } - case _helperWasmBytecode.default.sections.custom: + case _helperWasmBytecode["default"].sections.custom: { dumpSep("section Custom"); dump([sectionId], "section code"); dump([sectionSizeInBytes], "section size"); - var _metadata12 = [t.sectionMetadata("custom", startOffset, sectionSizeInBytesNode)]; + var _metadata11 = [t.sectionMetadata("custom", startOffset, sectionSizeInBytesNode)]; var sectionName = readUTF8String(); eatBytes(sectionName.nextIndex); dump([], "section name (".concat(sectionName.value, ")")); @@ -7462,7 +7563,7 @@ function decode(ab, opts) { var initialOffset = offset; try { - _metadata12.push.apply(_metadata12, _toConsumableArray(parseNameSection(_remainingBytes2))); + _metadata11.push.apply(_metadata11, _toConsumableArray(parseNameSection(_remainingBytes2))); } catch (e) { console.warn("Failed to decode custom \"name\" section @".concat(offset, "; ignoring (").concat(e.message, ").")); eatBytes(offset - (initialOffset + _remainingBytes2)); @@ -7471,7 +7572,7 @@ function decode(ab, opts) { var _initialOffset = offset; try { - _metadata12.push(parseProducersSection()); + _metadata11.push(parseProducersSection()); } catch (e) { console.warn("Failed to decode custom \"producers\" section @".concat(offset, "; ignoring (").concat(e.message, ").")); eatBytes(offset - (_initialOffset + _remainingBytes2)); @@ -7484,13 +7585,26 @@ function decode(ab, opts) { return { nodes: [], - metadata: _metadata12, + metadata: _metadata11, nextSectionIndex: nextSectionIndex }; } } - throw new _helperApiError.CompileError("Unexpected section: " + toHex(sectionId)); + if (opts.errorOnUnknownSection) { + throw new _helperApiError.CompileError("Unexpected section: " + toHex(sectionId)); + } else { + dumpSep("section " + toHex(sectionId)); + dump([sectionId], "section code"); + dump([sectionSizeInBytes], "section size"); + eatBytes(sectionSizeInBytes); + dumpSep("ignoring (" + sectionSizeInBytes + " bytes)"); + return { + nodes: [], + metadata: [], + nextSectionIndex: 0 + }; + } } parseModuleHeader(); @@ -7509,17 +7623,18 @@ function decode(ab, opts) { while (offset < buf.length) { var _parseSection = parseSection(sectionIndex), - _nodes12 = _parseSection.nodes, - _metadata13 = _parseSection.metadata, + nodes = _parseSection.nodes, + metadata = _parseSection.metadata, nextSectionIndex = _parseSection.nextSectionIndex; - moduleFields.push.apply(moduleFields, _toConsumableArray(_nodes12)); - var metadataArray = Array.isArray(_metadata13) ? _metadata13 : [_metadata13]; + moduleFields.push.apply(moduleFields, _toConsumableArray(nodes)); + var metadataArray = Array.isArray(metadata) ? metadata : [metadata]; metadataArray.forEach(function (metadataItem) { + // $FlowIgnore if (metadataItem.type === "FunctionNameMetadata") { - moduleMetadata.functionNames.push(metadataItem); + moduleMetadata.functionNames.push(metadataItem); // $FlowIgnore } else if (metadataItem.type === "LocalNameMetadata") { - moduleMetadata.localNames.push(metadataItem); + moduleMetadata.localNames.push(metadataItem); // $FlowIgnore } else if (metadataItem.type === "ProducersSectionMetadata") { moduleMetadata.producers.push(metadataItem); } else { @@ -7592,22 +7707,26 @@ function decode(ab, opts) { /***/ }), -/***/ 74102: +/***/ 34214: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; +function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + Object.defineProperty(exports, "__esModule", ({ value: true })); exports.decode = decode; -var decoder = _interopRequireWildcard(__webpack_require__(14222)); +var decoder = _interopRequireWildcard(__webpack_require__(25524)); -var t = _interopRequireWildcard(__webpack_require__(51606)); +var t = _interopRequireWildcard(__webpack_require__(75974)); -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } +function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } + +function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; } /** * TODO(sven): I added initial props, but we should rather fix @@ -7660,7 +7779,8 @@ function restoreFunctionNames(ast) { if (functionName) { var oldValue = nodeName.value; - nodeName.value = functionName.name; + nodeName.value = functionName.name; // $FlowIgnore + nodeName.numeric = oldValue; // $FlowIgnore delete nodeName.raw; @@ -9372,7 +9492,7 @@ Long.fromBytesBE = function fromBytesBE(bytes, unsigned) { /***/ }), -/***/ 77: +/***/ 42991: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; @@ -9382,20 +9502,15 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.importAssertions = importAssertions; - var _acorn = _interopRequireWildcard(__webpack_require__(11460)); - function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } - function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } - const leftCurlyBrace = "{".charCodeAt(0); const space = " ".charCodeAt(0); const keyword = "assert"; const FUNC_STATEMENT = 1, - FUNC_HANGING_STATEMENT = 2, - FUNC_NULLABLE_ID = 4; - + FUNC_HANGING_STATEMENT = 2, + FUNC_NULLABLE_ID = 4; function importAssertions(Parser) { // Use supplied version acorn version if present, to avoid // reference mismatches due to different acorn versions. This @@ -9412,30 +9527,25 @@ function importAssertions(Parser) { super(...args); this.assertToken = new TokenType(keyword); } - _codeAt(i) { return this.input.charCodeAt(i); } - _eat(t) { if (this.type !== t) { this.unexpected(); } - this.next(); } - readToken(code) { let i = 0; - for (; i < keyword.length; i++) { if (this._codeAt(this.pos + i) !== keyword.charCodeAt(i)) { return super.readToken(code); } - } // ensure that the keyword is at the correct location - // ie `assert{...` or `assert {...` - + } + // ensure that the keyword is at the correct location + // ie `assert{...` or `assert {...` for (;; i++) { if (this._codeAt(this.pos + i) === leftCurlyBrace) { // Found '{' @@ -9446,39 +9556,34 @@ function importAssertions(Parser) { } else { return super.readToken(code); } - } // If we're inside a dynamic import expression we'll parse + } + + // If we're inside a dynamic import expression we'll parse // the `assert` keyword as a standard object property name // ie `import(""./foo.json", { assert: { type: "json" } })` - - if (this.type.label === "{") { return super.readToken(code); } - this.pos += keyword.length; return this.finishToken(this.assertToken); } - parseDynamicImport(node) { this.next(); // skip `(` - // Parse node.source. + // Parse node.source. node.source = this.parseMaybeAssign(); - if (this.eat(tt.comma)) { const obj = this.parseObj(false); node.arguments = [obj]; } - this._eat(tt.parenR); - return this.finishNode(node, "ImportExpression"); - } // ported from acorn/src/statement.js pp.parseExport - + } + // ported from acorn/src/statement.js pp.parseExport parseExport(node, exports) { - this.next(); // export * from '...' - + this.next(); + // export * from '...' if (this.eat(tt.star)) { if (this.options.ecmaVersion >= 11) { if (this.eatContextual("as")) { @@ -9488,41 +9593,31 @@ function importAssertions(Parser) { node.exported = null; } } - this.expectContextual("from"); - if (this.type !== tt.string) { this.unexpected(); } - node.source = this.parseExprAtom(); - - if (this.type === this.assertToken) { + if (this.type === this.assertToken || this.type === tt._with) { this.next(); const assertions = this.parseImportAssertions(); - if (assertions) { node.assertions = assertions; } } - this.semicolon(); return this.finishNode(node, "ExportAllDeclaration"); } - if (this.eat(tt._default)) { // export default ... this.checkExport(exports, "default", this.lastTokStart); var isAsync; - if (this.type === tt._function || (isAsync = this.isAsyncFunction())) { var fNode = this.startNode(); this.next(); - if (isAsync) { this.next(); } - node.declaration = this.parseFunction(fNode, FUNC_STATEMENT | FUNC_NULLABLE_ID, false, isAsync); } else if (this.type === tt._class) { var cNode = this.startNode(); @@ -9531,38 +9626,30 @@ function importAssertions(Parser) { node.declaration = this.parseMaybeAssign(); this.semicolon(); } - return this.finishNode(node, "ExportDefaultDeclaration"); - } // export var|const|let|function|class ... - - + } + // export var|const|let|function|class ... if (this.shouldParseExportStatement()) { node.declaration = this.parseStatement(null); - if (node.declaration.type === "VariableDeclaration") { this.checkVariableExport(exports, node.declaration.declarations); } else { this.checkExport(exports, node.declaration.id.name, node.declaration.id.start); } - node.specifiers = []; node.source = null; } else { // export { x, y as z } [from '...'] node.declaration = null; node.specifiers = this.parseExportSpecifiers(exports); - if (this.eatContextual("from")) { if (this.type !== tt.string) { this.unexpected(); } - node.source = this.parseExprAtom(); - - if (this.type === this.assertToken) { + if (this.type === this.assertToken || this.type === tt._with) { this.next(); const assertions = this.parseImportAssertions(); - if (assertions) { node.assertions = assertions; } @@ -9571,23 +9658,19 @@ function importAssertions(Parser) { for (var i = 0, list = node.specifiers; i < list.length; i += 1) { // check for keywords used as local names var spec = list[i]; - this.checkUnreserved(spec.local); // check if export is defined - + this.checkUnreserved(spec.local); + // check if export is defined this.checkLocalExport(spec.local); } - node.source = null; } - this.semicolon(); } - return this.finishNode(node, "ExportNamedDeclaration"); } - parseImport(node) { - this.next(); // import '...' - + this.next(); + // import '...' if (this.type === tt.string) { node.specifiers = []; node.source = this.parseExprAtom(); @@ -9596,71 +9679,56 @@ function importAssertions(Parser) { this.expectContextual("from"); node.source = this.type === tt.string ? this.parseExprAtom() : this.unexpected(); } - - if (this.type === this.assertToken) { + if (this.type === this.assertToken || this.type == tt._with) { this.next(); const assertions = this.parseImportAssertions(); - if (assertions) { node.assertions = assertions; } } - this.semicolon(); return this.finishNode(node, "ImportDeclaration"); } - parseImportAssertions() { this._eat(tt.braceL); - const attrs = this.parseAssertEntries(); - this._eat(tt.braceR); - return attrs; } - parseAssertEntries() { const attrs = []; const attrNames = new Set(); - do { if (this.type === tt.braceR) { break; } + const node = this.startNode(); - const node = this.startNode(); // parse AssertionKey : IdentifierName, StringLiteral - + // parse AssertionKey : IdentifierName, StringLiteral let assertionKeyNode; - if (this.type === tt.string) { assertionKeyNode = this.parseLiteral(this.value); } else { assertionKeyNode = this.parseIdent(true); } - this.next(); - node.key = assertionKeyNode; // check if we already have an entry for an attribute + node.key = assertionKeyNode; + + // check if we already have an entry for an attribute // if a duplicate entry is found, throw an error // for now this logic will come into play only when someone declares `type` twice - if (attrNames.has(node.key.name)) { this.raise(this.pos, "Duplicated key in assertions"); } - attrNames.add(node.key.name); - if (this.type !== tt.string) { this.raise(this.pos, "Only string is supported as an assertion value"); } - node.value = this.parseLiteral(this.value); attrs.push(this.finishNode(node, "ImportAttribute")); } while (this.eat(tt.comma)); - return attrs; } - }; } @@ -22351,11 +22419,11 @@ module.exports = BrowserslistError /***/ 82333: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { -var jsReleases = __webpack_require__(68074) -var agents = (__webpack_require__(84562)/* .agents */ .D) -var jsEOL = __webpack_require__(31660) +var jsReleases = __webpack_require__(55917) +var agents = (__webpack_require__(99011)/* .agents */ .D) +var jsEOL = __webpack_require__(40426) var path = __webpack_require__(71017) -var e2c = __webpack_require__(79476) +var e2c = __webpack_require__(39875) var BrowserslistError = __webpack_require__(78769) var parse = __webpack_require__(96621) @@ -23547,8 +23615,8 @@ module.exports = browserslist /***/ 28477: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { -var feature = (__webpack_require__(33501)["default"]) -var region = (__webpack_require__(26777)["default"]) +var feature = (__webpack_require__(427)["default"]) +var region = (__webpack_require__(40054)["default"]) var path = __webpack_require__(71017) var fs = __webpack_require__(57147) @@ -23722,7 +23790,7 @@ module.exports = { if (!ctx.dangerousExtend && !process.env.BROWSERSLIST_DANGEROUS_EXTEND) { checkExtend(name) } - var queries = eval("require")(require.resolve(name, { paths: ['.', ctx.path] })) + var queries = require(__webpack_require__(64634).resolve(name, { paths: ['.', ctx.path] })) if (queries) { if (Array.isArray(queries)) { return queries @@ -23743,7 +23811,7 @@ module.exports = { if (!ctx.dangerousExtend && !process.env.BROWSERSLIST_DANGEROUS_EXTEND) { checkExtend(name) } - var stats = eval("require")(require.resolve( + var stats = require(__webpack_require__(64634).resolve( path.join(name, 'browserslist-stats.json'), { paths: ['.'] } )) @@ -24045,23 +24113,23 @@ module.exports = function parse(all, queries) { /***/ }), -/***/ 12567: +/***/ 88794: /***/ (function(module) { -module.exports={A:{A:{J:0.0131217,E:0.00621152,F:0.0581246,G:0.0774995,A:0.00968743,B:0.571559,AC:0.009298},B:"ms",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","AC","J","E","F","G","A","B","","",""],E:"IE",F:{AC:962323200,J:998870400,E:1161129600,F:1237420800,G:1300060800,A:1346716800,B:1381968000}},B:{A:{C:0.003773,K:0.004267,L:0.004268,H:0.003773,M:0.003702,N:0.003773,O:0.015092,P:0,Q:0.004298,R:0.00944,S:0.004043,T:0.003773,U:0.003773,V:0.003974,W:0.003901,X:0.004318,Y:0.003773,Z:0.004118,a:0.003939,b:0.007546,c:0.004118,d:0.003939,f:0.003801,g:0.003901,h:0.003855,i:0.003929,j:0.003901,k:0.003773,l:0.007546,m:0.003773,n:0.011319,o:0.011319,p:0.018865,q:0.033957,r:1.13945,s:2.85239,D:0},B:"webkit",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","C","K","L","H","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","f","g","h","i","j","k","l","m","n","o","p","q","r","s","D","","",""],E:"Edge",F:{C:1438128000,K:1447286400,L:1470096000,H:1491868800,M:1508198400,N:1525046400,O:1542067200,P:1579046400,Q:1581033600,R:1586736000,S:1590019200,T:1594857600,U:1598486400,V:1602201600,W:1605830400,X:1611360000,Y:1614816000,Z:1618358400,a:1622073600,b:1626912000,c:1630627200,d:1632441600,f:1634774400,g:1637539200,h:1641427200,i:1643932800,j:1646265600,k:1649635200,l:1651190400,m:1653955200,n:1655942400,o:1659657600,p:1661990400,q:1664755200,r:1666915200,s:1670198400,D:1673481600},D:{C:"ms",K:"ms",L:"ms",H:"ms",M:"ms",N:"ms",O:"ms"}},C:{A:{"0":0.004118,"1":0.004317,"2":0.004393,"3":0.004418,"4":0.008834,"5":0.008322,"6":0.008928,"7":0.004471,"8":0.009284,"9":0.004707,BC:0.004118,sB:0.004271,I:0.011703,t:0.004879,J:0.020136,E:0.005725,F:0.004525,G:0.00533,A:0.004283,B:0.007546,C:0.004471,K:0.004486,L:0.00453,H:0.008322,M:0.004417,N:0.004425,O:0.004161,u:0.004443,v:0.004283,w:0.008322,x:0.013698,y:0.004161,z:0.008786,AB:0.009076,BB:0.007546,CB:0.004783,DB:0.003929,EB:0.004783,FB:0.00487,GB:0.005029,HB:0.0047,IB:0.094325,JB:0.007546,KB:0.003867,LB:0.004525,MB:0.004293,NB:0.003773,OB:0.004538,PB:0.008282,QB:0.011601,RB:0.052822,SB:0.011601,TB:0.003929,UB:0.003974,VB:0.007546,WB:0.011601,XB:0.003939,tB:0.003773,YB:0.003929,uB:0.004356,ZB:0.004425,aB:0.008322,bB:0.00415,cB:0.004267,dB:0.003801,eB:0.004267,fB:0.003773,gB:0.00415,hB:0.004293,iB:0.004425,jB:0.003773,e:0.00415,kB:0.00415,lB:0.004318,mB:0.004356,nB:0.003974,oB:0.033957,P:0.003773,Q:0.003773,R:0.003773,vB:0.003773,S:0.003773,T:0.003929,U:0.004268,V:0.003801,W:0.011319,X:0.007546,Y:0.003773,Z:0.003773,a:0.018865,b:0.003801,c:0.003855,d:0.018865,f:0.003773,g:0.003773,h:0.003901,i:0.003901,j:0.007546,k:0.007546,l:0.007546,m:0.083006,n:0.030184,o:0.015092,p:0.030184,q:0.049049,r:1.12058,s:0.939477,D:0.011319,wB:0,xB:0,CC:0.008786,DC:0.00487},B:"moz",C:["BC","sB","CC","DC","I","t","J","E","F","G","A","B","C","K","L","H","M","N","O","u","v","w","x","y","z","0","1","2","3","4","5","6","7","8","9","AB","BB","CB","DB","EB","FB","GB","HB","IB","JB","KB","LB","MB","NB","OB","PB","QB","RB","SB","TB","UB","VB","WB","XB","tB","YB","uB","ZB","aB","bB","cB","dB","eB","fB","gB","hB","iB","jB","e","kB","lB","mB","nB","oB","P","Q","R","vB","S","T","U","V","W","X","Y","Z","a","b","c","d","f","g","h","i","j","k","l","m","n","o","p","q","r","s","D","wB","xB",""],E:"Firefox",F:{"0":1379376000,"1":1386633600,"2":1391472000,"3":1395100800,"4":1398729600,"5":1402358400,"6":1405987200,"7":1409616000,"8":1413244800,"9":1417392000,BC:1161648000,sB:1213660800,CC:1246320000,DC:1264032000,I:1300752000,t:1308614400,J:1313452800,E:1317081600,F:1317081600,G:1320710400,A:1324339200,B:1327968000,C:1331596800,K:1335225600,L:1338854400,H:1342483200,M:1346112000,N:1349740800,O:1353628800,u:1357603200,v:1361232000,w:1364860800,x:1368489600,y:1372118400,z:1375747200,AB:1421107200,BB:1424736000,CB:1428278400,DB:1431475200,EB:1435881600,FB:1439251200,GB:1442880000,HB:1446508800,IB:1450137600,JB:1453852800,KB:1457395200,LB:1461628800,MB:1465257600,NB:1470096000,OB:1474329600,PB:1479168000,QB:1485216000,RB:1488844800,SB:1492560000,TB:1497312000,UB:1502150400,VB:1506556800,WB:1510617600,XB:1516665600,tB:1520985600,YB:1525824000,uB:1529971200,ZB:1536105600,aB:1540252800,bB:1544486400,cB:1548720000,dB:1552953600,eB:1558396800,fB:1562630400,gB:1567468800,hB:1571788800,iB:1575331200,jB:1578355200,e:1581379200,kB:1583798400,lB:1586304000,mB:1588636800,nB:1591056000,oB:1593475200,P:1595894400,Q:1598313600,R:1600732800,vB:1603152000,S:1605571200,T:1607990400,U:1611619200,V:1614038400,W:1616457600,X:1618790400,Y:1622505600,Z:1626134400,a:1628553600,b:1630972800,c:1633392000,d:1635811200,f:1638835200,g:1641859200,h:1644364800,i:1646697600,j:1649116800,k:1651536000,l:1653955200,m:1656374400,n:1658793600,o:1661212800,p:1663632000,q:1666051200,r:1668470400,s:1670889600,D:1673913600,wB:null,xB:null}},D:{A:{"0":0.004461,"1":0.004141,"2":0.004326,"3":0.0047,"4":0.004538,"5":0.008322,"6":0.008596,"7":0.004566,"8":0.004118,"9":0.007546,I:0.004706,t:0.004879,J:0.004879,E:0.005591,F:0.005591,G:0.005591,A:0.004534,B:0.004464,C:0.010424,K:0.0083,L:0.004706,H:0.015087,M:0.004393,N:0.004393,O:0.008652,u:0.008322,v:0.004393,w:0.004317,x:0.003901,y:0.008786,z:0.003939,AB:0.003901,BB:0.004335,CB:0.004464,DB:0.015092,EB:0.003867,FB:0.015092,GB:0.003773,HB:0.003974,IB:0.007546,JB:0.007948,KB:0.003974,LB:0.003867,MB:0.007546,NB:0.022638,OB:0.049049,PB:0.003867,QB:0.003929,RB:0.007546,SB:0.011319,TB:0.003867,UB:0.007546,VB:0.045276,WB:0.003773,XB:0.003773,tB:0.003773,YB:0.011319,uB:0.011319,ZB:0.003773,aB:0.015092,bB:0.003773,cB:0.011319,dB:0.030184,eB:0.007546,fB:0.007546,gB:0.079233,hB:0.026411,iB:0.011319,jB:0.03773,e:0.011319,kB:0.045276,lB:0.041503,mB:0.026411,nB:0.011319,oB:0.033957,P:0.120736,Q:0.041503,R:0.041503,S:0.07546,T:0.045276,U:0.094325,V:0.07546,W:0.079233,X:0.018865,Y:0.033957,Z:0.026411,a:0.056595,b:0.041503,c:0.049049,d:0.033957,f:0.022638,g:0.041503,h:0.056595,i:0.098098,j:0.049049,k:0.079233,l:0.060368,m:0.098098,n:0.279202,o:0.124509,p:0.192423,q:0.286748,r:3.64849,s:16.8389,D:0.033957,wB:0.018865,xB:0.011319,EC:0},B:"webkit",C:["","","","","","I","t","J","E","F","G","A","B","C","K","L","H","M","N","O","u","v","w","x","y","z","0","1","2","3","4","5","6","7","8","9","AB","BB","CB","DB","EB","FB","GB","HB","IB","JB","KB","LB","MB","NB","OB","PB","QB","RB","SB","TB","UB","VB","WB","XB","tB","YB","uB","ZB","aB","bB","cB","dB","eB","fB","gB","hB","iB","jB","e","kB","lB","mB","nB","oB","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","f","g","h","i","j","k","l","m","n","o","p","q","r","s","D","wB","xB","EC"],E:"Chrome",F:{"0":1357862400,"1":1361404800,"2":1364428800,"3":1369094400,"4":1374105600,"5":1376956800,"6":1384214400,"7":1389657600,"8":1392940800,"9":1397001600,I:1264377600,t:1274745600,J:1283385600,E:1287619200,F:1291248000,G:1296777600,A:1299542400,B:1303862400,C:1307404800,K:1312243200,L:1316131200,H:1316131200,M:1319500800,N:1323734400,O:1328659200,u:1332892800,v:1337040000,w:1340668800,x:1343692800,y:1348531200,z:1352246400,AB:1400544000,BB:1405468800,CB:1409011200,DB:1412640000,EB:1416268800,FB:1421798400,GB:1425513600,HB:1429401600,IB:1432080000,JB:1437523200,KB:1441152000,LB:1444780800,MB:1449014400,NB:1453248000,OB:1456963200,PB:1460592000,QB:1464134400,RB:1469059200,SB:1472601600,TB:1476230400,UB:1480550400,VB:1485302400,WB:1489017600,XB:1492560000,tB:1496707200,YB:1500940800,uB:1504569600,ZB:1508198400,aB:1512518400,bB:1516752000,cB:1520294400,dB:1523923200,eB:1527552000,fB:1532390400,gB:1536019200,hB:1539648000,iB:1543968000,jB:1548720000,e:1552348800,kB:1555977600,lB:1559606400,mB:1564444800,nB:1568073600,oB:1571702400,P:1575936000,Q:1580860800,R:1586304000,S:1589846400,T:1594684800,U:1598313600,V:1601942400,W:1605571200,X:1611014400,Y:1614556800,Z:1618272000,a:1621987200,b:1626739200,c:1630368000,d:1632268800,f:1634601600,g:1637020800,h:1641340800,i:1643673600,j:1646092800,k:1648512000,l:1650931200,m:1653350400,n:1655769600,o:1659398400,p:1661817600,q:1664236800,r:1666656000,s:1669680000,D:1673308800,wB:null,xB:null,EC:null}},E:{A:{I:0,t:0.008322,J:0.004656,E:0.004465,F:0.003974,G:0.003929,A:0.004425,B:0.004318,C:0.003801,K:0.018865,L:0.094325,H:0.022638,FC:0,yB:0.008692,GC:0.011319,HC:0.00456,IC:0.004283,JC:0.022638,zB:0.007802,pB:0.007546,qB:0.033957,"0B":0.18865,KC:0.256564,LC:0.041503,"1B":0.03773,"2B":0.094325,"3B":0.192423,"4B":1.313,rB:0.162239,"5B":0.64141,"6B":0.143374,"7B":0,MC:0},B:"webkit",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","FC","yB","I","t","GC","J","HC","E","IC","F","G","JC","A","zB","B","pB","C","qB","K","0B","L","KC","H","LC","1B","2B","3B","4B","rB","5B","6B","7B","MC","",""],E:"Safari",F:{FC:1205798400,yB:1226534400,I:1244419200,t:1275868800,GC:1311120000,J:1343174400,HC:1382400000,E:1382400000,IC:1410998400,F:1413417600,G:1443657600,JC:1458518400,A:1474329600,zB:1490572800,B:1505779200,pB:1522281600,C:1537142400,qB:1553472000,K:1568851200,"0B":1585008000,L:1600214400,KC:1619395200,H:1632096000,LC:1635292800,"1B":1639353600,"2B":1647216000,"3B":1652745600,"4B":1658275200,rB:1662940800,"5B":1666569600,"6B":1670889600,"7B":1674432000,MC:null}},F:{A:{"0":0.006015,"1":0.005595,"2":0.004393,"3":0.007546,"4":0.004879,"5":0.004879,"6":0.003773,"7":0.005152,"8":0.005014,"9":0.009758,G:0.0082,B:0.016581,C:0.004317,H:0.00685,M:0.00685,N:0.00685,O:0.005014,u:0.006015,v:0.004879,w:0.006597,x:0.006597,y:0.013434,z:0.006702,AB:0.004879,BB:0.003773,CB:0.004283,DB:0.004367,EB:0.004534,FB:0.007546,GB:0.004227,HB:0.004418,IB:0.004161,JB:0.004227,KB:0.004725,LB:0.015092,MB:0.008942,NB:0.004707,OB:0.004827,PB:0.004707,QB:0.004707,RB:0.004326,SB:0.008922,TB:0.014349,UB:0.004425,VB:0.00472,WB:0.004425,XB:0.004425,YB:0.00472,ZB:0.004532,aB:0.004566,bB:0.02283,cB:0.00867,dB:0.004656,eB:0.004642,fB:0.003929,gB:0.00944,hB:0.004293,iB:0.003929,jB:0.004298,e:0.096692,kB:0.004201,lB:0.004141,mB:0.004257,nB:0.003939,oB:0.008236,P:0.003855,Q:0.003939,R:0.008514,vB:0.003939,S:0.003939,T:0.003702,U:0.007546,V:0.003855,W:0.003855,X:0.003929,Y:0.007802,Z:0.011703,a:0.007546,b:0.207515,c:0,d:0,NC:0.00685,OC:0,PC:0.008392,QC:0.004706,pB:0.006229,"8B":0.004879,RC:0.008786,qB:0.00472},B:"webkit",C:["","","","","","","","","","","","","","","","","","","","","","G","NC","OC","PC","QC","B","pB","8B","RC","C","qB","H","M","N","O","u","v","w","x","y","z","0","1","2","3","4","5","6","7","8","9","AB","BB","CB","DB","EB","FB","GB","HB","IB","JB","KB","LB","MB","NB","OB","PB","QB","RB","SB","TB","UB","VB","WB","XB","YB","ZB","aB","bB","cB","dB","eB","fB","gB","hB","iB","jB","e","kB","lB","mB","nB","oB","P","Q","R","vB","S","T","U","V","W","X","Y","Z","a","b","c","d","","",""],E:"Opera",F:{"0":1413331200,"1":1417132800,"2":1422316800,"3":1425945600,"4":1430179200,"5":1433808000,"6":1438646400,"7":1442448000,"8":1445904000,"9":1449100800,G:1150761600,NC:1223424000,OC:1251763200,PC:1267488000,QC:1277942400,B:1292457600,pB:1302566400,"8B":1309219200,RC:1323129600,C:1323129600,qB:1352073600,H:1372723200,M:1377561600,N:1381104000,O:1386288000,u:1390867200,v:1393891200,w:1399334400,x:1401753600,y:1405987200,z:1409616000,AB:1454371200,BB:1457308800,CB:1462320000,DB:1465344000,EB:1470096000,FB:1474329600,GB:1477267200,HB:1481587200,IB:1486425600,JB:1490054400,KB:1494374400,LB:1498003200,MB:1502236800,NB:1506470400,OB:1510099200,PB:1515024000,QB:1517961600,RB:1521676800,SB:1525910400,TB:1530144000,UB:1534982400,VB:1537833600,WB:1543363200,XB:1548201600,YB:1554768000,ZB:1561593600,aB:1566259200,bB:1570406400,cB:1573689600,dB:1578441600,eB:1583971200,fB:1587513600,gB:1592956800,hB:1595894400,iB:1600128000,jB:1603238400,e:1613520000,kB:1612224000,lB:1616544000,mB:1619568000,nB:1623715200,oB:1627948800,P:1631577600,Q:1633392000,R:1635984000,vB:1638403200,S:1642550400,T:1644969600,U:1647993600,V:1650412800,W:1652745600,X:1654646400,Y:1657152000,Z:1660780800,a:1663113600,b:1668816000,c:1668643200,d:1671062400},D:{G:"o",B:"o",C:"o",NC:"o",OC:"o",PC:"o",QC:"o",pB:"o","8B":"o",RC:"o",qB:"o"}},G:{A:{F:0,yB:0,SC:0,"9B":0.00470195,TC:0.00470195,UC:0.00313463,VC:0.0141058,WC:0.00626926,XC:0.0188078,YC:0.0611253,ZC:0.00783658,aC:0.106577,bC:0.0282117,cC:0.0266444,dC:0.0250771,eC:0.405935,fC:0.0423175,gC:0.0109712,hC:0.0391829,iC:0.141058,jC:0.340108,kC:0.647301,lC:0.186511,"1B":0.239799,"2B":0.304059,"3B":0.546993,"4B":2.31493,rB:2.09864,"5B":6.33196,"6B":0.694321,"7B":0.0156732},B:"webkit",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","yB","SC","9B","TC","UC","VC","F","WC","XC","YC","ZC","aC","bC","cC","dC","eC","fC","gC","hC","iC","jC","kC","lC","1B","2B","3B","4B","rB","5B","6B","7B","","",""],E:"Safari on iOS",F:{yB:1270252800,SC:1283904000,"9B":1299628800,TC:1331078400,UC:1359331200,VC:1394409600,F:1410912000,WC:1413763200,XC:1442361600,YC:1458518400,ZC:1473724800,aC:1490572800,bC:1505779200,cC:1522281600,dC:1537142400,eC:1553472000,fC:1568851200,gC:1572220800,hC:1580169600,iC:1585008000,jC:1600214400,kC:1619395200,lC:1632096000,"1B":1639353600,"2B":1647216000,"3B":1652659200,"4B":1658275200,rB:1662940800,"5B":1666569600,"6B":1670889600,"7B":1674432000}},H:{A:{mC:0.966988},B:"o",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","mC","","",""],E:"Opera Mini",F:{mC:1426464000}},I:{A:{sB:0,I:0.0306951,D:0,nC:0,oC:0.0204634,pC:0,qC:0.0204634,"9B":0.0818537,rC:0,sC:0.4195},B:"webkit",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","nC","oC","pC","sB","I","qC","9B","rC","sC","D","","",""],E:"Android Browser",F:{nC:1256515200,oC:1274313600,pC:1291593600,sB:1298332800,I:1318896000,qC:1341792000,"9B":1374624000,rC:1386547200,sC:1401667200,D:1673568000}},J:{A:{E:0,A:0},B:"webkit",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","E","A","","",""],E:"Blackberry Browser",F:{E:1325376000,A:1359504000}},K:{A:{A:0,B:0,C:0,e:0.0111391,pB:0,"8B":0,qB:0},B:"o",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","A","B","pB","8B","C","qB","e","","",""],E:"Opera Mobile",F:{A:1287100800,B:1300752000,pB:1314835200,"8B":1318291200,C:1330300800,qB:1349740800,e:1673827200},D:{e:"webkit"}},L:{A:{D:41.5426},B:"webkit",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","D","","",""],E:"Chrome for Android",F:{D:1673568000}},M:{A:{D:0.292716},B:"moz",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","D","","",""],E:"Firefox for Android",F:{D:1673913600}},N:{A:{A:0.0115934,B:0.022664},B:"ms",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","A","B","","",""],E:"IE Mobile",F:{A:1340150400,B:1353456000}},O:{A:{tC:1.75007},B:"webkit",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","tC","","",""],E:"UC Browser for Android",F:{tC:1634688000},D:{tC:"webkit"}},P:{A:{I:0.166409,uC:0.0103543,vC:0.010304,wC:0.0520028,xC:0.0103584,yC:0.0104443,zB:0.0105043,zC:0.0312017,"0C":0.0104006,"1C":0.0520028,"2C":0.0624033,"3C":0.0312017,rB:0.114406,"4C":0.124807,"5C":0.249613,"6C":2.25692},B:"webkit",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","I","uC","vC","wC","xC","yC","zB","zC","0C","1C","2C","3C","rB","4C","5C","6C","","",""],E:"Samsung Internet",F:{I:1461024000,uC:1481846400,vC:1509408000,wC:1528329600,xC:1546128000,yC:1554163200,zB:1567900800,zC:1582588800,"0C":1593475200,"1C":1605657600,"2C":1618531200,"3C":1629072000,rB:1640736000,"4C":1651708800,"5C":1659657600,"6C":1667260800}},Q:{A:{"0B":0.199296},B:"webkit",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","0B","","",""],E:"QQ Browser",F:{"0B":1663718400}},R:{A:{"7C":0},B:"webkit",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","7C","","",""],E:"Baidu Browser",F:{"7C":1663027200}},S:{A:{"8C":0.068508},B:"moz",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","8C","","",""],E:"KaiOS Browser",F:{"8C":1527811200}}}; +module.exports={A:{A:{J:0.0131217,E:0.00621152,F:0.0439988,G:0.0527986,A:0.00879976,B:0.36959,GC:0.009298},B:"ms",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","GC","J","E","F","G","A","B","","",""],E:"IE",F:{GC:962323200,J:998870400,E:1161129600,F:1237420800,G:1300060800,A:1346716800,B:1381968000}},B:{A:{C:0.004081,K:0.004267,L:0.004268,H:0.004081,M:0.003702,N:0.004441,O:0.013323,P:0,Q:0.004298,R:0.00944,S:0.004043,T:0.004441,U:0.003861,V:0.003861,W:0.004441,X:0.003943,Y:0.004441,Z:0.003943,a:0.003943,b:0.008882,c:0.004118,d:0.003939,e:0.003943,f:0.003943,g:0.003943,h:0.003929,k:0.003901,l:0.011829,m:0.004441,n:0.004441,o:0.008162,p:0.004081,q:0.004441,r:0.008882,s:0.017764,t:0.031087,u:0.093261,v:0.075497,w:1.38559,x:3.15755,D:0},B:"webkit",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","C","K","L","H","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","k","l","m","n","o","p","q","r","s","t","u","v","w","x","D","","",""],E:"Edge",F:{C:1438128000,K:1447286400,L:1470096000,H:1491868800,M:1508198400,N:1525046400,O:1542067200,P:1579046400,Q:1581033600,R:1586736000,S:1590019200,T:1594857600,U:1598486400,V:1602201600,W:1605830400,X:1611360000,Y:1614816000,Z:1618358400,a:1622073600,b:1626912000,c:1630627200,d:1632441600,e:1634774400,f:1637539200,g:1641427200,h:1643932800,k:1646265600,l:1649635200,m:1651190400,n:1653955200,o:1655942400,p:1659657600,q:1661990400,r:1664755200,s:1666915200,t:1670198400,u:1673481600,v:1675900800,w:1678665600,x:1680825600,D:1683158400},D:{C:"ms",K:"ms",L:"ms",H:"ms",M:"ms",N:"ms",O:"ms"}},C:{A:{"0":0.008322,"1":0.013698,"2":0.004161,"3":0.008786,"4":0.004118,"5":0.004317,"6":0.004393,"7":0.004418,"8":0.008834,"9":0.008322,HC:0.004118,wB:0.004271,I:0.011703,y:0.004879,J:0.020136,E:0.005725,F:0.004525,G:0.00533,A:0.004283,B:0.008882,C:0.004471,K:0.004486,L:0.00453,H:0.008322,M:0.004417,N:0.004425,O:0.004161,z:0.004443,i:0.004283,AB:0.008928,BB:0.004471,CB:0.009284,DB:0.004707,EB:0.009076,FB:0.004081,GB:0.004783,HB:0.003929,IB:0.004783,JB:0.00487,KB:0.005029,LB:0.0047,MB:0.022205,NB:0.004441,OB:0.003867,PB:0.004525,QB:0.004293,RB:0.004081,SB:0.004538,TB:0.008282,UB:0.011601,VB:0.039969,WB:0.011601,XB:0.004441,YB:0.004441,ZB:0.004441,aB:0.011601,bB:0.003939,xB:0.004441,cB:0.003929,yB:0.004356,dB:0.004425,eB:0.008322,fB:0.00415,gB:0.004267,hB:0.003801,iB:0.004267,jB:0.004081,kB:0.00415,lB:0.004293,mB:0.004425,nB:0.013323,j:0.00415,oB:0.00415,pB:0.004318,qB:0.004356,rB:0.003974,sB:0.031087,P:0.004081,Q:0.004081,R:0.004081,zB:0.003861,S:0.004441,T:0.003929,U:0.004268,V:0.003801,W:0.008882,X:0.004441,Y:0.003943,Z:0.003943,a:0.008882,b:0.003801,c:0.007722,d:0.017764,e:0.003773,f:0.007886,g:0.003901,h:0.003901,k:0.004081,l:0.003861,m:0.004081,n:0.097702,o:0.017764,p:0.004441,q:0.008882,r:0.008882,s:0.008882,t:0.013323,u:0.022205,v:0.048851,w:1.00367,x:0.905964,D:0.008882,"0B":0,"1B":0,IC:0.008786,JC:0.00487},B:"moz",C:["HC","wB","IC","JC","I","y","J","E","F","G","A","B","C","K","L","H","M","N","O","z","i","0","1","2","3","4","5","6","7","8","9","AB","BB","CB","DB","EB","FB","GB","HB","IB","JB","KB","LB","MB","NB","OB","PB","QB","RB","SB","TB","UB","VB","WB","XB","YB","ZB","aB","bB","xB","cB","yB","dB","eB","fB","gB","hB","iB","jB","kB","lB","mB","nB","j","oB","pB","qB","rB","sB","P","Q","R","zB","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","k","l","m","n","o","p","q","r","s","t","u","v","w","x","D","0B","1B",""],E:"Firefox",F:{"0":1364860800,"1":1368489600,"2":1372118400,"3":1375747200,"4":1379376000,"5":1386633600,"6":1391472000,"7":1395100800,"8":1398729600,"9":1402358400,HC:1161648000,wB:1213660800,IC:1246320000,JC:1264032000,I:1300752000,y:1308614400,J:1313452800,E:1317081600,F:1317081600,G:1320710400,A:1324339200,B:1327968000,C:1331596800,K:1335225600,L:1338854400,H:1342483200,M:1346112000,N:1349740800,O:1353628800,z:1357603200,i:1361232000,AB:1405987200,BB:1409616000,CB:1413244800,DB:1417392000,EB:1421107200,FB:1424736000,GB:1428278400,HB:1431475200,IB:1435881600,JB:1439251200,KB:1442880000,LB:1446508800,MB:1450137600,NB:1453852800,OB:1457395200,PB:1461628800,QB:1465257600,RB:1470096000,SB:1474329600,TB:1479168000,UB:1485216000,VB:1488844800,WB:1492560000,XB:1497312000,YB:1502150400,ZB:1506556800,aB:1510617600,bB:1516665600,xB:1520985600,cB:1525824000,yB:1529971200,dB:1536105600,eB:1540252800,fB:1544486400,gB:1548720000,hB:1552953600,iB:1558396800,jB:1562630400,kB:1567468800,lB:1571788800,mB:1575331200,nB:1578355200,j:1581379200,oB:1583798400,pB:1586304000,qB:1588636800,rB:1591056000,sB:1593475200,P:1595894400,Q:1598313600,R:1600732800,zB:1603152000,S:1605571200,T:1607990400,U:1611619200,V:1614038400,W:1616457600,X:1618790400,Y:1622505600,Z:1626134400,a:1628553600,b:1630972800,c:1633392000,d:1635811200,e:1638835200,f:1641859200,g:1644364800,h:1646697600,k:1649116800,l:1651536000,m:1653955200,n:1656374400,o:1658793600,p:1661212800,q:1663632000,r:1666051200,s:1668470400,t:1670889600,u:1673913600,v:1676332800,w:1678752000,x:1681171200,D:1683590400,"0B":null,"1B":null}},D:{A:{"0":0.004317,"1":0.003901,"2":0.008786,"3":0.003939,"4":0.004461,"5":0.004141,"6":0.004326,"7":0.0047,"8":0.004538,"9":0.008322,I:0.004706,y:0.004879,J:0.004879,E:0.005591,F:0.005591,G:0.005591,A:0.004534,B:0.004464,C:0.010424,K:0.0083,L:0.004706,H:0.015087,M:0.004393,N:0.004393,O:0.008652,z:0.008322,i:0.004393,AB:0.008596,BB:0.004566,CB:0.004118,DB:0.008882,EB:0.004441,FB:0.004335,GB:0.004464,HB:0.017764,IB:0.003867,JB:0.013323,KB:0.004441,LB:0.003974,MB:0.008882,NB:0.008882,OB:0.013323,PB:0.003867,QB:0.008882,RB:0.017764,SB:0.035528,TB:0.004441,UB:0.004081,VB:0.004441,WB:0.008882,XB:0.003867,YB:0.004441,ZB:0.066615,aB:0.004081,bB:0.004441,xB:0.003773,cB:0.013323,yB:0.008882,dB:0.003773,eB:0.004441,fB:0.003943,gB:0.008882,hB:0.031087,iB:0.008882,jB:0.013323,kB:0.039969,lB:0.022205,mB:0.017764,nB:0.026646,j:0.008882,oB:0.031087,pB:0.04441,qB:0.04441,rB:0.017764,sB:0.026646,P:0.22205,Q:0.039969,R:0.04441,S:0.137671,T:0.035528,U:0.071056,V:0.057733,W:0.093261,X:0.026646,Y:0.035528,Z:0.04441,a:0.084379,b:0.048851,c:0.137671,d:0.066615,e:0.017764,f:0.035528,g:0.048851,h:0.039969,k:0.057733,l:0.048851,m:0.039969,n:0.057733,o:0.270901,p:0.057733,q:0.08882,r:0.071056,s:0.093261,t:0.248696,u:2.10947,v:0.475187,w:8.75321,x:9.67694,D:0.022205,"0B":0.013323,"1B":0,KC:0},B:"webkit",C:["","","","","","I","y","J","E","F","G","A","B","C","K","L","H","M","N","O","z","i","0","1","2","3","4","5","6","7","8","9","AB","BB","CB","DB","EB","FB","GB","HB","IB","JB","KB","LB","MB","NB","OB","PB","QB","RB","SB","TB","UB","VB","WB","XB","YB","ZB","aB","bB","xB","cB","yB","dB","eB","fB","gB","hB","iB","jB","kB","lB","mB","nB","j","oB","pB","qB","rB","sB","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","k","l","m","n","o","p","q","r","s","t","u","v","w","x","D","0B","1B","KC"],E:"Chrome",F:{"0":1340668800,"1":1343692800,"2":1348531200,"3":1352246400,"4":1357862400,"5":1361404800,"6":1364428800,"7":1369094400,"8":1374105600,"9":1376956800,I:1264377600,y:1274745600,J:1283385600,E:1287619200,F:1291248000,G:1296777600,A:1299542400,B:1303862400,C:1307404800,K:1312243200,L:1316131200,H:1316131200,M:1319500800,N:1323734400,O:1328659200,z:1332892800,i:1337040000,AB:1384214400,BB:1389657600,CB:1392940800,DB:1397001600,EB:1400544000,FB:1405468800,GB:1409011200,HB:1412640000,IB:1416268800,JB:1421798400,KB:1425513600,LB:1429401600,MB:1432080000,NB:1437523200,OB:1441152000,PB:1444780800,QB:1449014400,RB:1453248000,SB:1456963200,TB:1460592000,UB:1464134400,VB:1469059200,WB:1472601600,XB:1476230400,YB:1480550400,ZB:1485302400,aB:1489017600,bB:1492560000,xB:1496707200,cB:1500940800,yB:1504569600,dB:1508198400,eB:1512518400,fB:1516752000,gB:1520294400,hB:1523923200,iB:1527552000,jB:1532390400,kB:1536019200,lB:1539648000,mB:1543968000,nB:1548720000,j:1552348800,oB:1555977600,pB:1559606400,qB:1564444800,rB:1568073600,sB:1571702400,P:1575936000,Q:1580860800,R:1586304000,S:1589846400,T:1594684800,U:1598313600,V:1601942400,W:1605571200,X:1611014400,Y:1614556800,Z:1618272000,a:1621987200,b:1626739200,c:1630368000,d:1632268800,e:1634601600,f:1637020800,g:1641340800,h:1643673600,k:1646092800,l:1648512000,m:1650931200,n:1653350400,o:1655769600,p:1659398400,q:1661817600,r:1664236800,s:1666656000,t:1669680000,u:1673308800,v:1675728000,w:1678147200,x:1680566400,D:1682985600,"0B":null,"1B":null,KC:null}},E:{A:{I:0,y:0.008322,J:0.004656,E:0.004465,F:0.003974,G:0.003929,A:0.004425,B:0.004318,C:0.003801,K:0.022205,L:0.119907,H:0.026646,LC:0,"2B":0.008692,MC:0.008882,NC:0.00456,OC:0.004283,PC:0.048851,"3B":0.007802,tB:0.008882,uB:0.039969,"4B":0.186522,QC:0.328634,RC:0.048851,"5B":0.04441,"6B":0.111025,"7B":0.195404,"8B":0.830467,vB:0.08882,"9B":0.279783,AC:0.408572,BC:1.63429,CC:0.688355,DC:0.013323,SC:0},B:"webkit",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","LC","2B","I","y","MC","J","NC","E","OC","F","G","PC","A","3B","B","tB","C","uB","K","4B","L","QC","H","RC","5B","6B","7B","8B","vB","9B","AC","BC","CC","DC","SC",""],E:"Safari",F:{LC:1205798400,"2B":1226534400,I:1244419200,y:1275868800,MC:1311120000,J:1343174400,NC:1382400000,E:1382400000,OC:1410998400,F:1413417600,G:1443657600,PC:1458518400,A:1474329600,"3B":1490572800,B:1505779200,tB:1522281600,C:1537142400,uB:1553472000,K:1568851200,"4B":1585008000,L:1600214400,QC:1619395200,H:1632096000,RC:1635292800,"5B":1639353600,"6B":1647216000,"7B":1652745600,"8B":1658275200,vB:1662940800,"9B":1666569600,AC:1670889600,BC:1674432000,CC:1679875200,DC:null,SC:null}},F:{A:{"0":0.006597,"1":0.006597,"2":0.013434,"3":0.006702,"4":0.006015,"5":0.005595,"6":0.004393,"7":0.008882,"8":0.004879,"9":0.004879,G:0.0082,B:0.016581,C:0.004317,H:0.00685,M:0.00685,N:0.00685,O:0.005014,z:0.006015,i:0.004879,AB:0.004441,BB:0.005152,CB:0.005014,DB:0.009758,EB:0.004879,FB:0.004441,GB:0.004283,HB:0.004367,IB:0.004534,JB:0.004441,KB:0.004227,LB:0.004418,MB:0.004161,NB:0.004227,OB:0.004725,PB:0.013323,QB:0.008942,RB:0.004707,SB:0.004827,TB:0.004707,UB:0.004707,VB:0.004326,WB:0.008922,XB:0.014349,YB:0.004425,ZB:0.00472,aB:0.004425,bB:0.004425,cB:0.00472,dB:0.004532,eB:0.004566,fB:0.02283,gB:0.00867,hB:0.004656,iB:0.004642,jB:0.003929,kB:0.00944,lB:0.004293,mB:0.003929,nB:0.004298,j:0.096692,oB:0.008162,pB:0.004141,qB:0.004257,rB:0.003939,sB:0.008236,P:0.003855,Q:0.003939,R:0.008514,zB:0.003939,S:0.003939,T:0.003702,U:0.004441,V:0.003855,W:0.003855,X:0.003929,Y:0.003861,Z:0.011703,a:0.007546,b:0.011829,c:0.069498,d:0.004441,e:0.066615,f:0.315311,g:0.817144,h:0.031087,TC:0.00685,UC:0,VC:0.008392,WC:0.004706,tB:0.006229,EC:0.004879,XC:0.008786,uB:0.00472},B:"webkit",C:["","","","","","","","","","","","","","","","","","","","","","G","TC","UC","VC","WC","B","tB","EC","XC","C","uB","H","M","N","O","z","i","0","1","2","3","4","5","6","7","8","9","AB","BB","CB","DB","EB","FB","GB","HB","IB","JB","KB","LB","MB","NB","OB","PB","QB","RB","SB","TB","UB","VB","WB","XB","YB","ZB","aB","bB","cB","dB","eB","fB","gB","hB","iB","jB","kB","lB","mB","nB","j","oB","pB","qB","rB","sB","P","Q","R","zB","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","","",""],E:"Opera",F:{"0":1399334400,"1":1401753600,"2":1405987200,"3":1409616000,"4":1413331200,"5":1417132800,"6":1422316800,"7":1425945600,"8":1430179200,"9":1433808000,G:1150761600,TC:1223424000,UC:1251763200,VC:1267488000,WC:1277942400,B:1292457600,tB:1302566400,EC:1309219200,XC:1323129600,C:1323129600,uB:1352073600,H:1372723200,M:1377561600,N:1381104000,O:1386288000,z:1390867200,i:1393891200,AB:1438646400,BB:1442448000,CB:1445904000,DB:1449100800,EB:1454371200,FB:1457308800,GB:1462320000,HB:1465344000,IB:1470096000,JB:1474329600,KB:1477267200,LB:1481587200,MB:1486425600,NB:1490054400,OB:1494374400,PB:1498003200,QB:1502236800,RB:1506470400,SB:1510099200,TB:1515024000,UB:1517961600,VB:1521676800,WB:1525910400,XB:1530144000,YB:1534982400,ZB:1537833600,aB:1543363200,bB:1548201600,cB:1554768000,dB:1561593600,eB:1566259200,fB:1570406400,gB:1573689600,hB:1578441600,iB:1583971200,jB:1587513600,kB:1592956800,lB:1595894400,mB:1600128000,nB:1603238400,j:1613520000,oB:1612224000,pB:1616544000,qB:1619568000,rB:1623715200,sB:1627948800,P:1631577600,Q:1633392000,R:1635984000,zB:1638403200,S:1642550400,T:1644969600,U:1647993600,V:1650412800,W:1652745600,X:1654646400,Y:1657152000,Z:1660780800,a:1663113600,b:1668816000,c:1668643200,d:1671062400,e:1675209600,f:1677024000,g:1679529600,h:1681948800},D:{G:"o",B:"o",C:"o",TC:"o",UC:"o",VC:"o",WC:"o",tB:"o",EC:"o",XC:"o",uB:"o"}},G:{A:{F:0.00318601,"2B":0,YC:0,FC:0.00318601,ZC:0.00477902,aC:0.00637202,bC:0.0175231,cC:0.0254881,dC:0.012744,eC:0.0541622,fC:0.00318601,gC:0.0684992,hC:0.0207091,iC:0.0223021,jC:0.0191161,kC:0.358426,lC:0.011151,mC:0.0207091,nC:0.0302671,oC:0.0908013,pC:0.237358,qC:0.430112,rC:0.136998,"5B":0.167266,"6B":0.191161,"7B":0.30745,"8B":0.831549,vB:0.933501,"9B":1.93709,AC:1.14696,BC:5.44011,CC:2.42455,DC:0.0525692},B:"webkit",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","2B","YC","FC","ZC","aC","bC","F","cC","dC","eC","fC","gC","hC","iC","jC","kC","lC","mC","nC","oC","pC","qC","rC","5B","6B","7B","8B","vB","9B","AC","BC","CC","DC","",""],E:"Safari on iOS",F:{"2B":1270252800,YC:1283904000,FC:1299628800,ZC:1331078400,aC:1359331200,bC:1394409600,F:1410912000,cC:1413763200,dC:1442361600,eC:1458518400,fC:1473724800,gC:1490572800,hC:1505779200,iC:1522281600,jC:1537142400,kC:1553472000,lC:1568851200,mC:1572220800,nC:1580169600,oC:1585008000,pC:1600214400,qC:1619395200,rC:1632096000,"5B":1639353600,"6B":1647216000,"7B":1652659200,"8B":1658275200,vB:1662940800,"9B":1666569600,AC:1670889600,BC:1674432000,CC:1679875200,DC:null}},H:{A:{sC:0.994689},B:"o",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","sC","","",""],E:"Opera Mini",F:{sC:1426464000}},I:{A:{wB:0,I:0.0285433,D:0,tC:0,uC:0.00951444,vC:0,wC:0.0190289,FC:0.0951444,xC:0,yC:0.34252},B:"webkit",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","tC","uC","vC","wB","I","wC","FC","xC","yC","D","","",""],E:"Android Browser",F:{tC:1256515200,uC:1274313600,vC:1291593600,wB:1298332800,I:1318896000,wC:1341792000,FC:1374624000,xC:1386547200,yC:1401667200,D:1682985600}},J:{A:{E:0,A:0},B:"webkit",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","E","A","","",""],E:"Blackberry Browser",F:{E:1325376000,A:1359504000}},K:{A:{A:0,B:0,C:0,j:0.0111391,tB:0,EC:0,uB:0},B:"o",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","A","B","tB","EC","C","uB","j","","",""],E:"Opera Mobile",F:{A:1287100800,B:1300752000,tB:1314835200,EC:1318291200,C:1330300800,uB:1349740800,j:1673827200},D:{j:"webkit"}},L:{A:{D:39.6882},B:"webkit",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","D","","",""],E:"Chrome for Android",F:{D:1682985600}},M:{A:{D:0.289068},B:"moz",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","D","","",""],E:"Firefox for Android",F:{D:1683590400}},N:{A:{A:0.0115934,B:0.022664},B:"ms",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","A","B","","",""],E:"IE Mobile",F:{A:1340150400,B:1353456000}},O:{A:{zC:0.950589},B:"webkit",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","zC","","",""],E:"UC Browser for Android",F:{zC:1634688000},D:{zC:"webkit"}},P:{A:{I:0.191027,i:2.06946,"0C":0.0103543,"1C":0.010304,"2C":0.0530632,"3C":0.0103584,"4C":0.0104443,"3B":0.0105043,"5C":0.0212253,"6C":0.0103982,"7C":0.0212253,"8C":0.0106126,"9C":0.0106126,vB:0.0530632,AD:0.0530632,BD:0.0530632,CD:0.148577},B:"webkit",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","I","0C","1C","2C","3C","4C","3B","5C","6C","7C","8C","9C","vB","AD","BD","CD","i","","",""],E:"Samsung Internet",F:{I:1461024000,"0C":1481846400,"1C":1509408000,"2C":1528329600,"3C":1546128000,"4C":1554163200,"3B":1567900800,"5C":1582588800,"6C":1593475200,"7C":1605657600,"8C":1618531200,"9C":1629072000,vB:1640736000,AD:1651708800,BD:1659657600,CD:1667260800,i:1677369600}},Q:{A:{"4B":0.127857},B:"webkit",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","4B","","",""],E:"QQ Browser",F:{"4B":1663718400}},R:{A:{DD:0},B:"webkit",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","DD","","",""],E:"Baidu Browser",F:{DD:1663027200}},S:{A:{ED:0.066708,FD:0},B:"moz",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","ED","FD","","",""],E:"KaiOS Browser",F:{ED:1527811200,FD:1631664000}}}; /***/ }), -/***/ 47534: +/***/ 48607: /***/ (function(module) { -module.exports={"0":"25","1":"26","2":"27","3":"28","4":"29","5":"30","6":"31","7":"32","8":"33","9":"34",A:"10",B:"11",C:"12",D:"109",E:"7",F:"8",G:"9",H:"15",I:"4",J:"6",K:"13",L:"14",M:"16",N:"17",O:"18",P:"79",Q:"80",R:"81",S:"83",T:"84",U:"85",V:"86",W:"87",X:"88",Y:"89",Z:"90",a:"91",b:"92",c:"93",d:"94",e:"73",f:"95",g:"96",h:"97",i:"98",j:"99",k:"100",l:"101",m:"102",n:"103",o:"104",p:"105",q:"106",r:"107",s:"108",t:"5",u:"19",v:"20",w:"21",x:"22",y:"23",z:"24",AB:"35",BB:"36",CB:"37",DB:"38",EB:"39",FB:"40",GB:"41",HB:"42",IB:"43",JB:"44",KB:"45",LB:"46",MB:"47",NB:"48",OB:"49",PB:"50",QB:"51",RB:"52",SB:"53",TB:"54",UB:"55",VB:"56",WB:"57",XB:"58",YB:"60",ZB:"62",aB:"63",bB:"64",cB:"65",dB:"66",eB:"67",fB:"68",gB:"69",hB:"70",iB:"71",jB:"72",kB:"74",lB:"75",mB:"76",nB:"77",oB:"78",pB:"11.1",qB:"12.1",rB:"16.0",sB:"3",tB:"59",uB:"61",vB:"82",wB:"110",xB:"111",yB:"3.2",zB:"10.1","0B":"13.1","1B":"15.2-15.3","2B":"15.4","3B":"15.5","4B":"15.6","5B":"16.1","6B":"16.2","7B":"16.3","8B":"11.5","9B":"4.2-4.3",AC:"5.5",BC:"2",CC:"3.5",DC:"3.6",EC:"112",FC:"3.1",GC:"5.1",HC:"6.1",IC:"7.1",JC:"9.1",KC:"14.1",LC:"15.1",MC:"TP",NC:"9.5-9.6",OC:"10.0-10.1",PC:"10.5",QC:"10.6",RC:"11.6",SC:"4.0-4.1",TC:"5.0-5.1",UC:"6.0-6.1",VC:"7.0-7.1",WC:"8.1-8.4",XC:"9.0-9.2",YC:"9.3",ZC:"10.0-10.2",aC:"10.3",bC:"11.0-11.2",cC:"11.3-11.4",dC:"12.0-12.1",eC:"12.2-12.5",fC:"13.0-13.1",gC:"13.2",hC:"13.3",iC:"13.4-13.7",jC:"14.0-14.4",kC:"14.5-14.8",lC:"15.0-15.1",mC:"all",nC:"2.1",oC:"2.2",pC:"2.3",qC:"4.1",rC:"4.4",sC:"4.4.3-4.4.4",tC:"13.4",uC:"5.0-5.4",vC:"6.2-6.4",wC:"7.2-7.4",xC:"8.2",yC:"9.2",zC:"11.1-11.2","0C":"12.0","1C":"13.0","2C":"14.0","3C":"15.0","4C":"17.0","5C":"18.0","6C":"19.0","7C":"13.18","8C":"2.5"}; +module.exports={"0":"21","1":"22","2":"23","3":"24","4":"25","5":"26","6":"27","7":"28","8":"29","9":"30",A:"10",B:"11",C:"12",D:"113",E:"7",F:"8",G:"9",H:"15",I:"4",J:"6",K:"13",L:"14",M:"16",N:"17",O:"18",P:"79",Q:"80",R:"81",S:"83",T:"84",U:"85",V:"86",W:"87",X:"88",Y:"89",Z:"90",a:"91",b:"92",c:"93",d:"94",e:"95",f:"96",g:"97",h:"98",i:"20",j:"73",k:"99",l:"100",m:"101",n:"102",o:"103",p:"104",q:"105",r:"106",s:"107",t:"108",u:"109",v:"110",w:"111",x:"112",y:"5",z:"19",AB:"31",BB:"32",CB:"33",DB:"34",EB:"35",FB:"36",GB:"37",HB:"38",IB:"39",JB:"40",KB:"41",LB:"42",MB:"43",NB:"44",OB:"45",PB:"46",QB:"47",RB:"48",SB:"49",TB:"50",UB:"51",VB:"52",WB:"53",XB:"54",YB:"55",ZB:"56",aB:"57",bB:"58",cB:"60",dB:"62",eB:"63",fB:"64",gB:"65",hB:"66",iB:"67",jB:"68",kB:"69",lB:"70",mB:"71",nB:"72",oB:"74",pB:"75",qB:"76",rB:"77",sB:"78",tB:"11.1",uB:"12.1",vB:"16.0",wB:"3",xB:"59",yB:"61",zB:"82","0B":"114","1B":"115","2B":"3.2","3B":"10.1","4B":"13.1","5B":"15.2-15.3","6B":"15.4","7B":"15.5","8B":"15.6","9B":"16.1",AC:"16.2",BC:"16.3",CC:"16.4",DC:"16.5",EC:"11.5",FC:"4.2-4.3",GC:"5.5",HC:"2",IC:"3.5",JC:"3.6",KC:"116",LC:"3.1",MC:"5.1",NC:"6.1",OC:"7.1",PC:"9.1",QC:"14.1",RC:"15.1",SC:"TP",TC:"9.5-9.6",UC:"10.0-10.1",VC:"10.5",WC:"10.6",XC:"11.6",YC:"4.0-4.1",ZC:"5.0-5.1",aC:"6.0-6.1",bC:"7.0-7.1",cC:"8.1-8.4",dC:"9.0-9.2",eC:"9.3",fC:"10.0-10.2",gC:"10.3",hC:"11.0-11.2",iC:"11.3-11.4",jC:"12.0-12.1",kC:"12.2-12.5",lC:"13.0-13.1",mC:"13.2",nC:"13.3",oC:"13.4-13.7",pC:"14.0-14.4",qC:"14.5-14.8",rC:"15.0-15.1",sC:"all",tC:"2.1",uC:"2.2",vC:"2.3",wC:"4.1",xC:"4.4",yC:"4.4.3-4.4.4",zC:"13.4","0C":"5.0-5.4","1C":"6.2-6.4","2C":"7.2-7.4","3C":"8.2","4C":"9.2","5C":"11.1-11.2","6C":"12.0","7C":"13.0","8C":"14.0","9C":"15.0",AD:"17.0",BD:"18.0",CD:"19.0",DD:"13.18",ED:"2.5",FD:"3.0-3.1"}; /***/ }), -/***/ 50483: +/***/ 25587: /***/ (function(module) { module.exports={A:"ie",B:"edge",C:"firefox",D:"chrome",E:"safari",F:"opera",G:"ios_saf",H:"op_mini",I:"android",J:"bb",K:"op_mob",L:"and_chr",M:"and_ff",N:"ie_mob",O:"and_uc",P:"samsung",Q:"and_qq",R:"baidu",S:"kaios"}; @@ -24069,7 +24137,7 @@ module.exports={A:"ie",B:"edge",C:"firefox",D:"chrome",E:"safari",F:"opera",G:"i /***/ }), -/***/ 86359: +/***/ 38720: /***/ (function(module) { module.exports = { @@ -24085,7 +24153,7 @@ module.exports = { /***/ }), -/***/ 53391: +/***/ 6133: /***/ (function(module) { module.exports = { @@ -24101,15 +24169,15 @@ module.exports = { /***/ }), -/***/ 84562: +/***/ 99011: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; -const browsers = (__webpack_require__(59219).browsers) -const versions = (__webpack_require__(59964).browserVersions) -const agentsData = __webpack_require__(12567) +const browsers = (__webpack_require__(60666).browsers) +const versions = (__webpack_require__(11148).browserVersions) +const agentsData = __webpack_require__(88794) function unpackBrowserVersions(versionsData) { return Object.keys(versionsData).reduce((usage, version) => { @@ -24156,32 +24224,32 @@ module.exports.D = Object.keys(agentsData).reduce((map, key) => { /***/ }), -/***/ 59964: +/***/ 11148: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { -module.exports.browserVersions = __webpack_require__(47534) +module.exports.browserVersions = __webpack_require__(48607) /***/ }), -/***/ 59219: +/***/ 60666: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { -module.exports.browsers = __webpack_require__(50483) +module.exports.browsers = __webpack_require__(25587) /***/ }), -/***/ 33501: +/***/ 427: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; -const statuses = __webpack_require__(86359) -const supported = __webpack_require__(53391) -const browsers = (__webpack_require__(59219).browsers) -const versions = (__webpack_require__(59964).browserVersions) +const statuses = __webpack_require__(38720) +const supported = __webpack_require__(6133) +const browsers = (__webpack_require__(60666).browsers) +const versions = (__webpack_require__(11148).browserVersions) const MATH2LOG = Math.log(2) @@ -24228,13 +24296,13 @@ module.exports["default"] = unpackFeature /***/ }), -/***/ 26777: +/***/ 40054: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; -const browsers = (__webpack_require__(59219).browsers) +const browsers = (__webpack_require__(60666).browsers) function unpackRegion(packed) { return Object.keys(packed).reduce((list, browser) => { @@ -24436,7 +24504,7 @@ exports.Tracer = Tracer; /***/ }), -/***/ 79476: +/***/ 39875: /***/ (function(module) { module.exports = { @@ -24542,12 +24610,27 @@ module.exports = { "20.3": "104", "21.0": "106", "21.1": "106", - "22.0": "108" -}; - -/***/ }), - -/***/ 69800: + "21.2": "106", + "21.3": "106", + "21.4": "106", + "22.0": "108", + "22.1": "108", + "22.2": "108", + "22.3": "108", + "23.0": "110", + "23.1": "110", + "23.2": "110", + "23.3": "110", + "24.0": "112", + "24.1": "112", + "24.2": "112", + "24.3": "112", + "25.0": "114" +}; + +/***/ }), + +/***/ 33279: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -24558,10 +24641,11 @@ module.exports = { -const DescriptionFileUtils = __webpack_require__(3980); -const getInnerRequest = __webpack_require__(36453); +const DescriptionFileUtils = __webpack_require__(92948); +const getInnerRequest = __webpack_require__(7508); /** @typedef {import("./Resolver")} Resolver */ +/** @typedef {import("./Resolver").JsonPrimitive} JsonPrimitive */ /** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ /** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ @@ -24602,13 +24686,18 @@ module.exports = class AliasFieldPlugin { ); return callback(); } + /** @type {JsonPrimitive | undefined} */ const data = Object.prototype.hasOwnProperty.call( fieldData, innerRequest ) - ? fieldData[innerRequest] + ? /** @type {{[Key in string]: JsonPrimitive}} */ (fieldData)[ + innerRequest + ] : innerRequest.startsWith("./") - ? fieldData[innerRequest.slice(2)] + ? /** @type {{[Key in string]: JsonPrimitive}} */ (fieldData)[ + innerRequest.slice(2) + ] : undefined; if (data === innerRequest) return callback(); if (data === undefined) return callback(); @@ -24624,10 +24713,11 @@ module.exports = class AliasFieldPlugin { } return callback(null, ignoreObj); } + /** @type {ResolveRequest} */ const obj = { ...request, - path: request.descriptionFileRoot, - request: data, + path: /** @type {string} */ (request.descriptionFileRoot), + request: /** @type {string} */ (data), fullySpecified: false }; resolver.doResolve( @@ -24638,7 +24728,7 @@ module.exports = class AliasFieldPlugin { " with mapping '" + innerRequest + "' to '" + - data + + /** @type {string} */ (data) + "'", resolveContext, (err, result) => { @@ -24656,7 +24746,7 @@ module.exports = class AliasFieldPlugin { /***/ }), -/***/ 98906: +/***/ 12577: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -24667,13 +24757,14 @@ module.exports = class AliasFieldPlugin { -const forEachBail = __webpack_require__(56535); -const { PathType, getType } = __webpack_require__(83544); +const forEachBail = __webpack_require__(64334); +const { PathType, getType } = __webpack_require__(18662); /** @typedef {import("./Resolver")} Resolver */ /** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ /** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ -/** @typedef {{alias: string|Array|false, name: string, onlyModule?: boolean}} AliasOption */ +/** @typedef {string | Array | false} Alias */ +/** @typedef {{alias: Alias, name: string, onlyModule?: boolean}} AliasOption */ module.exports = class AliasPlugin { /** @@ -24693,6 +24784,10 @@ module.exports = class AliasPlugin { */ apply(resolver) { const target = resolver.ensureHook(this.target); + /** + * @param {string} maybeAbsolutePath path + * @returns {null|string} absolute path with slash ending + */ const getAbsolutePathWithSlashEnding = maybeAbsolutePath => { const type = getType(maybeAbsolutePath); if (type === PathType.AbsolutePosix || type === PathType.AbsoluteWin) { @@ -24700,6 +24795,11 @@ module.exports = class AliasPlugin { } return null; }; + /** + * @param {string} path path + * @param {string} maybeSubPath sub path + * @returns {boolean} true, if path is sub path + */ const isSubPath = (path, maybeSubPath) => { const absolutePath = getAbsolutePathWithSlashEnding(maybeSubPath); if (!absolutePath) return false; @@ -24713,6 +24813,7 @@ module.exports = class AliasPlugin { forEachBail( this.options, (item, callback) => { + /** @type {boolean} */ let shouldStop = false; if ( innerRequest === item.name || @@ -24721,7 +24822,13 @@ module.exports = class AliasPlugin { ? innerRequest.startsWith(`${item.name}/`) : isSubPath(innerRequest, item.name))) ) { - const remainingRequest = innerRequest.substr(item.name.length); + /** @type {string} */ + const remainingRequest = innerRequest.slice(item.name.length); + /** + * @param {Alias} alias alias + * @param {(err?: null|Error, result?: null|ResolveRequest) => void} callback callback + * @returns {void} + */ const resolveWithAlias = (alias, callback) => { if (alias === false) { /** @type {ResolveRequest} */ @@ -24741,6 +24848,7 @@ module.exports = class AliasPlugin { ) { shouldStop = true; const newRequestStr = alias + remainingRequest; + /** @type {ResolveRequest} */ const obj = { ...request, request: newRequestStr, @@ -24766,6 +24874,11 @@ module.exports = class AliasPlugin { } return callback(); }; + /** + * @param {null|Error} [err] error + * @param {null|ResolveRequest} [result] result + * @returns {void} + */ const stoppingCallback = (err, result) => { if (err) return callback(err); @@ -24795,7 +24908,7 @@ module.exports = class AliasPlugin { /***/ }), -/***/ 86080: +/***/ 44581: /***/ (function(module) { "use strict"; @@ -24807,6 +24920,7 @@ module.exports = class AliasPlugin { /** @typedef {import("./Resolver")} Resolver */ +/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ /** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ module.exports = class AppendPlugin { @@ -24830,6 +24944,7 @@ module.exports = class AppendPlugin { resolver .getHook(this.source) .tapAsync("AppendPlugin", (request, resolveContext, callback) => { + /** @type {ResolveRequest} */ const obj = { ...request, path: request.path + this.appending, @@ -24850,7 +24965,7 @@ module.exports = class AppendPlugin { /***/ }), -/***/ 60152: +/***/ 38865: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -24865,7 +24980,17 @@ const nextTick = (__webpack_require__(77282).nextTick); /** @typedef {import("./Resolver").FileSystem} FileSystem */ /** @typedef {import("./Resolver").SyncFileSystem} SyncFileSystem */ +/** @typedef {any} BaseFileSystem */ +/** + * @template T + * @typedef {import("./Resolver").FileSystemCallback} FileSystemCallback + */ + +/** + * @param {string} path path + * @returns {string} dirname + */ const dirname = path => { let idx = path.length - 1; while (idx >= 0) { @@ -24878,6 +25003,12 @@ const dirname = path => { return path.slice(0, idx); }; +/** + * @template T + * @param {FileSystemCallback[]} callbacks callbacks + * @param {Error | undefined} err error + * @param {T} result result + */ const runCallbacks = (callbacks, err, result) => { if (callbacks.length === 1) { callbacks[0](err, result); @@ -24898,9 +25029,9 @@ const runCallbacks = (callbacks, err, result) => { class OperationMergerBackend { /** - * @param {any} provider async method - * @param {any} syncProvider sync method - * @param {any} providerContext call context for the provider methods + * @param {function} provider async method in filesystem + * @param {function} syncProvider sync method in filesystem + * @param {BaseFileSystem} providerContext call context for the provider methods */ constructor(provider, syncProvider, providerContext) { this._provider = provider; @@ -24909,7 +25040,13 @@ class OperationMergerBackend { this._activeAsyncOperations = new Map(); this.provide = this._provider - ? (path, options, callback) => { + ? /** + * @param {string} path path + * @param {any} options options + * @param {function} callback callback + * @returns {any} result + */ + (path, options, callback) => { if (typeof options === "function") { callback = options; options = undefined; @@ -24932,14 +25069,26 @@ class OperationMergerBackend { return; } this._activeAsyncOperations.set(path, (callbacks = [callback])); - provider(path, (err, result) => { - this._activeAsyncOperations.delete(path); - runCallbacks(callbacks, err, result); - }); + provider( + path, + /** + * @param {Error} err error + * @param {any} result result + */ + (err, result) => { + this._activeAsyncOperations.delete(path); + runCallbacks(callbacks, err, result); + } + ); } : null; this.provideSync = this._syncProvider - ? (path, options) => { + ? /** + * @param {string} path path + * @param {any} options options + * @returns {any} result + */ + (path, options) => { return this._syncProvider.call(this._providerContext, path, options); } : null; @@ -24976,18 +25125,18 @@ const STORAGE_MODE_ASYNC = 2; class CacheBackend { /** * @param {number} duration max cache duration of items - * @param {any} provider async method - * @param {any} syncProvider sync method - * @param {any} providerContext call context for the provider methods + * @param {function} provider async method + * @param {function} syncProvider sync method + * @param {BaseFileSystem} providerContext call context for the provider methods */ constructor(duration, provider, syncProvider, providerContext) { this._duration = duration; this._provider = provider; this._syncProvider = syncProvider; this._providerContext = providerContext; - /** @type {Map} */ + /** @type {Map[]>} */ this._activeAsyncOperations = new Map(); - /** @type {Map }>} */ + /** @type {Map }>} */ this._data = new Map(); /** @type {Set[]} */ this._levels = []; @@ -25003,10 +25152,18 @@ class CacheBackend { /** @type {number | undefined} */ this._nextDecay = undefined; + // @ts-ignore this.provide = provider ? this.provide.bind(this) : null; + // @ts-ignore this.provideSync = syncProvider ? this.provideSync.bind(this) : null; } + /** + * @param {string} path path + * @param {any} options options + * @param {FileSystemCallback} callback callback + * @returns {void} + */ provide(path, options, callback) { if (typeof options === "function") { callback = options; @@ -25046,17 +25203,34 @@ class CacheBackend { this._activeAsyncOperations.set(path, (callbacks = [callback])); // Run the operation - this._provider.call(this._providerContext, path, (err, result) => { - this._activeAsyncOperations.delete(path); - this._storeResult(path, err, result); + this._provider.call( + this._providerContext, + path, + /** + * @param {Error} [err] error + * @param {any} [result] result + */ + (err, result) => { + this._activeAsyncOperations.delete(path); + this._storeResult(path, err, result); - // Enter async mode if not yet done - this._enterAsyncMode(); + // Enter async mode if not yet done + this._enterAsyncMode(); - runCallbacks(callbacks, err, result); - }); + runCallbacks( + /** @type {FileSystemCallback[]} */ (callbacks), + err, + result + ); + } + ); } + /** + * @param {string} path path + * @param {any} options options + * @returns {any} result + */ provideSync(path, options) { if (typeof path !== "string") { throw new TypeError("path must be a string"); @@ -25088,17 +25262,24 @@ class CacheBackend { try { result = this._syncProvider.call(this._providerContext, path); } catch (err) { - this._storeResult(path, err, undefined); + this._storeResult(path, /** @type {Error} */ (err), undefined); this._enterSyncModeWhenIdle(); - if (callbacks) runCallbacks(callbacks, err, undefined); + if (callbacks) { + runCallbacks(callbacks, /** @type {Error} */ (err), undefined); + } throw err; } this._storeResult(path, undefined, result); this._enterSyncModeWhenIdle(); - if (callbacks) runCallbacks(callbacks, undefined, result); + if (callbacks) { + runCallbacks(callbacks, undefined, result); + } return result; } + /** + * @param {string|string[]|Set} [what] what to purge + */ purge(what) { if (!what) { if (this._mode !== STORAGE_MODE_IDLE) { @@ -25134,6 +25315,9 @@ class CacheBackend { } } + /** + * @param {string|string[]|Set} [what] what to purge + */ purgeParent(what) { if (!what) { this.purge(); @@ -25148,6 +25332,11 @@ class CacheBackend { } } + /** + * @param {string} path path + * @param {undefined | Error} err error + * @param {any} result result + */ _storeResult(path, err, result) { if (this._data.has(path)) return; const level = this._levels[this._currentLevel]; @@ -25166,8 +25355,8 @@ class CacheBackend { if (this._data.size === 0) { this._enterIdleMode(); } else { - // @ts-ignore _nextDecay is always a number in sync mode - this._nextDecay += this._tickInterval; + /** @type {number} */ + (this._nextDecay) += this._tickInterval; } } @@ -25191,8 +25380,12 @@ class CacheBackend { break; case STORAGE_MODE_SYNC: this._runDecays(); - // @ts-ignore _runDecays may change the mode - if (this._mode === STORAGE_MODE_IDLE) return; + // _runDecays may change the mode + if ( + /** @type {STORAGE_MODE_IDLE | STORAGE_MODE_SYNC | STORAGE_MODE_ASYNC}*/ + (this._mode) === STORAGE_MODE_IDLE + ) + return; timeout = Math.max( 0, /** @type {number} */ (this._nextDecay) - Date.now() @@ -25222,6 +25415,16 @@ class CacheBackend { } } +/** + * @template {function} Provider + * @template {function} AsyncProvider + * @template FileSystem + * @param {number} duration duration in ms files are cached + * @param {Provider} provider provider + * @param {AsyncProvider} syncProvider sync provider + * @param {FileSystem} providerContext provider context + * @returns {OperationMergerBackend | CacheBackend} backend + */ const createBackend = (duration, provider, syncProvider, providerContext) => { if (duration > 0) { return new CacheBackend(duration, provider, syncProvider, providerContext); @@ -25230,6 +25433,10 @@ const createBackend = (duration, provider, syncProvider, providerContext) => { }; module.exports = class CachedInputFileSystem { + /** + * @param {BaseFileSystem} fileSystem file system + * @param {number} duration duration in ms files are cached + */ constructor(fileSystem, duration) { this.fileSystem = fileSystem; @@ -25264,7 +25471,9 @@ module.exports = class CachedInputFileSystem { const readdir = this._readdirBackend.provide; this.readdir = /** @type {FileSystem["readdir"]} */ (readdir); const readdirSync = this._readdirBackend.provideSync; - this.readdirSync = /** @type {SyncFileSystem["readdirSync"]} */ (readdirSync); + this.readdirSync = /** @type {SyncFileSystem["readdirSync"]} */ ( + readdirSync + ); this._readFileBackend = createBackend( duration, @@ -25275,40 +25484,57 @@ module.exports = class CachedInputFileSystem { const readFile = this._readFileBackend.provide; this.readFile = /** @type {FileSystem["readFile"]} */ (readFile); const readFileSync = this._readFileBackend.provideSync; - this.readFileSync = /** @type {SyncFileSystem["readFileSync"]} */ (readFileSync); + this.readFileSync = /** @type {SyncFileSystem["readFileSync"]} */ ( + readFileSync + ); this._readJsonBackend = createBackend( duration, + // prettier-ignore this.fileSystem.readJson || (this.readFile && - ((path, callback) => { - // @ts-ignore - this.readFile(path, (err, buffer) => { - if (err) return callback(err); - if (!buffer || buffer.length === 0) - return callback(new Error("No file content")); - let data; - try { - data = JSON.parse(buffer.toString("utf-8")); - } catch (e) { - return callback(e); - } - callback(null, data); - }); - })), + ( + /** + * @param {string} path path + * @param {FileSystemCallback} callback + */ + (path, callback) => { + this.readFile(path, (err, buffer) => { + if (err) return callback(err); + if (!buffer || buffer.length === 0) + return callback(new Error("No file content")); + let data; + try { + data = JSON.parse(buffer.toString("utf-8")); + } catch (e) { + return callback(/** @type {Error} */ (e)); + } + callback(null, data); + }); + }) + ), + // prettier-ignore this.fileSystem.readJsonSync || (this.readFileSync && - (path => { - const buffer = this.readFileSync(path); - const data = JSON.parse(buffer.toString("utf-8")); - return data; - })), + ( + /** + * @param {string} path path + * @returns {any} result + */ + (path) => { + const buffer = this.readFileSync(path); + const data = JSON.parse(buffer.toString("utf-8")); + return data; + } + )), this.fileSystem ); const readJson = this._readJsonBackend.provide; this.readJson = /** @type {FileSystem["readJson"]} */ (readJson); const readJsonSync = this._readJsonBackend.provideSync; - this.readJsonSync = /** @type {SyncFileSystem["readJsonSync"]} */ (readJsonSync); + this.readJsonSync = /** @type {SyncFileSystem["readJsonSync"]} */ ( + readJsonSync + ); this._readlinkBackend = createBackend( duration, @@ -25319,9 +25545,14 @@ module.exports = class CachedInputFileSystem { const readlink = this._readlinkBackend.provide; this.readlink = /** @type {FileSystem["readlink"]} */ (readlink); const readlinkSync = this._readlinkBackend.provideSync; - this.readlinkSync = /** @type {SyncFileSystem["readlinkSync"]} */ (readlinkSync); + this.readlinkSync = /** @type {SyncFileSystem["readlinkSync"]} */ ( + readlinkSync + ); } + /** + * @param {string|string[]|Set} [what] what to purge + */ purge(what) { this._statBackend.purge(what); this._lstatBackend.purge(what); @@ -25335,7 +25566,7 @@ module.exports = class CachedInputFileSystem { /***/ }), -/***/ 79100: +/***/ 96236: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -25346,11 +25577,17 @@ module.exports = class CachedInputFileSystem { -const basename = (__webpack_require__(77927).basename); +const basename = (__webpack_require__(48631).basename); /** @typedef {import("./Resolver")} Resolver */ +/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ +/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ module.exports = class CloneBasenamePlugin { + /** + * @param {string | ResolveStepHook} source source + * @param {string | ResolveStepHook} target target + */ constructor(source, target) { this.source = source; this.target = target; @@ -25365,8 +25602,10 @@ module.exports = class CloneBasenamePlugin { resolver .getHook(this.source) .tapAsync("CloneBasenamePlugin", (request, resolveContext, callback) => { - const filename = basename(request.path); - const filePath = resolver.join(request.path, filename); + const requestPath = /** @type {string} */ (request.path); + const filename = /** @type {string} */ (basename(requestPath)); + const filePath = resolver.join(requestPath, filename); + /** @type {ResolveRequest} */ const obj = { ...request, path: filePath, @@ -25388,7 +25627,7 @@ module.exports = class CloneBasenamePlugin { /***/ }), -/***/ 75418: +/***/ 88312: /***/ (function(module) { "use strict"; @@ -25426,7 +25665,7 @@ module.exports = class ConditionalPlugin { apply(resolver) { const target = resolver.ensureHook(this.target); const { test, message, allowAlternatives } = this; - const keys = Object.keys(test); + const keys = /** @type {(keyof ResolveRequest)[]} */ (Object.keys(test)); resolver .getHook(this.source) .tapAsync("ConditionalPlugin", (request, resolveContext, callback) => { @@ -25455,7 +25694,7 @@ module.exports = class ConditionalPlugin { /***/ }), -/***/ 78778: +/***/ 99393: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -25466,9 +25705,10 @@ module.exports = class ConditionalPlugin { -const DescriptionFileUtils = __webpack_require__(3980); +const DescriptionFileUtils = __webpack_require__(92948); /** @typedef {import("./Resolver")} Resolver */ +/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ /** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ module.exports = class DescriptionFilePlugin { @@ -25524,7 +25764,8 @@ module.exports = class DescriptionFilePlugin { return callback(); } const relativePath = - "." + path.substr(result.directory.length).replace(/\\/g, "/"); + "." + path.slice(result.directory.length).replace(/\\/g, "/"); + /** @type {ResolveRequest} */ const obj = { ...request, descriptionFilePath: result.path, @@ -25559,7 +25800,7 @@ module.exports = class DescriptionFilePlugin { /***/ }), -/***/ 3980: +/***/ 92948: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; @@ -25570,14 +25811,17 @@ module.exports = class DescriptionFilePlugin { -const forEachBail = __webpack_require__(56535); +const forEachBail = __webpack_require__(64334); /** @typedef {import("./Resolver")} Resolver */ +/** @typedef {import("./Resolver").JsonObject} JsonObject */ +/** @typedef {import("./Resolver").JsonValue} JsonValue */ /** @typedef {import("./Resolver").ResolveContext} ResolveContext */ +/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ /** * @typedef {Object} DescriptionFileInfo - * @property {any=} content + * @property {JsonObject=} content * @property {string} path * @property {string} directory */ @@ -25588,6 +25832,13 @@ const forEachBail = __webpack_require__(56535); * @param {DescriptionFileInfo=} result */ +/** + * @typedef {Object} Result + * @property {string} path path to description file + * @property {string} directory directory of description file + * @property {JsonObject} content content of description file + */ + /** * @param {Resolver} resolver resolver * @param {string} directory directory @@ -25611,6 +25862,11 @@ function loadDescriptionFile( } forEachBail( filenames, + /** + * @param {string} filename filename + * @param {(err?: null|Error, result?: null|Result) => void} callback callback + * @returns {void} + */ (filename, callback) => { const descriptionFilePath = resolver.join(directory, filename); if (resolver.fileSystem.readJson) { @@ -25630,7 +25886,7 @@ function loadDescriptionFile( if (resolveContext.fileDependencies) { resolveContext.fileDependencies.add(descriptionFilePath); } - onJson(null, content); + onJson(null, /** @type {JsonObject} */ (content)); }); } else { resolver.fileSystem.readFile(descriptionFilePath, (err, content) => { @@ -25643,13 +25899,15 @@ function loadDescriptionFile( if (resolveContext.fileDependencies) { resolveContext.fileDependencies.add(descriptionFilePath); } + + /** @type {JsonObject | undefined} */ let json; if (content) { try { json = JSON.parse(content.toString()); - } catch (e) { - return onJson(e); + } catch (/** @type {unknown} */ e) { + return onJson(/** @type {Error} */ (e)); } } else { return onJson(new Error("No content in file")); @@ -25659,6 +25917,11 @@ function loadDescriptionFile( }); } + /** + * @param {null|Error} [err] error + * @param {JsonObject} [content] content + * @returns {void} + */ function onJson(err, content) { if (err) { if (resolveContext.log) @@ -25671,12 +25934,17 @@ function loadDescriptionFile( return callback(err); } callback(null, { - content, + content: /** @type {JsonObject} */ (content), directory, path: descriptionFilePath }); } }, + /** + * @param {null|Error} [err] error + * @param {null|Result} [result] result + * @returns {void} + */ (err, result) => { if (err) return callback(err); if (result) { @@ -25696,20 +25964,21 @@ function loadDescriptionFile( } /** - * @param {any} content content + * @param {JsonObject} content content * @param {string|string[]} field field - * @returns {object|string|number|boolean|undefined} field data + * @returns {JsonValue | undefined} field data */ function getField(content, field) { if (!content) return undefined; if (Array.isArray(field)) { + /** @type {JsonValue} */ let current = content; for (let j = 0; j < field.length; j++) { if (current === null || typeof current !== "object") { current = null; break; } - current = current[field[j]]; + current = /** @type {JsonObject} */ (current)[field[j]]; } return current; } else { @@ -25727,7 +25996,7 @@ function cdUp(directory) { j = directory.lastIndexOf("\\"); const p = i < 0 ? j : j < 0 ? i : i < j ? j : i; if (p < 0) return null; - return directory.substr(0, p || 1); + return directory.slice(0, p || 1); } exports.loadDescriptionFile = loadDescriptionFile; @@ -25737,7 +26006,7 @@ exports.cdUp = cdUp; /***/ }), -/***/ 78245: +/***/ 29945: /***/ (function(module) { "use strict"; @@ -25808,7 +26077,7 @@ module.exports = class DirectoryExistsPlugin { /***/ }), -/***/ 14295: +/***/ 60869: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -25820,13 +26089,15 @@ module.exports = class DirectoryExistsPlugin { const path = __webpack_require__(71017); -const DescriptionFileUtils = __webpack_require__(3980); -const forEachBail = __webpack_require__(56535); -const { processExportsField } = __webpack_require__(98211); -const { parseIdentifier } = __webpack_require__(91698); -const { checkImportsExportsFieldTarget } = __webpack_require__(83544); +const DescriptionFileUtils = __webpack_require__(92948); +const forEachBail = __webpack_require__(64334); +const { processExportsField } = __webpack_require__(53064); +const { parseIdentifier } = __webpack_require__(60528); +const { checkImportsExportsFieldTarget } = __webpack_require__(18662); /** @typedef {import("./Resolver")} Resolver */ +/** @typedef {import("./Resolver").JsonObject} JsonObject */ +/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ /** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ /** @typedef {import("./util/entrypoints").ExportsField} ExportsField */ /** @typedef {import("./util/entrypoints").FieldProcessor} FieldProcessor */ @@ -25843,7 +26114,7 @@ module.exports = class ExportsFieldPlugin { this.target = target; this.conditionNames = conditionNames; this.fieldName = fieldNamePath; - /** @type {WeakMap} */ + /** @type {WeakMap} */ this.fieldProcessorCache = new WeakMap(); } @@ -25872,11 +26143,14 @@ module.exports = class ExportsFieldPlugin { request.query + request.fragment : request.request; - /** @type {ExportsField|null} */ - const exportsField = DescriptionFileUtils.getField( - request.descriptionFileData, - this.fieldName - ); + const exportsField = + /** @type {ExportsField|null|undefined} */ + ( + DescriptionFileUtils.getField( + /** @type {JsonObject} */ (request.descriptionFileData), + this.fieldName + ) + ); if (!exportsField) return callback(); if (request.directory) { @@ -25887,6 +26161,7 @@ module.exports = class ExportsFieldPlugin { ); } + /** @type {string[]} */ let paths; try { @@ -25894,23 +26169,23 @@ module.exports = class ExportsFieldPlugin { // because we use a WeakMap and the exportsField could be a string too. // Description file is always an object when exports field can be accessed. let fieldProcessor = this.fieldProcessorCache.get( - request.descriptionFileData + /** @type {JsonObject} */ (request.descriptionFileData) ); if (fieldProcessor === undefined) { fieldProcessor = processExportsField(exportsField); this.fieldProcessorCache.set( - request.descriptionFileData, + /** @type {JsonObject} */ (request.descriptionFileData), fieldProcessor ); } paths = fieldProcessor(remainingRequest, this.conditionNames); - } catch (err) { + } catch (/** @type {unknown} */ err) { if (resolveContext.log) { resolveContext.log( `Exports field in ${request.descriptionFilePath} can't be processed: ${err}` ); } - return callback(err); + return callback(/** @type {Error} */ (err)); } if (paths.length === 0) { @@ -25923,6 +26198,11 @@ module.exports = class ExportsFieldPlugin { forEachBail( paths, + /** + * @param {string} p path + * @param {(err?: null|Error, result?: null|ResolveRequest) => void} callback callback + * @returns {void} + */ (p, callback) => { const parsedIdentifier = parseIdentifier(p); @@ -25936,6 +26216,7 @@ module.exports = class ExportsFieldPlugin { return callback(error); } + /** @type {ResolveRequest} */ const obj = { ...request, request: undefined, @@ -25956,6 +26237,11 @@ module.exports = class ExportsFieldPlugin { callback ); }, + /** + * @param {null|Error} [err] error + * @param {null|ResolveRequest} [result] result + * @returns {void} + */ (err, result) => callback(err, result || null) ); }); @@ -25965,7 +26251,7 @@ module.exports = class ExportsFieldPlugin { /***/ }), -/***/ 78283: +/***/ 14303: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -25976,7 +26262,7 @@ module.exports = class ExportsFieldPlugin { -const forEachBail = __webpack_require__(56535); +const forEachBail = __webpack_require__(64334); /** @typedef {import("./Resolver")} Resolver */ /** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ @@ -26007,27 +26293,60 @@ module.exports = class ExtensionAliasPlugin { .tapAsync("ExtensionAliasPlugin", (request, resolveContext, callback) => { const requestPath = request.request; if (!requestPath || !requestPath.endsWith(extension)) return callback(); - const resolve = (alias, callback) => { - resolver.doResolve( + const isAliasString = typeof alias === "string"; + /** + * @param {string} alias extension alias + * @param {(err?: null|Error, result?: null|ResolveRequest) => void} callback callback + * @param {number} [index] index + * @returns {void} + */ + const resolve = (alias, callback, index) => { + const newRequest = `${requestPath.slice( + 0, + -extension.length + )}${alias}`; + + return resolver.doResolve( target, { ...request, - request: `${requestPath.slice(0, -extension.length)}${alias}`, + request: newRequest, fullySpecified: true }, `aliased from extension alias with mapping '${extension}' to '${alias}'`, resolveContext, - callback + (err, result) => { + // Throw error if we are on the last alias (for multiple aliases) and it failed, always throw if we are not an array or we have only one alias + if (!isAliasString && index) { + if (index !== this.options.alias.length) { + if (resolveContext.log) { + resolveContext.log( + `Failed to alias from extension alias with mapping '${extension}' to '${alias}' for '${newRequest}': ${err}` + ); + } + + return callback(null, result); + } + + return callback(err, result); + } else { + callback(err, result); + } + } ); }; - + /** + * @param {null|Error} [err] error + * @param {null|ResolveRequest} [result] result + * @returns {void} + */ const stoppingCallback = (err, result) => { if (err) return callback(err); if (result) return callback(null, result); // Don't allow other aliasing or raw request return callback(null, null); }; - if (typeof alias === "string") { + if (isAliasString) { resolve(alias, stoppingCallback); } else if (alias.length > 1) { forEachBail(alias, resolve, stoppingCallback); @@ -26041,7 +26360,7 @@ module.exports = class ExtensionAliasPlugin { /***/ }), -/***/ 87580: +/***/ 73361: /***/ (function(module) { "use strict"; @@ -26107,7 +26426,7 @@ module.exports = class FileExistsPlugin { /***/ }), -/***/ 32731: +/***/ 46380: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -26119,13 +26438,15 @@ module.exports = class FileExistsPlugin { const path = __webpack_require__(71017); -const DescriptionFileUtils = __webpack_require__(3980); -const forEachBail = __webpack_require__(56535); -const { processImportsField } = __webpack_require__(98211); -const { parseIdentifier } = __webpack_require__(91698); -const { checkImportsExportsFieldTarget } = __webpack_require__(83544); +const DescriptionFileUtils = __webpack_require__(92948); +const forEachBail = __webpack_require__(64334); +const { processImportsField } = __webpack_require__(53064); +const { parseIdentifier } = __webpack_require__(60528); +const { checkImportsExportsFieldTarget } = __webpack_require__(18662); /** @typedef {import("./Resolver")} Resolver */ +/** @typedef {import("./Resolver").JsonObject} JsonObject */ +/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ /** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ /** @typedef {import("./util/entrypoints").FieldProcessor} FieldProcessor */ /** @typedef {import("./util/entrypoints").ImportsField} ImportsField */ @@ -26152,7 +26473,7 @@ module.exports = class ImportsFieldPlugin { this.targetPackage = targetPackage; this.conditionNames = conditionNames; this.fieldName = fieldNamePath; - /** @type {WeakMap} */ + /** @type {WeakMap} */ this.fieldProcessorCache = new WeakMap(); } @@ -26174,11 +26495,14 @@ module.exports = class ImportsFieldPlugin { const remainingRequest = request.request + request.query + request.fragment; - /** @type {ImportsField|null} */ - const importsField = DescriptionFileUtils.getField( - request.descriptionFileData, - this.fieldName - ); + const importsField = + /** @type {ImportsField|null|undefined} */ + ( + DescriptionFileUtils.getField( + /** @type {JsonObject} */ (request.descriptionFileData), + this.fieldName + ) + ); if (!importsField) return callback(); if (request.directory) { @@ -26189,6 +26513,7 @@ module.exports = class ImportsFieldPlugin { ); } + /** @type {string[]} */ let paths; try { @@ -26196,23 +26521,23 @@ module.exports = class ImportsFieldPlugin { // because we use a WeakMap and the importsField could be a string too. // Description file is always an object when exports field can be accessed. let fieldProcessor = this.fieldProcessorCache.get( - request.descriptionFileData + /** @type {JsonObject} */ (request.descriptionFileData) ); if (fieldProcessor === undefined) { fieldProcessor = processImportsField(importsField); this.fieldProcessorCache.set( - request.descriptionFileData, + /** @type {JsonObject} */ (request.descriptionFileData), fieldProcessor ); } paths = fieldProcessor(remainingRequest, this.conditionNames); - } catch (err) { + } catch (/** @type {unknown} */ err) { if (resolveContext.log) { resolveContext.log( `Imports field in ${request.descriptionFilePath} can't be processed: ${err}` ); } - return callback(err); + return callback(/** @type {Error} */ (err)); } if (paths.length === 0) { @@ -26225,6 +26550,11 @@ module.exports = class ImportsFieldPlugin { forEachBail( paths, + /** + * @param {string} p path + * @param {(err?: null|Error, result?: null|ResolveRequest) => void} callback callback + * @returns {void} + */ (p, callback) => { const parsedIdentifier = parseIdentifier(p); @@ -26241,6 +26571,7 @@ module.exports = class ImportsFieldPlugin { switch (path_.charCodeAt(0)) { // should be relative case dotCode: { + /** @type {ResolveRequest} */ const obj = { ...request, request: undefined, @@ -26265,6 +26596,7 @@ module.exports = class ImportsFieldPlugin { // package resolving default: { + /** @type {ResolveRequest} */ const obj = { ...request, request: path_, @@ -26284,6 +26616,11 @@ module.exports = class ImportsFieldPlugin { } } }, + /** + * @param {null|Error} [err] error + * @param {null|ResolveRequest} [result] result + * @returns {void} + */ (err, result) => callback(err, result || null) ); }); @@ -26293,7 +26630,7 @@ module.exports = class ImportsFieldPlugin { /***/ }), -/***/ 93899: +/***/ 57549: /***/ (function(module) { "use strict"; @@ -26305,6 +26642,7 @@ module.exports = class ImportsFieldPlugin { /** @typedef {import("./Resolver")} Resolver */ +/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ /** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ const namespaceStartCharCode = "@".charCodeAt(0); @@ -26337,7 +26675,12 @@ module.exports = class JoinRequestPartPlugin { i = req.indexOf("/", i + 1); } - let moduleName, remainingRequest, fullySpecified; + /** @type {string} */ + let moduleName; + /** @type {string} */ + let remainingRequest; + /** @type {boolean} */ + let fullySpecified; if (i < 0) { moduleName = req; remainingRequest = "."; @@ -26345,11 +26688,16 @@ module.exports = class JoinRequestPartPlugin { } else { moduleName = req.slice(0, i); remainingRequest = "." + req.slice(i); - fullySpecified = request.fullySpecified; + fullySpecified = /** @type {boolean} */ (request.fullySpecified); } + /** @type {ResolveRequest} */ const obj = { ...request, - path: resolver.join(request.path, moduleName), + path: resolver.join( + /** @type {string} */ + (request.path), + moduleName + ), relativePath: request.relativePath && resolver.join(request.relativePath, moduleName), @@ -26365,7 +26713,7 @@ module.exports = class JoinRequestPartPlugin { /***/ }), -/***/ 24377: +/***/ 15929: /***/ (function(module) { "use strict"; @@ -26377,6 +26725,7 @@ module.exports = class JoinRequestPartPlugin { /** @typedef {import("./Resolver")} Resolver */ +/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ /** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ module.exports = class JoinRequestPlugin { @@ -26398,12 +26747,15 @@ module.exports = class JoinRequestPlugin { resolver .getHook(this.source) .tapAsync("JoinRequestPlugin", (request, resolveContext, callback) => { + const requestPath = /** @type {string} */ (request.path); + const requestRequest = /** @type {string} */ (request.request); + /** @type {ResolveRequest} */ const obj = { ...request, - path: resolver.join(request.path, request.request), + path: resolver.join(requestPath, requestRequest), relativePath: request.relativePath && - resolver.join(request.relativePath, request.request), + resolver.join(request.relativePath, requestRequest), request: undefined }; resolver.doResolve(target, obj, null, resolveContext, callback); @@ -26414,7 +26766,7 @@ module.exports = class JoinRequestPlugin { /***/ }), -/***/ 58295: +/***/ 42970: /***/ (function(module) { "use strict"; @@ -26426,8 +26778,12 @@ module.exports = class JoinRequestPlugin { /** @typedef {import("./Resolver")} Resolver */ +/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ module.exports = class LogInfoPlugin { + /** + * @param {string | ResolveStepHook} source source + */ constructor(source) { this.source = source; } @@ -26472,7 +26828,7 @@ module.exports = class LogInfoPlugin { /***/ }), -/***/ 26583: +/***/ 12446: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -26484,10 +26840,13 @@ module.exports = class LogInfoPlugin { const path = __webpack_require__(71017); -const DescriptionFileUtils = __webpack_require__(3980); +const DescriptionFileUtils = __webpack_require__(92948); /** @typedef {import("./Resolver")} Resolver */ +/** @typedef {import("./Resolver").JsonObject} JsonObject */ +/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ /** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ + /** @typedef {{name: string|Array, forceRelative: boolean}} MainFieldOptions */ const alreadyTriedMainField = Symbol("alreadyTriedMainField"); @@ -26515,15 +26874,20 @@ module.exports = class MainFieldPlugin { .tapAsync("MainFieldPlugin", (request, resolveContext, callback) => { if ( request.path !== request.descriptionFileRoot || - request[alreadyTriedMainField] === request.descriptionFilePath || + /** @type {ResolveRequest & { [alreadyTriedMainField]?: string }} */ + (request)[alreadyTriedMainField] === request.descriptionFilePath || !request.descriptionFilePath ) return callback(); const filename = path.basename(request.descriptionFilePath); - let mainModule = DescriptionFileUtils.getField( - request.descriptionFileData, - this.options.name - ); + let mainModule = + /** @type {string|null|undefined} */ + ( + DescriptionFileUtils.getField( + /** @type {JsonObject} */ (request.descriptionFileData), + this.options.name + ) + ); if ( !mainModule || @@ -26535,6 +26899,7 @@ module.exports = class MainFieldPlugin { } if (this.options.forceRelative && !/^\.\.?\//.test(mainModule)) mainModule = "./" + mainModule; + /** @type {ResolveRequest & { [alreadyTriedMainField]?: string }} */ const obj = { ...request, request: mainModule, @@ -26561,7 +26926,7 @@ module.exports = class MainFieldPlugin { /***/ }), -/***/ 16108: +/***/ 786: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -26572,10 +26937,11 @@ module.exports = class MainFieldPlugin { -const forEachBail = __webpack_require__(56535); -const getPaths = __webpack_require__(77927); +const forEachBail = __webpack_require__(64334); +const getPaths = __webpack_require__(48631); /** @typedef {import("./Resolver")} Resolver */ +/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ /** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ module.exports = class ModulesInHierarchicalDirectoriesPlugin { @@ -26602,7 +26968,7 @@ module.exports = class ModulesInHierarchicalDirectoriesPlugin { "ModulesInHierarchicalDirectoriesPlugin", (request, resolveContext, callback) => { const fs = resolver.fileSystem; - const addrs = getPaths(request.path) + const addrs = getPaths(/** @type {string} */ (request.path)) .paths.map(p => { return this.directories.map(d => resolver.join(p, d)); }) @@ -26612,9 +26978,15 @@ module.exports = class ModulesInHierarchicalDirectoriesPlugin { }, []); forEachBail( addrs, + /** + * @param {string} addr addr + * @param {(err?: null|Error, result?: null|ResolveRequest) => void} callback callback + * @returns {void} + */ (addr, callback) => { fs.stat(addr, (err, stat) => { if (!err && stat && stat.isDirectory()) { + /** @type {ResolveRequest} */ const obj = { ...request, path: addr, @@ -26649,7 +27021,7 @@ module.exports = class ModulesInHierarchicalDirectoriesPlugin { /***/ }), -/***/ 85856: +/***/ 70179: /***/ (function(module) { "use strict"; @@ -26661,6 +27033,7 @@ module.exports = class ModulesInHierarchicalDirectoriesPlugin { /** @typedef {import("./Resolver")} Resolver */ +/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ /** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ module.exports = class ModulesInRootPlugin { @@ -26684,6 +27057,7 @@ module.exports = class ModulesInRootPlugin { resolver .getHook(this.source) .tapAsync("ModulesInRootPlugin", (request, resolveContext, callback) => { + /** @type {ResolveRequest} */ const obj = { ...request, path: this.path, @@ -26704,7 +27078,7 @@ module.exports = class ModulesInRootPlugin { /***/ }), -/***/ 5336: +/***/ 80619: /***/ (function(module) { "use strict"; @@ -26745,7 +27119,7 @@ module.exports = class NextPlugin { /***/ }), -/***/ 82427: +/***/ 61910: /***/ (function(module) { "use strict"; @@ -26782,6 +27156,7 @@ module.exports = class ParsePlugin { .getHook(this.source) .tapAsync("ParsePlugin", (request, resolveContext, callback) => { const parsed = resolver.parse(/** @type {string} */ (request.request)); + /** @type {ResolveRequest} */ const obj = { ...request, ...parsed, ...this.requestOptions }; if (request.query && !parsed.query) { obj.query = request.query; @@ -26797,6 +27172,7 @@ module.exports = class ParsePlugin { // There is an edge-case where a request with # can be a path or a fragment -> try both if (obj.request && !obj.query && obj.fragment) { const directory = obj.fragment.endsWith("/"); + /** @type {ResolveRequest} */ const alternative = { ...obj, directory, @@ -26827,7 +27203,7 @@ module.exports = class ParsePlugin { /***/ }), -/***/ 30156: +/***/ 73161: /***/ (function(module) { "use strict"; @@ -26840,6 +27216,7 @@ module.exports = class ParsePlugin { /** @typedef {import("./Resolver")} Resolver */ /** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ +/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ /** * @typedef {Object} PnpApiImpl * @property {function(string, string, object): string} resolveToUnqualified @@ -26862,6 +27239,7 @@ module.exports = class PnpPlugin { * @returns {void} */ apply(resolver) { + /** @type {ResolveStepHook} */ const target = resolver.ensureHook(this.target); resolver .getHook(this.source) @@ -26878,7 +27256,9 @@ module.exports = class PnpPlugin { const packageName = packageMatch[0]; const innerRequest = `.${req.slice(packageName.length)}`; + /** @type {string|undefined} */ let resolution; + /** @type {string|undefined} */ let apiResolution; try { resolution = this.pnpApi.resolveToUnqualified(packageName, issuer, { @@ -26889,21 +27269,25 @@ module.exports = class PnpPlugin { considerBuiltins: false }); } - } catch (error) { + } catch (/** @type {unknown} */ error) { if ( - error.code === "MODULE_NOT_FOUND" && - error.pnpCode === "UNDECLARED_DEPENDENCY" + /** @type {Error & { code: string }} */ + (error).code === "MODULE_NOT_FOUND" && + /** @type {Error & { pnpCode: string }} */ + (error).pnpCode === "UNDECLARED_DEPENDENCY" ) { // This is not a PnP managed dependency. // Try to continue resolving with our alternatives if (resolveContext.log) { resolveContext.log(`request is not managed by the pnpapi`); - for (const line of error.message.split("\n").filter(Boolean)) + for (const line of /** @type {Error} */ (error).message + .split("\n") + .filter(Boolean)) resolveContext.log(` ${line}`); } return callback(); } - return callback(error); + return callback(/** @type {Error} */ (error)); } if (resolution === packageName) return callback(); @@ -26911,7 +27295,7 @@ module.exports = class PnpPlugin { if (apiResolution && resolveContext.fileDependencies) { resolveContext.fileDependencies.add(apiResolution); } - + /** @type {ResolveRequest} */ const obj = { ...request, path: resolution, @@ -26938,7 +27322,7 @@ module.exports = class PnpPlugin { /***/ }), -/***/ 44175: +/***/ 1865: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -26950,17 +27334,21 @@ module.exports = class PnpPlugin { const { AsyncSeriesBailHook, AsyncSeriesHook, SyncHook } = __webpack_require__(70793); -const createInnerContext = __webpack_require__(80620); -const { parseIdentifier } = __webpack_require__(91698); +const createInnerContext = __webpack_require__(13285); +const { parseIdentifier } = __webpack_require__(60528); const { normalize, cachedJoin: join, getType, PathType -} = __webpack_require__(83544); +} = __webpack_require__(18662); /** @typedef {import("./ResolverFactory").ResolveOptions} ResolveOptions */ +/** @typedef {Error & {details?: string}} ErrorWithDetail */ + +/** @typedef {(err: ErrorWithDetail|null, res?: string|false, req?: ResolveRequest) => void} ResolveCallback */ + /** * @typedef {Object} FileSystemStats * @property {function(): boolean} isDirectory @@ -26989,10 +27377,18 @@ const { * @param {T=} result */ +/** @typedef {function((NodeJS.ErrnoException | null)=, (string | Buffer)[] | import("fs").Dirent[]=): void} DirentArrayCallback */ + +/** + * @typedef {Object} ReaddirOptions + * @property {BufferEncoding | null | 'buffer'} [encoding] + * @property {boolean | undefined} [withFileTypes=false] + */ + /** * @typedef {Object} FileSystem * @property {(function(string, FileSystemCallback): void) & function(string, object, FileSystemCallback): void} readFile - * @property {(function(string, FileSystemCallback<(Buffer | string)[] | FileSystemDirent[]>): void) & function(string, object, FileSystemCallback<(Buffer | string)[] | FileSystemDirent[]>): void} readdir + * @property {function(string, (ReaddirOptions | BufferEncoding | null | undefined | 'buffer' | DirentArrayCallback)=, DirentArrayCallback=): void} readdir * @property {((function(string, FileSystemCallback): void) & function(string, object, FileSystemCallback): void)=} readJson * @property {(function(string, FileSystemCallback): void) & function(string, object, FileSystemCallback): void} readlink * @property {(function(string, FileSystemCallback): void) & function(string, object, FileSystemCallback): void=} lstat @@ -27020,15 +27416,24 @@ const { * @property {boolean} internal */ +/** @typedef {string | number | boolean | null} JsonPrimitive */ +/** @typedef {JsonValue[]} JsonArray */ +/** @typedef {JsonPrimitive | JsonObject | JsonArray} JsonValue */ +/** @typedef {{[Key in string]: JsonValue} & {[Key in string]?: JsonValue | undefined}} JsonObject */ + /** * @typedef {Object} BaseResolveRequest * @property {string | false} path + * @property {object=} context * @property {string=} descriptionFilePath * @property {string=} descriptionFileRoot - * @property {object=} descriptionFileData + * @property {JsonObject=} descriptionFileData * @property {string=} relativePath * @property {boolean=} ignoreSymlinks * @property {boolean=} fullySpecified + * @property {string=} __innerRequest + * @property {string=} __innerRequest_request + * @property {string=} __innerRequest_relativePath */ /** @typedef {BaseResolveRequest & Partial} ResolveRequest */ @@ -27038,7 +27443,12 @@ const { * @typedef {string} StackEntry */ -/** @template T @typedef {{ add: (T) => void }} WriteOnlySet */ +/** + * @template T + * @typedef {{ add: (item: T) => void }} WriteOnlySet + */ + +/** @typedef {(function (ResolveRequest): void)} ResolveContextYield */ /** * Resolve context @@ -27048,17 +27458,29 @@ const { * @property {WriteOnlySet=} missingDependencies dependencies that was not found on file system * @property {Set=} stack set of hooks' calls. For instance, `resolve → parsedResolve → describedResolve`, * @property {(function(string): void)=} log log function - * @property {(function (ResolveRequest): void)=} yield yield result, if provided plugins can return several results + * @property {ResolveContextYield=} yield yield result, if provided plugins can return several results */ /** @typedef {AsyncSeriesBailHook<[ResolveRequest, ResolveContext], ResolveRequest | null>} ResolveStepHook */ +/** + * @typedef {Object} KnownHooks + * @property {SyncHook<[ResolveStepHook, ResolveRequest], void>} resolveStep + * @property {SyncHook<[ResolveRequest, Error]>} noResolve + * @property {ResolveStepHook} resolve + * @property {AsyncSeriesHook<[ResolveRequest, ResolveContext]>} result + */ + +/** + * @typedef {{[key: string]: ResolveStepHook}} EnsuredHooks + */ + /** * @param {string} str input string * @returns {string} in camel case */ function toCamelCase(str) { - return str.replace(/-([a-z])/g, str => str.substr(1).toUpperCase()); + return str.replace(/-([a-z])/g, str => str.slice(1).toUpperCase()); } class Resolver { @@ -27088,17 +27510,14 @@ class Resolver { constructor(fileSystem, options) { this.fileSystem = fileSystem; this.options = options; + /** @type {KnownHooks} */ this.hooks = { - /** @type {SyncHook<[ResolveStepHook, ResolveRequest], void>} */ resolveStep: new SyncHook(["hook", "request"], "resolveStep"), - /** @type {SyncHook<[ResolveRequest, Error]>} */ noResolve: new SyncHook(["request", "error"], "noResolve"), - /** @type {ResolveStepHook} */ resolve: new AsyncSeriesBailHook( ["request", "resolveContext"], "resolve" ), - /** @type {AsyncSeriesHook<[ResolveRequest, ResolveContext]>} */ result: new AsyncSeriesHook(["result", "resolveContext"], "result") }; } @@ -27113,25 +27532,29 @@ class Resolver { } name = toCamelCase(name); if (/^before/.test(name)) { - return /** @type {ResolveStepHook} */ (this.ensureHook( - name[6].toLowerCase() + name.substr(7) - ).withOptions({ - stage: -10 - })); + return /** @type {ResolveStepHook} */ ( + this.ensureHook(name[6].toLowerCase() + name.slice(7)).withOptions({ + stage: -10 + }) + ); } if (/^after/.test(name)) { - return /** @type {ResolveStepHook} */ (this.ensureHook( - name[5].toLowerCase() + name.substr(6) - ).withOptions({ - stage: 10 - })); + return /** @type {ResolveStepHook} */ ( + this.ensureHook(name[5].toLowerCase() + name.slice(6)).withOptions({ + stage: 10 + }) + ); } - const hook = this.hooks[name]; + /** @type {ResolveStepHook} */ + const hook = /** @type {KnownHooks & EnsuredHooks} */ (this.hooks)[name]; if (!hook) { - return (this.hooks[name] = new AsyncSeriesBailHook( + /** @type {KnownHooks & EnsuredHooks} */ + (this.hooks)[name] = new AsyncSeriesBailHook( ["request", "resolveContext"], name - )); + ); + + return /** @type {KnownHooks & EnsuredHooks} */ (this.hooks)[name]; } return hook; } @@ -27146,20 +27569,21 @@ class Resolver { } name = toCamelCase(name); if (/^before/.test(name)) { - return /** @type {ResolveStepHook} */ (this.getHook( - name[6].toLowerCase() + name.substr(7) - ).withOptions({ - stage: -10 - })); + return /** @type {ResolveStepHook} */ ( + this.getHook(name[6].toLowerCase() + name.slice(7)).withOptions({ + stage: -10 + }) + ); } if (/^after/.test(name)) { - return /** @type {ResolveStepHook} */ (this.getHook( - name[5].toLowerCase() + name.substr(6) - ).withOptions({ - stage: 10 - })); + return /** @type {ResolveStepHook} */ ( + this.getHook(name[5].toLowerCase() + name.slice(6)).withOptions({ + stage: 10 + }) + ); } - const hook = this.hooks[name]; + /** @type {ResolveStepHook} */ + const hook = /** @type {KnownHooks & EnsuredHooks} */ (this.hooks)[name]; if (!hook) { throw new Error(`Hook ${name} doesn't exist`); } @@ -27198,7 +27622,7 @@ class Resolver { * @param {string} path context path * @param {string} request request string * @param {ResolveContext} resolveContext resolve context - * @param {function(Error | null, (string|false)=, ResolveRequest=): void} callback callback function + * @param {ResolveCallback} callback callback function * @returns {void} */ resolve(context, path, request, resolveContext, callback) { @@ -27211,29 +27635,45 @@ class Resolver { if (!resolveContext) return callback(new Error("resolveContext argument is not set")); + /** @type {ResolveRequest} */ const obj = { context: context, path: path, request: request }; + /** @type {ResolveContextYield | undefined} */ let yield_; let yieldCalled = false; + /** @type {ResolveContextYield | undefined} */ let finishYield; if (typeof resolveContext.yield === "function") { const old = resolveContext.yield; + /** + * @param {ResolveRequest} obj object + */ yield_ = obj => { old(obj); yieldCalled = true; }; + /** + * @param {ResolveRequest} result result + * @returns {void} + */ finishYield = result => { - if (result) yield_(result); + if (result) { + /** @type {ResolveContextYield} */ (yield_)(result); + } callback(null); }; } const message = `resolve '${request}' in '${path}'`; + /** + * @param {ResolveRequest} result result + * @returns {void} + */ const finishResolved = result => { return callback( null, @@ -27246,9 +27686,13 @@ class Resolver { ); }; + /** + * @param {string[]} log logs + * @returns {void} + */ const finishWithoutResolve = log => { /** - * @type {Error & {details?: string}} + * @type {ErrorWithDetail} */ const error = new Error("Can't " + message); error.details = log.join("\n"); @@ -27259,6 +27703,7 @@ class Resolver { if (resolveContext.log) { // We need log anyway to capture it in case of an error const parentLog = resolveContext.log; + /** @type {string[]} */ const log = []; return this.doResolve( this.hooks.resolve, @@ -27278,7 +27723,12 @@ class Resolver { (err, result) => { if (err) return callback(err); - if (yieldCalled || (result && yield_)) return finishYield(result); + if (yieldCalled || (result && yield_)) { + return /** @type {ResolveContextYield} */ (finishYield)( + /** @type {ResolveRequest} */ (result) + ); + } + if (result) return finishResolved(result); return finishWithoutResolve(log); @@ -27302,14 +27752,19 @@ class Resolver { (err, result) => { if (err) return callback(err); - if (yieldCalled || (result && yield_)) return finishYield(result); + if (yieldCalled || (result && yield_)) { + return /** @type {ResolveContextYield} */ (finishYield)( + /** @type {ResolveRequest} */ (result) + ); + } + if (result) return finishResolved(result); // log is missing for the error details // so we redo the resolving for the log info // this is more expensive to the success case // is assumed by default - + /** @type {string[]} */ const log = []; return this.doResolve( @@ -27325,7 +27780,11 @@ class Resolver { if (err) return callback(err); // In a case that there is a race condition and yield will be called - if (yieldCalled || (result && yield_)) return finishYield(result); + if (yieldCalled || (result && yield_)) { + return /** @type {ResolveContextYield} */ (finishYield)( + /** @type {ResolveRequest} */ (result) + ); + } return finishWithoutResolve(log); } @@ -27335,9 +27794,18 @@ class Resolver { } } + /** + * @param {ResolveStepHook} hook hook + * @param {ResolveRequest} request request + * @param {null|string} message string + * @param {ResolveContext} resolveContext resolver context + * @param {(err?: null|Error, result?: ResolveRequest) => void} callback callback + * @returns {void} + */ doResolve(hook, request, message, resolveContext, callback) { const stackEntry = Resolver.createStackEntry(hook, request); + /** @type {Set | undefined} */ let newStack; if (resolveContext.stack) { newStack = new Set(resolveContext.stack); @@ -27409,17 +27877,25 @@ class Resolver { part.module = this.isModule(part.request); part.directory = this.isDirectory(part.request); if (part.directory) { - part.request = part.request.substr(0, part.request.length - 1); + part.request = part.request.slice(0, -1); } } return part; } + /** + * @param {string} path path + * @returns {boolean} true, if the path is a module + */ isModule(path) { return getType(path) === PathType.Normal; } + /** + * @param {string} path path + * @returns {boolean} true, if the path is private + */ isPrivate(path) { return getType(path) === PathType.Internal; } @@ -27432,10 +27908,19 @@ class Resolver { return path.endsWith("/"); } + /** + * @param {string} path path + * @param {string} request request + * @returns {string} joined path + */ join(path, request) { return join(path, request); } + /** + * @param {string} path path + * @returns {string} normalized path + */ normalize(path) { return normalize(path); } @@ -27446,7 +27931,7 @@ module.exports = Resolver; /***/ }), -/***/ 37899: +/***/ 52242: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; @@ -27458,49 +27943,52 @@ module.exports = Resolver; const versions = (__webpack_require__(77282).versions); -const Resolver = __webpack_require__(44175); -const { getType, PathType } = __webpack_require__(83544); - -const SyncAsyncFileSystemDecorator = __webpack_require__(77880); - -const AliasFieldPlugin = __webpack_require__(69800); -const AliasPlugin = __webpack_require__(98906); -const AppendPlugin = __webpack_require__(86080); -const ConditionalPlugin = __webpack_require__(75418); -const DescriptionFilePlugin = __webpack_require__(78778); -const DirectoryExistsPlugin = __webpack_require__(78245); -const ExportsFieldPlugin = __webpack_require__(14295); -const ExtensionAliasPlugin = __webpack_require__(78283); -const FileExistsPlugin = __webpack_require__(87580); -const ImportsFieldPlugin = __webpack_require__(32731); -const JoinRequestPartPlugin = __webpack_require__(93899); -const JoinRequestPlugin = __webpack_require__(24377); -const MainFieldPlugin = __webpack_require__(26583); -const ModulesInHierarchicalDirectoriesPlugin = __webpack_require__(16108); -const ModulesInRootPlugin = __webpack_require__(85856); -const NextPlugin = __webpack_require__(5336); -const ParsePlugin = __webpack_require__(82427); -const PnpPlugin = __webpack_require__(30156); -const RestrictionsPlugin = __webpack_require__(62105); -const ResultPlugin = __webpack_require__(85434); -const RootsPlugin = __webpack_require__(47221); -const SelfReferencePlugin = __webpack_require__(29751); -const SymlinkPlugin = __webpack_require__(1919); -const TryNextPlugin = __webpack_require__(28723); -const UnsafeCachePlugin = __webpack_require__(50615); -const UseFilePlugin = __webpack_require__(25838); +const Resolver = __webpack_require__(1865); +const { getType, PathType } = __webpack_require__(18662); + +const SyncAsyncFileSystemDecorator = __webpack_require__(64850); + +const AliasFieldPlugin = __webpack_require__(33279); +const AliasPlugin = __webpack_require__(12577); +const AppendPlugin = __webpack_require__(44581); +const ConditionalPlugin = __webpack_require__(88312); +const DescriptionFilePlugin = __webpack_require__(99393); +const DirectoryExistsPlugin = __webpack_require__(29945); +const ExportsFieldPlugin = __webpack_require__(60869); +const ExtensionAliasPlugin = __webpack_require__(14303); +const FileExistsPlugin = __webpack_require__(73361); +const ImportsFieldPlugin = __webpack_require__(46380); +const JoinRequestPartPlugin = __webpack_require__(57549); +const JoinRequestPlugin = __webpack_require__(15929); +const MainFieldPlugin = __webpack_require__(12446); +const ModulesInHierarchicalDirectoriesPlugin = __webpack_require__(786); +const ModulesInRootPlugin = __webpack_require__(70179); +const NextPlugin = __webpack_require__(80619); +const ParsePlugin = __webpack_require__(61910); +const PnpPlugin = __webpack_require__(73161); +const RestrictionsPlugin = __webpack_require__(54706); +const ResultPlugin = __webpack_require__(77095); +const RootsPlugin = __webpack_require__(78923); +const SelfReferencePlugin = __webpack_require__(22769); +const SymlinkPlugin = __webpack_require__(96387); +const TryNextPlugin = __webpack_require__(56663); +const UnsafeCachePlugin = __webpack_require__(51377); +const UseFilePlugin = __webpack_require__(60358); /** @typedef {import("./AliasPlugin").AliasOption} AliasOptionEntry */ /** @typedef {import("./ExtensionAliasPlugin").ExtensionAliasOption} ExtensionAliasOption */ /** @typedef {import("./PnpPlugin").PnpApiImpl} PnpApi */ +/** @typedef {import("./Resolver").EnsuredHooks} EnsuredHooks */ /** @typedef {import("./Resolver").FileSystem} FileSystem */ +/** @typedef {import("./Resolver").KnownHooks} KnownHooks */ /** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ /** @typedef {import("./Resolver").SyncFileSystem} SyncFileSystem */ /** @typedef {string|string[]|false} AliasOptionNewRequest */ /** @typedef {{[k: string]: AliasOptionNewRequest}} AliasOptions */ /** @typedef {{[k: string]: string|string[] }} ExtensionAliasOptions */ -/** @typedef {{apply: function(Resolver): void} | function(this: Resolver, Resolver): void} Plugin */ +/** @typedef {false | 0 | "" | null | undefined} Falsy */ +/** @typedef {{apply: function(Resolver): void} | (function(this: Resolver, Resolver): void) | Falsy} Plugin */ /** * @typedef {Object} UserResolveOptions @@ -27593,7 +28081,7 @@ function normalizeAlias(alias) { if (/\$$/.test(key)) { obj.onlyModule = true; - obj.name = key.substr(0, key.length - 1); + obj.name = key.slice(0, -1); } return obj; @@ -27607,6 +28095,7 @@ function normalizeAlias(alias) { */ function createOptions(options) { const mainFieldsSet = new Set(options.mainFields || ["main"]); + /** @type {ResolveOptions["mainFields"]} */ const mainFields = []; for (const item of mainFieldsSet) { @@ -27773,6 +28262,7 @@ exports.createResolver = function (options) { // TODO remove in next major // cspell:word Interal // Backward-compat + // @ts-ignore resolver.hooks.newInteralResolve = resolver.hooks.newInternalResolve; // resolve @@ -27785,7 +28275,7 @@ exports.createResolver = function (options) { new UnsafeCachePlugin( source, cachePredicate, - unsafeCache, + /** @type {import("./UnsafeCachePlugin").Cache} */ (unsafeCache), cacheWithContext, `new-${source}` ) @@ -28088,18 +28578,24 @@ exports.createResolver = function (options) { plugins.push(new NextPlugin("existing-file", "resolved")); } + const resolved = + /** @type {KnownHooks & EnsuredHooks} */ + (resolver.hooks).resolved; + // resolved if (restrictions.size > 0) { - plugins.push(new RestrictionsPlugin(resolver.hooks.resolved, restrictions)); + plugins.push(new RestrictionsPlugin(resolved, restrictions)); } - plugins.push(new ResultPlugin(resolver.hooks.resolved)); + + plugins.push(new ResultPlugin(resolved)); //// RESOLVER //// for (const plugin of plugins) { if (typeof plugin === "function") { - plugin.call(resolver, resolver); - } else { + /** @type {function(this: Resolver, Resolver): void} */ + (plugin).call(resolver, resolver); + } else if (plugin) { plugin.apply(resolver); } } @@ -28138,7 +28634,7 @@ function mergeFilteredToArray(array, filter) { /***/ }), -/***/ 62105: +/***/ 54706: /***/ (function(module) { "use strict"; @@ -28155,6 +28651,11 @@ function mergeFilteredToArray(array, filter) { const slashCode = "/".charCodeAt(0); const backslashCode = "\\".charCodeAt(0); +/** + * @param {string} path path + * @param {string} parent parent path + * @returns {boolean} true, if path is inside of parent + */ const isInside = (path, parent) => { if (!path.startsWith(parent)) return false; if (path.length === parent.length) return true; @@ -28211,7 +28712,7 @@ module.exports = class RestrictionsPlugin { /***/ }), -/***/ 85434: +/***/ 77095: /***/ (function(module) { "use strict"; @@ -28261,7 +28762,7 @@ module.exports = class ResultPlugin { /***/ }), -/***/ 47221: +/***/ 78923: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -28272,9 +28773,10 @@ module.exports = class ResultPlugin { -const forEachBail = __webpack_require__(56535); +const forEachBail = __webpack_require__(64334); /** @typedef {import("./Resolver")} Resolver */ +/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ /** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ class RootsPlugin { @@ -28305,8 +28807,14 @@ class RootsPlugin { forEachBail( this.roots, + /** + * @param {string} root root + * @param {(err?: null|Error, result?: null|ResolveRequest) => void} callback callback + * @returns {void} + */ (root, callback) => { const path = resolver.join(root, req.slice(1)); + /** @type {ResolveRequest} */ const obj = { ...request, path, @@ -28331,7 +28839,7 @@ module.exports = RootsPlugin; /***/ }), -/***/ 29751: +/***/ 22769: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -28342,9 +28850,11 @@ module.exports = RootsPlugin; -const DescriptionFileUtils = __webpack_require__(3980); +const DescriptionFileUtils = __webpack_require__(92948); /** @typedef {import("./Resolver")} Resolver */ +/** @typedef {import("./Resolver").JsonObject} JsonObject */ +/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ /** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ const slashCode = "/".charCodeAt(0); @@ -28377,13 +28887,13 @@ module.exports = class SelfReferencePlugin { // Feature is only enabled when an exports field is present const exportsField = DescriptionFileUtils.getField( - request.descriptionFileData, + /** @type {JsonObject} */ (request.descriptionFileData), this.fieldName ); if (!exportsField) return callback(); const name = DescriptionFileUtils.getField( - request.descriptionFileData, + /** @type {JsonObject} */ (request.descriptionFileData), "name" ); if (typeof name !== "string") return callback(); @@ -28394,7 +28904,7 @@ module.exports = class SelfReferencePlugin { req.charCodeAt(name.length) === slashCode) ) { const remainingRequest = `.${req.slice(name.length)}`; - + /** @type {ResolveRequest} */ const obj = { ...request, request: remainingRequest, @@ -28419,7 +28929,7 @@ module.exports = class SelfReferencePlugin { /***/ }), -/***/ 1919: +/***/ 96387: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -28430,11 +28940,12 @@ module.exports = class SelfReferencePlugin { -const forEachBail = __webpack_require__(56535); -const getPaths = __webpack_require__(77927); -const { getType, PathType } = __webpack_require__(83544); +const forEachBail = __webpack_require__(64334); +const getPaths = __webpack_require__(48631); +const { getType, PathType } = __webpack_require__(18662); /** @typedef {import("./Resolver")} Resolver */ +/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ /** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ module.exports = class SymlinkPlugin { @@ -28458,7 +28969,7 @@ module.exports = class SymlinkPlugin { .getHook(this.source) .tapAsync("SymlinkPlugin", (request, resolveContext, callback) => { if (request.ignoreSymlinks) return callback(); - const pathsResult = getPaths(request.path); + const pathsResult = getPaths(/** @type {string} */ (request.path)); const pathSegments = pathsResult.segments; const paths = pathsResult.paths; @@ -28466,13 +28977,18 @@ module.exports = class SymlinkPlugin { let idx = -1; forEachBail( paths, + /** + * @param {string} path path + * @param {(err?: null|Error, result?: null|number) => void} callback callback + * @returns {void} + */ (path, callback) => { idx++; if (resolveContext.fileDependencies) resolveContext.fileDependencies.add(path); fs.readlink(path, (err, result) => { if (!err && result) { - pathSegments[idx] = result; + pathSegments[idx] = /** @type {string} */ (result); containsSymlink = true; // Shortcut when absolute symlink found const resultType = getType(result.toString()); @@ -28486,6 +29002,11 @@ module.exports = class SymlinkPlugin { callback(); }); }, + /** + * @param {null|Error} [err] error + * @param {null|number} [idx] result + * @returns {void} + */ (err, idx) => { if (!containsSymlink) return callback(); const resultSegments = @@ -28495,6 +29016,7 @@ module.exports = class SymlinkPlugin { const result = resultSegments.reduceRight((a, b) => { return resolver.join(a, b); }); + /** @type {ResolveRequest} */ const obj = { ...request, path: result @@ -28515,7 +29037,7 @@ module.exports = class SymlinkPlugin { /***/ }), -/***/ 77880: +/***/ 64850: /***/ (function(module) { "use strict"; @@ -28536,7 +29058,9 @@ module.exports = class SymlinkPlugin { function SyncAsyncFileSystemDecorator(fs) { this.fs = fs; + /** @type {FileSystem["lstat"] | undefined} */ this.lstat = undefined; + /** @type {SyncFileSystem["lstatSync"] | undefined} */ this.lstatSync = undefined; const lstatSync = fs.lstatSync; if (lstatSync) { @@ -28545,13 +29069,15 @@ function SyncAsyncFileSystemDecorator(fs) { try { result = lstatSync.call(fs, arg); } catch (e) { + // @ts-ignore return (callback || options)(e); } + // @ts-ignore (callback || options)(null, result); }; this.lstatSync = (arg, options) => lstatSync.call(fs, arg, options); } - + // @ts-ignore this.stat = (arg, options, callback) => { let result; try { @@ -28561,8 +29087,9 @@ function SyncAsyncFileSystemDecorator(fs) { } (callback || options)(null, result); }; + /** @type {SyncFileSystem["statSync"]} */ this.statSync = (arg, options) => fs.statSync(arg, options); - + // @ts-ignore this.readdir = (arg, options, callback) => { let result; try { @@ -28572,8 +29099,9 @@ function SyncAsyncFileSystemDecorator(fs) { } (callback || options)(null, result); }; + /** @type {SyncFileSystem["readdirSync"]} */ this.readdirSync = (arg, options) => fs.readdirSync(arg, options); - + // @ts-ignore this.readFile = (arg, options, callback) => { let result; try { @@ -28583,8 +29111,9 @@ function SyncAsyncFileSystemDecorator(fs) { } (callback || options)(null, result); }; + /** @type {SyncFileSystem["readFileSync"]} */ this.readFileSync = (arg, options) => fs.readFileSync(arg, options); - + // @ts-ignore this.readlink = (arg, options, callback) => { let result; try { @@ -28594,9 +29123,11 @@ function SyncAsyncFileSystemDecorator(fs) { } (callback || options)(null, result); }; + /** @type {SyncFileSystem["readlinkSync"]} */ this.readlinkSync = (arg, options) => fs.readlinkSync(arg, options); - + /** @type {FileSystem["readJson"] | undefined} */ this.readJson = undefined; + /** @type {SyncFileSystem["readJsonSync"] | undefined} */ this.readJsonSync = undefined; const readJsonSync = fs.readJsonSync; if (readJsonSync) { @@ -28605,11 +29136,11 @@ function SyncAsyncFileSystemDecorator(fs) { try { result = readJsonSync.call(fs, arg); } catch (e) { + // @ts-ignore return (callback || options)(e); } (callback || options)(null, result); }; - this.readJsonSync = (arg, options) => readJsonSync.call(fs, arg, options); } } @@ -28618,7 +29149,7 @@ module.exports = SyncAsyncFileSystemDecorator; /***/ }), -/***/ 28723: +/***/ 56663: /***/ (function(module) { "use strict"; @@ -28667,7 +29198,7 @@ module.exports = class TryNextPlugin { /***/ }), -/***/ 50615: +/***/ 51377: /***/ (function(module) { "use strict"; @@ -28681,8 +29212,15 @@ module.exports = class TryNextPlugin { /** @typedef {import("./Resolver")} Resolver */ /** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ /** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ -/** @typedef {{[k: string]: any}} Cache */ +/** @typedef {import("./Resolver").ResolveContextYield} ResolveContextYield */ +/** @typedef {{[k: string]: ResolveRequest | ResolveRequest[] | undefined}} Cache */ +/** + * @param {string} type type of cache + * @param {ResolveRequest} request request + * @param {boolean} withContext cache with context? + * @returns {string} cache id + */ function getCacheId(type, request, withContext) { return JSON.stringify({ type, @@ -28737,11 +29275,14 @@ module.exports = class UnsafeCachePlugin { } return callback(null, null); } - return callback(null, cacheEntry); + return callback(null, /** @type {ResolveRequest} */ (cacheEntry)); } + /** @type {ResolveContextYield|undefined} */ let yieldFn; + /** @type {ResolveContextYield|undefined} */ let yield_; + /** @type {ResolveRequest[]} */ const yieldResult = []; if (isYield) { yieldFn = resolveContext.yield; @@ -28759,7 +29300,10 @@ module.exports = class UnsafeCachePlugin { if (err) return callback(err); if (isYield) { if (result) yieldResult.push(result); - for (const result of yieldResult) yieldFn(result); + for (const result of yieldResult) { + /** @type {ResolveContextYield} */ + (yieldFn)(result); + } this.cache[cacheId] = yieldResult; return callback(null, null); } @@ -28774,7 +29318,7 @@ module.exports = class UnsafeCachePlugin { /***/ }), -/***/ 25838: +/***/ 60358: /***/ (function(module) { "use strict"; @@ -28786,6 +29330,7 @@ module.exports = class UnsafeCachePlugin { /** @typedef {import("./Resolver")} Resolver */ +/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ /** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ module.exports = class UseFilePlugin { @@ -28809,7 +29354,12 @@ module.exports = class UseFilePlugin { resolver .getHook(this.source) .tapAsync("UseFilePlugin", (request, resolveContext, callback) => { - const filePath = resolver.join(request.path, this.filename); + const filePath = resolver.join( + /** @type {string} */ (request.path), + this.filename + ); + + /** @type {ResolveRequest} */ const obj = { ...request, path: filePath, @@ -28831,7 +29381,7 @@ module.exports = class UseFilePlugin { /***/ }), -/***/ 80620: +/***/ 13285: /***/ (function(module) { "use strict"; @@ -28842,27 +29392,37 @@ module.exports = class UseFilePlugin { -module.exports = function createInnerContext( - options, - message, - messageOptional -) { +/** @typedef {import("./Resolver").ResolveContext} ResolveContext */ + +/** + * @param {ResolveContext} options options for inner context + * @param {null|string} message message to log + * @returns {ResolveContext} inner context + */ +module.exports = function createInnerContext(options, message) { let messageReported = false; let innerLog = undefined; if (options.log) { if (message) { + /** + * @param {string} msg message + */ innerLog = msg => { if (!messageReported) { - options.log(message); + /** @type {(function(string): void)} */ + (options.log)(message); messageReported = true; } - options.log(" " + msg); + + /** @type {(function(string): void)} */ + (options.log)(" " + msg); }; } else { innerLog = options.log; } } - const childContext = { + + return { log: innerLog, yield: options.yield, fileDependencies: options.fileDependencies, @@ -28870,13 +29430,12 @@ module.exports = function createInnerContext( missingDependencies: options.missingDependencies, stack: options.stack }; - return childContext; }; /***/ }), -/***/ 56535: +/***/ 64334: /***/ (function(module) { "use strict"; @@ -28887,19 +29446,44 @@ module.exports = function createInnerContext( +/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ + +/** + * @template T + * @template Z + * @callback Iterator + * @param {T} item item + * @param {(err?: null|Error, result?: null|Z) => void} callback callback + * @param {number} i index + * @returns {void} + */ + +/** + * @template T + * @template Z + * @param {T[]} array array + * @param {Iterator} iterator iterator + * @param {(err?: null|Error, result?: null|Z) => void} callback callback after all items are iterated + * @returns {void} + */ module.exports = function forEachBail(array, iterator, callback) { if (array.length === 0) return callback(); let i = 0; const next = () => { + /** @type {boolean|undefined} */ let loop = undefined; - iterator(array[i++], (err, result) => { - if (err || result !== undefined || i >= array.length) { - return callback(err, result); - } - if (loop === false) while (next()); - loop = true; - }); + iterator( + array[i++], + (err, result) => { + if (err || result !== undefined || i >= array.length) { + return callback(err, result); + } + if (loop === false) while (next()); + loop = true; + }, + i + ); if (!loop) loop = false; return loop; }; @@ -28909,7 +29493,7 @@ module.exports = function forEachBail(array, iterator, callback) { /***/ }), -/***/ 36453: +/***/ 7508: /***/ (function(module) { "use strict"; @@ -28920,6 +29504,14 @@ module.exports = function forEachBail(array, iterator, callback) { +/** @typedef {import("./Resolver")} Resolver */ +/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ + +/** + * @param {Resolver} resolver resolver + * @param {ResolveRequest} request string + * @returns {string} inner request + */ module.exports = function getInnerRequest(resolver, request) { if ( typeof request.__innerRequest === "string" && @@ -28927,6 +29519,7 @@ module.exports = function getInnerRequest(resolver, request) { request.__innerRequest_relativePath === request.relativePath ) return request.__innerRequest; + /** @type {string|undefined} */ let innerRequest; if (request.request) { innerRequest = request.request; @@ -28938,13 +29531,13 @@ module.exports = function getInnerRequest(resolver, request) { } request.__innerRequest_request = request.request; request.__innerRequest_relativePath = request.relativePath; - return (request.__innerRequest = innerRequest); + return (request.__innerRequest = /** @type {string} */ (innerRequest)); }; /***/ }), -/***/ 77927: +/***/ 48631: /***/ (function(module) { "use strict"; @@ -28955,18 +29548,22 @@ module.exports = function getInnerRequest(resolver, request) { +/** + * @param {string} path path + * @returns {{paths: string[], segments: string[]}}} paths and segments + */ module.exports = function getPaths(path) { if (path === "/") return { paths: ["/"], segments: [""] }; const parts = path.split(/(.*?[\\/]+)/); const paths = [path]; const segments = [parts[parts.length - 1]]; let part = parts[parts.length - 1]; - path = path.substr(0, path.length - part.length - 1); + path = path.substring(0, path.length - part.length - 1); for (let i = parts.length - 2; i > 2; i -= 2) { paths.push(path); part = parts[i]; - path = path.substr(0, path.length - part.length) || "/"; - segments.push(part.substr(0, part.length - 1)); + path = path.substring(0, path.length - part.length) || "/"; + segments.push(part.slice(0, -1)); } part = parts[1]; segments.push(part); @@ -28977,19 +29574,23 @@ module.exports = function getPaths(path) { }; }; +/** + * @param {string} path path + * @returns {string|null} basename or null + */ module.exports.basename = function basename(path) { const i = path.lastIndexOf("/"), j = path.lastIndexOf("\\"); const p = i < 0 ? j : j < 0 ? i : i < j ? j : i; if (p < 0) return null; - const s = path.substr(p + 1); + const s = path.slice(p + 1); return s; }; /***/ }), -/***/ 65260: +/***/ 83866: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -29000,17 +29601,30 @@ module.exports.basename = function basename(path) { -const fs = __webpack_require__(78127); -const CachedInputFileSystem = __webpack_require__(60152); -const ResolverFactory = __webpack_require__(37899); +const fs = __webpack_require__(78885); +const CachedInputFileSystem = __webpack_require__(38865); +const ResolverFactory = __webpack_require__(52242); /** @typedef {import("./PnpPlugin").PnpApiImpl} PnpApi */ /** @typedef {import("./Resolver")} Resolver */ /** @typedef {import("./Resolver").FileSystem} FileSystem */ +/** @typedef {import("./Resolver").ResolveCallback} ResolveCallback */ /** @typedef {import("./Resolver").ResolveContext} ResolveContext */ /** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ /** @typedef {import("./ResolverFactory").Plugin} Plugin */ /** @typedef {import("./ResolverFactory").UserResolveOptions} ResolveOptions */ +/** @typedef {{ + * (context: object, path: string, request: string, resolveContext: ResolveContext, callback: ResolveCallback): void; + * (context: object, path: string, request: string, callback: ResolveCallback): void; + * (path: string, request: string, resolveContext: ResolveContext, callback: ResolveCallback): void; + * (path: string, request: string, callback: ResolveCallback): void; + * }} ResolveFunctionAsync + */ +/** @typedef {{ + * (context: object, path: string, request: string): string|false; + * (path: string, request: string): string|false; + * }} ResolveFunction + */ const nodeFileSystem = new CachedInputFileSystem(fs, 4000); @@ -29023,19 +29637,37 @@ const asyncResolver = ResolverFactory.createResolver({ extensions: [".js", ".json", ".node"], fileSystem: nodeFileSystem }); -function resolve(context, path, request, resolveContext, callback) { - if (typeof context === "string") { - callback = resolveContext; - resolveContext = request; - request = path; - path = context; - context = nodeContext; - } - if (typeof callback !== "function") { - callback = resolveContext; - } - asyncResolver.resolve(context, path, request, resolveContext, callback); -} + +/** + * @type {ResolveFunctionAsync} + */ +const resolve = + /** + * @param {object|string} context + * @param {string} path + * @param {string|ResolveContext|ResolveCallback} request + * @param {ResolveContext|ResolveCallback=} resolveContext + * @param {ResolveCallback=} callback + */ + (context, path, request, resolveContext, callback) => { + if (typeof context === "string") { + callback = /** @type {ResolveCallback} */ (resolveContext); + resolveContext = /** @type {ResolveContext} */ (request); + request = path; + path = context; + context = nodeContext; + } + if (typeof callback !== "function") { + callback = /** @type {ResolveCallback} */ (resolveContext); + } + asyncResolver.resolve( + context, + path, + /** @type {string} */ (request), + /** @type {ResolveContext} */ (resolveContext), + /** @type {ResolveCallback} */ (callback) + ); + }; const syncResolver = ResolverFactory.createResolver({ conditionNames: ["node"], @@ -29043,50 +29675,91 @@ const syncResolver = ResolverFactory.createResolver({ useSyncFileSystemCalls: true, fileSystem: nodeFileSystem }); -function resolveSync(context, path, request) { - if (typeof context === "string") { - request = path; - path = context; - context = nodeContext; - } - return syncResolver.resolveSync(context, path, request); -} +/** + * @type {ResolveFunction} + */ +const resolveSync = + /** + * @param {object|string} context + * @param {string} path + * @param {string=} request + */ + (context, path, request) => { + if (typeof context === "string") { + request = path; + path = context; + context = nodeContext; + } + return syncResolver.resolveSync( + context, + path, + /** @type {string} */ (request) + ); + }; + +/** @typedef {Omit & Partial>} ResolveOptionsOptionalFS */ + +/** + * @param {ResolveOptionsOptionalFS} options Resolver options + * @returns {ResolveFunctionAsync} Resolver function + */ function create(options) { - options = { + const resolver = ResolverFactory.createResolver({ fileSystem: nodeFileSystem, ...options - }; - const resolver = ResolverFactory.createResolver(options); + }); + /** + * @param {object|string} context Custom context + * @param {string} path Base path + * @param {string|ResolveContext|ResolveCallback} request String to resolve + * @param {ResolveContext|ResolveCallback=} resolveContext Resolve context + * @param {ResolveCallback=} callback Result callback + */ return function (context, path, request, resolveContext, callback) { if (typeof context === "string") { - callback = resolveContext; - resolveContext = request; + callback = /** @type {ResolveCallback} */ (resolveContext); + resolveContext = /** @type {ResolveContext} */ (request); request = path; path = context; context = nodeContext; } if (typeof callback !== "function") { - callback = resolveContext; + callback = /** @type {ResolveCallback} */ (resolveContext); } - resolver.resolve(context, path, request, resolveContext, callback); + resolver.resolve( + context, + path, + /** @type {string} */ (request), + /** @type {ResolveContext} */ (resolveContext), + callback + ); }; } +/** + * @param {ResolveOptionsOptionalFS} options Resolver options + * @returns {ResolveFunction} Resolver function + */ function createSync(options) { - options = { + const resolver = ResolverFactory.createResolver({ useSyncFileSystemCalls: true, fileSystem: nodeFileSystem, ...options - }; - const resolver = ResolverFactory.createResolver(options); + }); + /** + * @param {object|string} context custom context + * @param {string} path base path + * @param {string=} request request to resolve + * @returns {string|false} Resolved path or false + */ return function (context, path, request) { if (typeof context === "string") { request = path; path = context; context = nodeContext; } - return resolver.resolveSync(context, path, request); + return resolver.resolveSync(context, path, /** @type {string} */ (request)); }; } @@ -29115,20 +29788,20 @@ module.exports = mergeExports(resolve, { ResolverFactory, CachedInputFileSystem, get CloneBasenamePlugin() { - return __webpack_require__(79100); + return __webpack_require__(96236); }, get LogInfoPlugin() { - return __webpack_require__(58295); + return __webpack_require__(42970); }, get forEachBail() { - return __webpack_require__(56535); + return __webpack_require__(64334); } }); /***/ }), -/***/ 98211: +/***/ 53064: /***/ (function(module) { "use strict"; @@ -29145,14 +29818,6 @@ module.exports = mergeExports(resolve, { /** @typedef {Record|ConditionalMapping|DirectMapping} ExportsField */ /** @typedef {Record} ImportsField */ -/** - * @typedef {Object} PathTreeNode - * @property {Map|null} children - * @property {MappingValue} folder - * @property {Map|null} wildcards - * @property {Map} files - */ - /** * Processing exports/imports field * @callback FieldProcessor @@ -29217,6 +29882,7 @@ Conditional mapping nested in another conditional mapping is called nested mappi const slashCode = "/".charCodeAt(0); const dotCode = ".".charCodeAt(0); const hashCode = "#".charCodeAt(0); +const patternRegEx = /\*/g; /** * @param {ExportsField} exportsField the exports field @@ -29226,7 +29892,8 @@ module.exports.processExportsField = function processExportsField( exportsField ) { return createFieldProcessor( - buildExportsFieldPathTree(exportsField), + buildExportsField(exportsField), + request => (request.length === 0 ? "." : "./" + request), assertExportsFieldRequest, assertExportTarget ); @@ -29240,27 +29907,34 @@ module.exports.processImportsField = function processImportsField( importsField ) { return createFieldProcessor( - buildImportsFieldPathTree(importsField), + buildImportsField(importsField), + request => "#" + request, assertImportsFieldRequest, assertImportTarget ); }; /** - * @param {PathTreeNode} treeRoot root + * @param {ExportsField | ImportsField} field root + * @param {(s: string) => string} normalizeRequest Normalize request, for `imports` field it adds `#`, for `exports` field it adds `.` or `./` * @param {(s: string) => string} assertRequest assertRequest * @param {(s: string, f: boolean) => void} assertTarget assertTarget * @returns {FieldProcessor} field processor */ -function createFieldProcessor(treeRoot, assertRequest, assertTarget) { +function createFieldProcessor( + field, + normalizeRequest, + assertRequest, + assertTarget +) { return function fieldProcessor(request, conditionNames) { request = assertRequest(request); - const match = findMatch(request, treeRoot); + const match = findMatch(normalizeRequest(request), field); if (match === null) return []; - const [mapping, remainRequestIndex] = match; + const [mapping, remainingRequest, isSubpathMapping, isPattern] = match; /** @type {DirectMapping|null} */ let direct = null; @@ -29277,16 +29951,10 @@ function createFieldProcessor(treeRoot, assertRequest, assertTarget) { direct = /** @type {DirectMapping} */ (mapping); } - const remainingRequest = - remainRequestIndex === request.length + 1 - ? undefined - : remainRequestIndex < 0 - ? request.slice(-remainRequestIndex - 1) - : request.slice(remainRequestIndex); - return directMapping( remainingRequest, - remainRequestIndex < 0, + isPattern, + isSubpathMapping, direct, conditionNames, assertTarget @@ -29386,100 +30054,93 @@ function assertImportTarget(imp, expectFolder) { } /** - * Trying to match request to field - * @param {string} request request - * @param {PathTreeNode} treeRoot path tree root - * @returns {[MappingValue, number]|null} match or null, number is negative and one less when it's a folder mapping, number is request.length + 1 for direct mappings + * @param {string} a first string + * @param {string} b second string + * @returns {number} compare result */ -function findMatch(request, treeRoot) { - if (request.length === 0) { - const value = treeRoot.files.get(""); +function patternKeyCompare(a, b) { + const aPatternIndex = a.indexOf("*"); + const bPatternIndex = b.indexOf("*"); + const baseLenA = aPatternIndex === -1 ? a.length : aPatternIndex + 1; + const baseLenB = bPatternIndex === -1 ? b.length : bPatternIndex + 1; - return value ? [value, 1] : null; - } + if (baseLenA > baseLenB) return -1; + if (baseLenB > baseLenA) return 1; + if (aPatternIndex === -1) return 1; + if (bPatternIndex === -1) return -1; + if (a.length > b.length) return -1; + if (b.length > a.length) return 1; + return 0; +} + +/** + * Trying to match request to field + * @param {string} request request + * @param {ExportsField | ImportsField} field exports or import field + * @returns {[MappingValue, string, boolean, boolean]|null} match or null, number is negative and one less when it's a folder mapping, number is request.length + 1 for direct mappings + */ +function findMatch(request, field) { if ( - treeRoot.children === null && - treeRoot.folder === null && - treeRoot.wildcards === null + Object.prototype.hasOwnProperty.call(field, request) && + !request.includes("*") && + !request.endsWith("/") ) { - const value = treeRoot.files.get(request); + const target = /** @type {{[k: string]: MappingValue}} */ (field)[request]; - return value ? [value, request.length + 1] : null; + return [target, "", false, false]; } - let node = treeRoot; - let lastNonSlashIndex = 0; - let slashIndex = request.indexOf("/", 0); + /** @type {string} */ + let bestMatch = ""; + /** @type {string|undefined} */ + let bestMatchSubpath; - /** @type {[MappingValue, number]|null} */ - let lastFolderMatch = null; + const keys = Object.getOwnPropertyNames(field); - const applyFolderMapping = () => { - const folderMapping = node.folder; - if (folderMapping) { - if (lastFolderMatch) { - lastFolderMatch[0] = folderMapping; - lastFolderMatch[1] = -lastNonSlashIndex - 1; - } else { - lastFolderMatch = [folderMapping, -lastNonSlashIndex - 1]; - } - } - }; + for (let i = 0; i < keys.length; i++) { + const key = keys[i]; + const patternIndex = key.indexOf("*"); - const applyWildcardMappings = (wildcardMappings, remainingRequest) => { - if (wildcardMappings) { - for (const [key, target] of wildcardMappings) { - if (remainingRequest.startsWith(key)) { - if (!lastFolderMatch) { - lastFolderMatch = [target, lastNonSlashIndex + key.length]; - } else if (lastFolderMatch[1] < lastNonSlashIndex + key.length) { - lastFolderMatch[0] = target; - lastFolderMatch[1] = lastNonSlashIndex + key.length; - } - } + if (patternIndex !== -1 && request.startsWith(key.slice(0, patternIndex))) { + const patternTrailer = key.slice(patternIndex + 1); + + if ( + request.length >= key.length && + request.endsWith(patternTrailer) && + patternKeyCompare(bestMatch, key) === 1 && + key.lastIndexOf("*") === patternIndex + ) { + bestMatch = key; + bestMatchSubpath = request.slice( + patternIndex, + request.length - patternTrailer.length + ); } } - }; - - while (slashIndex !== -1) { - applyFolderMapping(); - - const wildcardMappings = node.wildcards; - - if (!wildcardMappings && node.children === null) return lastFolderMatch; - - const folder = request.slice(lastNonSlashIndex, slashIndex); - - applyWildcardMappings(wildcardMappings, folder); - - if (node.children === null) return lastFolderMatch; - - const newNode = node.children.get(folder); - - if (!newNode) { - return lastFolderMatch; + // For legacy `./foo/` + else if ( + key[key.length - 1] === "/" && + request.startsWith(key) && + patternKeyCompare(bestMatch, key) === 1 + ) { + bestMatch = key; + bestMatchSubpath = request.slice(key.length); } - - node = newNode; - lastNonSlashIndex = slashIndex + 1; - slashIndex = request.indexOf("/", lastNonSlashIndex); - } - - const remainingRequest = - lastNonSlashIndex > 0 ? request.slice(lastNonSlashIndex) : request; - - const value = node.files.get(remainingRequest); - - if (value) { - return [value, request.length + 1]; } - applyFolderMapping(); + if (bestMatch === "") return null; - applyWildcardMappings(node.wildcards, remainingRequest); + const target = /** @type {{[k: string]: MappingValue}} */ (field)[bestMatch]; + const isSubpathMapping = bestMatch.endsWith("/"); + const isPattern = bestMatch.includes("*"); - return lastFolderMatch; + return [ + target, + /** @type {string} */ (bestMatchSubpath), + isSubpathMapping, + isPattern + ]; } /** @@ -29494,7 +30155,8 @@ function isConditionalMapping(mapping) { /** * @param {string|undefined} remainingRequest remaining request when folder mapping, undefined for file mappings - * @param {boolean} subpathMapping true, for subpath mappings + * @param {boolean} isPattern true, if mapping is a pattern (contains "*") + * @param {boolean} isSubpathMapping true, for subpath mappings * @param {DirectMapping|null} mappingTarget direct export * @param {Set} conditionNames condition names * @param {(d: string, f: boolean) => void} assert asserting direct value @@ -29502,7 +30164,8 @@ function isConditionalMapping(mapping) { */ function directMapping( remainingRequest, - subpathMapping, + isPattern, + isSubpathMapping, mappingTarget, conditionNames, assert @@ -29511,16 +30174,29 @@ function directMapping( if (typeof mappingTarget === "string") { return [ - targetMapping(remainingRequest, subpathMapping, mappingTarget, assert) + targetMapping( + remainingRequest, + isPattern, + isSubpathMapping, + mappingTarget, + assert + ) ]; } + /** @type {string[]} */ const targets = []; for (const exp of mappingTarget) { if (typeof exp === "string") { targets.push( - targetMapping(remainingRequest, subpathMapping, exp, assert) + targetMapping( + remainingRequest, + isPattern, + isSubpathMapping, + exp, + assert + ) ); continue; } @@ -29529,7 +30205,8 @@ function directMapping( if (!mapping) continue; const innerExports = directMapping( remainingRequest, - subpathMapping, + isPattern, + isSubpathMapping, mapping, conditionNames, assert @@ -29544,27 +30221,43 @@ function directMapping( /** * @param {string|undefined} remainingRequest remaining request when folder mapping, undefined for file mappings - * @param {boolean} subpathMapping true, for subpath mappings + * @param {boolean} isPattern true, if mapping is a pattern (contains "*") + * @param {boolean} isSubpathMapping true, for subpath mappings * @param {string} mappingTarget direct export * @param {(d: string, f: boolean) => void} assert asserting direct value * @returns {string} mapping result */ function targetMapping( remainingRequest, - subpathMapping, + isPattern, + isSubpathMapping, mappingTarget, assert ) { if (remainingRequest === undefined) { assert(mappingTarget, false); + return mappingTarget; } - if (subpathMapping) { + + if (isSubpathMapping) { assert(mappingTarget, true); + return mappingTarget + remainingRequest; } + assert(mappingTarget, false); - return mappingTarget.replace(/\*/g, remainingRequest.replace(/\$/g, "$$")); + + let result = mappingTarget; + + if (isPattern) { + result = result.replace( + patternRegEx, + remainingRequest.replace(/\$/g, "$$") + ); + } + + return result; } /** @@ -29592,7 +30285,9 @@ function conditionalMapping(conditionalMapping_, conditionNames) { const innerMapping = mapping[condition]; // is nested if (isConditionalMapping(innerMapping)) { - const conditionalMapping = /** @type {ConditionalMapping} */ (innerMapping); + const conditionalMapping = /** @type {ConditionalMapping} */ ( + innerMapping + ); lookup[lookup.length - 1][2] = i + 1; lookup.push([conditionalMapping, Object.keys(conditionalMapping), 0]); continue loop; @@ -29605,7 +30300,9 @@ function conditionalMapping(conditionalMapping_, conditionNames) { const innerMapping = mapping[condition]; // is nested if (isConditionalMapping(innerMapping)) { - const conditionalMapping = /** @type {ConditionalMapping} */ (innerMapping); + const conditionalMapping = /** @type {ConditionalMapping} */ ( + innerMapping + ); lookup[lookup.length - 1][2] = i + 1; lookup.push([conditionalMapping, Object.keys(conditionalMapping), 0]); continue loop; @@ -29621,93 +30318,14 @@ function conditionalMapping(conditionalMapping_, conditionNames) { return null; } -/** - * Internal helper to create path tree node - * to ensure that each node gets the same hidden class - * @returns {PathTreeNode} node - */ -function createNode() { - return { - children: null, - folder: null, - wildcards: null, - files: new Map() - }; -} - -/** - * Internal helper for building path tree - * @param {PathTreeNode} root root - * @param {string} path path - * @param {MappingValue} target target - */ -function walkPath(root, path, target) { - if (path.length === 0) { - root.folder = target; - return; - } - - let node = root; - // Typical path tree can looks like - // root - // - files: ["a.js", "b.js"] - // - children: - // node1: - // - files: ["a.js", "b.js"] - let lastNonSlashIndex = 0; - let slashIndex = path.indexOf("/", 0); - - while (slashIndex !== -1) { - const folder = path.slice(lastNonSlashIndex, slashIndex); - let newNode; - - if (node.children === null) { - newNode = createNode(); - node.children = new Map(); - node.children.set(folder, newNode); - } else { - newNode = node.children.get(folder); - - if (!newNode) { - newNode = createNode(); - node.children.set(folder, newNode); - } - } - - node = newNode; - lastNonSlashIndex = slashIndex + 1; - slashIndex = path.indexOf("/", lastNonSlashIndex); - } - - if (lastNonSlashIndex >= path.length) { - node.folder = target; - } else { - const file = lastNonSlashIndex > 0 ? path.slice(lastNonSlashIndex) : path; - if (file.endsWith("*")) { - if (node.wildcards === null) node.wildcards = new Map(); - node.wildcards.set(file.slice(0, -1), target); - } else { - node.files.set(file, target); - } - } -} - /** * @param {ExportsField} field exports field - * @returns {PathTreeNode} tree root + * @returns {ExportsField} normalized exports field */ -function buildExportsFieldPathTree(field) { - const root = createNode(); - +function buildExportsField(field) { // handle syntax sugar, if exports field is direct mapping for "." - if (typeof field === "string") { - root.files.set("", field); - - return root; - } else if (Array.isArray(field)) { - root.files.set("", field.slice()); - - return root; + if (typeof field === "string" || Array.isArray(field)) { + return { ".": field }; } const keys = Object.keys(field); @@ -29730,8 +30348,7 @@ function buildExportsFieldPathTree(field) { i++; } - root.files.set("", field); - return root; + return { ".": field }; } throw new Error( @@ -29742,7 +30359,6 @@ function buildExportsFieldPathTree(field) { } if (key.length === 1) { - root.files.set("", field[key]); continue; } @@ -29753,20 +30369,16 @@ function buildExportsFieldPathTree(field) { )})` ); } - - walkPath(root, key.slice(2), field[key]); } - return root; + return field; } /** * @param {ImportsField} field imports field - * @returns {PathTreeNode} root + * @returns {ImportsField} normalized imports field */ -function buildImportsFieldPathTree(field) { - const root = createNode(); - +function buildImportsField(field) { const keys = Object.keys(field); for (let i = 0; i < keys.length; i++) { @@ -29793,17 +30405,15 @@ function buildImportsFieldPathTree(field) { )})` ); } - - walkPath(root, key.slice(1), field[key]); } - return root; + return field; } /***/ }), -/***/ 91698: +/***/ 60528: /***/ (function(module) { "use strict"; @@ -29814,7 +30424,8 @@ function buildImportsFieldPathTree(field) { -const PATH_QUERY_FRAGMENT_REGEXP = /^(#?(?:\0.|[^?#\0])*)(\?(?:\0.|[^#\0])*)?(#.*)?$/; +const PATH_QUERY_FRAGMENT_REGEXP = + /^(#?(?:\0.|[^?#\0])*)(\?(?:\0.|[^#\0])*)?(#.*)?$/; /** * @param {string} identifier identifier @@ -29837,7 +30448,7 @@ module.exports.parseIdentifier = parseIdentifier; /***/ }), -/***/ 83544: +/***/ 18662: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; @@ -30013,14 +30624,16 @@ const join = (rootPath, request) => { }; exports.join = join; +/** @type {Map>} */ const joinCache = new Map(); /** * @param {string} rootPath the root path - * @param {string | undefined} request the request path + * @param {string} request the request path * @returns {string} the joined path */ const cachedJoin = (rootPath, request) => { + /** @type {string | undefined} */ let cacheEntry; let cache = joinCache.get(rootPath); if (cache === undefined) { @@ -30035,6 +30648,10 @@ const cachedJoin = (rootPath, request) => { }; exports.cachedJoin = cachedJoin; +/** + * @param {string} relativePath relative path + * @returns {undefined|Error} nothing or an error + */ const checkImportsExportsFieldTarget = relativePath => { let lastNonSlashIndex = 0; let slashIndex = relativePath.indexOf("/", 1); @@ -34397,7 +35014,7 @@ module.exports = function (glob, opts) { /***/ }), -/***/ 68132: +/***/ 88297: /***/ (function(module) { "use strict"; @@ -34428,13 +35045,13 @@ function clone (obj) { /***/ }), -/***/ 78127: +/***/ 78885: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { var fs = __webpack_require__(57147) -var polyfills = __webpack_require__(2367) -var legacy = __webpack_require__(67876) -var clone = __webpack_require__(68132) +var polyfills = __webpack_require__(80125) +var legacy = __webpack_require__(95845) +var clone = __webpack_require__(88297) var util = __webpack_require__(73837) @@ -34883,7 +35500,7 @@ function retry () { /***/ }), -/***/ 67876: +/***/ 95845: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { var Stream = (__webpack_require__(12781).Stream) @@ -35008,7 +35625,7 @@ function legacy (fs) { /***/ }), -/***/ 2367: +/***/ 80125: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { var constants = __webpack_require__(22057) @@ -35114,7 +35731,7 @@ function patch (fs) { var backoff = 0; fs$rename(from, to, function CB (er) { if (er - && (er.code === "EACCES" || er.code === "EPERM") + && (er.code === "EACCES" || er.code === "EPERM" || er.code === "EBUSY") && Date.now() - start < 60000) { setTimeout(function() { fs.stat(to, function (stater, st) { @@ -45501,7 +46118,7 @@ function populateMaps (extensions, types) { /***/ }), -/***/ 25826: +/***/ 85879: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; @@ -45515,7 +46132,7 @@ exports["default"] = void 0; const { stringHints, numberHints -} = __webpack_require__(10544); +} = __webpack_require__(44590); /** @typedef {import("json-schema").JSONSchema6} JSONSchema6 */ /** @typedef {import("json-schema").JSONSchema7} JSONSchema7 */ @@ -46008,10 +46625,16 @@ class ValidationError extends Error { } if (schema.enum) { - return ( - /** @type {Array} */ - schema.enum.map(item => JSON.stringify(item)).join(" | ") - ); + const enumValues = + /** @type {Array} */ + schema.enum.map(item => { + if (item === null && schema.undefinedAsNull) { + return `${JSON.stringify(item)} | undefined`; + } + + return JSON.stringify(item); + }).join(" | "); + return `${enumValues}`; } if (typeof schema.const !== "undefined") { @@ -46779,7 +47402,7 @@ exports["default"] = _default; /***/ }), -/***/ 1489: +/***/ 16633: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -46787,17 +47410,23 @@ exports["default"] = _default; const { validate, - ValidationError -} = __webpack_require__(42121); + ValidationError, + enableValidation, + disableValidation, + needValidate +} = __webpack_require__(25624); module.exports = { validate, - ValidationError + ValidationError, + enableValidation, + disableValidation, + needValidate }; /***/ }), -/***/ 79294: +/***/ 17206: /***/ (function(__unused_webpack_module, exports) { "use strict"; @@ -46897,7 +47526,109 @@ exports["default"] = _default; /***/ }), -/***/ 86378: +/***/ 30760: +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +/** @typedef {import("ajv").Ajv} Ajv */ + +/** + * + * @param {Ajv} ajv + * @param {string} keyword + * @param {any} definition + */ +function addKeyword(ajv, keyword, definition) { + let customRuleCode; + + try { + // @ts-ignore + // eslint-disable-next-line global-require + customRuleCode = __webpack_require__(19481); // @ts-ignore + + const { + RULES + } = ajv; + let ruleGroup; + + for (let i = 0; i < RULES.length; i++) { + const rg = RULES[i]; + + if (typeof rg.type === "undefined") { + ruleGroup = rg; + break; + } + } + + const rule = { + keyword, + definition, + custom: true, + code: customRuleCode, + implements: definition.implements + }; + ruleGroup.rules.unshift(rule); + RULES.custom[keyword] = rule; + RULES.keywords[keyword] = true; + RULES.all[keyword] = true; + } catch (e) {// Nothing, fallback + } +} +/** + * + * @param {Ajv} ajv + * @returns {Ajv} + */ + + +function addUndefinedAsNullKeyword(ajv) { + // There is workaround for old versions of ajv, where `before` is not implemented + addKeyword(ajv, "undefinedAsNull", { + modifying: true, + + /** + * @param {boolean} kwVal + * @param {unknown} data + * @param {any} parentSchema + * @param {string} dataPath + * @param {unknown} parentData + * @param {number | string} parentDataProperty + * @return {boolean} + */ + validate(kwVal, data, parentSchema, dataPath, parentData, parentDataProperty) { + if (kwVal && parentSchema && typeof parentSchema.enum !== "undefined" && parentData && typeof parentDataProperty === "number") { + const idx = + /** @type {number} */ + parentDataProperty; + const parentDataRef = + /** @type {any[]} */ + parentData; + + if (typeof parentDataRef[idx] === "undefined") { + parentDataRef[idx] = null; + } + } + + return true; + } + + }); + return ajv; +} + +var _default = addUndefinedAsNullKeyword; +exports["default"] = _default; + +/***/ }), + +/***/ 93794: /***/ (function(module) { "use strict"; @@ -47067,13 +47798,13 @@ module.exports = Range; /***/ }), -/***/ 10544: +/***/ 44590: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; -const Range = __webpack_require__(86378); +const Range = __webpack_require__(93794); /** @typedef {import("../validate").Schema} Schema */ /** @@ -47179,7 +47910,7 @@ module.exports.numberHints = function numberHints(schema, logic) { /***/ }), -/***/ 42121: +/***/ 25624: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; @@ -47189,6 +47920,9 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.validate = validate; +exports.enableValidation = enableValidation; +exports.disableValidation = disableValidation; +exports.needValidate = needValidate; Object.defineProperty(exports, "ValidationError", ({ enumerable: true, get: function () { @@ -47196,16 +47930,60 @@ Object.defineProperty(exports, "ValidationError", ({ } })); -var _absolutePath = _interopRequireDefault(__webpack_require__(79294)); +var _absolutePath = _interopRequireDefault(__webpack_require__(17206)); -var _ValidationError = _interopRequireDefault(__webpack_require__(25826)); +var _undefinedAsNull = _interopRequireDefault(__webpack_require__(30760)); + +var _ValidationError = _interopRequireDefault(__webpack_require__(85879)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -// Use CommonJS require for ajv libs so TypeScript consumers aren't locked into esModuleInterop (see #110). -const Ajv = __webpack_require__(88601); +/** + * @template T + * @param fn {(function(): any) | undefined} + * @returns {function(): T} + */ +const memoize = fn => { + let cache = false; + /** @type {T} */ + + let result; + return () => { + if (cache) { + return result; + } + + result = + /** @type {function(): any} */ + fn(); + cache = true; // Allow to clean up memory for fn + // and all dependent resources + // eslint-disable-next-line no-undefined, no-param-reassign + + fn = undefined; + return result; + }; +}; + +const getAjv = memoize(() => { + // Use CommonJS require for ajv libs so TypeScript consumers aren't locked into esModuleInterop (see #110). + // eslint-disable-next-line global-require + const Ajv = __webpack_require__(88601); // eslint-disable-next-line global-require + + + const ajvKeywords = __webpack_require__(14133); + + const ajv = new Ajv({ + allErrors: true, + verbose: true, + $data: true + }); + ajvKeywords(ajv, ["instanceof", "formatMinimum", "formatMaximum", "patternRequired"]); // Custom keywords -const ajvKeywords = __webpack_require__(14133); + (0, _absolutePath.default)(ajv); + (0, _undefinedAsNull.default)(ajv); + return ajv; +}); /** @typedef {import("json-schema").JSONSchema4} JSONSchema4 */ /** @typedef {import("json-schema").JSONSchema6} JSONSchema6 */ @@ -47214,6 +47992,8 @@ const ajvKeywords = __webpack_require__(14133); /** @typedef {import("ajv").ErrorObject} ErrorObject */ +/** @typedef {import("ajv").ValidateFunction} ValidateFunction */ + /** * @typedef {Object} Extend * @property {number=} formatMinimum @@ -47221,6 +48001,7 @@ const ajvKeywords = __webpack_require__(14133); * @property {boolean=} formatExclusiveMinimum * @property {boolean=} formatExclusiveMaximum * @property {string=} link + * @property {boolean=} undefinedAsNull */ /** @typedef {(JSONSchema4 | JSONSchema6 | JSONSchema7) & Extend} Schema */ @@ -47241,15 +48022,64 @@ const ajvKeywords = __webpack_require__(14133); * @property {PostFormatter=} postFormatter */ +/** + * @param {SchemaUtilErrorObject} error + * @param {number} idx + * @returns {SchemaUtilErrorObject} + */ + +function applyPrefix(error, idx) { + // eslint-disable-next-line no-param-reassign + error.dataPath = `[${idx}]${error.dataPath}`; -const ajv = new Ajv({ - allErrors: true, - verbose: true, - $data: true -}); -ajvKeywords(ajv, ["instanceof", "formatMinimum", "formatMaximum", "patternRequired"]); // Custom keywords + if (error.children) { + error.children.forEach(err => applyPrefix(err, idx)); + } + + return error; +} + +let skipValidation = false; // We use `process.env.SKIP_VALIDATION` because you can have multiple `schema-utils` with different version, +// so we want to disable it globally, `process.env` doesn't supported by browsers, so we have the local `skipValidation` variables +// Enable validation -(0, _absolutePath.default)(ajv); +function enableValidation() { + skipValidation = false; // Disable validation for any versions + + if (process && process.env) { + process.env.SKIP_VALIDATION = "n"; + } +} // Disable validation + + +function disableValidation() { + skipValidation = true; + + if (process && process.env) { + process.env.SKIP_VALIDATION = "y"; + } +} // Check if we need to confirm + + +function needValidate() { + if (skipValidation) { + return false; + } + + if (process && process.env && process.env.SKIP_VALIDATION) { + const value = process.env.SKIP_VALIDATION.trim(); + + if (/^(?:y|yes|true|1|on)$/i.test(value)) { + return false; + } + + if (/^(?:n|no|false|0|off)$/i.test(value)) { + return true; + } + } + + return true; +} /** * @param {Schema} schema * @param {Array | object} options @@ -47257,31 +48087,18 @@ ajvKeywords(ajv, ["instanceof", "formatMinimum", "formatMaximum", "patternRequir * @returns {void} */ + function validate(schema, options, configuration) { + if (!needValidate()) { + return; + } + let errors = []; if (Array.isArray(options)) { - errors = Array.from(options, nestedOptions => validateObject(schema, nestedOptions)); - errors.forEach((list, idx) => { - const applyPrefix = - /** - * @param {SchemaUtilErrorObject} error - */ - error => { - // eslint-disable-next-line no-param-reassign - error.dataPath = `[${idx}]${error.dataPath}`; - - if (error.children) { - error.children.forEach(applyPrefix); - } - }; - - list.forEach(applyPrefix); - }); - errors = errors.reduce((arr, items) => { - arr.push(...items); - return arr; - }, []); + for (let i = 0; i <= options.length - 1; i++) { + errors.push(...validateObject(schema, options[i]).map(err => applyPrefix(err, i))); + } } else { errors = validateObject(schema, options); } @@ -47290,15 +48107,24 @@ function validate(schema, options, configuration) { throw new _ValidationError.default(errors, schema, configuration); } } +/** @typedef {WeakMap} */ + + +const schemaCache = new WeakMap(); /** * @param {Schema} schema * @param {Array | object} options * @returns {Array} */ - function validateObject(schema, options) { - const compiledSchema = ajv.compile(schema); + let compiledSchema = schemaCache.get(schema); + + if (!compiledSchema) { + compiledSchema = getAjv().compile(schema); + schemaCache.set(schema, compiledSchema); + } + const valid = compiledSchema(options); if (valid) return []; return compiledSchema.errors ? filterErrors(compiledSchema.errors) : []; @@ -48809,7 +49635,7 @@ Object.defineProperty(exports, '__esModule', { value: true }); const EventEmitter = (__webpack_require__(82361).EventEmitter); -const fs = __webpack_require__(78127); +const fs = __webpack_require__(78885); const path = __webpack_require__(71017); const watchEventSource = __webpack_require__(14361); @@ -50647,7 +51473,7 @@ module.exports = Watchpack; /***/ }), -/***/ 46: +/***/ 60592: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -50658,115 +51484,142 @@ module.exports = Watchpack; -const RuntimeGlobals = __webpack_require__(34623); -const WebpackError = __webpack_require__(10841); -const ConstDependency = __webpack_require__(78284); -const BasicEvaluatedExpression = __webpack_require__(88981); +const InitFragment = __webpack_require__(44508); +const { + JAVASCRIPT_MODULE_TYPE_AUTO, + JAVASCRIPT_MODULE_TYPE_DYNAMIC, + JAVASCRIPT_MODULE_TYPE_ESM +} = __webpack_require__(92891); +const RuntimeGlobals = __webpack_require__(61539); +const WebpackError = __webpack_require__(49999); +const ConstDependency = __webpack_require__(67538); +const BasicEvaluatedExpression = __webpack_require__(52493); +const JavascriptModulesPlugin = __webpack_require__(70061); const { toConstantDependency, evaluateToString -} = __webpack_require__(645); -const ChunkNameRuntimeModule = __webpack_require__(98107); -const GetFullHashRuntimeModule = __webpack_require__(95770); +} = __webpack_require__(94213); +const ChunkNameRuntimeModule = __webpack_require__(26891); +const GetFullHashRuntimeModule = __webpack_require__(36909); /** @typedef {import("./Compiler")} Compiler */ /** @typedef {import("./javascript/JavascriptParser")} JavascriptParser */ -/* eslint-disable camelcase */ -const REPLACEMENTS = { - __webpack_require__: { - expr: RuntimeGlobals.require, - req: [RuntimeGlobals.require], - type: "function", - assign: false - }, - __webpack_public_path__: { - expr: RuntimeGlobals.publicPath, - req: [RuntimeGlobals.publicPath], - type: "string", - assign: true - }, - __webpack_base_uri__: { - expr: RuntimeGlobals.baseURI, - req: [RuntimeGlobals.baseURI], - type: "string", - assign: true - }, - __webpack_modules__: { - expr: RuntimeGlobals.moduleFactories, - req: [RuntimeGlobals.moduleFactories], - type: "object", - assign: false - }, - __webpack_chunk_load__: { - expr: RuntimeGlobals.ensureChunk, - req: [RuntimeGlobals.ensureChunk], - type: "function", - assign: true - }, - __non_webpack_require__: { - expr: "require", - req: null, - type: undefined, // type is not known, depends on environment - assign: true - }, - __webpack_nonce__: { - expr: RuntimeGlobals.scriptNonce, - req: [RuntimeGlobals.scriptNonce], - type: "string", - assign: true - }, - __webpack_hash__: { - expr: `${RuntimeGlobals.getFullHash}()`, - req: [RuntimeGlobals.getFullHash], - type: "string", - assign: false - }, - __webpack_chunkname__: { - expr: RuntimeGlobals.chunkName, - req: [RuntimeGlobals.chunkName], - type: "string", - assign: false - }, - __webpack_get_script_filename__: { - expr: RuntimeGlobals.getChunkScriptFilename, - req: [RuntimeGlobals.getChunkScriptFilename], - type: "function", - assign: true - }, - __webpack_runtime_id__: { - expr: RuntimeGlobals.runtimeId, - req: [RuntimeGlobals.runtimeId], - assign: false - }, - "require.onError": { - expr: RuntimeGlobals.uncaughtErrorHandler, - req: [RuntimeGlobals.uncaughtErrorHandler], - type: undefined, // type is not known, could be function or undefined - assign: true // is never a pattern - }, - __system_context__: { - expr: RuntimeGlobals.systemContext, - req: [RuntimeGlobals.systemContext], - type: "object", - assign: false - }, - __webpack_share_scopes__: { - expr: RuntimeGlobals.shareScopeMap, - req: [RuntimeGlobals.shareScopeMap], - type: "object", - assign: false - }, - __webpack_init_sharing__: { - expr: RuntimeGlobals.initializeSharing, - req: [RuntimeGlobals.initializeSharing], - type: "function", - assign: true - } -}; -/* eslint-enable camelcase */ +/** + * @param {boolean} module true if ES module + * @param {string} importMetaName `import.meta` name + * @returns {Record} replacements + */ +function getReplacements(module, importMetaName) { + return { + __webpack_require__: { + expr: RuntimeGlobals.require, + req: [RuntimeGlobals.require], + type: "function", + assign: false + }, + __webpack_public_path__: { + expr: RuntimeGlobals.publicPath, + req: [RuntimeGlobals.publicPath], + type: "string", + assign: true + }, + __webpack_base_uri__: { + expr: RuntimeGlobals.baseURI, + req: [RuntimeGlobals.baseURI], + type: "string", + assign: true + }, + __webpack_modules__: { + expr: RuntimeGlobals.moduleFactories, + req: [RuntimeGlobals.moduleFactories], + type: "object", + assign: false + }, + __webpack_chunk_load__: { + expr: RuntimeGlobals.ensureChunk, + req: [RuntimeGlobals.ensureChunk], + type: "function", + assign: true + }, + __non_webpack_require__: { + expr: module + ? `__WEBPACK_EXTERNAL_createRequire(${importMetaName}.url)` + : "require", + req: null, + type: undefined, // type is not known, depends on environment + assign: true + }, + __webpack_nonce__: { + expr: RuntimeGlobals.scriptNonce, + req: [RuntimeGlobals.scriptNonce], + type: "string", + assign: true + }, + __webpack_hash__: { + expr: `${RuntimeGlobals.getFullHash}()`, + req: [RuntimeGlobals.getFullHash], + type: "string", + assign: false + }, + __webpack_chunkname__: { + expr: RuntimeGlobals.chunkName, + req: [RuntimeGlobals.chunkName], + type: "string", + assign: false + }, + __webpack_get_script_filename__: { + expr: RuntimeGlobals.getChunkScriptFilename, + req: [RuntimeGlobals.getChunkScriptFilename], + type: "function", + assign: true + }, + __webpack_runtime_id__: { + expr: RuntimeGlobals.runtimeId, + req: [RuntimeGlobals.runtimeId], + assign: false + }, + "require.onError": { + expr: RuntimeGlobals.uncaughtErrorHandler, + req: [RuntimeGlobals.uncaughtErrorHandler], + type: undefined, // type is not known, could be function or undefined + assign: true // is never a pattern + }, + __system_context__: { + expr: RuntimeGlobals.systemContext, + req: [RuntimeGlobals.systemContext], + type: "object", + assign: false + }, + __webpack_share_scopes__: { + expr: RuntimeGlobals.shareScopeMap, + req: [RuntimeGlobals.shareScopeMap], + type: "object", + assign: false + }, + __webpack_init_sharing__: { + expr: RuntimeGlobals.initializeSharing, + req: [RuntimeGlobals.initializeSharing], + type: "function", + assign: true + } + }; +} + +const PLUGIN_NAME = "APIPlugin"; + +/** + * @typedef {Object} APIPluginOptions + * @property {boolean} [module] the output filename + */ class APIPlugin { + /** + * @param {APIPluginOptions} [options] options + */ + constructor(options = {}) { + this.options = options; + } /** * Apply the plugin * @param {Compiler} compiler the compiler instance @@ -50774,8 +51627,14 @@ class APIPlugin { */ apply(compiler) { compiler.hooks.compilation.tap( - "APIPlugin", + PLUGIN_NAME, (compilation, { normalModuleFactory }) => { + const { importMetaName } = compilation.outputOptions; + const REPLACEMENTS = getReplacements( + this.options.module, + importMetaName + ); + compilation.dependencyTemplates.set( ConstDependency, new ConstDependency.Template() @@ -50783,7 +51642,7 @@ class APIPlugin { compilation.hooks.runtimeRequirementInTree .for(RuntimeGlobals.chunkName) - .tap("APIPlugin", chunk => { + .tap(PLUGIN_NAME, chunk => { compilation.addRuntimeModule( chunk, new ChunkNameRuntimeModule(chunk.name) @@ -50793,25 +51652,50 @@ class APIPlugin { compilation.hooks.runtimeRequirementInTree .for(RuntimeGlobals.getFullHash) - .tap("APIPlugin", (chunk, set) => { + .tap(PLUGIN_NAME, (chunk, set) => { compilation.addRuntimeModule(chunk, new GetFullHashRuntimeModule()); return true; }); + const hooks = JavascriptModulesPlugin.getCompilationHooks(compilation); + + hooks.renderModuleContent.tap( + PLUGIN_NAME, + (source, module, renderContext) => { + if (module.buildInfo.needCreateRequire) { + const chunkInitFragments = [ + new InitFragment( + 'import { createRequire as __WEBPACK_EXTERNAL_createRequire } from "module";\n', + InitFragment.STAGE_HARMONY_IMPORTS, + 0, + "external module node-commonjs" + ) + ]; + + renderContext.chunkInitFragments.push(...chunkInitFragments); + } + + return source; + } + ); + /** * @param {JavascriptParser} parser the parser */ const handler = parser => { Object.keys(REPLACEMENTS).forEach(key => { const info = REPLACEMENTS[key]; - parser.hooks.expression - .for(key) - .tap( - "APIPlugin", - toConstantDependency(parser, info.expr, info.req) - ); + parser.hooks.expression.for(key).tap(PLUGIN_NAME, expression => { + const dep = toConstantDependency(parser, info.expr, info.req); + + if (key === "__non_webpack_require__" && this.options.module) { + parser.state.module.buildInfo.needCreateRequire = true; + } + + return dep(expression); + }); if (info.assign === false) { - parser.hooks.assign.for(key).tap("APIPlugin", expr => { + parser.hooks.assign.for(key).tap(PLUGIN_NAME, expr => { const err = new WebpackError(`${key} must not be assigned`); err.loc = expr.loc; throw err; @@ -50820,13 +51704,13 @@ class APIPlugin { if (info.type) { parser.hooks.evaluateTypeof .for(key) - .tap("APIPlugin", evaluateToString(info.type)); + .tap(PLUGIN_NAME, evaluateToString(info.type)); } }); parser.hooks.expression .for("__webpack_layer__") - .tap("APIPlugin", expr => { + .tap(PLUGIN_NAME, expr => { const dep = new ConstDependency( JSON.stringify(parser.state.module.layer), expr.range @@ -50837,7 +51721,7 @@ class APIPlugin { }); parser.hooks.evaluateIdentifier .for("__webpack_layer__") - .tap("APIPlugin", expr => + .tap(PLUGIN_NAME, expr => (parser.state.module.layer === null ? new BasicEvaluatedExpression().setNull() : new BasicEvaluatedExpression().setString( @@ -50847,7 +51731,7 @@ class APIPlugin { ); parser.hooks.evaluateTypeof .for("__webpack_layer__") - .tap("APIPlugin", expr => + .tap(PLUGIN_NAME, expr => new BasicEvaluatedExpression() .setString( parser.state.module.layer === null ? "object" : "string" @@ -50857,7 +51741,7 @@ class APIPlugin { parser.hooks.expression .for("__webpack_module__.id") - .tap("APIPlugin", expr => { + .tap(PLUGIN_NAME, expr => { parser.state.module.buildInfo.moduleConcatenationBailout = "__webpack_module__.id"; const dep = new ConstDependency( @@ -50872,7 +51756,7 @@ class APIPlugin { parser.hooks.expression .for("__webpack_module__") - .tap("APIPlugin", expr => { + .tap(PLUGIN_NAME, expr => { parser.state.module.buildInfo.moduleConcatenationBailout = "__webpack_module__"; const dep = new ConstDependency( @@ -50886,18 +51770,18 @@ class APIPlugin { }); parser.hooks.evaluateTypeof .for("__webpack_module__") - .tap("APIPlugin", evaluateToString("object")); + .tap(PLUGIN_NAME, evaluateToString("object")); }; normalModuleFactory.hooks.parser - .for("javascript/auto") - .tap("APIPlugin", handler); + .for(JAVASCRIPT_MODULE_TYPE_AUTO) + .tap(PLUGIN_NAME, handler); normalModuleFactory.hooks.parser - .for("javascript/dynamic") - .tap("APIPlugin", handler); + .for(JAVASCRIPT_MODULE_TYPE_DYNAMIC) + .tap(PLUGIN_NAME, handler); normalModuleFactory.hooks.parser - .for("javascript/esm") - .tap("APIPlugin", handler); + .for(JAVASCRIPT_MODULE_TYPE_ESM) + .tap(PLUGIN_NAME, handler); } ); } @@ -50908,7 +51792,7 @@ module.exports = APIPlugin; /***/ }), -/***/ 26907: +/***/ 9906: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -50919,7 +51803,7 @@ module.exports = APIPlugin; -const WebpackError = __webpack_require__(10841); +const WebpackError = __webpack_require__(49999); const CURRENT_METHOD_REGEXP = /at ([a-zA-Z0-9_.]*)/; /** @@ -50965,7 +51849,7 @@ module.exports = AbstractMethodError; /***/ }), -/***/ 54823: +/***/ 27973: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -50976,8 +51860,8 @@ module.exports = AbstractMethodError; -const DependenciesBlock = __webpack_require__(67493); -const makeSerializable = __webpack_require__(23827); +const DependenciesBlock = __webpack_require__(99939); +const makeSerializable = __webpack_require__(83626); /** @typedef {import("./ChunkGraph")} ChunkGraph */ /** @typedef {import("./ChunkGroup")} ChunkGroup */ @@ -50986,13 +51870,15 @@ const makeSerializable = __webpack_require__(23827); /** @typedef {import("./Dependency").UpdateHashContext} UpdateHashContext */ /** @typedef {import("./Entrypoint").EntryOptions} EntryOptions */ /** @typedef {import("./Module")} Module */ +/** @typedef {import("./serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */ +/** @typedef {import("./serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */ /** @typedef {import("./util/Hash")} Hash */ class AsyncDependenciesBlock extends DependenciesBlock { /** - * @param {ChunkGroupOptions & { entryOptions?: EntryOptions }} groupOptions options for the group - * @param {DependencyLocation=} loc the line of code - * @param {string=} request the request + * @param {(ChunkGroupOptions & { entryOptions?: EntryOptions }) | null} groupOptions options for the group + * @param {(DependencyLocation | null)=} loc the line of code + * @param {(string | null)=} request the request */ constructor(groupOptions, loc, request) { super(); @@ -51008,14 +51894,14 @@ class AsyncDependenciesBlock extends DependenciesBlock { } /** - * @returns {string} The name of the chunk + * @returns {string | undefined} The name of the chunk */ get chunkName() { return this.groupOptions.name; } /** - * @param {string} value The new chunk name + * @param {string | undefined} value The new chunk name * @returns {void} */ set chunkName(value) { @@ -51042,6 +51928,9 @@ class AsyncDependenciesBlock extends DependenciesBlock { super.updateHash(hash, context); } + /** + * @param {ObjectSerializerContext} context context + */ serialize(context) { const { write } = context; write(this.groupOptions); @@ -51050,6 +51939,9 @@ class AsyncDependenciesBlock extends DependenciesBlock { super.serialize(context); } + /** + * @param {ObjectDeserializerContext} context context + */ deserialize(context) { const { read } = context; this.groupOptions = read(); @@ -51079,7 +51971,7 @@ module.exports = AsyncDependenciesBlock; /***/ }), -/***/ 83514: +/***/ 3634: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -51090,7 +51982,7 @@ module.exports = AsyncDependenciesBlock; -const WebpackError = __webpack_require__(10841); +const WebpackError = __webpack_require__(49999); /** @typedef {import("./Dependency").DependencyLocation} DependencyLocation */ /** @typedef {import("./Module")} Module */ @@ -51118,7 +52010,7 @@ module.exports = AsyncDependencyToInitialChunkError; /***/ }), -/***/ 76411: +/***/ 88895: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -51130,8 +52022,8 @@ module.exports = AsyncDependencyToInitialChunkError; const asyncLib = __webpack_require__(47087); -const NormalModule = __webpack_require__(55443); -const PrefetchDependency = __webpack_require__(51351); +const NormalModule = __webpack_require__(17318); +const PrefetchDependency = __webpack_require__(98786); /** @typedef {import("./Compiler")} Compiler */ @@ -51151,6 +52043,7 @@ class AutomaticPrefetchPlugin { ); } ); + /** @type {{context: string, request: string}[] | null} */ let lastModules = null; compiler.hooks.afterCompile.tap("AutomaticPrefetchPlugin", compilation => { lastModules = []; @@ -51191,7 +52084,7 @@ module.exports = AutomaticPrefetchPlugin; /***/ }), -/***/ 20357: +/***/ 82533: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -51203,24 +52096,29 @@ module.exports = AutomaticPrefetchPlugin; const { ConcatSource } = __webpack_require__(59728); -const Compilation = __webpack_require__(38292); -const ModuleFilenameHelpers = __webpack_require__(38738); -const Template = __webpack_require__(88070); -const createSchemaValidation = __webpack_require__(94091); +const Compilation = __webpack_require__(20417); +const ModuleFilenameHelpers = __webpack_require__(82444); +const Template = __webpack_require__(88835); +const createSchemaValidation = __webpack_require__(45488); +/** @typedef {import("../declarations/plugins/BannerPlugin").BannerFunction} BannerFunction */ /** @typedef {import("../declarations/plugins/BannerPlugin").BannerPluginArgument} BannerPluginArgument */ /** @typedef {import("../declarations/plugins/BannerPlugin").BannerPluginOptions} BannerPluginOptions */ /** @typedef {import("./Compiler")} Compiler */ const validate = createSchemaValidation( - __webpack_require__(8808), - () => __webpack_require__(80139), + __webpack_require__(44871), + () => __webpack_require__(12605), { name: "Banner Plugin", baseDataPath: "options" } ); +/** + * @param {string} str string to wrap + * @returns {string} wrapped string + */ const wrapComment = str => { if (!str.includes("\n")) { return Template.toComment(str); @@ -51253,7 +52151,7 @@ class BannerPlugin { const getBanner = bannerOption; this.banner = this.options.raw ? getBanner - : data => wrapComment(getBanner(data)); + : /** @type {BannerFunction} */ data => wrapComment(getBanner(data)); } else { const banner = this.options.raw ? bannerOption @@ -51324,7 +52222,7 @@ module.exports = BannerPlugin; /***/ }), -/***/ 20130: +/***/ 11948: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -51339,7 +52237,7 @@ const { AsyncParallelHook, AsyncSeriesBailHook, SyncHook } = __webpack_require__ const { makeWebpackError, makeWebpackErrorCallback -} = __webpack_require__(88608); +} = __webpack_require__(39319); /** @typedef {import("./WebpackError")} WebpackError */ @@ -51493,7 +52391,7 @@ module.exports = Cache; /***/ }), -/***/ 60415: +/***/ 98230: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -51504,10 +52402,10 @@ module.exports = Cache; -const { forEachBail } = __webpack_require__(65260); +const { forEachBail } = __webpack_require__(83866); const asyncLib = __webpack_require__(47087); -const getLazyHashedEtag = __webpack_require__(36899); -const mergeEtags = __webpack_require__(60302); +const getLazyHashedEtag = __webpack_require__(64968); +const mergeEtags = __webpack_require__(34408); /** @typedef {import("./Cache")} Cache */ /** @typedef {import("./Cache").Etag} Etag */ @@ -51554,6 +52452,10 @@ class MultiItemCache { * @returns {Promise} promise with the data */ getPromise() { + /** + * @param {number} i index + * @returns {Promise} promise with the data + */ const next = i => { return this._items[i].getPromise().then(result => { if (result !== undefined) return result; @@ -51846,7 +52748,7 @@ module.exports.MultiItemCache = MultiItemCache; /***/ }), -/***/ 27763: +/***/ 75408: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -51857,7 +52759,7 @@ module.exports.MultiItemCache = MultiItemCache; -const WebpackError = __webpack_require__(10841); +const WebpackError = __webpack_require__(49999); /** @typedef {import("./Module")} Module */ /** @typedef {import("./ModuleGraph")} ModuleGraph */ @@ -51894,7 +52796,9 @@ const createModulesListMessage = (modules, moduleGraph) => { if (validReasons.length > 0) { message += `\n Used by ${validReasons.length} module(s), i. e.`; - message += `\n ${validReasons[0].identifier()}`; + message += `\n ${ + /** @type {Module[]} */ (validReasons)[0].identifier() + }`; } return message; }) @@ -51925,7 +52829,7 @@ module.exports = CaseSensitiveModulesWarning; /***/ }), -/***/ 67732: +/***/ 93399: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -51936,24 +52840,25 @@ module.exports = CaseSensitiveModulesWarning; -const ChunkGraph = __webpack_require__(64438); -const Entrypoint = __webpack_require__(3457); -const { intersect } = __webpack_require__(97045); -const SortableSet = __webpack_require__(98203); -const StringXor = __webpack_require__(78565); +const ChunkGraph = __webpack_require__(84275); +const Entrypoint = __webpack_require__(25661); +const { intersect } = __webpack_require__(24352); +const SortableSet = __webpack_require__(94845); +const StringXor = __webpack_require__(81650); const { compareModulesByIdentifier, compareChunkGroupsByIndex, compareModulesById -} = __webpack_require__(29355); -const { createArrayToSetDeprecationSet } = __webpack_require__(47762); -const { mergeRuntime } = __webpack_require__(55693); +} = __webpack_require__(95978); +const { createArrayToSetDeprecationSet } = __webpack_require__(40630); +const { mergeRuntime } = __webpack_require__(69965); /** @typedef {import("webpack-sources").Source} Source */ /** @typedef {import("./ChunkGraph").ChunkFilterPredicate} ChunkFilterPredicate */ /** @typedef {import("./ChunkGraph").ChunkSizeOptions} ChunkSizeOptions */ /** @typedef {import("./ChunkGraph").ModuleFilterPredicate} ModuleFilterPredicate */ /** @typedef {import("./ChunkGroup")} ChunkGroup */ +/** @typedef {import("./ChunkGroup").ChunkGroupOptions} ChunkGroupOptions */ /** @typedef {import("./Compilation")} Compilation */ /** @typedef {import("./Compilation").AssetInfo} AssetInfo */ /** @typedef {import("./Compilation").PathData} PathData */ @@ -51963,6 +52868,8 @@ const { mergeRuntime } = __webpack_require__(55693); /** @typedef {import("./util/Hash")} Hash */ /** @typedef {import("./util/runtime").RuntimeSpec} RuntimeSpec */ +/** @typedef {number | string} ChunkId */ + const ChunkFilesSet = createArrayToSetDeprecationSet("chunk.files"); /** @@ -51997,21 +52904,21 @@ class Chunk { * @param {boolean} backCompat enable backward-compatibility */ constructor(name, backCompat = true) { - /** @type {number | string | null} */ + /** @type {ChunkId | null} */ this.id = null; - /** @type {(number|string)[] | null} */ + /** @type {ChunkId[] | null} */ this.ids = null; /** @type {number} */ this.debugId = debugId++; - /** @type {string} */ + /** @type {string | undefined} */ this.name = name; /** @type {SortableSet} */ this.idNameHints = new SortableSet(); /** @type {boolean} */ this.preventIntegration = false; - /** @type {(string | function(PathData, AssetInfo=): string)?} */ + /** @type {(string | function(PathData, AssetInfo=): string) | undefined} */ this.filenameTemplate = undefined; - /** @type {(string | function(PathData, AssetInfo=): string)?} */ + /** @type {(string | function(PathData, AssetInfo=): string) | undefined} */ this.cssFilenameTemplate = undefined; /** @private @type {SortableSet} */ this._groups = new SortableSet(undefined, compareChunkGroupsByIndex); @@ -52281,7 +53188,7 @@ class Chunk { const chunkModuleHashMap = Object.create(null); for (const asyncChunk of this.getAllAsyncChunks()) { - /** @type {(string|number)[]} */ + /** @type {ChunkId[] | undefined} */ let array; for (const module of chunkGraph.getOrderedChunkModulesIterable( asyncChunk, @@ -52290,7 +53197,7 @@ class Chunk { if (filterFn(module)) { if (array === undefined) { array = []; - chunkModuleIdMap[asyncChunk.id] = array; + chunkModuleIdMap[/** @type {ChunkId} */ (asyncChunk.id)] = array; } const moduleId = chunkGraph.getModuleId(module); array.push(moduleId); @@ -52336,15 +53243,18 @@ class Chunk { const chunkNameMap = Object.create(null); for (const chunk of this.getAllAsyncChunks()) { - chunkHashMap[chunk.id] = realHash ? chunk.hash : chunk.renderedHash; + const id = /** @type {ChunkId} */ (chunk.id); + chunkHashMap[id] = + /** @type {string} */ + (realHash ? chunk.hash : chunk.renderedHash); for (const key of Object.keys(chunk.contentHash)) { if (!chunkContentHashMap[key]) { chunkContentHashMap[key] = Object.create(null); } - chunkContentHashMap[key][chunk.id] = chunk.contentHash[key]; + chunkContentHashMap[key][id] = chunk.contentHash[key]; } if (chunk.name) { - chunkNameMap[chunk.id] = chunk.name; + chunkNameMap[id] = chunk.name; } } @@ -52436,7 +53346,7 @@ class Chunk { } /** - * @returns {Iterable} the chunkGroups that the said chunk is referenced in + * @returns {SortableSet} the chunkGroups that the said chunk is referenced in */ get groupsIterable() { this._groups.sort(); @@ -52484,7 +53394,11 @@ class Chunk { const entryModules = chunkGraph.getChunkEntryModulesWithChunkGroupIterable(this); for (const [m, chunkGroup] of entryModules) { - hash.update(`entry${chunkGraph.getModuleId(m)}${chunkGroup.id}`); + hash.update( + `entry${chunkGraph.getModuleId(m)}${ + /** @type {ChunkGroup} */ (chunkGroup).id + }` + ); } } @@ -52628,7 +53542,13 @@ class Chunk { lists.set(name, list); } list.push({ - order: childGroup.options[key], + order: + /** @type {number} */ + ( + childGroup.options[ + /** @type {keyof ChunkGroupOptions} */ (key) + ] + ), group: childGroup }); } @@ -52649,7 +53569,7 @@ class Chunk { for (const item of list) { for (const chunk of item.group.chunks) { if (filterFn && !filterFn(chunk, chunkGraph)) continue; - chunkIdSet.add(chunk.id); + chunkIdSet.add(/** @type {ChunkId} */ (chunk.id)); } } if (chunkIdSet.size > 0) { @@ -52662,13 +53582,14 @@ class Chunk { /** * @param {ChunkGraph} chunkGraph the chunk graph * @param {string} type option name - * @returns {{ onChunks: Chunk[], chunks: Set }[]} referenced chunks for a specific type + * @returns {{ onChunks: Chunk[], chunks: Set }[] | undefined} referenced chunks for a specific type */ getChildrenOfTypeInOrder(chunkGraph, type) { const list = []; for (const group of this.groupsIterable) { for (const childGroup of group.childrenIterable) { - const order = childGroup.options[type]; + const order = + childGroup.options[/** @type {keyof ChunkGroupOptions} */ (type)]; if (order === undefined) continue; list.push({ order, @@ -52679,7 +53600,8 @@ class Chunk { } if (list.length === 0) return undefined; list.sort((a, b) => { - const cmp = b.order - a.order; + const cmp = + /** @type {number} */ (b.order) - /** @type {number} */ (a.order); if (cmp !== 0) return cmp; return a.group.compareTo(chunkGraph, b.group); }); @@ -52723,7 +53645,7 @@ class Chunk { if (chunkMap === undefined) { chunkMaps[key] = chunkMap = Object.create(null); } - chunkMap[chunk.id] = data[key]; + chunkMap[/** @type {ChunkId} */ (chunk.id)] = data[key]; } }; @@ -52753,7 +53675,7 @@ module.exports = Chunk; /***/ }), -/***/ 64438: +/***/ 84275: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -52765,10 +53687,10 @@ module.exports = Chunk; const util = __webpack_require__(73837); -const Entrypoint = __webpack_require__(3457); -const ModuleGraphConnection = __webpack_require__(17977); -const { first } = __webpack_require__(97045); -const SortableSet = __webpack_require__(98203); +const Entrypoint = __webpack_require__(25661); +const ModuleGraphConnection = __webpack_require__(7976); +const { first } = __webpack_require__(24352); +const SortableSet = __webpack_require__(94845); const { compareModulesById, compareIterables, @@ -52776,16 +53698,16 @@ const { concatComparators, compareSelect, compareIds -} = __webpack_require__(29355); -const createHash = __webpack_require__(94624); -const findGraphRoots = __webpack_require__(90196); +} = __webpack_require__(95978); +const createHash = __webpack_require__(31147); +const findGraphRoots = __webpack_require__(60830); const { RuntimeSpecMap, RuntimeSpecSet, runtimeToString, mergeRuntime, forEachRuntime -} = __webpack_require__(55693); +} = __webpack_require__(69965); /** @typedef {import("./AsyncDependenciesBlock")} AsyncDependenciesBlock */ /** @typedef {import("./Chunk")} Chunk */ @@ -52947,7 +53869,7 @@ class ChunkGraphModule { this.entryInChunks = undefined; /** @type {Set | undefined} */ this.runtimeInChunks = undefined; - /** @type {RuntimeSpecMap} */ + /** @type {RuntimeSpecMap | undefined} */ this.hashes = undefined; /** @type {string | number} */ this.id = null; @@ -54147,7 +55069,7 @@ Caller might not support runtime-dependent code generation (opt-out via optimiza */ hasModuleHashes(module, runtime) { const cgm = this._getChunkGraphModule(module); - const hashes = cgm.hashes; + const hashes = /** @type {RuntimeSpecMap} */ (cgm.hashes); return hashes && hashes.has(runtime); } @@ -54158,7 +55080,7 @@ Caller might not support runtime-dependent code generation (opt-out via optimiza */ getModuleHash(module, runtime) { const cgm = this._getChunkGraphModule(module); - const hashes = cgm.hashes; + const hashes = /** @type {RuntimeSpecMap} */ (cgm.hashes); return this._getModuleHashInfo(module, hashes, runtime).hash; } @@ -54169,7 +55091,7 @@ Caller might not support runtime-dependent code generation (opt-out via optimiza */ getRenderedModuleHash(module, runtime) { const cgm = this._getChunkGraphModule(module); - const hashes = cgm.hashes; + const hashes = /** @type {RuntimeSpecMap} */ (cgm.hashes); return this._getModuleHashInfo(module, hashes, runtime).renderedHash; } @@ -54575,7 +55497,7 @@ module.exports = ChunkGraph; /***/ }), -/***/ 51910: +/***/ 39: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -54587,12 +55509,12 @@ module.exports = ChunkGraph; const util = __webpack_require__(73837); -const SortableSet = __webpack_require__(98203); +const SortableSet = __webpack_require__(94845); const { compareLocations, compareChunks, compareIterables -} = __webpack_require__(29355); +} = __webpack_require__(95978); /** @typedef {import("./AsyncDependenciesBlock")} AsyncDependenciesBlock */ /** @typedef {import("./Chunk")} Chunk */ @@ -54609,6 +55531,7 @@ const { * @typedef {Object} RawChunkGroupOptions * @property {number=} preloadOrder * @property {number=} prefetchOrder + * @property {("low" | "high" | "auto")=} fetchPriority */ /** @typedef {RawChunkGroupOptions & { name?: string }} ChunkGroupOptions */ @@ -54678,7 +55601,7 @@ class ChunkGroup { /** Indices in bottom-up order */ /** @private @type {Map} */ this._modulePostOrderIndices = new Map(); - /** @type {number} */ + /** @type {number | undefined} */ this.index = undefined; } @@ -54689,9 +55612,15 @@ class ChunkGroup { */ addOptions(options) { for (const key of Object.keys(options)) { - if (this.options[key] === undefined) { - this.options[key] = options[key]; - } else if (this.options[key] !== options[key]) { + if ( + this.options[/** @type {keyof ChunkGroupOptions} */ (key)] === undefined + ) { + this.options[key] = + options[/** @type {keyof ChunkGroupOptions} */ (key)]; + } else if ( + this.options[/** @type {keyof ChunkGroupOptions} */ (key)] !== + options[/** @type {keyof ChunkGroupOptions} */ (key)] + ) { if (key.endsWith("Order")) { this.options[key] = Math.max(this.options[key], options[key]); } else { @@ -54705,7 +55634,7 @@ class ChunkGroup { /** * returns the name of current ChunkGroup - * @returns {string|undefined} returns the ChunkGroup name + * @returns {string | undefined} returns the ChunkGroup name */ get name() { return this.options.name; @@ -54713,7 +55642,7 @@ class ChunkGroup { /** * sets a new name for current ChunkGroup - * @param {string} value the new name for ChunkGroup + * @param {string | undefined} value the new name for ChunkGroup * @returns {void} */ set name(value) { @@ -54934,7 +55863,7 @@ class ChunkGroup { } /** - * @returns {Array} an array containing the blocks + * @returns {Array} an array containing the blocks */ getBlocks() { return this._blocks.getFromCache(getArray); @@ -54944,6 +55873,10 @@ class ChunkGroup { return this._blocks.size; } + /** + * @param {AsyncDependenciesBlock} block block + * @returns {boolean} true, if block exists + */ hasBlock(block) { return this._blocks.has(block); } @@ -55073,7 +56006,11 @@ class ChunkGroup { lists.set(name, (list = [])); } list.push({ - order: childGroup.options[key], + order: + /** @type {number} */ + ( + childGroup.options[/** @type {keyof ChunkGroupOptions} */ (key)] + ), group: childGroup }); } @@ -55105,7 +56042,7 @@ class ChunkGroup { /** * Gets the top-down index of a module in this ChunkGroup * @param {Module} module the module - * @returns {number} index + * @returns {number | undefined} index */ getModulePreOrderIndex(module) { return this._modulePreOrderIndices.get(module); @@ -55124,7 +56061,7 @@ class ChunkGroup { /** * Gets the bottom-up index of a module in this ChunkGroup * @param {Module} module the module - * @returns {number} index + * @returns {number | undefined} index */ getModulePostOrderIndex(module) { return this._modulePostOrderIndices.get(module); @@ -55167,7 +56104,7 @@ module.exports = ChunkGroup; /***/ }), -/***/ 73963: +/***/ 33076: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -55178,7 +56115,7 @@ module.exports = ChunkGroup; -const WebpackError = __webpack_require__(10841); +const WebpackError = __webpack_require__(49999); /** @typedef {import("./Chunk")} Chunk */ @@ -55206,7 +56143,7 @@ module.exports = ChunkRenderError; /***/ }), -/***/ 43435: +/***/ 89324: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -55218,13 +56155,13 @@ module.exports = ChunkRenderError; const util = __webpack_require__(73837); -const memoize = __webpack_require__(27319); +const memoize = __webpack_require__(62377); /** @typedef {import("../declarations/WebpackOptions").Output} OutputOptions */ /** @typedef {import("./Compilation")} Compilation */ const getJavascriptModulesPlugin = memoize(() => - __webpack_require__(96230) + __webpack_require__(70061) ); // TODO webpack 6 remove this class @@ -55352,7 +56289,7 @@ module.exports = ChunkTemplate; /***/ }), -/***/ 25358: +/***/ 9110: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -55365,10 +56302,10 @@ module.exports = ChunkTemplate; const asyncLib = __webpack_require__(47087); const { SyncBailHook } = __webpack_require__(70793); -const Compilation = __webpack_require__(38292); -const createSchemaValidation = __webpack_require__(94091); -const { join } = __webpack_require__(33139); -const processAsyncTree = __webpack_require__(65754); +const Compilation = __webpack_require__(20417); +const createSchemaValidation = __webpack_require__(45488); +const { join } = __webpack_require__(96220); +const processAsyncTree = __webpack_require__(18119); /** @typedef {import("../declarations/WebpackOptions").CleanOptions} CleanOptions */ /** @typedef {import("./Compiler")} Compiler */ @@ -55388,7 +56325,7 @@ const processAsyncTree = __webpack_require__(65754); const validate = createSchemaValidation( undefined, () => { - const { definitions } = __webpack_require__(9183); + const { definitions } = __webpack_require__(40138); return { definitions, oneOf: [{ $ref: "#/definitions/CleanOptions" }] @@ -55436,7 +56373,8 @@ const getDiffToFs = (fs, outputPath, currentAssets, callback) => { directories, 10, (directory, callback) => { - fs.readdir(join(fs, outputPath, directory), (err, entries) => { + /** @type {NonNullable} */ + (fs.readdir)(join(fs, outputPath, directory), (err, entries) => { if (err) { if (err.code === "ENOENT") return callback(); if (err.code === "ENOTDIR") { @@ -55486,7 +56424,8 @@ const getDiffToOldAssets = (currentAssets, oldAssets) => { */ const doStat = (fs, filename, callback) => { if ("lstat" in fs) { - fs.lstat(filename, callback); + /** @type {NonNullable} */ + (fs.lstat)(filename, callback); } else { fs.stat(filename, callback); } @@ -55503,6 +56442,9 @@ const doStat = (fs, filename, callback) => { * @returns {void} */ const applyDiff = (fs, outputPath, dry, logger, diff, isKept, callback) => { + /** + * @param {string} msg message + */ const log = msg => { if (dry) { logger.info(msg); @@ -55523,6 +56465,10 @@ const applyDiff = (fs, outputPath, dry, logger, diff, isKept, callback) => { jobs, 10, ({ type, filename, parent }, push, callback) => { + /** + * @param {Error & { code?: string }} err error + * @returns {void} + */ const handleError = err => { if (err.code === "ENOENT") { log(`${filename} was removed during cleaning by something else`); @@ -55553,7 +56499,9 @@ const applyDiff = (fs, outputPath, dry, logger, diff, isKept, callback) => { }); return callback(); } - fs.readdir(path, (err, entries) => { + + /** @type {NonNullable} */ + (fs.readdir)(path, (err, entries) => { if (err) return handleError(err); /** @type {Job} */ const deleteJob = { @@ -55675,9 +56623,17 @@ class CleanPlugin { typeof keep === "function" ? keep : typeof keep === "string" - ? path => path.startsWith(keep) + ? /** + * @param {string} path path + * @returns {boolean} true, if the path should be kept + */ + path => path.startsWith(keep) : typeof keep === "object" && keep.test - ? path => keep.test(path) + ? /** + * @param {string} path path + * @returns {boolean} true, if the path should be kept + */ + path => keep.test(path) : () => false; // We assume that no external modification happens while the compiler is active @@ -55729,6 +56685,10 @@ class CleanPlugin { const outputPath = compilation.getPath(compiler.outputPath, {}); + /** + * @param {string} path path + * @returns {boolean} true, if needs to be kept + */ const isKept = path => { const result = hooks.keep.call(path); if (result !== undefined) return result; @@ -55736,7 +56696,7 @@ class CleanPlugin { }; /** - * @param {Error=} err err + * @param {(Error | null)=} err err * @param {Set=} diff diff */ const diffCallback = (err, diff) => { @@ -55750,7 +56710,7 @@ class CleanPlugin { outputPath, dry, logger, - diff, + /** @type {Set} */ (diff), isKept, (err, keptAssets) => { if (err) { @@ -55780,7 +56740,7 @@ module.exports = CleanPlugin; /***/ }), -/***/ 49218: +/***/ 74522: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -55791,7 +56751,7 @@ module.exports = CleanPlugin; -const WebpackError = __webpack_require__(10841); +const WebpackError = __webpack_require__(49999); /** @typedef {import("./Module")} Module */ @@ -55817,7 +56777,7 @@ module.exports = CodeGenerationError; /***/ }), -/***/ 51893: +/***/ 25758: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -55828,10 +56788,10 @@ module.exports = CodeGenerationError; -const { provide } = __webpack_require__(79262); -const { first } = __webpack_require__(97045); -const createHash = __webpack_require__(94624); -const { runtimeToString, RuntimeSpecMap } = __webpack_require__(55693); +const { getOrInsert } = __webpack_require__(76790); +const { first } = __webpack_require__(24352); +const createHash = __webpack_require__(31147); +const { runtimeToString, RuntimeSpecMap } = __webpack_require__(69965); /** @typedef {import("webpack-sources").Source} Source */ /** @typedef {import("./Module")} Module */ @@ -55970,7 +56930,7 @@ Caller might not support runtime-dependent code generation (opt-out via optimiza * @returns {void} */ add(module, runtime, result) { - const map = provide(this.map, module, () => new RuntimeSpecMap()); + const map = getOrInsert(this.map, module, () => new RuntimeSpecMap()); map.set(runtime, result); } } @@ -55980,7 +56940,7 @@ module.exports = CodeGenerationResults; /***/ }), -/***/ 72190: +/***/ 38011: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -55991,8 +56951,8 @@ module.exports = CodeGenerationResults; -const WebpackError = __webpack_require__(10841); -const makeSerializable = __webpack_require__(23827); +const WebpackError = __webpack_require__(49999); +const makeSerializable = __webpack_require__(83626); /** @typedef {import("./Dependency").DependencyLocation} DependencyLocation */ @@ -56021,7 +56981,7 @@ module.exports = CommentCompilationWarning; /***/ }), -/***/ 89354: +/***/ 35197: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -56032,12 +56992,22 @@ module.exports = CommentCompilationWarning; -const ConstDependency = __webpack_require__(78284); - +const { + JAVASCRIPT_MODULE_TYPE_AUTO, + JAVASCRIPT_MODULE_TYPE_DYNAMIC, + JAVASCRIPT_MODULE_TYPE_ESM +} = __webpack_require__(92891); +const RuntimeGlobals = __webpack_require__(61539); +const ConstDependency = __webpack_require__(67538); + +/** @typedef {import("estree").CallExpression} CallExpression */ /** @typedef {import("./Compiler")} Compiler */ +/** @typedef {import("./Dependency").DependencyLocation} DependencyLocation */ /** @typedef {import("./javascript/JavascriptParser")} JavascriptParser */ +/** @typedef {import("./javascript/JavascriptParser").Range} Range */ -const nestedWebpackRequireTag = Symbol("nested __webpack_require__"); +const nestedWebpackIdentifierTag = Symbol("nested webpack identifier"); +const PLUGIN_NAME = "CompatibilityPlugin"; class CompatibilityPlugin { /** @@ -56047,7 +57017,7 @@ class CompatibilityPlugin { */ apply(compiler) { compiler.hooks.compilation.tap( - "CompatibilityPlugin", + PLUGIN_NAME, (compilation, { normalModuleFactory }) => { compilation.dependencyTemplates.set( ConstDependency, @@ -56055,24 +57025,31 @@ class CompatibilityPlugin { ); normalModuleFactory.hooks.parser - .for("javascript/auto") - .tap("CompatibilityPlugin", (parser, parserOptions) => { + .for(JAVASCRIPT_MODULE_TYPE_AUTO) + .tap(PLUGIN_NAME, (parser, parserOptions) => { if ( parserOptions.browserify !== undefined && !parserOptions.browserify ) return; - parser.hooks.call - .for("require") - .tap("CompatibilityPlugin", expr => { + parser.hooks.call.for("require").tap( + PLUGIN_NAME, + /** + * @param {CallExpression} expr call expression + * @returns {boolean | void} true when need to handle + */ + expr => { // support for browserify style require delegator: "require(o, !0)" if (expr.arguments.length !== 2) return; const second = parser.evaluateExpression(expr.arguments[1]); if (!second.isBoolean()) return; if (second.asBool() !== true) return; - const dep = new ConstDependency("require", expr.callee.range); - dep.loc = expr.loc; + const dep = new ConstDependency( + "require", + /** @type {Range} */ (expr.callee.range) + ); + dep.loc = /** @type {DependencyLocation} */ (expr.loc); if (parser.state.current.dependencies.length > 0) { const last = parser.state.current.dependencies[ @@ -56089,7 +57066,8 @@ class CompatibilityPlugin { } parser.state.module.addPresentationalDependency(dep); return true; - }); + } + ); }); /** @@ -56098,30 +57076,51 @@ class CompatibilityPlugin { */ const handler = parser => { // Handle nested requires - parser.hooks.preStatement.tap("CompatibilityPlugin", statement => { + parser.hooks.preStatement.tap(PLUGIN_NAME, statement => { if ( statement.type === "FunctionDeclaration" && statement.id && - statement.id.name === "__webpack_require__" + statement.id.name === RuntimeGlobals.require ) { - const newName = `__nested_webpack_require_${statement.range[0]}__`; - parser.tagVariable(statement.id.name, nestedWebpackRequireTag, { + const newName = `__nested_webpack_require_${ + /** @type {Range} */ (statement.range)[0] + }__`; + parser.tagVariable( + statement.id.name, + nestedWebpackIdentifierTag, + { + name: newName, + declaration: { + updated: false, + loc: statement.id.loc, + range: statement.id.range + } + } + ); + return true; + } + }); + parser.hooks.pattern + .for(RuntimeGlobals.require) + .tap(PLUGIN_NAME, pattern => { + const newName = `__nested_webpack_require_${ + /** @type {Range} */ (pattern.range)[0] + }__`; + parser.tagVariable(pattern.name, nestedWebpackIdentifierTag, { name: newName, declaration: { updated: false, - loc: statement.id.loc, - range: statement.id.range + loc: pattern.loc, + range: pattern.range } }); return true; - } - }); + }); parser.hooks.pattern - .for("__webpack_require__") - .tap("CompatibilityPlugin", pattern => { - const newName = `__nested_webpack_require_${pattern.range[0]}__`; - parser.tagVariable(pattern.name, nestedWebpackRequireTag, { - name: newName, + .for(RuntimeGlobals.exports) + .tap(PLUGIN_NAME, pattern => { + parser.tagVariable(pattern.name, nestedWebpackIdentifierTag, { + name: "__nested_webpack_exports__", declaration: { updated: false, loc: pattern.loc, @@ -56131,8 +57130,8 @@ class CompatibilityPlugin { return true; }); parser.hooks.expression - .for(nestedWebpackRequireTag) - .tap("CompatibilityPlugin", expr => { + .for(nestedWebpackIdentifierTag) + .tap(PLUGIN_NAME, expr => { const { name, declaration } = parser.currentTagData; if (!declaration.updated) { const dep = new ConstDependency(name, declaration.range); @@ -56140,38 +57139,38 @@ class CompatibilityPlugin { parser.state.module.addPresentationalDependency(dep); declaration.updated = true; } - const dep = new ConstDependency(name, expr.range); - dep.loc = expr.loc; + const dep = new ConstDependency( + name, + /** @type {Range} */ (expr.range) + ); + dep.loc = /** @type {DependencyLocation} */ (expr.loc); parser.state.module.addPresentationalDependency(dep); return true; }); // Handle hashbang - parser.hooks.program.tap( - "CompatibilityPlugin", - (program, comments) => { - if (comments.length === 0) return; - const c = comments[0]; - if (c.type === "Line" && c.range[0] === 0) { - if (parser.state.source.slice(0, 2).toString() !== "#!") return; - // this is a hashbang comment - const dep = new ConstDependency("//", 0); - dep.loc = c.loc; - parser.state.module.addPresentationalDependency(dep); - } + parser.hooks.program.tap(PLUGIN_NAME, (program, comments) => { + if (comments.length === 0) return; + const c = comments[0]; + if (c.type === "Line" && /** @type {Range} */ (c.range)[0] === 0) { + if (parser.state.source.slice(0, 2).toString() !== "#!") return; + // this is a hashbang comment + const dep = new ConstDependency("//", 0); + dep.loc = /** @type {DependencyLocation} */ (c.loc); + parser.state.module.addPresentationalDependency(dep); } - ); + }); }; normalModuleFactory.hooks.parser - .for("javascript/auto") - .tap("CompatibilityPlugin", handler); + .for(JAVASCRIPT_MODULE_TYPE_AUTO) + .tap(PLUGIN_NAME, handler); normalModuleFactory.hooks.parser - .for("javascript/dynamic") - .tap("CompatibilityPlugin", handler); + .for(JAVASCRIPT_MODULE_TYPE_DYNAMIC) + .tap(PLUGIN_NAME, handler); normalModuleFactory.hooks.parser - .for("javascript/esm") - .tap("CompatibilityPlugin", handler); + .for(JAVASCRIPT_MODULE_TYPE_ESM) + .tap(PLUGIN_NAME, handler); } ); } @@ -56181,7 +57180,7 @@ module.exports = CompatibilityPlugin; /***/ }), -/***/ 38292: +/***/ 20417: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -56204,53 +57203,54 @@ const { } = __webpack_require__(70793); const util = __webpack_require__(73837); const { CachedSource } = __webpack_require__(59728); -const { MultiItemCache } = __webpack_require__(60415); -const Chunk = __webpack_require__(67732); -const ChunkGraph = __webpack_require__(64438); -const ChunkGroup = __webpack_require__(51910); -const ChunkRenderError = __webpack_require__(73963); -const ChunkTemplate = __webpack_require__(43435); -const CodeGenerationError = __webpack_require__(49218); -const CodeGenerationResults = __webpack_require__(51893); -const Dependency = __webpack_require__(68242); -const DependencyTemplates = __webpack_require__(40506); -const Entrypoint = __webpack_require__(3457); -const ErrorHelpers = __webpack_require__(68390); -const FileSystemInfo = __webpack_require__(1120); +const { MultiItemCache } = __webpack_require__(98230); +const Chunk = __webpack_require__(93399); +const ChunkGraph = __webpack_require__(84275); +const ChunkGroup = __webpack_require__(39); +const ChunkRenderError = __webpack_require__(33076); +const ChunkTemplate = __webpack_require__(89324); +const CodeGenerationError = __webpack_require__(74522); +const CodeGenerationResults = __webpack_require__(25758); +const Dependency = __webpack_require__(504); +const DependencyTemplates = __webpack_require__(81661); +const Entrypoint = __webpack_require__(25661); +const ErrorHelpers = __webpack_require__(65206); +const FileSystemInfo = __webpack_require__(18509); const { connectChunkGroupAndChunk, connectChunkGroupParentAndChild -} = __webpack_require__(3093); +} = __webpack_require__(90461); const { makeWebpackError, tryRunOrWebpackError -} = __webpack_require__(88608); -const MainTemplate = __webpack_require__(58619); -const Module = __webpack_require__(96040); -const ModuleDependencyError = __webpack_require__(66524); -const ModuleDependencyWarning = __webpack_require__(93492); -const ModuleGraph = __webpack_require__(85215); -const ModuleHashingError = __webpack_require__(75037); -const ModuleNotFoundError = __webpack_require__(79150); -const ModuleProfile = __webpack_require__(68318); -const ModuleRestoreError = __webpack_require__(77081); -const ModuleStoreError = __webpack_require__(77963); -const ModuleTemplate = __webpack_require__(6927); -const RuntimeGlobals = __webpack_require__(34623); -const RuntimeTemplate = __webpack_require__(96303); -const Stats = __webpack_require__(62218); -const WebpackError = __webpack_require__(10841); -const buildChunkGraph = __webpack_require__(84217); -const BuildCycleError = __webpack_require__(46006); -const { Logger, LogType } = __webpack_require__(10689); -const StatsFactory = __webpack_require__(24195); -const StatsPrinter = __webpack_require__(91180); -const { equals: arrayEquals } = __webpack_require__(91696); -const AsyncQueue = __webpack_require__(94975); -const LazySet = __webpack_require__(66205); -const { provide } = __webpack_require__(79262); -const WeakTupleMap = __webpack_require__(63887); -const { cachedCleverMerge } = __webpack_require__(31074); +} = __webpack_require__(39319); +const MainTemplate = __webpack_require__(75078); +const Module = __webpack_require__(6309); +const ModuleDependencyError = __webpack_require__(8885); +const ModuleDependencyWarning = __webpack_require__(99391); +const ModuleGraph = __webpack_require__(43714); +const ModuleHashingError = __webpack_require__(70044); +const ModuleNotFoundError = __webpack_require__(32569); +const ModuleProfile = __webpack_require__(27981); +const ModuleRestoreError = __webpack_require__(20130); +const ModuleStoreError = __webpack_require__(59592); +const ModuleTemplate = __webpack_require__(69853); +const { WEBPACK_MODULE_TYPE_RUNTIME } = __webpack_require__(92891); +const RuntimeGlobals = __webpack_require__(61539); +const RuntimeTemplate = __webpack_require__(42741); +const Stats = __webpack_require__(92646); +const WebpackError = __webpack_require__(49999); +const buildChunkGraph = __webpack_require__(6501); +const BuildCycleError = __webpack_require__(83989); +const { Logger, LogType } = __webpack_require__(52249); +const StatsFactory = __webpack_require__(9147); +const StatsPrinter = __webpack_require__(40979); +const { equals: arrayEquals } = __webpack_require__(22150); +const AsyncQueue = __webpack_require__(19422); +const LazySet = __webpack_require__(57876); +const { getOrInsert } = __webpack_require__(76790); +const WeakTupleMap = __webpack_require__(22435); +const { cachedCleverMerge } = __webpack_require__(44639); const { compareLocations, concatComparators, @@ -56258,16 +57258,16 @@ const { compareIds, compareStringsNumeric, compareModulesByIdentifier -} = __webpack_require__(29355); -const createHash = __webpack_require__(94624); +} = __webpack_require__(95978); +const createHash = __webpack_require__(31147); const { arrayToSetDeprecation, soonFrozenObjectDeprecation, createFakeHook -} = __webpack_require__(47762); -const processAsyncTree = __webpack_require__(65754); -const { getRuntimeKey } = __webpack_require__(55693); -const { isSourceEqual } = __webpack_require__(70475); +} = __webpack_require__(40630); +const processAsyncTree = __webpack_require__(18119); +const { getRuntimeKey } = __webpack_require__(69965); +const { isSourceEqual } = __webpack_require__(39946); /** @template T @typedef {import("tapable").AsArray} AsArray */ /** @typedef {import("webpack-sources").Source} Source */ @@ -56537,7 +57537,7 @@ const esmDependencyCategory = "esm"; // TODO webpack 6: remove const deprecatedNormalModuleLoaderHook = util.deprecate( compilation => { - return (__webpack_require__(55443).getCompilationHooks)(compilation).loader; + return (__webpack_require__(17318).getCompilationHooks)(compilation).loader; }, "Compilation.hooks.normalModuleLoader was moved to NormalModule.getCompilationHooks(compilation).loader", "DEP_WEBPACK_COMPILATION_NORMAL_MODULE_LOADER_HOOK" @@ -56833,7 +57833,12 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si /** @type {SyncHook<[]>} */ beforeChunks: new SyncHook([]), - /** @type {SyncHook<[Iterable]>} */ + /** + * The `afterChunks` hook is called directly after the chunks and module graph have + * been created and before the chunks and modules have been optimized. This hook is useful to + * inspect, analyze, and/or modify the chunk graph. + * @type {SyncHook<[Iterable]>} + */ afterChunks: new SyncHook(["chunks"]), /** @type {SyncBailHook<[Iterable]>} */ @@ -56862,7 +57867,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si optimizeChunkModules: new AsyncSeriesBailHook(["chunks", "modules"]), /** @type {SyncHook<[Iterable, Iterable]>} */ afterOptimizeChunkModules: new SyncHook(["chunks", "modules"]), - /** @type {SyncBailHook<[], boolean>} */ + /** @type {SyncBailHook<[], boolean | undefined>} */ shouldRecord: new SyncBailHook([]), /** @type {SyncHook<[Chunk, Set, RuntimeRequirementsContext]>} */ @@ -58717,7 +59722,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si this.factorizeQueue.clear(); if (this.profile) { this.logger.time("finish module profiles"); - const ParallelismFactorCalculator = __webpack_require__(44320); + const ParallelismFactorCalculator = __webpack_require__(58816); const p = new ParallelismFactorCalculator(); const moduleGraph = this.moduleGraph; const modulesWithProfiles = new Map(); @@ -58765,6 +59770,8 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si p.calculate(); const logger = this.getLogger("webpack.Compilation.ModuleProfile"); + // Avoid coverage problems due indirect changes + /* istanbul ignore next */ const logByValue = (value, msg) => { if (value > 1000) { logger.error(msg); @@ -58805,7 +59812,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si const logByLoadersSummary = (category, getDuration, getParallelism) => { const map = new Map(); for (const [module, profile] of modulesWithProfiles) { - const list = provide( + const list = getOrInsert( map, module.type + "!" + module.identifier().replace(/(!|^)[^!]*$/, ""), () => [] @@ -59387,6 +60394,7 @@ Or do you want to use the entrypoints '${name}' and '${runtime}' independently o const { chunkGraph, moduleGraph, dependencyTemplates, runtimeTemplate } = this; const results = this.codeGenerationResults; + /** @type {WebpackError[]} */ const errors = []; /** @type {Set | undefined} */ let notCodeGeneratedModules = undefined; @@ -59482,7 +60490,7 @@ Or do you want to use the entrypoints '${name}' and '${runtime}' independently o * @param {RuntimeTemplate} runtimeTemplate runtimeTemplate * @param {WebpackError[]} errors errors * @param {CodeGenerationResults} results results - * @param {function(WebpackError=, boolean=): void} callback callback + * @param {function((WebpackError | null)=, boolean=): void} callback callback */ _codeGenerationModule( module, @@ -61192,7 +62200,7 @@ This prevents using hashes of each other and should be avoided.`); strictModuleErrorHandling, strictModuleExceptionHandling } = this.outputOptions; - const __nested_webpack_require_153330__ = id => { + const __nested_webpack_require_153795__ = id => { const cached = moduleCache[id]; if (cached !== undefined) { if (cached.error) throw cached.error; @@ -61201,20 +62209,20 @@ This prevents using hashes of each other and should be avoided.`); const moduleArgument = moduleArgumentsById.get(id); return __webpack_require_module__(moduleArgument, id); }; - const interceptModuleExecution = (__nested_webpack_require_153330__[ + const interceptModuleExecution = (__nested_webpack_require_153795__[ RuntimeGlobals.interceptModuleExecution.replace( - "__webpack_require__.", + `${RuntimeGlobals.require}.`, "" ) ] = []); - const moduleCache = (__nested_webpack_require_153330__[ + const moduleCache = (__nested_webpack_require_153795__[ RuntimeGlobals.moduleCache.replace( - "__webpack_require__.", + `${RuntimeGlobals.require}.`, "" ) ] = {}); - context.__webpack_require__ = __nested_webpack_require_153330__; + context.__webpack_require__ = __nested_webpack_require_153795__; /** * @param {ExecuteModuleArgument} moduleArgument the module argument @@ -61230,7 +62238,7 @@ This prevents using hashes of each other and should be avoided.`); loaded: false, error: undefined }, - require: __nested_webpack_require_153330__ + require: __nested_webpack_require_153795__ }; interceptModuleExecution.forEach(handler => handler(execOptions) @@ -61270,7 +62278,7 @@ This prevents using hashes of each other and should be avoided.`); moduleArgumentsMap.get(runtimeModule) ); } - exports = __nested_webpack_require_153330__(module.identifier()); + exports = __nested_webpack_require_153795__(module.identifier()); } catch (e) { const err = new WebpackError( `Execution of module code from module graph (${module.readableIdentifier( @@ -61306,7 +62314,7 @@ This prevents using hashes of each other and should be avoided.`); const usedIds = new Set(); for (const module of this.modules) { - if (module.type === "runtime") continue; + if (module.type === WEBPACK_MODULE_TYPE_RUNTIME) continue; const moduleId = chunkGraph.getModuleId(module); if (moduleId === null) continue; if (usedIds.has(moduleId)) { @@ -61490,7 +62498,7 @@ module.exports = Compilation; /***/ }), -/***/ 27551: +/***/ 18771: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -61510,24 +62518,24 @@ const { AsyncSeriesHook } = __webpack_require__(70793); const { SizeOnlySource } = __webpack_require__(59728); -const webpack = __webpack_require__(3516); -const Cache = __webpack_require__(20130); -const CacheFacade = __webpack_require__(60415); -const ChunkGraph = __webpack_require__(64438); -const Compilation = __webpack_require__(38292); -const ConcurrentCompilationError = __webpack_require__(79831); -const ContextModuleFactory = __webpack_require__(81301); -const ModuleGraph = __webpack_require__(85215); -const NormalModuleFactory = __webpack_require__(51548); -const RequestShortener = __webpack_require__(89692); -const ResolverFactory = __webpack_require__(29955); -const Stats = __webpack_require__(62218); -const Watching = __webpack_require__(91561); -const WebpackError = __webpack_require__(10841); -const { Logger } = __webpack_require__(10689); -const { join, dirname, mkdirp } = __webpack_require__(33139); -const { makePathsRelative } = __webpack_require__(63146); -const { isSourceEqual } = __webpack_require__(70475); +const webpack = __webpack_require__(7265); +const Cache = __webpack_require__(11948); +const CacheFacade = __webpack_require__(98230); +const ChunkGraph = __webpack_require__(84275); +const Compilation = __webpack_require__(20417); +const ConcurrentCompilationError = __webpack_require__(86540); +const ContextModuleFactory = __webpack_require__(76928); +const ModuleGraph = __webpack_require__(43714); +const NormalModuleFactory = __webpack_require__(43329); +const RequestShortener = __webpack_require__(25931); +const ResolverFactory = __webpack_require__(639); +const Stats = __webpack_require__(92646); +const Watching = __webpack_require__(41951); +const WebpackError = __webpack_require__(49999); +const { Logger } = __webpack_require__(52249); +const { join, dirname, mkdirp } = __webpack_require__(96220); +const { makePathsRelative } = __webpack_require__(97451); +const { isSourceEqual } = __webpack_require__(39946); /** @typedef {import("webpack-sources").Source} Source */ /** @typedef {import("../declarations/WebpackOptions").EntryNormalized} Entry */ @@ -61622,7 +62630,7 @@ class Compiler { /** @type {SyncHook<[]>} */ initialize: new SyncHook([]), - /** @type {SyncBailHook<[Compilation], boolean>} */ + /** @type {SyncBailHook<[Compilation], boolean | undefined>} */ shouldEmit: new SyncBailHook(["compilation"]), /** @type {AsyncSeriesHook<[Stats]>} */ done: new AsyncSeriesHook(["stats"]), @@ -61704,7 +62712,7 @@ class Compiler { this.root = this; /** @type {string} */ this.outputPath = ""; - /** @type {Watching} */ + /** @type {Watching | undefined} */ this.watching = undefined; /** @type {OutputFileSystem} */ @@ -61726,15 +62734,15 @@ class Compiler { /** @type {Set} */ this.immutablePaths = new Set(); - /** @type {ReadonlySet} */ + /** @type {ReadonlySet | undefined} */ this.modifiedFiles = undefined; - /** @type {ReadonlySet} */ + /** @type {ReadonlySet | undefined} */ this.removedFiles = undefined; - /** @type {ReadonlyMap} */ + /** @type {ReadonlyMap | undefined} */ this.fileTimestamps = undefined; - /** @type {ReadonlyMap} */ + /** @type {ReadonlyMap | undefined} */ this.contextTimestamps = undefined; - /** @type {number} */ + /** @type {number | undefined} */ this.fsStartTime = undefined; /** @type {ResolverFactory} */ @@ -62466,10 +63474,13 @@ ${other}`); readRecords(callback) { if (this.hooks.readRecords.isUsed()) { if (this.recordsInputPath) { - asyncLib.parallel([ - cb => this.hooks.readRecords.callAsync(cb), - this._readRecords.bind(this) - ]); + asyncLib.parallel( + [ + cb => this.hooks.readRecords.callAsync(cb), + this._readRecords.bind(this) + ], + err => callback(err) + ); } else { this.records = {}; this.hooks.readRecords.callAsync(callback); @@ -62504,8 +63515,7 @@ ${other}`); try { this.records = parseJson(content.toString("utf-8")); } catch (e) { - e.message = "Cannot parse records: " + e.message; - return callback(e); + return callback(new Error(`Cannot parse records: ${e.message}`)); } return callback(); @@ -62567,7 +63577,9 @@ ${other}`); childCompiler.root = this.root; if (Array.isArray(plugins)) { for (const plugin of plugins) { - plugin.apply(childCompiler); + if (plugin) { + plugin.apply(childCompiler); + } } } for (const name in this.hooks) { @@ -62728,7 +63740,7 @@ module.exports = Compiler; /***/ }), -/***/ 68645: +/***/ 92811: /***/ (function(module) { "use strict"; @@ -62842,7 +63854,7 @@ class ConcatenationScope { module, { ids = undefined, call = false, directImport = false, asiSafe = false } ) { - const info = this._modulesMap.get(module); + const info = /** @type {ModuleInfo} */ (this._modulesMap.get(module)); const callFlag = call ? "_call" : ""; const directImportFlag = directImport ? "_directImport" : ""; const asiSafeFlag = asiSafe @@ -62867,7 +63879,7 @@ class ConcatenationScope { /** * @param {string} name the identifier - * @returns {ModuleReferenceOptions & { index: number }} parsed options and index + * @returns {ModuleReferenceOptions & { index: number } | null} parsed options and index */ static matchModuleReference(name) { const match = MODULE_REFERENCE_REGEXP.exec(name); @@ -62895,7 +63907,7 @@ module.exports = ConcatenationScope; /***/ }), -/***/ 79831: +/***/ 86540: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -62906,7 +63918,7 @@ module.exports = ConcatenationScope; -const WebpackError = __webpack_require__(10841); +const WebpackError = __webpack_require__(49999); module.exports = class ConcurrentCompilationError extends WebpackError { constructor() { @@ -62921,7 +63933,7 @@ module.exports = class ConcurrentCompilationError extends WebpackError { /***/ }), -/***/ 63723: +/***/ 1617: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -62933,14 +63945,19 @@ module.exports = class ConcurrentCompilationError extends WebpackError { const { ConcatSource, PrefixSource } = __webpack_require__(59728); -const InitFragment = __webpack_require__(53658); -const Template = __webpack_require__(88070); -const { mergeRuntime } = __webpack_require__(55693); +const InitFragment = __webpack_require__(44508); +const Template = __webpack_require__(88835); +const { mergeRuntime } = __webpack_require__(69965); /** @typedef {import("webpack-sources").Source} Source */ /** @typedef {import("./Generator").GenerateContext} GenerateContext */ /** @typedef {import("./util/runtime").RuntimeSpec} RuntimeSpec */ +/** + * @param {string} condition condition + * @param {string | Source} source source + * @returns {string | Source} wrapped source + */ const wrapInCondition = (condition, source) => { if (typeof source === "string") { return Template.asString([ @@ -62960,13 +63977,14 @@ const wrapInCondition = (condition, source) => { /** * @typedef {GenerateContext} Context + * @extends {InitFragment} */ class ConditionalInitFragment extends InitFragment { /** * @param {string|Source} content the source code that will be included as initialization code * @param {number} stage category of initialization code (contribute to order) * @param {number} position position in the category (contribute to order) - * @param {string} key unique key to avoid emitting the same initialization code twice + * @param {string | undefined} key unique key to avoid emitting the same initialization code twice * @param {RuntimeSpec | boolean} runtimeCondition in which runtime this fragment should be executed * @param {string|Source=} endContent the source code that will be included at the end of the module */ @@ -63016,6 +64034,10 @@ class ConditionalInitFragment extends InitFragment { return wrapInCondition(expr, this.endContent); } + /** + * @param {ConditionalInitFragment} other fragment to merge with + * @returns {ConditionalInitFragment} merged fragment + */ merge(other) { if (this.runtimeCondition === true) return this; if (other.runtimeCondition === true) return other; @@ -63041,7 +64063,7 @@ module.exports = ConditionalInitFragment; /***/ }), -/***/ 58425: +/***/ 46523: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -63052,19 +64074,36 @@ module.exports = ConditionalInitFragment; -const CachedConstDependency = __webpack_require__(12389); -const ConstDependency = __webpack_require__(78284); -const { evaluateToString } = __webpack_require__(645); -const { parseResource } = __webpack_require__(63146); - -/** @typedef {import("estree").Expression} ExpressionNode */ -/** @typedef {import("estree").Super} SuperNode */ +const { + JAVASCRIPT_MODULE_TYPE_AUTO, + JAVASCRIPT_MODULE_TYPE_DYNAMIC, + JAVASCRIPT_MODULE_TYPE_ESM +} = __webpack_require__(92891); +const CachedConstDependency = __webpack_require__(346); +const ConstDependency = __webpack_require__(67538); +const { evaluateToString } = __webpack_require__(94213); +const { parseResource } = __webpack_require__(97451); + +/** @typedef {import("estree").AssignmentProperty} AssignmentProperty */ +/** @typedef {import("estree").Expression} Expression */ +/** @typedef {import("estree").Identifier} Identifier */ +/** @typedef {import("estree").Pattern} Pattern */ +/** @typedef {import("estree").SourceLocation} SourceLocation */ +/** @typedef {import("estree").Statement} Statement */ +/** @typedef {import("estree").Super} Super */ /** @typedef {import("./Compiler")} Compiler */ +/** @typedef {import("./javascript/BasicEvaluatedExpression")} BasicEvaluatedExpression */ +/** @typedef {import("./javascript/JavascriptParser")} JavascriptParser */ +/** @typedef {import("./javascript/JavascriptParser").Range} Range */ +/** + * @param {Set} declarations set of declarations + * @param {Identifier | Pattern} pattern pattern to collect declarations from + */ const collectDeclaration = (declarations, pattern) => { const stack = [pattern]; while (stack.length > 0) { - const node = stack.pop(); + const node = /** @type {Pattern} */ (stack.pop()); switch (node.type) { case "Identifier": declarations.add(node.name); @@ -63081,7 +64120,7 @@ const collectDeclaration = (declarations, pattern) => { break; case "ObjectPattern": for (const property of node.properties) { - stack.push(property.value); + stack.push(/** @type {AssignmentProperty} */ (property).value); } break; case "RestElement": @@ -63091,8 +64130,14 @@ const collectDeclaration = (declarations, pattern) => { } }; +/** + * @param {Statement} branch branch to get hoisted declarations from + * @param {boolean} includeFunctionDeclarations whether to include function declarations + * @returns {Array} hoisted declarations + */ const getHoistedDeclarations = (branch, includeFunctionDeclarations) => { const declarations = new Set(); + /** @type {Array} */ const stack = [branch]; while (stack.length > 0) { const node = stack.pop(); @@ -63140,7 +64185,7 @@ const getHoistedDeclarations = (branch, includeFunctionDeclarations) => { break; case "FunctionDeclaration": if (includeFunctionDeclarations) { - collectDeclaration(declarations, node.id); + collectDeclaration(declarations, /** @type {Identifier} */ (node.id)); } break; case "VariableDeclaration": @@ -63155,6 +64200,8 @@ const getHoistedDeclarations = (branch, includeFunctionDeclarations) => { return Array.from(declarations); }; +const PLUGIN_NAME = "ConstPlugin"; + class ConstPlugin { /** * Apply the plugin @@ -63164,7 +64211,7 @@ class ConstPlugin { apply(compiler) { const cachedParseResource = parseResource.bindCache(compiler.root); compiler.hooks.compilation.tap( - "ConstPlugin", + PLUGIN_NAME, (compilation, { normalModuleFactory }) => { compilation.dependencyTemplates.set( ConstDependency, @@ -63176,15 +64223,21 @@ class ConstPlugin { new CachedConstDependency.Template() ); + /** + * @param {JavascriptParser} parser the parser + */ const handler = parser => { - parser.hooks.statementIf.tap("ConstPlugin", statement => { + parser.hooks.statementIf.tap(PLUGIN_NAME, statement => { if (parser.scope.isAsmJs) return; const param = parser.evaluateExpression(statement.test); const bool = param.asBool(); if (typeof bool === "boolean") { if (!param.couldHaveSideEffects()) { - const dep = new ConstDependency(`${bool}`, param.range); - dep.loc = statement.loc; + const dep = new ConstDependency( + `${bool}`, + /** @type {Range} */ (param.range) + ); + dep.loc = /** @type {SourceLocation} */ (statement.loc); parser.state.module.addPresentationalDependency(dep); } else { parser.walkExpression(statement.test); @@ -63240,24 +64293,27 @@ class ConstPlugin { } const dep = new ConstDependency( replacement, - branchToRemove.range + /** @type {Range} */ (branchToRemove.range) ); - dep.loc = branchToRemove.loc; + dep.loc = /** @type {SourceLocation} */ (branchToRemove.loc); parser.state.module.addPresentationalDependency(dep); } return bool; } }); parser.hooks.expressionConditionalOperator.tap( - "ConstPlugin", + PLUGIN_NAME, expression => { if (parser.scope.isAsmJs) return; const param = parser.evaluateExpression(expression.test); const bool = param.asBool(); if (typeof bool === "boolean") { if (!param.couldHaveSideEffects()) { - const dep = new ConstDependency(` ${bool}`, param.range); - dep.loc = expression.loc; + const dep = new ConstDependency( + ` ${bool}`, + /** @type {Range} */ (param.range) + ); + dep.loc = /** @type {SourceLocation} */ (expression.loc); parser.state.module.addPresentationalDependency(dep); } else { parser.walkExpression(expression.test); @@ -63276,15 +64332,18 @@ class ConstPlugin { const branchToRemove = bool ? expression.alternate : expression.consequent; - const dep = new ConstDependency("0", branchToRemove.range); - dep.loc = branchToRemove.loc; + const dep = new ConstDependency( + "0", + /** @type {Range} */ (branchToRemove.range) + ); + dep.loc = /** @type {SourceLocation} */ (branchToRemove.loc); parser.state.module.addPresentationalDependency(dep); return bool; } } ); parser.hooks.expressionLogicalOperator.tap( - "ConstPlugin", + PLUGIN_NAME, expression => { if (parser.scope.isAsmJs) return; if ( @@ -63353,8 +64412,11 @@ class ConstPlugin { // // returnfalse&&'foo' // - const dep = new ConstDependency(` ${bool}`, param.range); - dep.loc = expression.loc; + const dep = new ConstDependency( + ` ${bool}`, + /** @type {Range} */ (param.range) + ); + dep.loc = /** @type {SourceLocation} */ (expression.loc); parser.state.module.addPresentationalDependency(dep); } else { parser.walkExpression(expression.left); @@ -63362,9 +64424,9 @@ class ConstPlugin { if (!keepRight) { const dep = new ConstDependency( "0", - expression.right.range + /** @type {Range} */ (expression.right.range) ); - dep.loc = expression.loc; + dep.loc = /** @type {SourceLocation} */ (expression.loc); parser.state.module.addPresentationalDependency(dep); } return keepRight; @@ -63403,15 +64465,18 @@ class ConstPlugin { // // returnnull??'foo' // - const dep = new ConstDependency(" null", param.range); - dep.loc = expression.loc; + const dep = new ConstDependency( + " null", + /** @type {Range} */ (param.range) + ); + dep.loc = /** @type {SourceLocation} */ (expression.loc); parser.state.module.addPresentationalDependency(dep); } else { const dep = new ConstDependency( "0", - expression.right.range + /** @type {Range} */ (expression.right.range) ); - dep.loc = expression.loc; + dep.loc = /** @type {SourceLocation} */ (expression.loc); parser.state.module.addPresentationalDependency(dep); parser.walkExpression(expression.left); } @@ -63421,10 +64486,10 @@ class ConstPlugin { } } ); - parser.hooks.optionalChaining.tap("ConstPlugin", expr => { - /** @type {ExpressionNode[]} */ + parser.hooks.optionalChaining.tap(PLUGIN_NAME, expr => { + /** @type {Expression[]} */ const optionalExpressionsStack = []; - /** @type {ExpressionNode|SuperNode} */ + /** @type {Expression | Super} */ let next = expr.expression; while ( @@ -63435,7 +64500,7 @@ class ConstPlugin { if (next.optional) { // SuperNode can not be optional optionalExpressionsStack.push( - /** @type {ExpressionNode} */ (next.object) + /** @type {Expression} */ (next.object) ); } next = next.object; @@ -63443,7 +64508,7 @@ class ConstPlugin { if (next.optional) { // SuperNode can not be optional optionalExpressionsStack.push( - /** @type {ExpressionNode} */ (next.callee) + /** @type {Expression} */ (next.callee) ); } next = next.callee; @@ -63452,7 +64517,9 @@ class ConstPlugin { while (optionalExpressionsStack.length) { const expression = optionalExpressionsStack.pop(); - const evaluated = parser.evaluateExpression(expression); + const evaluated = parser.evaluateExpression( + /** @type {Expression} */ (expression) + ); if (evaluated.asNullish()) { // ------------------------------------------ @@ -63467,8 +64534,11 @@ class ConstPlugin { // // ------------------------------------------ // - const dep = new ConstDependency(" undefined", expr.range); - dep.loc = expr.loc; + const dep = new ConstDependency( + " undefined", + /** @type {Range} */ (expr.range) + ); + dep.loc = /** @type {SourceLocation} */ (expr.loc); parser.state.module.addPresentationalDependency(dep); return true; } @@ -63476,7 +64546,7 @@ class ConstPlugin { }); parser.hooks.evaluateIdentifier .for("__resourceQuery") - .tap("ConstPlugin", expr => { + .tap(PLUGIN_NAME, expr => { if (parser.scope.isAsmJs) return; if (!parser.state.module) return; return evaluateToString( @@ -63485,24 +64555,24 @@ class ConstPlugin { }); parser.hooks.expression .for("__resourceQuery") - .tap("ConstPlugin", expr => { + .tap(PLUGIN_NAME, expr => { if (parser.scope.isAsmJs) return; if (!parser.state.module) return; const dep = new CachedConstDependency( JSON.stringify( cachedParseResource(parser.state.module.resource).query ), - expr.range, + /** @type {Range} */ (expr.range), "__resourceQuery" ); - dep.loc = expr.loc; + dep.loc = /** @type {SourceLocation} */ (expr.loc); parser.state.module.addPresentationalDependency(dep); return true; }); parser.hooks.evaluateIdentifier .for("__resourceFragment") - .tap("ConstPlugin", expr => { + .tap(PLUGIN_NAME, expr => { if (parser.scope.isAsmJs) return; if (!parser.state.module) return; return evaluateToString( @@ -63511,31 +64581,31 @@ class ConstPlugin { }); parser.hooks.expression .for("__resourceFragment") - .tap("ConstPlugin", expr => { + .tap(PLUGIN_NAME, expr => { if (parser.scope.isAsmJs) return; if (!parser.state.module) return; const dep = new CachedConstDependency( JSON.stringify( cachedParseResource(parser.state.module.resource).fragment ), - expr.range, + /** @type {Range} */ (expr.range), "__resourceFragment" ); - dep.loc = expr.loc; + dep.loc = /** @type {SourceLocation} */ (expr.loc); parser.state.module.addPresentationalDependency(dep); return true; }); }; normalModuleFactory.hooks.parser - .for("javascript/auto") - .tap("ConstPlugin", handler); + .for(JAVASCRIPT_MODULE_TYPE_AUTO) + .tap(PLUGIN_NAME, handler); normalModuleFactory.hooks.parser - .for("javascript/dynamic") - .tap("ConstPlugin", handler); + .for(JAVASCRIPT_MODULE_TYPE_DYNAMIC) + .tap(PLUGIN_NAME, handler); normalModuleFactory.hooks.parser - .for("javascript/esm") - .tap("ConstPlugin", handler); + .for(JAVASCRIPT_MODULE_TYPE_ESM) + .tap(PLUGIN_NAME, handler); } ); } @@ -63546,7 +64616,7 @@ module.exports = ConstPlugin; /***/ }), -/***/ 14030: +/***/ 41509: /***/ (function(module) { "use strict"; @@ -63586,7 +64656,7 @@ module.exports = ContextExclusionPlugin; /***/ }), -/***/ 40317: +/***/ 18816: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -63598,25 +64668,26 @@ module.exports = ContextExclusionPlugin; const { OriginalSource, RawSource } = __webpack_require__(59728); -const AsyncDependenciesBlock = __webpack_require__(54823); -const { makeWebpackError } = __webpack_require__(88608); -const Module = __webpack_require__(96040); -const RuntimeGlobals = __webpack_require__(34623); -const Template = __webpack_require__(88070); -const WebpackError = __webpack_require__(10841); +const AsyncDependenciesBlock = __webpack_require__(27973); +const { makeWebpackError } = __webpack_require__(39319); +const Module = __webpack_require__(6309); +const { JAVASCRIPT_MODULE_TYPE_DYNAMIC } = __webpack_require__(92891); +const RuntimeGlobals = __webpack_require__(61539); +const Template = __webpack_require__(88835); +const WebpackError = __webpack_require__(49999); const { compareLocations, concatComparators, compareSelect, keepOriginalOrder, compareModulesById -} = __webpack_require__(29355); +} = __webpack_require__(95978); const { contextify, parseResource, makePathsRelative -} = __webpack_require__(63146); -const makeSerializable = __webpack_require__(23827); +} = __webpack_require__(97451); +const makeSerializable = __webpack_require__(83626); /** @typedef {import("webpack-sources").Source} Source */ /** @typedef {import("../declarations/WebpackOptions").WebpackOptionsNormalized} WebpackOptions */ @@ -63634,6 +64705,8 @@ const makeSerializable = __webpack_require__(23827); /** @typedef {import("./ResolverFactory").ResolverWithOptions} ResolverWithOptions */ /** @typedef {import("./RuntimeTemplate")} RuntimeTemplate */ /** @typedef {import("./dependencies/ContextElementDependency")} ContextElementDependency */ +/** @typedef {import("./serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */ +/** @typedef {import("./serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */ /** @template T @typedef {import("./util/LazySet")} LazySet */ /** @typedef {import("./util/fs").InputFileSystem} InputFileSystem */ @@ -63652,7 +64725,8 @@ const makeSerializable = __webpack_require__(23827); * @property {RawChunkGroupOptions=} groupOptions * @property {string=} typePrefix * @property {string=} category - * @property {string[][]=} referencedExports exports referenced from modules (won't be mangled) + * @property {(string[][] | null)=} referencedExports exports referenced from modules (won't be mangled) + * @property {string=} layer */ /** @@ -63696,8 +64770,9 @@ class ContextModule extends Module { const resourceQuery = (options && options.resourceQuery) || parsed.query; const resourceFragment = (options && options.resourceFragment) || parsed.fragment; + const layer = options && options.layer; - super("javascript/dynamic", resource); + super(JAVASCRIPT_MODULE_TYPE_DYNAMIC, resource, layer); /** @type {ContextModuleOptions} */ this.options = { ...options, @@ -63706,7 +64781,7 @@ class ContextModule extends Module { resourceFragment }; } else { - super("javascript/dynamic"); + super(JAVASCRIPT_MODULE_TYPE_DYNAMIC, undefined, options.layer); /** @type {ContextModuleOptions} */ this.options = { ...options, @@ -63818,6 +64893,9 @@ class ContextModule extends Module { } else if (this.options.namespaceObject) { identifier += "|namespace object"; } + if (this.layer) { + identifier += `|layer: ${this.layer}`; + } return identifier; } @@ -64229,7 +65307,7 @@ class ContextModule extends Module { getReturn(type, asyncModule) { if (type === 9) { - return "__webpack_require__(id)"; + return `${RuntimeGlobals.require}(id)`; } return `${RuntimeGlobals.createFakeNamespaceObject}(id, ${type}${ asyncModule ? " | 16" : "" @@ -64388,7 +65466,7 @@ module.exports = webpackAsyncContext;`; ? `${arrow ? "id =>" : "function(id)"} { ${this.getReturnModuleObjectSource(fakeMap)} }` - : "__webpack_require__"; + : RuntimeGlobals.require; return `var map = ${JSON.stringify(map, null, "\t")}; ${this.getFakeMapInitStatement(fakeMap)} @@ -64439,7 +65517,7 @@ module.exports = webpackAsyncContext;`; ? `${arrow ? "id =>" : "function(id)"} { ${this.getReturnModuleObjectSource(fakeMap, true)}; }` - : "__webpack_require__"; + : RuntimeGlobals.require; return `var map = ${JSON.stringify(map, null, "\t")}; ${this.getFakeMapInitStatement(fakeMap)} @@ -64742,6 +65820,9 @@ module.exports = webpackEmptyAsyncContext;`; return size; } + /** + * @param {ObjectSerializerContext} context context + */ serialize(context) { const { write } = context; write(this._identifier); @@ -64749,6 +65830,9 @@ module.exports = webpackEmptyAsyncContext;`; super.serialize(context); } + /** + * @param {ObjectDeserializerContext} context context + */ deserialize(context) { const { read } = context; this._identifier = read(); @@ -64764,7 +65848,7 @@ module.exports = ContextModule; /***/ }), -/***/ 81301: +/***/ 76928: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -64777,13 +65861,13 @@ module.exports = ContextModule; const asyncLib = __webpack_require__(47087); const { AsyncSeriesWaterfallHook, SyncWaterfallHook } = __webpack_require__(70793); -const ContextModule = __webpack_require__(40317); -const ModuleFactory = __webpack_require__(10149); -const ContextElementDependency = __webpack_require__(34286); -const LazySet = __webpack_require__(66205); -const { cachedSetProperty } = __webpack_require__(31074); -const { createFakeHook } = __webpack_require__(47762); -const { join } = __webpack_require__(33139); +const ContextModule = __webpack_require__(18816); +const ModuleFactory = __webpack_require__(60667); +const ContextElementDependency = __webpack_require__(27054); +const LazySet = __webpack_require__(57876); +const { cachedSetProperty } = __webpack_require__(44639); +const { createFakeHook } = __webpack_require__(40630); +const { join } = __webpack_require__(96220); /** @typedef {import("./ContextModule").ContextModuleOptions} ContextModuleOptions */ /** @typedef {import("./ContextModule").ResolveDependenciesCallback} ResolveDependenciesCallback */ @@ -64850,7 +65934,7 @@ module.exports = class ContextModuleFactory extends ModuleFactory { /** * @param {ModuleFactoryCreateData} data data object - * @param {function(Error=, ModuleFactoryResult=): void} callback callback + * @param {function((Error | null)=, ModuleFactoryResult=): void} callback callback * @returns {void} */ create(data, callback) { @@ -64865,6 +65949,7 @@ module.exports = class ContextModuleFactory extends ModuleFactory { { context: context, dependencies: dependencies, + layer: data.contextInfo.issuerLayer, resolveOptions, fileDependencies, missingDependencies, @@ -65205,7 +66290,7 @@ module.exports = class ContextModuleFactory extends ModuleFactory { /***/ }), -/***/ 33399: +/***/ 18610: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -65216,10 +66301,18 @@ module.exports = class ContextModuleFactory extends ModuleFactory { -const ContextElementDependency = __webpack_require__(34286); -const { join } = __webpack_require__(33139); +const ContextElementDependency = __webpack_require__(27054); +const { join } = __webpack_require__(96220); + +/** @typedef {import("./Compiler")} Compiler */ class ContextReplacementPlugin { + /** + * @param {RegExp} resourceRegExp A regular expression that determines which files will be selected + * @param {TODO=} newContentResource A new resource to replace the match + * @param {TODO=} newContentRecursive If true, all subdirectories are searched for matches + * @param {TODO=} newContentRegExp A regular expression that determines which files will be selected + */ constructor( resourceRegExp, newContentResource, @@ -65260,6 +66353,11 @@ class ContextReplacementPlugin { } } + /** + * Apply the plugin + * @param {Compiler} compiler the compiler instance + * @returns {void} + */ apply(compiler) { const resourceRegExp = this.resourceRegExp; const newContentCallback = this.newContentCallback; @@ -65370,7 +66468,184 @@ module.exports = ContextReplacementPlugin; /***/ }), -/***/ 84036: +/***/ 46555: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Alexander Krasnoyarov @alexander-akait +*/ + + + +const NormalModule = __webpack_require__(17318); +const makeSerializable = __webpack_require__(83626); + +/** @typedef {import("./Module")} Module */ +/** @typedef {import("./NormalModule").NormalModuleCreateData} NormalModuleCreateData */ +/** @typedef {import("./RequestShortener")} RequestShortener */ +/** @typedef {import("./serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */ +/** @typedef {import("./serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */ + +/** @typedef {string|undefined} CssLayer */ +/** @typedef {string|undefined} Supports */ +/** @typedef {string|undefined} Media */ +/** @typedef {[CssLayer?, Supports?, Media?]} InheritanceItem */ +/** @typedef {Array} Inheritance */ + +/** @typedef {NormalModuleCreateData & { cssLayer: CssLayer|null, supports: Supports|null, media: Media|null, inheritance: Inheritance|null }} CSSModuleCreateData */ + +class CssModule extends NormalModule { + /** + * @param {CSSModuleCreateData} options options object + */ + constructor(options) { + super(options); + + // Avoid override `layer` for `Module` class, because it is a feature to run module in specific layer + this.cssLayer = options.cssLayer; + this.supports = options.supports; + this.media = options.media; + this.inheritance = options.inheritance; + } + + /** + * @returns {string} a unique identifier of the module + */ + identifier() { + let identifier = super.identifier(); + + if (this.cssLayer) { + identifier += `|${this.cssLayer}`; + } + + if (this.supports) { + identifier += `|${this.supports}`; + } + + if (this.media) { + identifier += `|${this.media}`; + } + + if (this.inheritance) { + const inheritance = this.inheritance.map( + (item, index) => + `inheritance_${index}|${item[0] || ""}|${item[1] || ""}|${ + item[2] || "" + }` + ); + + identifier += `|${inheritance.join("|")}`; + } + + return identifier; + } + + /** + * @param {RequestShortener} requestShortener the request shortener + * @returns {string} a user readable identifier of the module + */ + readableIdentifier(requestShortener) { + const readableIdentifier = super.readableIdentifier(requestShortener); + + let identifier = `css ${readableIdentifier}`; + + if (this.cssLayer) { + identifier += ` (layer: ${this.cssLayer})`; + } + + if (this.supports) { + identifier += ` (supports: ${this.supports})`; + } + + if (this.media) { + identifier += ` (media: ${this.media})`; + } + + return identifier; + } + + /** + * Assuming this module is in the cache. Update the (cached) module with + * the fresh module from the factory. Usually updates internal references + * and properties. + * @param {Module} module fresh module + * @returns {void} + */ + updateCacheModule(module) { + super.updateCacheModule(module); + const m = /** @type {CssModule} */ (module); + this.cssLayer = m.cssLayer; + this.supports = m.supports; + this.media = m.media; + this.inheritance = m.inheritance; + } + + /** + * @param {ObjectSerializerContext} context context + */ + serialize(context) { + const { write } = context; + write(this.cssLayer); + write(this.supports); + write(this.media); + write(this.inheritance); + super.serialize(context); + } + + /** + * @param {ObjectDeserializerContext} context context + * @returns {CssModule} the deserialized object + */ + static deserialize(context) { + const obj = new CssModule({ + // will be deserialized by Module + layer: null, + type: "", + // will be filled by updateCacheModule + resource: "", + context: "", + request: null, + userRequest: null, + rawRequest: null, + loaders: null, + matchResource: null, + parser: null, + parserOptions: null, + generator: null, + generatorOptions: null, + resolveOptions: null, + cssLayer: null, + supports: null, + media: null, + inheritance: null + }); + obj.deserialize(context); + return obj; + } + + /** + * @param {ObjectDeserializerContext} context context + */ + deserialize(context) { + const { read } = context; + this.cssLayer = read(); + this.supports = read(); + this.media = read(); + this.inheritance = read(); + super.deserialize(context); + } +} + +makeSerializable(CssModule, "webpack/lib/CssModule"); + +module.exports = CssModule; + + +/***/ }), + +/***/ 7628: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -65381,21 +66656,28 @@ module.exports = ContextReplacementPlugin; -const RuntimeGlobals = __webpack_require__(34623); -const WebpackError = __webpack_require__(10841); -const ConstDependency = __webpack_require__(78284); -const BasicEvaluatedExpression = __webpack_require__(88981); +const { + JAVASCRIPT_MODULE_TYPE_AUTO, + JAVASCRIPT_MODULE_TYPE_ESM, + JAVASCRIPT_MODULE_TYPE_DYNAMIC +} = __webpack_require__(92891); +const RuntimeGlobals = __webpack_require__(61539); +const WebpackError = __webpack_require__(49999); +const ConstDependency = __webpack_require__(67538); +const BasicEvaluatedExpression = __webpack_require__(52493); + const { evaluateToString, toConstantDependency -} = __webpack_require__(645); -const createHash = __webpack_require__(94624); +} = __webpack_require__(94213); +const createHash = __webpack_require__(31147); /** @typedef {import("estree").Expression} Expression */ /** @typedef {import("./Compiler")} Compiler */ /** @typedef {import("./NormalModule")} NormalModule */ /** @typedef {import("./RuntimeTemplate")} RuntimeTemplate */ /** @typedef {import("./javascript/JavascriptParser")} JavascriptParser */ +/** @typedef {import("./logging/Logger").Logger} Logger */ /** @typedef {null|undefined|RegExp|Function|string|number|boolean|bigint|undefined} CodeValuePrimitive */ /** @typedef {RecursiveArrayOrRecord} CodeValue */ @@ -65487,7 +66769,9 @@ class RuntimeValue { * @param {Map>} valueCacheVersions valueCacheVersions * @param {string} key the defined key * @param {RuntimeTemplate} runtimeTemplate the runtime template + * @param {Logger} logger the logger object * @param {boolean|undefined|null=} asiSafe asi safe (undefined: unknown, null: unneeded) + * @param {Set|undefined=} objKeys used keys * @returns {string} code converted to string that evaluates */ const stringifyObj = ( @@ -65496,24 +66780,47 @@ const stringifyObj = ( valueCacheVersions, key, runtimeTemplate, - asiSafe + logger, + asiSafe, + objKeys ) => { let code; let arr = Array.isArray(obj); if (arr) { code = `[${obj .map(code => - toCode(code, parser, valueCacheVersions, key, runtimeTemplate, null) + toCode( + code, + parser, + valueCacheVersions, + key, + runtimeTemplate, + logger, + null + ) ) .join(",")}]`; } else { - code = `{${Object.keys(obj) + let keys = Object.keys(obj); + if (objKeys) { + if (objKeys.size === 0) keys = []; + else keys = keys.filter(k => objKeys.has(k)); + } + code = `{${keys .map(key => { const code = obj[key]; return ( JSON.stringify(key) + ":" + - toCode(code, parser, valueCacheVersions, key, runtimeTemplate, null) + toCode( + code, + parser, + valueCacheVersions, + key, + runtimeTemplate, + logger, + null + ) ); }) .join(",")}}`; @@ -65538,7 +66845,9 @@ const stringifyObj = ( * @param {Map>} valueCacheVersions valueCacheVersions * @param {string} key the defined key * @param {RuntimeTemplate} runtimeTemplate the runtime template + * @param {Logger} logger the logger object * @param {boolean|undefined|null=} asiSafe asi safe (undefined: unknown, null: unneeded) + * @param {Set|undefined=} objKeys used keys * @returns {string} code converted to string that evaluates */ const toCode = ( @@ -65547,49 +66856,62 @@ const toCode = ( valueCacheVersions, key, runtimeTemplate, - asiSafe + logger, + asiSafe, + objKeys ) => { - if (code === null) { - return "null"; - } - if (code === undefined) { - return "undefined"; - } - if (Object.is(code, -0)) { - return "-0"; - } - if (code instanceof RuntimeValue) { - return toCode( - code.exec(parser, valueCacheVersions, key), - parser, - valueCacheVersions, - key, - runtimeTemplate, - asiSafe - ); - } - if (code instanceof RegExp && code.toString) { - return code.toString(); - } - if (typeof code === "function" && code.toString) { - return "(" + code.toString() + ")"; - } - if (typeof code === "object") { - return stringifyObj( - code, - parser, - valueCacheVersions, - key, - runtimeTemplate, - asiSafe - ); - } - if (typeof code === "bigint") { - return runtimeTemplate.supportsBigIntLiteral() - ? `${code}n` - : `BigInt("${code}")`; - } - return code + ""; + const transformToCode = () => { + if (code === null) { + return "null"; + } + if (code === undefined) { + return "undefined"; + } + if (Object.is(code, -0)) { + return "-0"; + } + if (code instanceof RuntimeValue) { + return toCode( + code.exec(parser, valueCacheVersions, key), + parser, + valueCacheVersions, + key, + runtimeTemplate, + logger, + asiSafe + ); + } + if (code instanceof RegExp && code.toString) { + return code.toString(); + } + if (typeof code === "function" && code.toString) { + return "(" + code.toString() + ")"; + } + if (typeof code === "object") { + return stringifyObj( + code, + parser, + valueCacheVersions, + key, + runtimeTemplate, + logger, + asiSafe, + objKeys + ); + } + if (typeof code === "bigint") { + return runtimeTemplate.supportsBigIntLiteral() + ? `${code}n` + : `BigInt("${code}")`; + } + return code + ""; + }; + + const strCode = transformToCode(); + + logger.log(`Replaced "${key}" with "${strCode}"`); + + return strCode; }; const toCacheVersion = code => { @@ -65625,8 +66947,12 @@ const toCacheVersion = code => { return code + ""; }; -const VALUE_DEP_PREFIX = "webpack/DefinePlugin "; -const VALUE_DEP_MAIN = "webpack/DefinePlugin_hash"; +const PLUGIN_NAME = "DefinePlugin"; +const VALUE_DEP_PREFIX = `webpack/${PLUGIN_NAME} `; +const VALUE_DEP_MAIN = `webpack/${PLUGIN_NAME}_hash`; +const TYPEOF_OPERATOR_REGEXP = /^typeof\s+/; +const WEBPACK_REQUIRE_FUNCTION_REGEXP = /__webpack_require__\s*(!?\.)/; +const WEBPACK_REQUIRE_IDENTIFIER_REGEXP = /__webpack_require__/; class DefinePlugin { /** @@ -65654,8 +66980,9 @@ class DefinePlugin { apply(compiler) { const definitions = this.definitions; compiler.hooks.compilation.tap( - "DefinePlugin", + PLUGIN_NAME, (compilation, { normalModuleFactory }) => { + const logger = compilation.getLogger("webpack.DefinePlugin"); compilation.dependencyTemplates.set( ConstDependency, new ConstDependency.Template() @@ -65676,7 +67003,7 @@ class DefinePlugin { */ const handler = parser => { const mainValue = compilation.valueCacheVersions.get(VALUE_DEP_MAIN); - parser.hooks.program.tap("DefinePlugin", () => { + parser.hooks.program.tap(PLUGIN_NAME, () => { const { buildInfo } = parser.state.module; if (!buildInfo.valueDependencies) buildInfo.valueDependencies = new Map(); @@ -65732,7 +67059,7 @@ class DefinePlugin { const splittedKey = key.split("."); splittedKey.slice(1).forEach((_, i) => { const fullKey = prefix + splittedKey.slice(0, i + 1).join("."); - parser.hooks.canRename.for(fullKey).tap("DefinePlugin", () => { + parser.hooks.canRename.for(fullKey).tap(PLUGIN_NAME, () => { addValueDependency(key); return true; }); @@ -65747,18 +67074,18 @@ class DefinePlugin { */ const applyDefine = (key, code) => { const originalKey = key; - const isTypeof = /^typeof\s+/.test(key); - if (isTypeof) key = key.replace(/^typeof\s+/, ""); + const isTypeof = TYPEOF_OPERATOR_REGEXP.test(key); + if (isTypeof) key = key.replace(TYPEOF_OPERATOR_REGEXP, ""); let recurse = false; let recurseTypeof = false; if (!isTypeof) { - parser.hooks.canRename.for(key).tap("DefinePlugin", () => { + parser.hooks.canRename.for(key).tap(PLUGIN_NAME, () => { addValueDependency(originalKey); return true; }); parser.hooks.evaluateIdentifier .for(key) - .tap("DefinePlugin", expr => { + .tap(PLUGIN_NAME, expr => { /** * this is needed in case there is a recursion in the DefinePlugin * to prevent an endless recursion @@ -65777,6 +67104,7 @@ class DefinePlugin { compilation.valueCacheVersions, key, runtimeTemplate, + logger, null ) ); @@ -65784,21 +67112,28 @@ class DefinePlugin { res.setRange(expr.range); return res; }); - parser.hooks.expression.for(key).tap("DefinePlugin", expr => { + parser.hooks.expression.for(key).tap(PLUGIN_NAME, expr => { addValueDependency(originalKey); - const strCode = toCode( + let strCode = toCode( code, parser, compilation.valueCacheVersions, originalKey, runtimeTemplate, - !parser.isAsiPosition(expr.range[0]) + logger, + !parser.isAsiPosition(expr.range[0]), + parser.destructuringAssignmentPropertiesFor(expr) ); - if (/__webpack_require__\s*(!?\.)/.test(strCode)) { + + if (parser.scope.inShorthand) { + strCode = parser.scope.inShorthand + ":" + strCode; + } + + if (WEBPACK_REQUIRE_FUNCTION_REGEXP.test(strCode)) { return toConstantDependency(parser, strCode, [ RuntimeGlobals.require ])(expr); - } else if (/__webpack_require__/.test(strCode)) { + } else if (WEBPACK_REQUIRE_IDENTIFIER_REGEXP.test(strCode)) { return toConstantDependency(parser, strCode, [ RuntimeGlobals.requireScope ])(expr); @@ -65807,7 +67142,7 @@ class DefinePlugin { } }); } - parser.hooks.evaluateTypeof.for(key).tap("DefinePlugin", expr => { + parser.hooks.evaluateTypeof.for(key).tap(PLUGIN_NAME, expr => { /** * this is needed in case there is a recursion in the DefinePlugin * to prevent an endless recursion @@ -65825,6 +67160,7 @@ class DefinePlugin { compilation.valueCacheVersions, originalKey, runtimeTemplate, + logger, null ); const typeofCode = isTypeof @@ -65835,7 +67171,7 @@ class DefinePlugin { res.setRange(expr.range); return res; }); - parser.hooks.typeof.for(key).tap("DefinePlugin", expr => { + parser.hooks.typeof.for(key).tap(PLUGIN_NAME, expr => { addValueDependency(originalKey); const codeCode = toCode( code, @@ -65843,6 +67179,7 @@ class DefinePlugin { compilation.valueCacheVersions, originalKey, runtimeTemplate, + logger, null ); const typeofCode = isTypeof @@ -65864,41 +67201,45 @@ class DefinePlugin { * @returns {void} */ const applyObjectDefine = (key, obj) => { - parser.hooks.canRename.for(key).tap("DefinePlugin", () => { + parser.hooks.canRename.for(key).tap(PLUGIN_NAME, () => { addValueDependency(key); return true; }); - parser.hooks.evaluateIdentifier - .for(key) - .tap("DefinePlugin", expr => { - addValueDependency(key); - return new BasicEvaluatedExpression() - .setTruthy() - .setSideEffects(false) - .setRange(expr.range); - }); + parser.hooks.evaluateIdentifier.for(key).tap(PLUGIN_NAME, expr => { + addValueDependency(key); + return new BasicEvaluatedExpression() + .setTruthy() + .setSideEffects(false) + .setRange(expr.range); + }); parser.hooks.evaluateTypeof .for(key) .tap( - "DefinePlugin", + PLUGIN_NAME, withValueDependency(key, evaluateToString("object")) ); - parser.hooks.expression.for(key).tap("DefinePlugin", expr => { + parser.hooks.expression.for(key).tap(PLUGIN_NAME, expr => { addValueDependency(key); - const strCode = stringifyObj( + let strCode = stringifyObj( obj, parser, compilation.valueCacheVersions, key, runtimeTemplate, - !parser.isAsiPosition(expr.range[0]) + logger, + !parser.isAsiPosition(expr.range[0]), + parser.destructuringAssignmentPropertiesFor(expr) ); - if (/__webpack_require__\s*(!?\.)/.test(strCode)) { + if (parser.scope.inShorthand) { + strCode = parser.scope.inShorthand + ":" + strCode; + } + + if (WEBPACK_REQUIRE_FUNCTION_REGEXP.test(strCode)) { return toConstantDependency(parser, strCode, [ RuntimeGlobals.require ])(expr); - } else if (/__webpack_require__/.test(strCode)) { + } else if (WEBPACK_REQUIRE_IDENTIFIER_REGEXP.test(strCode)) { return toConstantDependency(parser, strCode, [ RuntimeGlobals.requireScope ])(expr); @@ -65909,7 +67250,7 @@ class DefinePlugin { parser.hooks.typeof .for(key) .tap( - "DefinePlugin", + PLUGIN_NAME, withValueDependency( key, toConstantDependency(parser, JSON.stringify("object")) @@ -65921,14 +67262,14 @@ class DefinePlugin { }; normalModuleFactory.hooks.parser - .for("javascript/auto") - .tap("DefinePlugin", handler); + .for(JAVASCRIPT_MODULE_TYPE_AUTO) + .tap(PLUGIN_NAME, handler); normalModuleFactory.hooks.parser - .for("javascript/dynamic") - .tap("DefinePlugin", handler); + .for(JAVASCRIPT_MODULE_TYPE_DYNAMIC) + .tap(PLUGIN_NAME, handler); normalModuleFactory.hooks.parser - .for("javascript/esm") - .tap("DefinePlugin", handler); + .for(JAVASCRIPT_MODULE_TYPE_ESM) + .tap(PLUGIN_NAME, handler); /** * Walk definitions @@ -65947,7 +67288,7 @@ class DefinePlugin { compilation.valueCacheVersions.set(name, version); } else if (oldVersion !== version) { const warning = new WebpackError( - `DefinePlugin\nConflicting values for '${prefix + key}'` + `${PLUGIN_NAME}\nConflicting values for '${prefix + key}'` ); warning.details = `'${oldVersion}' !== '${version}'`; warning.hideStack = true; @@ -65979,7 +67320,7 @@ module.exports = DefinePlugin; /***/ }), -/***/ 62387: +/***/ 21859: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -65991,11 +67332,12 @@ module.exports = DefinePlugin; const { OriginalSource, RawSource } = __webpack_require__(59728); -const Module = __webpack_require__(96040); -const RuntimeGlobals = __webpack_require__(34623); -const DelegatedSourceDependency = __webpack_require__(16582); -const StaticExportsDependency = __webpack_require__(64422); -const makeSerializable = __webpack_require__(23827); +const Module = __webpack_require__(6309); +const { JAVASCRIPT_MODULE_TYPE_DYNAMIC } = __webpack_require__(92891); +const RuntimeGlobals = __webpack_require__(61539); +const DelegatedSourceDependency = __webpack_require__(99416); +const StaticExportsDependency = __webpack_require__(71444); +const makeSerializable = __webpack_require__(83626); /** @typedef {import("webpack-sources").Source} Source */ /** @typedef {import("../declarations/WebpackOptions").WebpackOptionsNormalized} WebpackOptions */ @@ -66014,6 +67356,8 @@ const makeSerializable = __webpack_require__(23827); /** @typedef {import("./RuntimeTemplate")} RuntimeTemplate */ /** @typedef {import("./WebpackError")} WebpackError */ /** @typedef {import("./dependencies/ModuleDependency")} ModuleDependency */ +/** @typedef {import("./serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */ +/** @typedef {import("./serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */ /** @typedef {import("./util/Hash")} Hash */ /** @typedef {import("./util/fs").InputFileSystem} InputFileSystem */ @@ -66024,8 +67368,15 @@ const RUNTIME_REQUIREMENTS = new Set([ ]); class DelegatedModule extends Module { + /** + * @param {string} sourceRequest source request + * @param {TODO} data data + * @param {"require" | "object"} type type + * @param {string} userRequest user request + * @param {string | Module} originalRequest original request + */ constructor(sourceRequest, data, type, userRequest, originalRequest) { - super("javascript/dynamic", null); + super(JAVASCRIPT_MODULE_TYPE_DYNAMIC, null); // Info from Factory this.sourceRequest = sourceRequest; @@ -66033,7 +67384,7 @@ class DelegatedModule extends Module { this.delegationType = type; this.userRequest = userRequest; this.originalRequest = originalRequest; - /** @type {ManifestModuleData} */ + /** @type {ManifestModuleData | undefined} */ this.delegateData = data; // Build info @@ -66092,7 +67443,8 @@ class DelegatedModule extends Module { * @returns {void} */ build(options, compilation, resolver, fs, callback) { - this.buildMeta = { ...this.delegateData.buildMeta }; + const delegateData = /** @type {ManifestModuleData} */ (this.delegateData); + this.buildMeta = { ...delegateData.buildMeta }; this.buildInfo = {}; this.dependencies.length = 0; this.delegatedSourceDependency = new DelegatedSourceDependency( @@ -66100,7 +67452,7 @@ class DelegatedModule extends Module { ); this.addDependency(this.delegatedSourceDependency); this.addDependency( - new StaticExportsDependency(this.delegateData.exports || true, false) + new StaticExportsDependency(delegateData.exports || true, false) ); callback(); } @@ -66170,6 +67522,9 @@ class DelegatedModule extends Module { super.updateHash(hash, context); } + /** + * @param {ObjectSerializerContext} context context + */ serialize(context) { const { write } = context; // constructor @@ -66181,6 +67536,10 @@ class DelegatedModule extends Module { super.serialize(context); } + /** + * @param {ObjectDeserializerContext} context context\ + * @returns {DelegatedModule} DelegatedModule + */ static deserialize(context) { const { read } = context; const obj = new DelegatedModule( @@ -66226,7 +67585,7 @@ module.exports = DelegatedModule; /***/ }), -/***/ 23546: +/***/ 78141: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -66237,7 +67596,9 @@ module.exports = DelegatedModule; -const DelegatedModule = __webpack_require__(62387); +const DelegatedModule = __webpack_require__(21859); + +/** @typedef {import("./NormalModuleFactory")} NormalModuleFactory */ // options.source // options.type @@ -66252,6 +67613,10 @@ class DelegatedModuleFactoryPlugin { options.extensions = options.extensions || ["", ".js", ".json", ".wasm"]; } + /** + * @param {NormalModuleFactory} normalModuleFactory the normal module factory + * @returns {void} + */ apply(normalModuleFactory) { const scope = this.options.scope; if (scope) { @@ -66325,7 +67690,7 @@ module.exports = DelegatedModuleFactoryPlugin; /***/ }), -/***/ 58702: +/***/ 14728: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -66336,8 +67701,8 @@ module.exports = DelegatedModuleFactoryPlugin; -const DelegatedModuleFactoryPlugin = __webpack_require__(23546); -const DelegatedSourceDependency = __webpack_require__(16582); +const DelegatedModuleFactoryPlugin = __webpack_require__(78141); +const DelegatedSourceDependency = __webpack_require__(99416); /** @typedef {import("./Compiler")} Compiler */ @@ -66376,7 +67741,7 @@ module.exports = DelegatedPlugin; /***/ }), -/***/ 67493: +/***/ 99939: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -66387,24 +67752,34 @@ module.exports = DelegatedPlugin; -const makeSerializable = __webpack_require__(23827); +const makeSerializable = __webpack_require__(83626); /** @typedef {import("./AsyncDependenciesBlock")} AsyncDependenciesBlock */ /** @typedef {import("./ChunkGraph")} ChunkGraph */ /** @typedef {import("./ChunkGroup")} ChunkGroup */ /** @typedef {import("./Dependency")} Dependency */ /** @typedef {import("./Dependency").UpdateHashContext} UpdateHashContext */ +/** @typedef {import("./serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */ +/** @typedef {import("./serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */ /** @typedef {import("./util/Hash")} Hash */ /** @typedef {(d: Dependency) => boolean} DependencyFilterFunction */ +/** + * DependenciesBlock is the base class for all Module classes in webpack. It describes a + * "block" of dependencies which are pointers to other DependenciesBlock instances. For example + * when a Module has a CommonJs require statement, the DependencyBlock for the CommonJs module + * would be added as a dependency to the Module. DependenciesBlock is inherited by two types of classes: + * Module subclasses and AsyncDependenciesBlock subclasses. The only difference between the two is that + * AsyncDependenciesBlock subclasses are used for code-splitting (async boundary) and Module subclasses are not. + */ class DependenciesBlock { constructor() { /** @type {Dependency[]} */ this.dependencies = []; /** @type {AsyncDependenciesBlock[]} */ this.blocks = []; - /** @type {DependenciesBlock} */ + /** @type {DependenciesBlock | undefined} */ this.parent = undefined; } @@ -66470,11 +67845,17 @@ class DependenciesBlock { } } + /** + * @param {ObjectSerializerContext} context context + */ serialize({ write }) { write(this.dependencies); write(this.blocks); } + /** + * @param {ObjectDeserializerContext} context context + */ deserialize({ read }) { this.dependencies = read(); this.blocks = read(); @@ -66491,7 +67872,7 @@ module.exports = DependenciesBlock; /***/ }), -/***/ 68242: +/***/ 504: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -66502,7 +67883,7 @@ module.exports = DependenciesBlock; -const memoize = __webpack_require__(27319); +const memoize = __webpack_require__(62377); /** @typedef {import("webpack-sources").Source} Source */ /** @typedef {import("./ChunkGraph")} ChunkGraph */ @@ -66514,6 +67895,8 @@ const memoize = __webpack_require__(27319); /** @typedef {import("./ModuleGraphConnection").ConnectionState} ConnectionState */ /** @typedef {import("./RuntimeTemplate")} RuntimeTemplate */ /** @typedef {import("./WebpackError")} WebpackError */ +/** @typedef {import("./serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */ +/** @typedef {import("./serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */ /** @typedef {import("./util/Hash")} Hash */ /** @typedef {import("./util/runtime").RuntimeSpec} RuntimeSpec */ @@ -66578,15 +67961,15 @@ const memoize = __webpack_require__(27319); const TRANSITIVE = Symbol("transitive"); const getIgnoredModule = memoize(() => { - const RawModule = __webpack_require__(11794); + const RawModule = __webpack_require__(74360); return new RawModule("/* (ignored) */", `ignored`, `(ignored)`); }); class Dependency { constructor() { - /** @type {Module} */ + /** @type {Module | undefined} */ this._parentModule = undefined; - /** @type {DependenciesBlock} */ + /** @type {DependenciesBlock | undefined} */ this._parentDependenciesBlock = undefined; /** @type {number} */ this._parentDependenciesBlockIndex = -1; @@ -66669,6 +68052,12 @@ class Dependency { this._loc = loc; } + /** + * @param {number} startLine start line + * @param {number} startColumn start column + * @param {number} endLine end line + * @param {number} endColumn end column + */ setLoc(startLine, startColumn, endLine, endColumn) { this._locSL = startLine; this._locSC = startColumn; @@ -66742,7 +68131,7 @@ class Dependency { /** * Returns warnings * @param {ModuleGraph} moduleGraph module graph - * @returns {WebpackError[]} warnings + * @returns {WebpackError[] | null | undefined} warnings */ getWarnings(moduleGraph) { return null; @@ -66751,7 +68140,7 @@ class Dependency { /** * Returns errors * @param {ModuleGraph} moduleGraph module graph - * @returns {WebpackError[]} errors + * @returns {WebpackError[] | null | undefined} errors */ getErrors(moduleGraph) { return null; @@ -66783,12 +68172,15 @@ class Dependency { /** * @param {string} context context directory - * @returns {Module} a module + * @returns {Module | null} a module */ createIgnoredModule(context) { return getIgnoredModule(); } + /** + * @param {ObjectSerializerContext} context context + */ serialize({ write }) { write(this.weak); write(this.optional); @@ -66800,6 +68192,9 @@ class Dependency { write(this._locN); } + /** + * @param {ObjectDeserializerContext} context context + */ deserialize({ read }) { this.weak = read(); this.optional = read(); @@ -66854,7 +68249,7 @@ module.exports = Dependency; /***/ }), -/***/ 26472: +/***/ 17043: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -66909,7 +68304,7 @@ class DependencyTemplate { * @returns {void} */ apply(dependency, source, templateContext) { - const AbstractMethodError = __webpack_require__(26907); + const AbstractMethodError = __webpack_require__(9906); throw new AbstractMethodError(); } } @@ -66919,7 +68314,7 @@ module.exports = DependencyTemplate; /***/ }), -/***/ 40506: +/***/ 81661: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -66930,7 +68325,7 @@ module.exports = DependencyTemplate; -const createHash = __webpack_require__(94624); +const createHash = __webpack_require__(31147); /** @typedef {import("./Dependency")} Dependency */ /** @typedef {import("./DependencyTemplate")} DependencyTemplate */ @@ -66952,7 +68347,7 @@ class DependencyTemplates { /** * @param {DependencyConstructor} dependency Constructor of Dependency - * @returns {DependencyTemplate} template for this dependency + * @returns {DependencyTemplate | undefined} template for this dependency */ get(dependency) { return this._map.get(dependency); @@ -66994,7 +68389,7 @@ module.exports = DependencyTemplates; /***/ }), -/***/ 35248: +/***/ 71244: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -67005,17 +68400,29 @@ module.exports = DependencyTemplates; -const DllModuleFactory = __webpack_require__(14141); -const DllEntryDependency = __webpack_require__(11377); -const EntryDependency = __webpack_require__(54511); +const DllModuleFactory = __webpack_require__(29182); +const DllEntryDependency = __webpack_require__(93970); +const EntryDependency = __webpack_require__(49787); + +/** @typedef {import("./Compiler")} Compiler */ class DllEntryPlugin { + /** + * @param {string} context context + * @param {string[]} entries entry names + * @param {TODO} options options + */ constructor(context, entries, options) { this.context = context; this.entries = entries; this.options = options; } + /** + * Apply the plugin + * @param {Compiler} compiler the compiler instance + * @returns {void} + */ apply(compiler) { compiler.hooks.compilation.tap( "DllEntryPlugin", @@ -67046,7 +68453,10 @@ class DllEntryPlugin { this.options.name ), this.options, - callback + error => { + if (error) return callback(error); + callback(); + } ); }); } @@ -67057,7 +68467,7 @@ module.exports = DllEntryPlugin; /***/ }), -/***/ 30618: +/***/ 84063: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -67069,14 +68479,16 @@ module.exports = DllEntryPlugin; const { RawSource } = __webpack_require__(59728); -const Module = __webpack_require__(96040); -const RuntimeGlobals = __webpack_require__(34623); -const makeSerializable = __webpack_require__(23827); +const Module = __webpack_require__(6309); +const { JAVASCRIPT_MODULE_TYPE_DYNAMIC } = __webpack_require__(92891); +const RuntimeGlobals = __webpack_require__(61539); +const makeSerializable = __webpack_require__(83626); /** @typedef {import("webpack-sources").Source} Source */ /** @typedef {import("../declarations/WebpackOptions").WebpackOptionsNormalized} WebpackOptions */ /** @typedef {import("./ChunkGraph")} ChunkGraph */ /** @typedef {import("./Compilation")} Compilation */ +/** @typedef {import("./Dependency")} Dependency */ /** @typedef {import("./Dependency").UpdateHashContext} UpdateHashContext */ /** @typedef {import("./DependencyTemplates")} DependencyTemplates */ /** @typedef {import("./Module").CodeGenerationContext} CodeGenerationContext */ @@ -67087,6 +68499,8 @@ const makeSerializable = __webpack_require__(23827); /** @typedef {import("./ResolverFactory").ResolverWithOptions} ResolverWithOptions */ /** @typedef {import("./RuntimeTemplate")} RuntimeTemplate */ /** @typedef {import("./WebpackError")} WebpackError */ +/** @typedef {import("./serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */ +/** @typedef {import("./serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */ /** @typedef {import("./util/Hash")} Hash */ /** @typedef {import("./util/fs").InputFileSystem} InputFileSystem */ @@ -67097,8 +68511,13 @@ const RUNTIME_REQUIREMENTS = new Set([ ]); class DllModule extends Module { + /** + * @param {string} context context path + * @param {Dependency[]} dependencies dependencies + * @param {string} name name + */ constructor(context, dependencies, name) { - super("javascript/dynamic", context); + super(JAVASCRIPT_MODULE_TYPE_DYNAMIC, context); // Info from Factory this.dependencies = dependencies; @@ -67149,7 +68568,7 @@ class DllModule extends Module { const sources = new Map(); sources.set( "javascript", - new RawSource("module.exports = __webpack_require__;") + new RawSource(`module.exports = ${RuntimeGlobals.require};`) ); return { sources, @@ -67184,11 +68603,17 @@ class DllModule extends Module { super.updateHash(hash, context); } + /** + * @param {ObjectSerializerContext} context context + */ serialize(context) { context.write(this.name); super.serialize(context); } + /** + * @param {ObjectDeserializerContext} context context + */ deserialize(context) { this.name = context.read(); super.deserialize(context); @@ -67222,7 +68647,7 @@ module.exports = DllModule; /***/ }), -/***/ 14141: +/***/ 29182: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -67233,8 +68658,8 @@ module.exports = DllModule; -const DllModule = __webpack_require__(30618); -const ModuleFactory = __webpack_require__(10149); +const DllModule = __webpack_require__(84063); +const ModuleFactory = __webpack_require__(60667); /** @typedef {import("./ModuleFactory").ModuleFactoryCreateData} ModuleFactoryCreateData */ /** @typedef {import("./ModuleFactory").ModuleFactoryResult} ModuleFactoryResult */ @@ -67247,7 +68672,7 @@ class DllModuleFactory extends ModuleFactory { } /** * @param {ModuleFactoryCreateData} data data object - * @param {function(Error=, ModuleFactoryResult=): void} callback callback + * @param {function((Error | null)=, ModuleFactoryResult=): void} callback callback * @returns {void} */ create(data, callback) { @@ -67267,7 +68692,7 @@ module.exports = DllModuleFactory; /***/ }), -/***/ 42512: +/***/ 59318: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -67278,17 +68703,17 @@ module.exports = DllModuleFactory; -const DllEntryPlugin = __webpack_require__(35248); -const FlagAllModulesAsUsedPlugin = __webpack_require__(85419); -const LibManifestPlugin = __webpack_require__(96138); -const createSchemaValidation = __webpack_require__(94091); +const DllEntryPlugin = __webpack_require__(71244); +const FlagAllModulesAsUsedPlugin = __webpack_require__(41725); +const LibManifestPlugin = __webpack_require__(96577); +const createSchemaValidation = __webpack_require__(45488); /** @typedef {import("../declarations/plugins/DllPlugin").DllPluginOptions} DllPluginOptions */ /** @typedef {import("./Compiler")} Compiler */ const validate = createSchemaValidation( - __webpack_require__(16235), - () => __webpack_require__(8122), + __webpack_require__(56783), + () => __webpack_require__(9413), { name: "Dll Plugin", baseDataPath: "options" @@ -67343,7 +68768,7 @@ module.exports = DllPlugin; /***/ }), -/***/ 57699: +/***/ 50673: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -67355,20 +68780,21 @@ module.exports = DllPlugin; const parseJson = __webpack_require__(89227); -const DelegatedModuleFactoryPlugin = __webpack_require__(23546); -const ExternalModuleFactoryPlugin = __webpack_require__(53045); -const WebpackError = __webpack_require__(10841); -const DelegatedSourceDependency = __webpack_require__(16582); -const createSchemaValidation = __webpack_require__(94091); -const makePathsRelative = (__webpack_require__(63146).makePathsRelative); +const DelegatedModuleFactoryPlugin = __webpack_require__(78141); +const ExternalModuleFactoryPlugin = __webpack_require__(63102); +const WebpackError = __webpack_require__(49999); +const DelegatedSourceDependency = __webpack_require__(99416); +const createSchemaValidation = __webpack_require__(45488); +const makePathsRelative = (__webpack_require__(97451).makePathsRelative); /** @typedef {import("../declarations/WebpackOptions").Externals} Externals */ /** @typedef {import("../declarations/plugins/DllReferencePlugin").DllReferencePluginOptions} DllReferencePluginOptions */ /** @typedef {import("../declarations/plugins/DllReferencePlugin").DllReferencePluginOptionsManifest} DllReferencePluginOptionsManifest */ +/** @typedef {import("./Compiler")} Compiler */ const validate = createSchemaValidation( - __webpack_require__(5101), - () => __webpack_require__(83051), + __webpack_require__(14914), + () => __webpack_require__(4107), { name: "Dll Reference Plugin", baseDataPath: "options" @@ -67386,6 +68812,11 @@ class DllReferencePlugin { this._compilationData = new WeakMap(); } + /** + * Apply the plugin + * @param {Compiler} compiler the compiler instance + * @returns {void} + */ apply(compiler) { compiler.hooks.compilation.tap( "DllReferencePlugin", @@ -67489,7 +68920,9 @@ class DllReferencePlugin { // If there was an error parsing the manifest file, add the // error as a compilation error to make the compilation fail. if (data.error) { - compilation.errors.push(data.error); + compilation.errors.push( + /** @type {DllManifestError} */ (data.error) + ); } compilation.fileDependencies.add(manifest); } @@ -67500,6 +68933,10 @@ class DllReferencePlugin { } class DllManifestError extends WebpackError { + /** + * @param {string} filename filename of the manifest + * @param {string} message error message + */ constructor(filename, message) { super(); @@ -67513,7 +68950,7 @@ module.exports = DllReferencePlugin; /***/ }), -/***/ 90956: +/***/ 58677: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -67524,9 +68961,9 @@ module.exports = DllReferencePlugin; -const EntryOptionPlugin = __webpack_require__(87685); -const EntryPlugin = __webpack_require__(42102); -const EntryDependency = __webpack_require__(54511); +const EntryOptionPlugin = __webpack_require__(98397); +const EntryPlugin = __webpack_require__(95113); +const EntryDependency = __webpack_require__(49787); /** @typedef {import("../declarations/WebpackOptions").EntryDynamicNormalized} EntryDynamic */ /** @typedef {import("../declarations/WebpackOptions").EntryItem} EntryItem */ @@ -67600,7 +69037,7 @@ module.exports = DynamicEntryPlugin; /***/ }), -/***/ 87685: +/***/ 98397: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -67636,10 +69073,10 @@ class EntryOptionPlugin { */ static applyEntryOption(compiler, context, entry) { if (typeof entry === "function") { - const DynamicEntryPlugin = __webpack_require__(90956); + const DynamicEntryPlugin = __webpack_require__(58677); new DynamicEntryPlugin(context, entry).apply(compiler); } else { - const EntryPlugin = __webpack_require__(42102); + const EntryPlugin = __webpack_require__(95113); for (const name of Object.keys(entry)) { const desc = entry[name]; const options = EntryOptionPlugin.entryDescriptionToOptions( @@ -67681,15 +69118,15 @@ class EntryOptionPlugin { ); } if (desc.chunkLoading) { - const EnableChunkLoadingPlugin = __webpack_require__(14622); + const EnableChunkLoadingPlugin = __webpack_require__(51050); EnableChunkLoadingPlugin.checkEnabled(compiler, desc.chunkLoading); } if (desc.wasmLoading) { - const EnableWasmLoadingPlugin = __webpack_require__(15102); + const EnableWasmLoadingPlugin = __webpack_require__(25240); EnableWasmLoadingPlugin.checkEnabled(compiler, desc.wasmLoading); } if (desc.library) { - const EnableLibraryPlugin = __webpack_require__(3580); + const EnableLibraryPlugin = __webpack_require__(90487); EnableLibraryPlugin.checkEnabled(compiler, desc.library.type); } return options; @@ -67701,7 +69138,7 @@ module.exports = EntryOptionPlugin; /***/ }), -/***/ 42102: +/***/ 95113: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -67712,7 +69149,7 @@ module.exports = EntryOptionPlugin; -const EntryDependency = __webpack_require__(54511); +const EntryDependency = __webpack_require__(49787); /** @typedef {import("./Compiler")} Compiler */ /** @typedef {import("./Entrypoint").EntryOptions} EntryOptions */ @@ -67776,7 +69213,7 @@ module.exports = EntryPlugin; /***/ }), -/***/ 3457: +/***/ 25661: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -67787,7 +69224,7 @@ module.exports = EntryPlugin; -const ChunkGroup = __webpack_require__(51910); +const ChunkGroup = __webpack_require__(39); /** @typedef {import("../declarations/WebpackOptions").EntryDescriptionNormalized} EntryDescription */ /** @typedef {import("./Chunk")} Chunk */ @@ -67865,7 +69302,7 @@ class Entrypoint extends ChunkGroup { * @returns {Chunk} chunk */ getEntrypointChunk() { - return this._entrypointChunk; + return /** @type {Chunk} */ (this._entrypointChunk); } /** @@ -67885,7 +69322,7 @@ module.exports = Entrypoint; /***/ }), -/***/ 63460: +/***/ 17652: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -67896,8 +69333,8 @@ module.exports = Entrypoint; -const DefinePlugin = __webpack_require__(84036); -const WebpackError = __webpack_require__(10841); +const DefinePlugin = __webpack_require__(7628); +const WebpackError = __webpack_require__(49999); /** @typedef {import("./Compiler")} Compiler */ /** @typedef {import("./DefinePlugin").CodeValue} CodeValue */ @@ -67956,7 +69393,7 @@ module.exports = EnvironmentPlugin; /***/ }), -/***/ 68390: +/***/ 65206: /***/ (function(__unused_webpack_module, exports) { "use strict"; @@ -67971,36 +69408,58 @@ const loaderFlag = "LOADER_EXECUTION"; const webpackOptionsFlag = "WEBPACK_OPTIONS"; -exports.cutOffByFlag = (stack, flag) => { - stack = stack.split("\n"); - for (let i = 0; i < stack.length; i++) { - if (stack[i].includes(flag)) { - stack.length = i; +/** + * @param {string} stack stack trace + * @param {string} flag flag to cut off + * @returns {string} stack trace without the specified flag included + */ +const cutOffByFlag = (stack, flag) => { + const errorStack = stack.split("\n"); + for (let i = 0; i < errorStack.length; i++) { + if (errorStack[i].includes(flag)) { + errorStack.length = i; } } - return stack.join("\n"); + return errorStack.join("\n"); }; -exports.cutOffLoaderExecution = stack => - exports.cutOffByFlag(stack, loaderFlag); +/** + * @param {string} stack stack trace + * @returns {string} stack trace without the loader execution flag included + */ +const cutOffLoaderExecution = stack => cutOffByFlag(stack, loaderFlag); -exports.cutOffWebpackOptions = stack => - exports.cutOffByFlag(stack, webpackOptionsFlag); +/** + * @param {string} stack stack trace + * @returns {string} stack trace without the webpack options flag included + */ +const cutOffWebpackOptions = stack => cutOffByFlag(stack, webpackOptionsFlag); -exports.cutOffMultilineMessage = (stack, message) => { - stack = stack.split("\n"); - message = message.split("\n"); +/** + * @param {string} stack stack trace + * @param {string} message error message + * @returns {string} stack trace without the message included + */ +const cutOffMultilineMessage = (stack, message) => { + const stackSplitByLines = stack.split("\n"); + const messageSplitByLines = message.split("\n"); + /** @type {string[]} */ const result = []; - stack.forEach((line, idx) => { - if (!line.includes(message[idx])) result.push(line); + stackSplitByLines.forEach((line, idx) => { + if (!line.includes(messageSplitByLines[idx])) result.push(line); }); return result.join("\n"); }; -exports.cutOffMessage = (stack, message) => { +/** + * @param {string} stack stack trace + * @param {string} message error message + * @returns {string} stack trace without the message included + */ +const cutOffMessage = (stack, message) => { const nextLine = stack.indexOf("\n"); if (nextLine === -1) { return stack === message ? "" : stack; @@ -68010,22 +69469,40 @@ exports.cutOffMessage = (stack, message) => { } }; -exports.cleanUp = (stack, message) => { - stack = exports.cutOffLoaderExecution(stack); - stack = exports.cutOffMessage(stack, message); +/** + * @param {string} stack stack trace + * @param {string} message error message + * @returns {string} stack trace without the loader execution flag and message included + */ +const cleanUp = (stack, message) => { + stack = cutOffLoaderExecution(stack); + stack = cutOffMessage(stack, message); return stack; }; -exports.cleanUpWebpackOptions = (stack, message) => { - stack = exports.cutOffWebpackOptions(stack); - stack = exports.cutOffMultilineMessage(stack, message); +/** + * @param {string} stack stack trace + * @param {string} message error message + * @returns {string} stack trace without the webpack options flag and message included + */ +const cleanUpWebpackOptions = (stack, message) => { + stack = cutOffWebpackOptions(stack); + stack = cutOffMultilineMessage(stack, message); return stack; }; +exports.cutOffByFlag = cutOffByFlag; +exports.cutOffLoaderExecution = cutOffLoaderExecution; +exports.cutOffWebpackOptions = cutOffWebpackOptions; +exports.cutOffMultilineMessage = cutOffMultilineMessage; +exports.cutOffMessage = cutOffMessage; +exports.cleanUp = cleanUp; +exports.cleanUpWebpackOptions = cleanUpWebpackOptions; + /***/ }), -/***/ 11929: +/***/ 83204: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -68037,10 +69514,10 @@ exports.cleanUpWebpackOptions = (stack, message) => { const { ConcatSource, RawSource } = __webpack_require__(59728); -const ExternalModule = __webpack_require__(43308); -const ModuleFilenameHelpers = __webpack_require__(38738); -const RuntimeGlobals = __webpack_require__(34623); -const JavascriptModulesPlugin = __webpack_require__(96230); +const ExternalModule = __webpack_require__(90790); +const ModuleFilenameHelpers = __webpack_require__(82444); +const RuntimeGlobals = __webpack_require__(61539); +const JavascriptModulesPlugin = __webpack_require__(70061); /** @typedef {import("webpack-sources").Source} Source */ /** @typedef {import("./Compiler")} Compiler */ @@ -68150,7 +69627,7 @@ module.exports = EvalDevToolModulePlugin; /***/ }), -/***/ 99849: +/***/ 35920: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -68162,13 +69639,13 @@ module.exports = EvalDevToolModulePlugin; const { ConcatSource, RawSource } = __webpack_require__(59728); -const ModuleFilenameHelpers = __webpack_require__(38738); -const NormalModule = __webpack_require__(55443); -const RuntimeGlobals = __webpack_require__(34623); -const SourceMapDevToolModuleOptionsPlugin = __webpack_require__(58501); -const JavascriptModulesPlugin = __webpack_require__(96230); -const ConcatenatedModule = __webpack_require__(10742); -const { makePathsAbsolute } = __webpack_require__(63146); +const ModuleFilenameHelpers = __webpack_require__(82444); +const NormalModule = __webpack_require__(17318); +const RuntimeGlobals = __webpack_require__(61539); +const SourceMapDevToolModuleOptionsPlugin = __webpack_require__(35449); +const JavascriptModulesPlugin = __webpack_require__(70061); +const ConcatenatedModule = __webpack_require__(22590); +const { makePathsAbsolute } = __webpack_require__(97451); /** @typedef {import("webpack-sources").Source} Source */ /** @typedef {import("../declarations/WebpackOptions").DevTool} DevToolOptions */ @@ -68204,7 +69681,9 @@ class EvalSourceMapDevToolPlugin { options = inputOptions; } this.sourceMapComment = - options.append || "//# sourceURL=[module]\n//# sourceMappingURL=[url]"; + options.append && typeof options.append !== "function" + ? options.append + : "//# sourceURL=[module]\n//# sourceMappingURL=[url]"; this.moduleFilenameTemplate = options.moduleFilenameTemplate || "webpack://[namespace]/[resource-path]?[hash]"; @@ -68236,6 +69715,10 @@ class EvalSourceMapDevToolPlugin { return cachedSource; } + /** + * @param {Source} r result + * @returns {Source} result + */ const result = r => { cache.set(source, r); return r; @@ -68314,7 +69797,8 @@ class EvalSourceMapDevToolPlugin { } sourceMap.sourceRoot = options.sourceRoot || ""; const moduleId = chunkGraph.getModuleId(m); - sourceMap.file = `${moduleId}.js`; + sourceMap.file = + typeof moduleId === "number" ? `${moduleId}.js` : moduleId; const footer = this.sourceMapComment.replace( @@ -68368,7 +69852,7 @@ module.exports = EvalSourceMapDevToolPlugin; /***/ }), -/***/ 1723: +/***/ 14768: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -68379,15 +69863,17 @@ module.exports = EvalSourceMapDevToolPlugin; -const { equals } = __webpack_require__(91696); -const SortableSet = __webpack_require__(98203); -const makeSerializable = __webpack_require__(23827); -const { forEachRuntime } = __webpack_require__(55693); +const { equals } = __webpack_require__(22150); +const SortableSet = __webpack_require__(94845); +const makeSerializable = __webpack_require__(83626); +const { forEachRuntime } = __webpack_require__(69965); /** @typedef {import("./Dependency").RuntimeSpec} RuntimeSpec */ /** @typedef {import("./Module")} Module */ /** @typedef {import("./ModuleGraph")} ModuleGraph */ /** @typedef {import("./ModuleGraphConnection")} ModuleGraphConnection */ +/** @typedef {import("./serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */ +/** @typedef {import("./serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */ /** @typedef {import("./util/Hash")} Hash */ /** @typedef {typeof UsageState.OnlyPropertiesUsed | typeof UsageState.NoInfo | typeof UsageState.Unknown | typeof UsageState.Used} RuntimeUsageStateType */ @@ -68418,6 +69904,9 @@ class RestoreProvidedData { this.otherTerminalBinding = otherTerminalBinding; } + /** + * @param {ObjectSerializerContext} context context + */ serialize({ write }) { write(this.exports); write(this.otherProvided); @@ -68425,6 +69914,10 @@ class RestoreProvidedData { write(this.otherTerminalBinding); } + /** + * @param {ObjectDeserializerContext} context context + * @returns {RestoreProvidedData} RestoreProvidedData + */ static deserialize({ read }) { return new RestoreProvidedData(read(), read(), read(), read()); } @@ -68675,7 +70168,12 @@ class ExportsInfo { changed = true; } if (targetKey) { - exportInfo.setTarget(targetKey, targetModule, [exportInfo.name], -1); + exportInfo.setTarget( + targetKey, + /** @type {ModuleGraphConnection} */ (targetModule), + [exportInfo.name], + -1 + ); } } if (this._redirectTo !== undefined) { @@ -68705,7 +70203,7 @@ class ExportsInfo { if (targetKey) { this._otherExportsInfo.setTarget( targetKey, - targetModule, + /** @type {ModuleGraphConnection} */ (targetModule), undefined, priority ); @@ -69126,6 +70624,9 @@ class ExportsInfo { ); } + /** + * @param {{ otherProvided: any, otherCanMangleProvide: any, otherTerminalBinding: any, exports: any }} data data + */ restoreProvided({ otherProvided, otherCanMangleProvide, @@ -69597,7 +71098,7 @@ class ExportInfo { /** * @param {ModuleGraph} moduleGraph the module graph * @param {function(Module): boolean} validTargetModuleFilter a valid target module - * @param {Set | undefined} alreadyVisited set of already visited export info to avoid circular references + * @param {Set} alreadyVisited set of already visited export info to avoid circular references * @returns {{ module: Module, export: string[] | undefined } | undefined | false} the target, undefined when there is no target, false when no target is valid */ _findTarget(moduleGraph, validTargetModuleFilter, alreadyVisited) { @@ -69721,7 +71222,11 @@ class ExportInfo { if (t === null) return undefined; if (t.module !== target.module) return undefined; if (!t.export !== !target.export) return undefined; - if (target.export && !equals(t.export, target.export)) return undefined; + if ( + target.export && + !equals(/** @type {ArrayLike} */ (t.export), target.export) + ) + return undefined; result = values.next(); } return target; @@ -69899,7 +71404,7 @@ module.exports.UsageState = UsageState; /***/ }), -/***/ 98869: +/***/ 78575: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -69910,11 +71415,20 @@ module.exports.UsageState = UsageState; -const ConstDependency = __webpack_require__(78284); -const ExportsInfoDependency = __webpack_require__(38914); +const { + JAVASCRIPT_MODULE_TYPE_AUTO, + JAVASCRIPT_MODULE_TYPE_DYNAMIC, + JAVASCRIPT_MODULE_TYPE_ESM +} = __webpack_require__(92891); +const ConstDependency = __webpack_require__(67538); +const ExportsInfoDependency = __webpack_require__(624); /** @typedef {import("./Compiler")} Compiler */ +/** @typedef {import("./Dependency").DependencyLocation} DependencyLocation */ /** @typedef {import("./javascript/JavascriptParser")} JavascriptParser */ +/** @typedef {import("./javascript/JavascriptParser").Range} Range */ + +const PLUGIN_NAME = "ExportsInfoApiPlugin"; class ExportsInfoApiPlugin { /** @@ -69924,7 +71438,7 @@ class ExportsInfoApiPlugin { */ apply(compiler) { compiler.hooks.compilation.tap( - "ExportsInfoApiPlugin", + PLUGIN_NAME, (compilation, { normalModuleFactory }) => { compilation.dependencyTemplates.set( ExportsInfoDependency, @@ -69937,37 +71451,44 @@ class ExportsInfoApiPlugin { const handler = parser => { parser.hooks.expressionMemberChain .for("__webpack_exports_info__") - .tap("ExportsInfoApiPlugin", (expr, members) => { + .tap(PLUGIN_NAME, (expr, members) => { const dep = members.length >= 2 ? new ExportsInfoDependency( - expr.range, + /** @type {Range} */ (expr.range), members.slice(0, -1), members[members.length - 1] ) - : new ExportsInfoDependency(expr.range, null, members[0]); - dep.loc = expr.loc; + : new ExportsInfoDependency( + /** @type {Range} */ (expr.range), + null, + members[0] + ); + dep.loc = /** @type {DependencyLocation} */ (expr.loc); parser.state.module.addDependency(dep); return true; }); parser.hooks.expression .for("__webpack_exports_info__") - .tap("ExportsInfoApiPlugin", expr => { - const dep = new ConstDependency("true", expr.range); - dep.loc = expr.loc; + .tap(PLUGIN_NAME, expr => { + const dep = new ConstDependency( + "true", + /** @type {Range} */ (expr.range) + ); + dep.loc = /** @type {DependencyLocation} */ (expr.loc); parser.state.module.addPresentationalDependency(dep); return true; }); }; normalModuleFactory.hooks.parser - .for("javascript/auto") - .tap("ExportsInfoApiPlugin", handler); + .for(JAVASCRIPT_MODULE_TYPE_AUTO) + .tap(PLUGIN_NAME, handler); normalModuleFactory.hooks.parser - .for("javascript/dynamic") - .tap("ExportsInfoApiPlugin", handler); + .for(JAVASCRIPT_MODULE_TYPE_DYNAMIC) + .tap(PLUGIN_NAME, handler); normalModuleFactory.hooks.parser - .for("javascript/esm") - .tap("ExportsInfoApiPlugin", handler); + .for(JAVASCRIPT_MODULE_TYPE_ESM) + .tap(PLUGIN_NAME, handler); } ); } @@ -69978,7 +71499,7 @@ module.exports = ExportsInfoApiPlugin; /***/ }), -/***/ 43308: +/***/ 90790: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -69990,18 +71511,19 @@ module.exports = ExportsInfoApiPlugin; const { OriginalSource, RawSource } = __webpack_require__(59728); -const ConcatenationScope = __webpack_require__(68645); -const { UsageState } = __webpack_require__(1723); -const InitFragment = __webpack_require__(53658); -const Module = __webpack_require__(96040); -const RuntimeGlobals = __webpack_require__(34623); -const Template = __webpack_require__(88070); -const StaticExportsDependency = __webpack_require__(64422); -const createHash = __webpack_require__(94624); -const extractUrlAndGlobal = __webpack_require__(67627); -const makeSerializable = __webpack_require__(23827); -const propertyAccess = __webpack_require__(92884); -const { register } = __webpack_require__(94965); +const ConcatenationScope = __webpack_require__(92811); +const { UsageState } = __webpack_require__(14768); +const InitFragment = __webpack_require__(44508); +const Module = __webpack_require__(6309); +const { JAVASCRIPT_MODULE_TYPE_DYNAMIC } = __webpack_require__(92891); +const RuntimeGlobals = __webpack_require__(61539); +const Template = __webpack_require__(88835); +const StaticExportsDependency = __webpack_require__(71444); +const createHash = __webpack_require__(31147); +const extractUrlAndGlobal = __webpack_require__(30147); +const makeSerializable = __webpack_require__(83626); +const propertyAccess = __webpack_require__(60305); +const { register } = __webpack_require__(93141); /** @typedef {import("webpack-sources").Source} Source */ /** @typedef {import("../declarations/WebpackOptions").WebpackOptionsNormalized} WebpackOptions */ @@ -70022,6 +71544,8 @@ const { register } = __webpack_require__(94965); /** @typedef {import("./RuntimeTemplate")} RuntimeTemplate */ /** @typedef {import("./WebpackError")} WebpackError */ /** @typedef {import("./javascript/JavascriptModulesPlugin").ChunkRenderContext} ChunkRenderContext */ +/** @typedef {import("./serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */ +/** @typedef {import("./serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */ /** @typedef {import("./util/Hash")} Hash */ /** @typedef {typeof import("./util/Hash")} HashConstructor */ /** @typedef {import("./util/fs").InputFileSystem} InputFileSystem */ @@ -70085,9 +71609,13 @@ const getSourceForCommonJsExternal = moduleAndSpecifiers => { /** * @param {string|string[]} moduleAndSpecifiers the module request + * @param {string} importMetaName import.meta name * @returns {SourceData} the generated source */ -const getSourceForCommonJsExternalInNodeModule = moduleAndSpecifiers => { +const getSourceForCommonJsExternalInNodeModule = ( + moduleAndSpecifiers, + importMetaName +) => { const chunkInitFragments = [ new InitFragment( 'import { createRequire as __WEBPACK_EXTERNAL_createRequire } from "module";\n', @@ -70098,18 +71626,18 @@ const getSourceForCommonJsExternalInNodeModule = moduleAndSpecifiers => { ]; if (!Array.isArray(moduleAndSpecifiers)) { return { - expression: `__WEBPACK_EXTERNAL_createRequire(import.meta.url)(${JSON.stringify( + chunkInitFragments, + expression: `__WEBPACK_EXTERNAL_createRequire(${importMetaName}.url)(${JSON.stringify( moduleAndSpecifiers - )})`, - chunkInitFragments + )})` }; } const moduleName = moduleAndSpecifiers[0]; return { - expression: `__WEBPACK_EXTERNAL_createRequire(import.meta.url)(${JSON.stringify( + chunkInitFragments, + expression: `__WEBPACK_EXTERNAL_createRequire(${importMetaName}.url)(${JSON.stringify( moduleName - )})${propertyAccess(moduleAndSpecifiers, 1)}`, - chunkInitFragments + )})${propertyAccess(moduleAndSpecifiers, 1)}` }; }; @@ -70361,8 +71889,13 @@ const getSourceForDefaultCase = (optional, request, runtimeTemplate) => { }; class ExternalModule extends Module { + /** + * @param {string | string[] | Record} request request + * @param {TODO} type type + * @param {string} userRequest user request + */ constructor(request, type, userRequest) { - super("javascript/dynamic", null); + super(JAVASCRIPT_MODULE_TYPE_DYNAMIC, null); // Info from Factory /** @type {string | string[] | Record} */ @@ -70538,7 +72071,10 @@ class ExternalModule extends Module { return getSourceForCommonJsExternal(request); case "node-commonjs": return this.buildInfo.module - ? getSourceForCommonJsExternalInNodeModule(request) + ? getSourceForCommonJsExternalInNodeModule( + request, + runtimeTemplate.outputOptions.importMetaName + ) : getSourceForCommonJsExternal(request); case "amd": case "amd-require": @@ -70716,6 +72252,9 @@ class ExternalModule extends Module { super.updateHash(hash, context); } + /** + * @param {ObjectSerializerContext} context context + */ serialize(context) { const { write } = context; @@ -70726,6 +72265,9 @@ class ExternalModule extends Module { super.serialize(context); } + /** + * @param {ObjectDeserializerContext} context context + */ deserialize(context) { const { read } = context; @@ -70744,7 +72286,7 @@ module.exports = ExternalModule; /***/ }), -/***/ 53045: +/***/ 63102: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -70756,8 +72298,8 @@ module.exports = ExternalModule; const util = __webpack_require__(73837); -const ExternalModule = __webpack_require__(43308); -const { resolveByProperty, cachedSetProperty } = __webpack_require__(31074); +const ExternalModule = __webpack_require__(90790); +const { resolveByProperty, cachedSetProperty } = __webpack_require__(44639); /** @typedef {import("../declarations/WebpackOptions").Externals} Externals */ /** @typedef {import("./NormalModuleFactory")} NormalModuleFactory */ @@ -71006,7 +72548,7 @@ module.exports = ExternalModuleFactoryPlugin; /***/ }), -/***/ 3021: +/***/ 42605: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -71017,7 +72559,7 @@ module.exports = ExternalModuleFactoryPlugin; -const ExternalModuleFactoryPlugin = __webpack_require__(53045); +const ExternalModuleFactoryPlugin = __webpack_require__(63102); /** @typedef {import("../declarations/WebpackOptions").Externals} Externals */ /** @typedef {import("./Compiler")} Compiler */ @@ -71051,7 +72593,7 @@ module.exports = ExternalsPlugin; /***/ }), -/***/ 1120: +/***/ 18509: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -71062,19 +72604,21 @@ module.exports = ExternalsPlugin; -const { create: createResolver } = __webpack_require__(65260); +const { create: createResolver } = __webpack_require__(83866); const nodeModule = __webpack_require__(98188); const asyncLib = __webpack_require__(47087); const { isAbsolute } = __webpack_require__(71017); -const AsyncQueue = __webpack_require__(94975); -const StackedCacheMap = __webpack_require__(60142); -const createHash = __webpack_require__(94624); -const { join, dirname, relative, lstatReadlinkAbsolute } = __webpack_require__(33139); -const makeSerializable = __webpack_require__(23827); -const processAsyncTree = __webpack_require__(65754); +const AsyncQueue = __webpack_require__(19422); +const StackedCacheMap = __webpack_require__(64490); +const createHash = __webpack_require__(31147); +const { join, dirname, relative, lstatReadlinkAbsolute } = __webpack_require__(96220); +const makeSerializable = __webpack_require__(83626); +const processAsyncTree = __webpack_require__(18119); /** @typedef {import("./WebpackError")} WebpackError */ /** @typedef {import("./logging/Logger").Logger} Logger */ +/** @typedef {import("./serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */ +/** @typedef {import("./serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */ /** @typedef {typeof import("./util/Hash")} Hash */ /** @typedef {import("./util/fs").IStats} IStats */ /** @typedef {import("./util/fs").InputFileSystem} InputFileSystem */ @@ -71154,8 +72698,8 @@ const INVALID = Symbol("invalid"); * @typedef {Object} SnapshotOptimizationEntry * @property {Snapshot} snapshot * @property {number} shared - * @property {Set} snapshotContent - * @property {Set} children + * @property {Set | undefined} snapshotContent + * @property {Set | undefined} children */ /** @@ -71170,6 +72714,12 @@ const INVALID = Symbol("invalid"); * @property {Set} resolveDependencies.missing list of missing entries */ +/** + * @typedef {Object} SnapshotOptions + * @property {boolean=} hash should use hash to snapshot + * @property {boolean=} timestamp should use timestamp to snapshot + */ + const DONE_ITERATOR_RESULT = new Set().keys().next(); // cspell:word tshs @@ -71192,7 +72742,7 @@ class SnapshotIterable { let state = 0; /** @type {IterableIterator} */ let it; - /** @type {(Snapshot) => (Map | Set)[]} */ + /** @type {(snapshot: Snapshot) => (Map | Set)[]} */ let getMaps; /** @type {(Map | Set)[]} */ let maps; @@ -71435,6 +72985,9 @@ class Snapshot { this.children.add(child); } + /** + * @param {ObjectSerializerContext} context context + */ serialize({ write }) { write(this._flags); if (this.hasStartTime()) write(this.startTime); @@ -71452,6 +73005,9 @@ class Snapshot { if (this.hasChildren()) write(this.children); } + /** + * @param {ObjectDeserializerContext} context context + */ deserialize({ read }) { this._flags = read(); if (this.hasStartTime()) this.startTime = read(); @@ -71601,7 +73157,7 @@ class SnapshotOptimization { } }; - /** @type {SnapshotOptimizationEntry} */ + /** @type {SnapshotOptimizationEntry | undefined} */ let newOptimizationEntry = undefined; const capturedFilesSize = capturedFiles.size; @@ -71806,10 +73362,9 @@ const mergeMaps = (a, b) => { /** * @template T - * @template K - * @param {Set} a source map - * @param {Set} b joining map - * @returns {Set} joined map + * @param {Set} a source map + * @param {Set} b joining map + * @returns {Set} joined map */ const mergeSets = (a, b) => { if (!b || b.size === 0) return a; @@ -71907,8 +73462,8 @@ const getManagedItem = (managedPath, path) => { /** * @template {ContextFileSystemInfoEntry | ContextTimestampAndHash} T - * @param {T} entry entry - * @returns {T["resolved"] | undefined} the resolved entry + * @param {T | null} entry entry + * @returns {T["resolved"] | null | undefined} the resolved entry */ const getResolvedTimestamp = entry => { if (entry === null) return null; @@ -71917,8 +73472,8 @@ const getResolvedTimestamp = entry => { }; /** - * @param {ContextHash} entry entry - * @returns {string | undefined} the resolved entry + * @param {ContextHash | null} entry entry + * @returns {string | null | undefined} the resolved entry */ const getResolvedHash = entry => { if (entry === null) return null; @@ -71926,6 +73481,11 @@ const getResolvedHash = entry => { return entry.symlinks === undefined ? entry.hash : undefined; }; +/** + * @template T + * @param {Set} source source + * @param {Set} target target + */ const addAll = (source, target) => { for (const key of source) target.add(key); }; @@ -72194,6 +73754,11 @@ class FileSystemInfo { ); } + /** + * @param {string} path path + * @param {string} reason reason + * @param {any[]} args arguments + */ _log(path, reason, ...args) { const key = path + reason; if (this._loggedPaths.has(key)) return; @@ -72307,7 +73872,7 @@ class FileSystemInfo { /** * @param {string} path file path - * @param {function((WebpackError | null)=, string=): void} callback callback function + * @param {function((WebpackError | null)=, (string | null)=): void} callback callback function * @returns {void} */ getFileHash(path, callback) { @@ -72338,7 +73903,7 @@ class FileSystemInfo { /** * @param {string} path context path - * @param {function((WebpackError | null)=, ContextHash=): void} callback callback function + * @param {function((WebpackError | null)=, (ContextHash | null)=): void} callback callback function * @returns {void} */ _getUnresolvedContextHash(path, callback) { @@ -72369,7 +73934,7 @@ class FileSystemInfo { /** * @param {string} path context path - * @param {function((WebpackError | null)=, ContextTimestampAndHash=): void} callback callback function + * @param {function((WebpackError | null)=, (ContextTimestampAndHash | null)=): void} callback callback function * @returns {void} */ _getUnresolvedContextTsh(path, callback) { @@ -72432,7 +73997,7 @@ class FileSystemInfo { const resolveDirectories = new Set(); /** @type {Set} */ const resolveMissing = new Set(); - /** @type {Map} */ + /** @type {Map} */ const resolveResults = new Map(); const invalidResolveResults = new Set(); const resolverContext = { @@ -72440,6 +74005,10 @@ class FileSystemInfo { contextDependencies: resolveDirectories, missingDependencies: resolveMissing }; + /** + * @param {string} expected expected result + * @returns {string} expected result + */ const expectedToString = expected => { return expected ? ` (expected ${expected})` : ""; }; @@ -72513,7 +74082,7 @@ class FileSystemInfo { push({ type: RBDT_DIRECTORY, context: undefined, - path: resultPath, + path: /** @type {string} */ (resultPath), expected: undefined, issuer: job }); @@ -72659,7 +74228,7 @@ class FileSystemInfo { break; } // Check commonjs cache for the module - /** @type {NodeModule} */ + /** @type {NodeModule | undefined} */ const module = require.cache[path]; if (module && Array.isArray(module.children)) { children: for (const child of module.children) { @@ -72959,13 +74528,11 @@ class FileSystemInfo { /** * - * @param {number} startTime when processing the files has started + * @param {number | null | undefined} startTime when processing the files has started * @param {Iterable} files all files * @param {Iterable} directories all directories * @param {Iterable} missing all missing files or directories - * @param {Object} options options object (for future extensions) - * @param {boolean=} options.hash should use hash to snapshot - * @param {boolean=} options.timestamp should use timestamp to snapshot + * @param {SnapshotOptions | null | undefined} options options object (for future extensions) * @param {function((WebpackError | null)=, (Snapshot | null)=): void} callback callback function * @returns {void} */ @@ -73102,6 +74669,9 @@ class FileSystemInfo { } return capturedItems; }; + /** + * @param {Set} capturedFiles captured files + */ const processCapturedFiles = capturedFiles => { switch (mode) { case 3: @@ -73688,6 +75258,10 @@ class FileSystemInfo { } } } + /** + * @param {string} path file path + * @param {string} hash hash + */ const processFileHashSnapshot = (path, hash) => { const cache = this._fileHashes.get(path); if (cache !== undefined) { @@ -73970,7 +75544,7 @@ class FileSystemInfo { const hash = createHash(this._hashFunction); - hash.update(content); + hash.update(/** @type {string | Buffer} */ (content)); const digest = /** @type {string} */ (hash.digest("hex")); @@ -74034,7 +75608,7 @@ class FileSystemInfo { * @param {function(string, IStats, function(Error=, ItemType=): void): void} options.fromFile called when context item is a file * @param {function(string, IStats, function(Error=, ItemType=): void): void} options.fromDirectory called when context item is a directory * @param {function(string[], ItemType[]): T} options.reduce called from all context items - * @param {function((Error | null)=, (T)=): void} callback callback + * @param {function((Error | null)=, (T | null)=): void} callback callback */ _readContext( { @@ -74221,6 +75795,7 @@ class FileSystemInfo { * @returns {void} */ _resolveContextTimestamp(entry, callback) { + /** @type {string[]} */ const hashes = []; let safeTime = 0; processAsyncTree( @@ -74329,6 +75904,7 @@ class FileSystemInfo { * @returns {void} */ _resolveContextHash(entry, callback) { + /** @type {string[]} */ const hashes = []; processAsyncTree( entry.symlinks, @@ -74485,7 +76061,9 @@ class FileSystemInfo { * @returns {void} */ _resolveContextTsh(entry, callback) { + /** @type {string[]} */ const hashes = []; + /** @type {string[]} */ const tsHashes = []; let safeTime = 0; processAsyncTree( @@ -74603,7 +76181,7 @@ class FileSystemInfo { } let data; try { - data = JSON.parse(content.toString("utf-8")); + data = JSON.parse(/** @type {Buffer} */ (content).toString("utf-8")); } catch (e) { return callback(e); } @@ -74647,7 +76225,7 @@ module.exports.Snapshot = Snapshot; /***/ }), -/***/ 85419: +/***/ 41725: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -74658,12 +76236,17 @@ module.exports.Snapshot = Snapshot; -const { getEntryRuntime, mergeRuntimeOwned } = __webpack_require__(55693); +const { getEntryRuntime, mergeRuntimeOwned } = __webpack_require__(69965); /** @typedef {import("./Compiler")} Compiler */ +/** @typedef {import("./Module").FactoryMeta} FactoryMeta */ /** @typedef {import("./util/runtime").RuntimeSpec} RuntimeSpec */ +const PLUGIN_NAME = "FlagAllModulesAsUsedPlugin"; class FlagAllModulesAsUsedPlugin { + /** + * @param {string} explanation explanation + */ constructor(explanation) { this.explanation = explanation; } @@ -74674,34 +76257,29 @@ class FlagAllModulesAsUsedPlugin { * @returns {void} */ apply(compiler) { - compiler.hooks.compilation.tap( - "FlagAllModulesAsUsedPlugin", - compilation => { - const moduleGraph = compilation.moduleGraph; - compilation.hooks.optimizeDependencies.tap( - "FlagAllModulesAsUsedPlugin", - modules => { - /** @type {RuntimeSpec} */ - let runtime = undefined; - for (const [name, { options }] of compilation.entries) { - runtime = mergeRuntimeOwned( - runtime, - getEntryRuntime(compilation, name, options) - ); - } - for (const module of modules) { - const exportsInfo = moduleGraph.getExportsInfo(module); - exportsInfo.setUsedInUnknownWay(runtime); - moduleGraph.addExtraReason(module, this.explanation); - if (module.factoryMeta === undefined) { - module.factoryMeta = {}; - } - module.factoryMeta.sideEffectFree = false; - } + compiler.hooks.compilation.tap(PLUGIN_NAME, compilation => { + const moduleGraph = compilation.moduleGraph; + compilation.hooks.optimizeDependencies.tap(PLUGIN_NAME, modules => { + /** @type {RuntimeSpec} */ + let runtime = undefined; + for (const [name, { options }] of compilation.entries) { + runtime = mergeRuntimeOwned( + runtime, + getEntryRuntime(compilation, name, options) + ); + } + for (const module of modules) { + const exportsInfo = moduleGraph.getExportsInfo(module); + exportsInfo.setUsedInUnknownWay(runtime); + moduleGraph.addExtraReason(module, this.explanation); + if (module.factoryMeta === undefined) { + module.factoryMeta = {}; } - ); - } - ); + /** @type {FactoryMeta} */ + (module.factoryMeta).sideEffectFree = false; + } + }); + }); } } @@ -74710,7 +76288,7 @@ module.exports = FlagAllModulesAsUsedPlugin; /***/ }), -/***/ 54621: +/***/ 42229: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -74722,7 +76300,7 @@ module.exports = FlagAllModulesAsUsedPlugin; const asyncLib = __webpack_require__(47087); -const Queue = __webpack_require__(5004); +const Queue = __webpack_require__(67755); /** @typedef {import("./Compiler")} Compiler */ /** @typedef {import("./DependenciesBlock")} DependenciesBlock */ @@ -74732,6 +76310,9 @@ const Queue = __webpack_require__(5004); /** @typedef {import("./ExportsInfo")} ExportsInfo */ /** @typedef {import("./Module")} Module */ +const PLUGIN_NAME = "FlagDependencyExportsPlugin"; +const PLUGIN_LOGGER_NAME = `webpack.${PLUGIN_NAME}`; + class FlagDependencyExportsPlugin { /** * Apply the plugin @@ -74739,394 +76320,379 @@ class FlagDependencyExportsPlugin { * @returns {void} */ apply(compiler) { - compiler.hooks.compilation.tap( - "FlagDependencyExportsPlugin", - compilation => { - const moduleGraph = compilation.moduleGraph; - const cache = compilation.getCache("FlagDependencyExportsPlugin"); - compilation.hooks.finishModules.tapAsync( - "FlagDependencyExportsPlugin", - (modules, callback) => { - const logger = compilation.getLogger( - "webpack.FlagDependencyExportsPlugin" - ); - let statRestoredFromMemCache = 0; - let statRestoredFromCache = 0; - let statNoExports = 0; - let statFlaggedUncached = 0; - let statNotCached = 0; - let statQueueItemsProcessed = 0; - - const { moduleMemCaches } = compilation; - - /** @type {Queue} */ - const queue = new Queue(); - - // Step 1: Try to restore cached provided export info from cache - logger.time("restore cached provided exports"); - asyncLib.each( - modules, - (module, callback) => { - const exportsInfo = moduleGraph.getExportsInfo(module); - if (!module.buildMeta || !module.buildMeta.exportsType) { - if (exportsInfo.otherExportsInfo.provided !== null) { - // It's a module without declared exports - statNoExports++; - exportsInfo.setHasProvideInfo(); - exportsInfo.setUnknownExportsProvided(); - return callback(); - } - } - if (typeof module.buildInfo.hash !== "string") { - statFlaggedUncached++; - // Enqueue uncacheable module for determining the exports - queue.enqueue(module); + compiler.hooks.compilation.tap(PLUGIN_NAME, compilation => { + const moduleGraph = compilation.moduleGraph; + const cache = compilation.getCache(PLUGIN_NAME); + compilation.hooks.finishModules.tapAsync( + PLUGIN_NAME, + (modules, callback) => { + const logger = compilation.getLogger(PLUGIN_LOGGER_NAME); + let statRestoredFromMemCache = 0; + let statRestoredFromCache = 0; + let statNoExports = 0; + let statFlaggedUncached = 0; + let statNotCached = 0; + let statQueueItemsProcessed = 0; + + const { moduleMemCaches } = compilation; + + /** @type {Queue} */ + const queue = new Queue(); + + // Step 1: Try to restore cached provided export info from cache + logger.time("restore cached provided exports"); + asyncLib.each( + modules, + (module, callback) => { + const exportsInfo = moduleGraph.getExportsInfo(module); + // If the module doesn't have an exportsType, it's a module + // without declared exports. + if (!module.buildMeta || !module.buildMeta.exportsType) { + if (exportsInfo.otherExportsInfo.provided !== null) { + // It's a module without declared exports + statNoExports++; exportsInfo.setHasProvideInfo(); + exportsInfo.setUnknownExportsProvided(); return callback(); } - const memCache = moduleMemCaches && moduleMemCaches.get(module); - const memCacheValue = memCache && memCache.get(this); - if (memCacheValue !== undefined) { - statRestoredFromMemCache++; - exportsInfo.restoreProvided(memCacheValue); - return callback(); - } - cache.get( - module.identifier(), - module.buildInfo.hash, - (err, result) => { - if (err) return callback(err); + } + // If the module has no hash, it's uncacheable + if (typeof module.buildInfo.hash !== "string") { + statFlaggedUncached++; + // Enqueue uncacheable module for determining the exports + queue.enqueue(module); + exportsInfo.setHasProvideInfo(); + return callback(); + } + const memCache = moduleMemCaches && moduleMemCaches.get(module); + const memCacheValue = memCache && memCache.get(this); + if (memCacheValue !== undefined) { + statRestoredFromMemCache++; + exportsInfo.restoreProvided(memCacheValue); + return callback(); + } + cache.get( + module.identifier(), + module.buildInfo.hash, + (err, result) => { + if (err) return callback(err); - if (result !== undefined) { - statRestoredFromCache++; - exportsInfo.restoreProvided(result); - } else { - statNotCached++; - // Without cached info enqueue module for determining the exports - queue.enqueue(module); - exportsInfo.setHasProvideInfo(); - } - callback(); + if (result !== undefined) { + statRestoredFromCache++; + exportsInfo.restoreProvided(result); + } else { + statNotCached++; + // Without cached info enqueue module for determining the exports + queue.enqueue(module); + exportsInfo.setHasProvideInfo(); } - ); - }, - err => { - logger.timeEnd("restore cached provided exports"); - if (err) return callback(err); + callback(); + } + ); + }, + err => { + logger.timeEnd("restore cached provided exports"); + if (err) return callback(err); - /** @type {Set} */ - const modulesToStore = new Set(); + /** @type {Set} */ + const modulesToStore = new Set(); - /** @type {Map>} */ - const dependencies = new Map(); + /** @type {Map>} */ + const dependencies = new Map(); - /** @type {Module} */ - let module; + /** @type {Module} */ + let module; - /** @type {ExportsInfo} */ - let exportsInfo; + /** @type {ExportsInfo} */ + let exportsInfo; - /** @type {Map} */ - const exportsSpecsFromDependencies = new Map(); + /** @type {Map} */ + const exportsSpecsFromDependencies = new Map(); - let cacheable = true; - let changed = false; + let cacheable = true; + let changed = false; - /** - * @param {DependenciesBlock} depBlock the dependencies block - * @returns {void} - */ - const processDependenciesBlock = depBlock => { - for (const dep of depBlock.dependencies) { - processDependency(dep); - } - for (const block of depBlock.blocks) { - processDependenciesBlock(block); - } - }; + /** + * @param {DependenciesBlock} depBlock the dependencies block + * @returns {void} + */ + const processDependenciesBlock = depBlock => { + for (const dep of depBlock.dependencies) { + processDependency(dep); + } + for (const block of depBlock.blocks) { + processDependenciesBlock(block); + } + }; - /** - * @param {Dependency} dep the dependency - * @returns {void} - */ - const processDependency = dep => { - const exportDesc = dep.getExports(moduleGraph); - if (!exportDesc) return; - exportsSpecsFromDependencies.set(dep, exportDesc); - }; + /** + * @param {Dependency} dep the dependency + * @returns {void} + */ + const processDependency = dep => { + const exportDesc = dep.getExports(moduleGraph); + if (!exportDesc) return; + exportsSpecsFromDependencies.set(dep, exportDesc); + }; - /** - * @param {Dependency} dep dependency - * @param {ExportsSpec} exportDesc info - * @returns {void} - */ - const processExportsSpec = (dep, exportDesc) => { - const exports = exportDesc.exports; - const globalCanMangle = exportDesc.canMangle; - const globalFrom = exportDesc.from; - const globalPriority = exportDesc.priority; - const globalTerminalBinding = - exportDesc.terminalBinding || false; - const exportDeps = exportDesc.dependencies; - if (exportDesc.hideExports) { - for (const name of exportDesc.hideExports) { - const exportInfo = exportsInfo.getExportInfo(name); - exportInfo.unsetTarget(dep); - } + /** + * @param {Dependency} dep dependency + * @param {ExportsSpec} exportDesc info + * @returns {void} + */ + const processExportsSpec = (dep, exportDesc) => { + const exports = exportDesc.exports; + const globalCanMangle = exportDesc.canMangle; + const globalFrom = exportDesc.from; + const globalPriority = exportDesc.priority; + const globalTerminalBinding = + exportDesc.terminalBinding || false; + const exportDeps = exportDesc.dependencies; + if (exportDesc.hideExports) { + for (const name of exportDesc.hideExports) { + const exportInfo = exportsInfo.getExportInfo(name); + exportInfo.unsetTarget(dep); } - if (exports === true) { - // unknown exports - if ( - exportsInfo.setUnknownExportsProvided( - globalCanMangle, - exportDesc.excludeExports, - globalFrom && dep, - globalFrom, - globalPriority - ) - ) { - changed = true; - } - } else if (Array.isArray(exports)) { - /** - * merge in new exports - * @param {ExportsInfo} exportsInfo own exports info - * @param {(ExportSpec | string)[]} exports list of exports - */ - const mergeExports = (exportsInfo, exports) => { - for (const exportNameOrSpec of exports) { - let name; - let canMangle = globalCanMangle; - let terminalBinding = globalTerminalBinding; - let exports = undefined; - let from = globalFrom; - let fromExport = undefined; - let priority = globalPriority; - let hidden = false; - if (typeof exportNameOrSpec === "string") { - name = exportNameOrSpec; - } else { - name = exportNameOrSpec.name; - if (exportNameOrSpec.canMangle !== undefined) - canMangle = exportNameOrSpec.canMangle; - if (exportNameOrSpec.export !== undefined) - fromExport = exportNameOrSpec.export; - if (exportNameOrSpec.exports !== undefined) - exports = exportNameOrSpec.exports; - if (exportNameOrSpec.from !== undefined) - from = exportNameOrSpec.from; - if (exportNameOrSpec.priority !== undefined) - priority = exportNameOrSpec.priority; - if (exportNameOrSpec.terminalBinding !== undefined) - terminalBinding = exportNameOrSpec.terminalBinding; - if (exportNameOrSpec.hidden !== undefined) - hidden = exportNameOrSpec.hidden; - } - const exportInfo = exportsInfo.getExportInfo(name); + } + if (exports === true) { + // unknown exports + if ( + exportsInfo.setUnknownExportsProvided( + globalCanMangle, + exportDesc.excludeExports, + globalFrom && dep, + globalFrom, + globalPriority + ) + ) { + changed = true; + } + } else if (Array.isArray(exports)) { + /** + * merge in new exports + * @param {ExportsInfo} exportsInfo own exports info + * @param {(ExportSpec | string)[]} exports list of exports + */ + const mergeExports = (exportsInfo, exports) => { + for (const exportNameOrSpec of exports) { + let name; + let canMangle = globalCanMangle; + let terminalBinding = globalTerminalBinding; + let exports = undefined; + let from = globalFrom; + let fromExport = undefined; + let priority = globalPriority; + let hidden = false; + if (typeof exportNameOrSpec === "string") { + name = exportNameOrSpec; + } else { + name = exportNameOrSpec.name; + if (exportNameOrSpec.canMangle !== undefined) + canMangle = exportNameOrSpec.canMangle; + if (exportNameOrSpec.export !== undefined) + fromExport = exportNameOrSpec.export; + if (exportNameOrSpec.exports !== undefined) + exports = exportNameOrSpec.exports; + if (exportNameOrSpec.from !== undefined) + from = exportNameOrSpec.from; + if (exportNameOrSpec.priority !== undefined) + priority = exportNameOrSpec.priority; + if (exportNameOrSpec.terminalBinding !== undefined) + terminalBinding = exportNameOrSpec.terminalBinding; + if (exportNameOrSpec.hidden !== undefined) + hidden = exportNameOrSpec.hidden; + } + const exportInfo = exportsInfo.getExportInfo(name); - if ( - exportInfo.provided === false || - exportInfo.provided === null - ) { - exportInfo.provided = true; - changed = true; - } + if ( + exportInfo.provided === false || + exportInfo.provided === null + ) { + exportInfo.provided = true; + changed = true; + } - if ( - exportInfo.canMangleProvide !== false && - canMangle === false - ) { - exportInfo.canMangleProvide = false; - changed = true; - } + if ( + exportInfo.canMangleProvide !== false && + canMangle === false + ) { + exportInfo.canMangleProvide = false; + changed = true; + } - if (terminalBinding && !exportInfo.terminalBinding) { - exportInfo.terminalBinding = true; - changed = true; - } + if (terminalBinding && !exportInfo.terminalBinding) { + exportInfo.terminalBinding = true; + changed = true; + } - if (exports) { - const nestedExportsInfo = - exportInfo.createNestedExportsInfo(); - mergeExports(nestedExportsInfo, exports); - } + if (exports) { + const nestedExportsInfo = + exportInfo.createNestedExportsInfo(); + mergeExports(nestedExportsInfo, exports); + } - if ( - from && - (hidden - ? exportInfo.unsetTarget(dep) - : exportInfo.setTarget( - dep, - from, - fromExport === undefined ? [name] : fromExport, - priority - )) - ) { - changed = true; - } + if ( + from && + (hidden + ? exportInfo.unsetTarget(dep) + : exportInfo.setTarget( + dep, + from, + fromExport === undefined ? [name] : fromExport, + priority + )) + ) { + changed = true; + } - // Recalculate target exportsInfo - const target = exportInfo.getTarget(moduleGraph); - let targetExportsInfo = undefined; - if (target) { - const targetModuleExportsInfo = - moduleGraph.getExportsInfo(target.module); - targetExportsInfo = - targetModuleExportsInfo.getNestedExportsInfo( - target.export - ); - // add dependency for this module - const set = dependencies.get(target.module); - if (set === undefined) { - dependencies.set(target.module, new Set([module])); - } else { - set.add(module); - } + // Recalculate target exportsInfo + const target = exportInfo.getTarget(moduleGraph); + let targetExportsInfo = undefined; + if (target) { + const targetModuleExportsInfo = + moduleGraph.getExportsInfo(target.module); + targetExportsInfo = + targetModuleExportsInfo.getNestedExportsInfo( + target.export + ); + // add dependency for this module + const set = dependencies.get(target.module); + if (set === undefined) { + dependencies.set(target.module, new Set([module])); + } else { + set.add(module); } + } - if (exportInfo.exportsInfoOwned) { - if ( - exportInfo.exportsInfo.setRedirectNamedTo( - targetExportsInfo - ) - ) { - changed = true; - } - } else if ( - exportInfo.exportsInfo !== targetExportsInfo + if (exportInfo.exportsInfoOwned) { + if ( + exportInfo.exportsInfo.setRedirectNamedTo( + targetExportsInfo + ) ) { - exportInfo.exportsInfo = targetExportsInfo; changed = true; } - } - }; - mergeExports(exportsInfo, exports); - } - // store dependencies - if (exportDeps) { - cacheable = false; - for (const exportDependency of exportDeps) { - // add dependency for this module - const set = dependencies.get(exportDependency); - if (set === undefined) { - dependencies.set(exportDependency, new Set([module])); - } else { - set.add(module); + } else if (exportInfo.exportsInfo !== targetExportsInfo) { + exportInfo.exportsInfo = targetExportsInfo; + changed = true; } } + }; + mergeExports(exportsInfo, exports); + } + // store dependencies + if (exportDeps) { + cacheable = false; + for (const exportDependency of exportDeps) { + // add dependency for this module + const set = dependencies.get(exportDependency); + if (set === undefined) { + dependencies.set(exportDependency, new Set([module])); + } else { + set.add(module); + } } - }; + } + }; - const notifyDependencies = () => { - const deps = dependencies.get(module); - if (deps !== undefined) { - for (const dep of deps) { - queue.enqueue(dep); - } + const notifyDependencies = () => { + const deps = dependencies.get(module); + if (deps !== undefined) { + for (const dep of deps) { + queue.enqueue(dep); } - }; + } + }; - logger.time("figure out provided exports"); - while (queue.length > 0) { - module = queue.dequeue(); + logger.time("figure out provided exports"); + while (queue.length > 0) { + module = queue.dequeue(); - statQueueItemsProcessed++; + statQueueItemsProcessed++; - exportsInfo = moduleGraph.getExportsInfo(module); + exportsInfo = moduleGraph.getExportsInfo(module); - cacheable = true; - changed = false; + cacheable = true; + changed = false; - exportsSpecsFromDependencies.clear(); - moduleGraph.freeze(); - processDependenciesBlock(module); - moduleGraph.unfreeze(); - for (const [ - dep, - exportsSpec - ] of exportsSpecsFromDependencies) { - processExportsSpec(dep, exportsSpec); - } + exportsSpecsFromDependencies.clear(); + moduleGraph.freeze(); + processDependenciesBlock(module); + moduleGraph.unfreeze(); + for (const [dep, exportsSpec] of exportsSpecsFromDependencies) { + processExportsSpec(dep, exportsSpec); + } - if (cacheable) { - modulesToStore.add(module); - } + if (cacheable) { + modulesToStore.add(module); + } - if (changed) { - notifyDependencies(); - } + if (changed) { + notifyDependencies(); } - logger.timeEnd("figure out provided exports"); + } + logger.timeEnd("figure out provided exports"); - logger.log( - `${Math.round( - (100 * (statFlaggedUncached + statNotCached)) / - (statRestoredFromMemCache + - statRestoredFromCache + - statNotCached + - statFlaggedUncached + - statNoExports) - )}% of exports of modules have been determined (${statNoExports} no declared exports, ${statNotCached} not cached, ${statFlaggedUncached} flagged uncacheable, ${statRestoredFromCache} from cache, ${statRestoredFromMemCache} from mem cache, ${ - statQueueItemsProcessed - - statNotCached - - statFlaggedUncached - } additional calculations due to dependencies)` - ); + logger.log( + `${Math.round( + (100 * (statFlaggedUncached + statNotCached)) / + (statRestoredFromMemCache + + statRestoredFromCache + + statNotCached + + statFlaggedUncached + + statNoExports) + )}% of exports of modules have been determined (${statNoExports} no declared exports, ${statNotCached} not cached, ${statFlaggedUncached} flagged uncacheable, ${statRestoredFromCache} from cache, ${statRestoredFromMemCache} from mem cache, ${ + statQueueItemsProcessed - statNotCached - statFlaggedUncached + } additional calculations due to dependencies)` + ); - logger.time("store provided exports into cache"); - asyncLib.each( - modulesToStore, - (module, callback) => { - if (typeof module.buildInfo.hash !== "string") { - // not cacheable - return callback(); - } - const cachedData = moduleGraph - .getExportsInfo(module) - .getRestoreProvidedData(); - const memCache = - moduleMemCaches && moduleMemCaches.get(module); - if (memCache) { - memCache.set(this, cachedData); - } - cache.store( - module.identifier(), - module.buildInfo.hash, - cachedData, - callback - ); - }, - err => { - logger.timeEnd("store provided exports into cache"); - callback(err); + logger.time("store provided exports into cache"); + asyncLib.each( + modulesToStore, + (module, callback) => { + if (typeof module.buildInfo.hash !== "string") { + // not cacheable + return callback(); } - ); - } - ); - } - ); + const cachedData = moduleGraph + .getExportsInfo(module) + .getRestoreProvidedData(); + const memCache = + moduleMemCaches && moduleMemCaches.get(module); + if (memCache) { + memCache.set(this, cachedData); + } + cache.store( + module.identifier(), + module.buildInfo.hash, + cachedData, + callback + ); + }, + err => { + logger.timeEnd("store provided exports into cache"); + callback(err); + } + ); + } + ); + } + ); - /** @type {WeakMap} */ - const providedExportsCache = new WeakMap(); - compilation.hooks.rebuildModule.tap( - "FlagDependencyExportsPlugin", - module => { - providedExportsCache.set( - module, - moduleGraph.getExportsInfo(module).getRestoreProvidedData() - ); - } - ); - compilation.hooks.finishRebuildingModule.tap( - "FlagDependencyExportsPlugin", - module => { - moduleGraph - .getExportsInfo(module) - .restoreProvided(providedExportsCache.get(module)); - } + /** @type {WeakMap} */ + const providedExportsCache = new WeakMap(); + compilation.hooks.rebuildModule.tap(PLUGIN_NAME, module => { + providedExportsCache.set( + module, + moduleGraph.getExportsInfo(module).getRestoreProvidedData() ); - } - ); + }); + compilation.hooks.finishRebuildingModule.tap(PLUGIN_NAME, module => { + moduleGraph + .getExportsInfo(module) + .restoreProvided(providedExportsCache.get(module)); + }); + }); } } @@ -75135,7 +76701,7 @@ module.exports = FlagDependencyExportsPlugin; /***/ }), -/***/ 3232: +/***/ 46360: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -75146,13 +76712,13 @@ module.exports = FlagDependencyExportsPlugin; -const Dependency = __webpack_require__(68242); -const { UsageState } = __webpack_require__(1723); -const ModuleGraphConnection = __webpack_require__(17977); -const { STAGE_DEFAULT } = __webpack_require__(36760); -const ArrayQueue = __webpack_require__(45596); -const TupleQueue = __webpack_require__(27134); -const { getEntryRuntime, mergeRuntimeOwned } = __webpack_require__(55693); +const Dependency = __webpack_require__(504); +const { UsageState } = __webpack_require__(14768); +const ModuleGraphConnection = __webpack_require__(7976); +const { STAGE_DEFAULT } = __webpack_require__(6537); +const ArrayQueue = __webpack_require__(49425); +const TupleQueue = __webpack_require__(85379); +const { getEntryRuntime, mergeRuntimeOwned } = __webpack_require__(69965); /** @typedef {import("./Chunk")} Chunk */ /** @typedef {import("./ChunkGroup")} ChunkGroup */ @@ -75165,6 +76731,9 @@ const { getEntryRuntime, mergeRuntimeOwned } = __webpack_require__(55693); const { NO_EXPORTS_REFERENCED, EXPORTS_OBJECT_REFERENCED } = Dependency; +const PLUGIN_NAME = "FlagDependencyUsagePlugin"; +const PLUGIN_LOGGER_NAME = `webpack.${PLUGIN_NAME}`; + class FlagDependencyUsagePlugin { /** * @param {boolean} global do a global analysis instead of per runtime @@ -75179,13 +76748,10 @@ class FlagDependencyUsagePlugin { * @returns {void} */ apply(compiler) { - compiler.hooks.compilation.tap("FlagDependencyUsagePlugin", compilation => { + compiler.hooks.compilation.tap(PLUGIN_NAME, compilation => { const moduleGraph = compilation.moduleGraph; compilation.hooks.optimizeDependencies.tap( - { - name: "FlagDependencyUsagePlugin", - stage: STAGE_DEFAULT - }, + { name: PLUGIN_NAME, stage: STAGE_DEFAULT }, modules => { if (compilation.moduleMemCaches) { throw new Error( @@ -75193,9 +76759,7 @@ class FlagDependencyUsagePlugin { ); } - const logger = compilation.getLogger( - "webpack.FlagDependencyUsagePlugin" - ); + const logger = compilation.getLogger(PLUGIN_LOGGER_NAME); /** @type {Map} */ const exportInfoToModuleMap = new Map(); @@ -75475,7 +77039,9 @@ class FlagDependencyUsagePlugin { } while (queue.length) { - const [module, runtime] = queue.dequeue(); + const [module, runtime] = /** @type {[Module, RuntimeSpec]} */ ( + queue.dequeue() + ); processModule(module, runtime, false); } logger.timeEnd("trace exports usage in graph"); @@ -75490,7 +77056,7 @@ module.exports = FlagDependencyUsagePlugin; /***/ }), -/***/ 8635: +/***/ 58387: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -75541,6 +77107,10 @@ module.exports = FlagDependencyUsagePlugin; * */ class Generator { + /** + * @param {Record} map map of types + * @returns {ByTypeGenerator} generator by type + */ static byType(map) { return new ByTypeGenerator(map); } @@ -75552,7 +77122,7 @@ class Generator { * @returns {Set} available types (do not mutate) */ getTypes(module) { - const AbstractMethodError = __webpack_require__(26907); + const AbstractMethodError = __webpack_require__(9906); throw new AbstractMethodError(); } @@ -75564,7 +77134,7 @@ class Generator { * @returns {number} estimate size of the module */ getSize(module, type) { - const AbstractMethodError = __webpack_require__(26907); + const AbstractMethodError = __webpack_require__(9906); throw new AbstractMethodError(); } @@ -75579,7 +77149,7 @@ class Generator { module, { dependencyTemplates, runtimeTemplate, moduleGraph, type } ) { - const AbstractMethodError = __webpack_require__(26907); + const AbstractMethodError = __webpack_require__(9906); throw new AbstractMethodError(); } @@ -75602,6 +77172,9 @@ class Generator { } class ByTypeGenerator extends Generator { + /** + * @param {Record} map map of types + */ constructor(map) { super(); this.map = map; @@ -75647,7 +77220,7 @@ module.exports = Generator; /***/ }), -/***/ 3093: +/***/ 90461: /***/ (function(__unused_webpack_module, exports) { "use strict"; @@ -75692,7 +77265,7 @@ exports.connectChunkGroupParentAndChild = connectChunkGroupParentAndChild; /***/ }), -/***/ 71905: +/***/ 63325: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -75702,7 +77275,7 @@ exports.connectChunkGroupParentAndChild = connectChunkGroupParentAndChild; -const WebpackError = __webpack_require__(10841); +const WebpackError = __webpack_require__(49999); module.exports = class HarmonyLinkingError extends WebpackError { /** @param {string} message Error message */ @@ -75716,7 +77289,7 @@ module.exports = class HarmonyLinkingError extends WebpackError { /***/ }), -/***/ 88608: +/***/ 39319: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -75727,7 +77300,7 @@ module.exports = class HarmonyLinkingError extends WebpackError { -const WebpackError = __webpack_require__(10841); +const WebpackError = __webpack_require__(49999); /** @typedef {import("./Module")} Module */ @@ -75807,7 +77380,7 @@ const tryRunOrWebpackError = (fn, hook) => { if (err instanceof WebpackError) { throw err; } - throw new HookWebpackError(err, hook); + throw new HookWebpackError(/** @type {Error} */ (err), hook); } return r; }; @@ -75817,7 +77390,7 @@ module.exports.tryRunOrWebpackError = tryRunOrWebpackError; /***/ }), -/***/ 92837: +/***/ 41490: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -75830,25 +77403,25 @@ module.exports.tryRunOrWebpackError = tryRunOrWebpackError; const { SyncBailHook } = __webpack_require__(70793); const { RawSource } = __webpack_require__(59728); -const ChunkGraph = __webpack_require__(64438); -const Compilation = __webpack_require__(38292); -const HotUpdateChunk = __webpack_require__(72873); -const NormalModule = __webpack_require__(55443); -const RuntimeGlobals = __webpack_require__(34623); -const WebpackError = __webpack_require__(10841); -const ConstDependency = __webpack_require__(78284); -const ImportMetaHotAcceptDependency = __webpack_require__(46209); -const ImportMetaHotDeclineDependency = __webpack_require__(47713); -const ModuleHotAcceptDependency = __webpack_require__(92807); -const ModuleHotDeclineDependency = __webpack_require__(74213); -const HotModuleReplacementRuntimeModule = __webpack_require__(78630); -const JavascriptParser = __webpack_require__(23628); +const ChunkGraph = __webpack_require__(84275); +const Compilation = __webpack_require__(20417); +const HotUpdateChunk = __webpack_require__(80065); +const NormalModule = __webpack_require__(17318); +const RuntimeGlobals = __webpack_require__(61539); +const WebpackError = __webpack_require__(49999); +const ConstDependency = __webpack_require__(67538); +const ImportMetaHotAcceptDependency = __webpack_require__(95698); +const ImportMetaHotDeclineDependency = __webpack_require__(99022); +const ModuleHotAcceptDependency = __webpack_require__(19647); +const ModuleHotDeclineDependency = __webpack_require__(5341); +const HotModuleReplacementRuntimeModule = __webpack_require__(38839); +const JavascriptParser = __webpack_require__(27865); const { evaluateToIdentifier -} = __webpack_require__(645); -const { find, isSubset } = __webpack_require__(97045); -const TupleSet = __webpack_require__(97638); -const { compareModulesById } = __webpack_require__(29355); +} = __webpack_require__(94213); +const { find, isSubset } = __webpack_require__(24352); +const TupleSet = __webpack_require__(14223); +const { compareModulesById } = __webpack_require__(95978); const { getRuntimeKey, keyToRuntime, @@ -75856,7 +77429,14 @@ const { mergeRuntimeOwned, subtractRuntime, intersectRuntime -} = __webpack_require__(55693); +} = __webpack_require__(69965); + +const { + JAVASCRIPT_MODULE_TYPE_AUTO, + JAVASCRIPT_MODULE_TYPE_DYNAMIC, + JAVASCRIPT_MODULE_TYPE_ESM, + WEBPACK_MODULE_TYPE_RUNTIME +} = __webpack_require__(92891); /** @typedef {import("./Chunk")} Chunk */ /** @typedef {import("./Compilation").AssetInfo} AssetInfo */ @@ -75874,6 +77454,8 @@ const { /** @type {WeakMap} */ const parserHooksMap = new WeakMap(); +const PLUGIN_NAME = "HotModuleReplacementPlugin"; + class HotModuleReplacementPlugin { /** * @param {JavascriptParser} parser the parser @@ -76003,10 +77585,14 @@ class HotModuleReplacementPlugin { return true; }; + /** + * @param {JavascriptParser} parser the parser + * @returns {void} + */ const applyModuleHot = parser => { parser.hooks.evaluateIdentifier.for("module.hot").tap( { - name: "HotModuleReplacementPlugin", + name: PLUGIN_NAME, before: "NodeStuffPlugin" }, expr => { @@ -76021,24 +77607,28 @@ class HotModuleReplacementPlugin { parser.hooks.call .for("module.hot.accept") .tap( - "HotModuleReplacementPlugin", + PLUGIN_NAME, createAcceptHandler(parser, ModuleHotAcceptDependency) ); parser.hooks.call .for("module.hot.decline") .tap( - "HotModuleReplacementPlugin", + PLUGIN_NAME, createDeclineHandler(parser, ModuleHotDeclineDependency) ); parser.hooks.expression .for("module.hot") - .tap("HotModuleReplacementPlugin", createHMRExpressionHandler(parser)); + .tap(PLUGIN_NAME, createHMRExpressionHandler(parser)); }; + /** + * @param {JavascriptParser} parser the parser + * @returns {void} + */ const applyImportMetaHot = parser => { parser.hooks.evaluateIdentifier .for("import.meta.webpackHot") - .tap("HotModuleReplacementPlugin", expr => { + .tap(PLUGIN_NAME, expr => { return evaluateToIdentifier( "import.meta.webpackHot", "import.meta", @@ -76049,22 +77639,22 @@ class HotModuleReplacementPlugin { parser.hooks.call .for("import.meta.webpackHot.accept") .tap( - "HotModuleReplacementPlugin", + PLUGIN_NAME, createAcceptHandler(parser, ImportMetaHotAcceptDependency) ); parser.hooks.call .for("import.meta.webpackHot.decline") .tap( - "HotModuleReplacementPlugin", + PLUGIN_NAME, createDeclineHandler(parser, ImportMetaHotDeclineDependency) ); parser.hooks.expression .for("import.meta.webpackHot") - .tap("HotModuleReplacementPlugin", createHMRExpressionHandler(parser)); + .tap(PLUGIN_NAME, createHMRExpressionHandler(parser)); }; compiler.hooks.compilation.tap( - "HotModuleReplacementPlugin", + PLUGIN_NAME, (compilation, { normalModuleFactory }) => { // This applies the HMR plugin only to the targeted compiler // It should not affect child compilations @@ -76112,40 +77702,37 @@ class HotModuleReplacementPlugin { const fullHashChunkModuleHashes = {}; const chunkModuleHashes = {}; - compilation.hooks.record.tap( - "HotModuleReplacementPlugin", - (compilation, records) => { - if (records.hash === compilation.hash) return; - const chunkGraph = compilation.chunkGraph; - records.hash = compilation.hash; - records.hotIndex = hotIndex; - records.fullHashChunkModuleHashes = fullHashChunkModuleHashes; - records.chunkModuleHashes = chunkModuleHashes; - records.chunkHashes = {}; - records.chunkRuntime = {}; - for (const chunk of compilation.chunks) { - records.chunkHashes[chunk.id] = chunk.hash; - records.chunkRuntime[chunk.id] = getRuntimeKey(chunk.runtime); - } - records.chunkModuleIds = {}; - for (const chunk of compilation.chunks) { - records.chunkModuleIds[chunk.id] = Array.from( - chunkGraph.getOrderedChunkModulesIterable( - chunk, - compareModulesById(chunkGraph) - ), - m => chunkGraph.getModuleId(m) - ); - } + compilation.hooks.record.tap(PLUGIN_NAME, (compilation, records) => { + if (records.hash === compilation.hash) return; + const chunkGraph = compilation.chunkGraph; + records.hash = compilation.hash; + records.hotIndex = hotIndex; + records.fullHashChunkModuleHashes = fullHashChunkModuleHashes; + records.chunkModuleHashes = chunkModuleHashes; + records.chunkHashes = {}; + records.chunkRuntime = {}; + for (const chunk of compilation.chunks) { + records.chunkHashes[chunk.id] = chunk.hash; + records.chunkRuntime[chunk.id] = getRuntimeKey(chunk.runtime); } - ); + records.chunkModuleIds = {}; + for (const chunk of compilation.chunks) { + records.chunkModuleIds[chunk.id] = Array.from( + chunkGraph.getOrderedChunkModulesIterable( + chunk, + compareModulesById(chunkGraph) + ), + m => chunkGraph.getModuleId(m) + ); + } + }); /** @type {TupleSet<[Module, Chunk]>} */ const updatedModules = new TupleSet(); /** @type {TupleSet<[Module, Chunk]>} */ const fullHashModules = new TupleSet(); /** @type {TupleSet<[Module, RuntimeSpec]>} */ const nonCodeGeneratedModules = new TupleSet(); - compilation.hooks.fullHash.tap("HotModuleReplacementPlugin", hash => { + compilation.hooks.fullHash.tap(PLUGIN_NAME, hash => { const chunkGraph = compilation.chunkGraph; const records = compilation.records; for (const chunk of compilation.chunks) { @@ -76235,7 +77822,7 @@ class HotModuleReplacementPlugin { }); compilation.hooks.processAssets.tap( { - name: "HotModuleReplacementPlugin", + name: PLUGIN_NAME, stage: Compilation.PROCESS_ASSETS_STAGE_ADDITIONAL }, () => { @@ -76382,7 +77969,7 @@ class HotModuleReplacementPlugin { newRuntime ); if (hash !== oldHash) { - if (module.type === "runtime") { + if (module.type === WEBPACK_MODULE_TYPE_RUNTIME) { newRuntimeModules = newRuntimeModules || []; newRuntimeModules.push( /** @type {RuntimeModule} */ (module) @@ -76557,7 +78144,7 @@ To fix this, make sure to include [runtime] in the output.hotUpdateMainFilename ); compilation.hooks.additionalTreeRuntimeRequirements.tap( - "HotModuleReplacementPlugin", + PLUGIN_NAME, (chunk, runtimeRequirements) => { runtimeRequirements.add(RuntimeGlobals.hmrDownloadManifest); runtimeRequirements.add(RuntimeGlobals.hmrDownloadUpdateHandlers); @@ -76571,24 +78158,24 @@ To fix this, make sure to include [runtime] in the output.hotUpdateMainFilename ); normalModuleFactory.hooks.parser - .for("javascript/auto") - .tap("HotModuleReplacementPlugin", parser => { + .for(JAVASCRIPT_MODULE_TYPE_AUTO) + .tap(PLUGIN_NAME, parser => { applyModuleHot(parser); applyImportMetaHot(parser); }); normalModuleFactory.hooks.parser - .for("javascript/dynamic") - .tap("HotModuleReplacementPlugin", parser => { + .for(JAVASCRIPT_MODULE_TYPE_DYNAMIC) + .tap(PLUGIN_NAME, parser => { applyModuleHot(parser); }); normalModuleFactory.hooks.parser - .for("javascript/esm") - .tap("HotModuleReplacementPlugin", parser => { + .for(JAVASCRIPT_MODULE_TYPE_ESM) + .tap(PLUGIN_NAME, parser => { applyImportMetaHot(parser); }); NormalModule.getCompilationHooks(compilation).loader.tap( - "HotModuleReplacementPlugin", + PLUGIN_NAME, context => { context.hot = true; } @@ -76603,7 +78190,7 @@ module.exports = HotModuleReplacementPlugin; /***/ }), -/***/ 72873: +/***/ 80065: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -76614,7 +78201,7 @@ module.exports = HotModuleReplacementPlugin; -const Chunk = __webpack_require__(67732); +const Chunk = __webpack_require__(93399); /** @typedef {import("./ChunkGraph")} ChunkGraph */ /** @typedef {import("./util/Hash")} Hash */ @@ -76630,7 +78217,7 @@ module.exports = HotUpdateChunk; /***/ }), -/***/ 78625: +/***/ 46837: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -76641,7 +78228,7 @@ module.exports = HotUpdateChunk; -const ModuleFactory = __webpack_require__(10149); +const ModuleFactory = __webpack_require__(60667); /** @typedef {import("./ModuleFactory").ModuleFactoryCreateData} ModuleFactoryCreateData */ /** @typedef {import("./ModuleFactory").ModuleFactoryResult} ModuleFactoryResult */ @@ -76662,7 +78249,7 @@ class IgnoreErrorModuleFactory extends ModuleFactory { /** * @param {ModuleFactoryCreateData} data data object - * @param {function(Error=, ModuleFactoryResult=): void} callback callback + * @param {function((Error | null)=, ModuleFactoryResult=): void} callback callback * @returns {void} */ create(data, callback) { @@ -76677,7 +78264,7 @@ module.exports = IgnoreErrorModuleFactory; /***/ }), -/***/ 5563: +/***/ 42441: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -76688,15 +78275,15 @@ module.exports = IgnoreErrorModuleFactory; -const createSchemaValidation = __webpack_require__(94091); +const createSchemaValidation = __webpack_require__(45488); /** @typedef {import("../declarations/plugins/IgnorePlugin").IgnorePluginOptions} IgnorePluginOptions */ /** @typedef {import("./Compiler")} Compiler */ /** @typedef {import("./NormalModuleFactory").ResolveData} ResolveData */ const validate = createSchemaValidation( - __webpack_require__(30390), - () => __webpack_require__(5574), + __webpack_require__(9012), + () => __webpack_require__(72453), { name: "Ignore Plugin", baseDataPath: "options" @@ -76768,7 +78355,7 @@ module.exports = IgnorePlugin; /***/ }), -/***/ 1220: +/***/ 54251: /***/ (function(module) { "use strict"; @@ -76815,7 +78402,7 @@ module.exports = IgnoreWarningsPlugin; /***/ }), -/***/ 53658: +/***/ 44508: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -76827,21 +78414,25 @@ module.exports = IgnoreWarningsPlugin; const { ConcatSource } = __webpack_require__(59728); -const makeSerializable = __webpack_require__(23827); +const makeSerializable = __webpack_require__(83626); /** @typedef {import("webpack-sources").Source} Source */ /** @typedef {import("./Generator").GenerateContext} GenerateContext */ +/** @typedef {import("./serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */ +/** @typedef {import("./serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */ /** - * @param {InitFragment} fragment the init fragment + * @template T + * @param {InitFragment} fragment the init fragment * @param {number} index index - * @returns {[InitFragment, number]} tuple with both + * @returns {[InitFragment, number]} tuple with both */ const extractFragmentIndex = (fragment, index) => [fragment, index]; /** - * @param {[InitFragment, number]} a first pair - * @param {[InitFragment, number]} b second pair + * @template T + * @param {[InitFragment, number]} a first pair + * @param {[InitFragment, number]} b second pair * @returns {number} sort value */ const sortFragmentWithIndex = ([a, i], [b, j]) => { @@ -76887,6 +78478,14 @@ class InitFragment { return this.endContent; } + /** + * @template Context + * @template T + * @param {Source} source sources + * @param {InitFragment[]} initFragments init fragments + * @param {Context} context context + * @returns {Source} source + */ static addToSource(source, initFragments, context) { if (initFragments.length > 0) { // Sort fragments by position. If 2 fragments have the same position, @@ -76898,7 +78497,12 @@ class InitFragment { // Deduplicate fragments. If a fragment has no key, it is always included. const keyedFragments = new Map(); for (const [fragment] of sortedFragments) { - if (typeof fragment.mergeAll === "function") { + if ( + typeof ( + /** @type {InitFragment & { mergeAll?: (fragments: InitFragment[]) => InitFragment[] }} */ + (fragment).mergeAll + ) === "function" + ) { if (!fragment.key) { throw new Error( `InitFragment with mergeAll function must have a valid key: ${fragment.constructor.name}` @@ -76946,6 +78550,9 @@ class InitFragment { } } + /** + * @param {ObjectSerializerContext} context context + */ serialize(context) { const { write } = context; @@ -76956,6 +78563,9 @@ class InitFragment { write(this.endContent); } + /** + * @param {ObjectDeserializerContext} context context + */ deserialize(context) { const { read } = context; @@ -76984,7 +78594,7 @@ module.exports = InitFragment; /***/ }), -/***/ 33869: +/***/ 14086: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -76995,8 +78605,8 @@ module.exports = InitFragment; -const WebpackError = __webpack_require__(10841); -const makeSerializable = __webpack_require__(23827); +const WebpackError = __webpack_require__(49999); +const makeSerializable = __webpack_require__(83626); /** @typedef {import("./Dependency").DependencyLocation} DependencyLocation */ /** @typedef {import("./Module")} Module */ @@ -77036,7 +78646,7 @@ module.exports = InvalidDependenciesModuleWarning; /***/ }), -/***/ 46056: +/***/ 12506: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -77047,11 +78657,19 @@ module.exports = InvalidDependenciesModuleWarning; -const InnerGraph = __webpack_require__(91424); +const { + JAVASCRIPT_MODULE_TYPE_AUTO, + JAVASCRIPT_MODULE_TYPE_DYNAMIC, + JAVASCRIPT_MODULE_TYPE_ESM +} = __webpack_require__(92891); +const InnerGraph = __webpack_require__(53310); /** @typedef {import("./Compiler")} Compiler */ +/** @typedef {import("./Module").BuildInfo} BuildInfo */ /** @typedef {import("./javascript/JavascriptParser")} JavascriptParser */ +const PLUGIN_NAME = "JavascriptMetaInfoPlugin"; + class JavascriptMetaInfoPlugin { /** * Apply the plugin @@ -77060,16 +78678,19 @@ class JavascriptMetaInfoPlugin { */ apply(compiler) { compiler.hooks.compilation.tap( - "JavascriptMetaInfoPlugin", + PLUGIN_NAME, (compilation, { normalModuleFactory }) => { /** * @param {JavascriptParser} parser the parser * @returns {void} */ const handler = parser => { - parser.hooks.call.for("eval").tap("JavascriptMetaInfoPlugin", () => { - parser.state.module.buildInfo.moduleConcatenationBailout = "eval()"; - parser.state.module.buildInfo.usingEval = true; + parser.hooks.call.for("eval").tap(PLUGIN_NAME, () => { + const buildInfo = + /** @type {BuildInfo} */ + (parser.state.module.buildInfo); + buildInfo.moduleConcatenationBailout = "eval()"; + buildInfo.usingEval = true; const currentSymbol = InnerGraph.getTopLevelSymbol(parser.state); if (currentSymbol) { InnerGraph.addUsage(parser.state, null, currentSymbol); @@ -77077,12 +78698,13 @@ class JavascriptMetaInfoPlugin { InnerGraph.bailout(parser.state); } }); - parser.hooks.finish.tap("JavascriptMetaInfoPlugin", () => { - let topLevelDeclarations = - parser.state.module.buildInfo.topLevelDeclarations; + parser.hooks.finish.tap(PLUGIN_NAME, () => { + const buildInfo = + /** @type {BuildInfo} */ + (parser.state.module.buildInfo); + let topLevelDeclarations = buildInfo.topLevelDeclarations; if (topLevelDeclarations === undefined) { - topLevelDeclarations = - parser.state.module.buildInfo.topLevelDeclarations = new Set(); + topLevelDeclarations = buildInfo.topLevelDeclarations = new Set(); } for (const name of parser.scope.definitions.asSet()) { const freeInfo = parser.getFreeInfoFromVariable(name); @@ -77094,14 +78716,14 @@ class JavascriptMetaInfoPlugin { }; normalModuleFactory.hooks.parser - .for("javascript/auto") - .tap("JavascriptMetaInfoPlugin", handler); + .for(JAVASCRIPT_MODULE_TYPE_AUTO) + .tap(PLUGIN_NAME, handler); normalModuleFactory.hooks.parser - .for("javascript/dynamic") - .tap("JavascriptMetaInfoPlugin", handler); + .for(JAVASCRIPT_MODULE_TYPE_DYNAMIC) + .tap(PLUGIN_NAME, handler); normalModuleFactory.hooks.parser - .for("javascript/esm") - .tap("JavascriptMetaInfoPlugin", handler); + .for(JAVASCRIPT_MODULE_TYPE_ESM) + .tap(PLUGIN_NAME, handler); } ); } @@ -77112,7 +78734,7 @@ module.exports = JavascriptMetaInfoPlugin; /***/ }), -/***/ 96138: +/***/ 96577: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -77124,21 +78746,35 @@ module.exports = JavascriptMetaInfoPlugin; const asyncLib = __webpack_require__(47087); -const EntryDependency = __webpack_require__(54511); -const { someInIterable } = __webpack_require__(99958); -const { compareModulesById } = __webpack_require__(29355); -const { dirname, mkdirp } = __webpack_require__(33139); +const EntryDependency = __webpack_require__(49787); +const { someInIterable } = __webpack_require__(12281); +const { compareModulesById } = __webpack_require__(95978); +const { dirname, mkdirp } = __webpack_require__(96220); /** @typedef {import("./Compiler")} Compiler */ +/** @typedef {import("./Module").BuildMeta} BuildMeta */ /** * @typedef {Object} ManifestModuleData * @property {string | number} id - * @property {Object} buildMeta - * @property {boolean | string[]} exports + * @property {BuildMeta} buildMeta + * @property {boolean | string[] | undefined} exports + */ + +/** + * @typedef {Object} LibManifestPluginOptions + * @property {string=} context Context of requests in the manifest file (defaults to the webpack context). + * @property {boolean=} entryOnly If true, only entry points will be exposed (default: true). + * @property {boolean=} format If true, manifest json file (output) will be formatted. + * @property {string=} name Name of the exposed dll function (external name, use value of 'output.library'). + * @property {string} path Absolute path to the manifest json file (output). + * @property {string=} type Type of the dll bundle (external type, use value of 'output.libraryTarget'). */ class LibManifestPlugin { + /** + * @param {LibManifestPluginOptions} options the options + */ constructor(options) { this.options = options; } @@ -77167,7 +78803,8 @@ class LibManifestPlugin { const name = this.options.name && compilation.getPath(this.options.name, { - chunk + chunk, + contentHashType: "javascript" }); const content = Object.create(null); for (const module of chunkGraph.getOrderedChunkModulesIterable( @@ -77184,7 +78821,9 @@ class LibManifestPlugin { continue; } const ident = module.libIdent({ - context: this.options.context || compiler.options.context, + context: + this.options.context || + /** @type {string} */ (compiler.options.context), associatedObjectForCache: compiler.root }); if (ident) { @@ -77193,7 +78832,7 @@ class LibManifestPlugin { /** @type {ManifestModuleData} */ const data = { id: chunkGraph.getModuleId(module), - buildMeta: module.buildMeta, + buildMeta: /** @type {BuildMeta} */ (module.buildMeta), exports: Array.isArray(providedExports) ? providedExports : undefined @@ -77235,7 +78874,7 @@ module.exports = LibManifestPlugin; /***/ }), -/***/ 9398: +/***/ 72309: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -77246,7 +78885,7 @@ module.exports = LibManifestPlugin; -const EnableLibraryPlugin = __webpack_require__(3580); +const EnableLibraryPlugin = __webpack_require__(90487); /** @typedef {import("../declarations/WebpackOptions").AuxiliaryComment} AuxiliaryComment */ /** @typedef {import("../declarations/WebpackOptions").LibraryExport} LibraryExport */ @@ -77291,7 +78930,7 @@ module.exports = LibraryTemplatePlugin; /***/ }), -/***/ 26794: +/***/ 48423: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -77302,32 +78941,42 @@ module.exports = LibraryTemplatePlugin; -const ModuleFilenameHelpers = __webpack_require__(38738); -const NormalModule = __webpack_require__(55443); -const createSchemaValidation = __webpack_require__(94091); +const ModuleFilenameHelpers = __webpack_require__(82444); +const NormalModule = __webpack_require__(17318); +const createSchemaValidation = __webpack_require__(45488); /** @typedef {import("../declarations/plugins/LoaderOptionsPlugin").LoaderOptionsPluginOptions} LoaderOptionsPluginOptions */ /** @typedef {import("./Compiler")} Compiler */ +/** @typedef {import("./ModuleFilenameHelpers").MatchObject} MatchObject */ const validate = createSchemaValidation( - __webpack_require__(47951), - () => __webpack_require__(77781), + __webpack_require__(4008), + () => __webpack_require__(14772), { name: "Loader Options Plugin", baseDataPath: "options" } ); + class LoaderOptionsPlugin { /** - * @param {LoaderOptionsPluginOptions} options options object + * @param {LoaderOptionsPluginOptions & MatchObject} options options object */ constructor(options = {}) { validate(options); + // If no options are set then generate empty options object if (typeof options !== "object") options = {}; if (!options.test) { - options.test = { + // This is mocking a RegExp object which always returns true + // TODO: Figure out how to do `as unknown as RegExp` for this line + // in JSDoc equivalent + /** @type {any} */ + const defaultTrueMockRegExp = { test: () => true }; + + /** @type {RegExp} */ + options.test = defaultTrueMockRegExp; } this.options = options; } @@ -77370,7 +79019,7 @@ module.exports = LoaderOptionsPlugin; /***/ }), -/***/ 87343: +/***/ 26056: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -77381,7 +79030,7 @@ module.exports = LoaderOptionsPlugin; -const NormalModule = __webpack_require__(55443); +const NormalModule = __webpack_require__(17318); /** @typedef {import("./Compiler")} Compiler */ @@ -77415,7 +79064,7 @@ module.exports = LoaderTargetPlugin; /***/ }), -/***/ 58619: +/***/ 75078: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -77428,8 +79077,8 @@ module.exports = LoaderTargetPlugin; const { SyncWaterfallHook } = __webpack_require__(70793); const util = __webpack_require__(73837); -const RuntimeGlobals = __webpack_require__(34623); -const memoize = __webpack_require__(27319); +const RuntimeGlobals = __webpack_require__(61539); +const memoize = __webpack_require__(62377); /** @typedef {import("webpack-sources").ConcatSource} ConcatSource */ /** @typedef {import("webpack-sources").Source} Source */ @@ -77449,13 +79098,13 @@ const memoize = __webpack_require__(27319); /** @typedef {import("./Template").RenderManifestEntry} RenderManifestEntry} */ const getJavascriptModulesPlugin = memoize(() => - __webpack_require__(96230) + __webpack_require__(70061) ); const getJsonpTemplatePlugin = memoize(() => - __webpack_require__(93225) + __webpack_require__(21185) ); const getLoadScriptRuntimeModule = memoize(() => - __webpack_require__(13139) + __webpack_require__(94304) ); // TODO webpack 6 remove this class @@ -77727,8 +79376,8 @@ class MainTemplate { Object.defineProperty(MainTemplate.prototype, "requireFn", { get: util.deprecate( - () => "__webpack_require__", - 'MainTemplate.requireFn is deprecated (use "__webpack_require__")', + () => RuntimeGlobals.require, + `MainTemplate.requireFn is deprecated (use "${RuntimeGlobals.require}")`, "DEP_WEBPACK_MAIN_TEMPLATE_REQUIRE_FN" ) }); @@ -77752,7 +79401,7 @@ module.exports = MainTemplate; /***/ }), -/***/ 96040: +/***/ 6309: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -77764,13 +79413,13 @@ module.exports = MainTemplate; const util = __webpack_require__(73837); -const ChunkGraph = __webpack_require__(64438); -const DependenciesBlock = __webpack_require__(67493); -const ModuleGraph = __webpack_require__(85215); -const RuntimeGlobals = __webpack_require__(34623); -const { first } = __webpack_require__(97045); -const { compareChunksById } = __webpack_require__(29355); -const makeSerializable = __webpack_require__(23827); +const ChunkGraph = __webpack_require__(84275); +const DependenciesBlock = __webpack_require__(99939); +const ModuleGraph = __webpack_require__(43714); +const RuntimeGlobals = __webpack_require__(61539); +const { first } = __webpack_require__(24352); +const { compareChunksById } = __webpack_require__(95978); +const makeSerializable = __webpack_require__(83626); /** @typedef {import("webpack-sources").Source} Source */ /** @typedef {import("../declarations/WebpackOptions").ResolveOptions} ResolveOptions */ @@ -77786,11 +79435,14 @@ const makeSerializable = __webpack_require__(23827); /** @typedef {import("./ExportsInfo").UsageStateType} UsageStateType */ /** @typedef {import("./FileSystemInfo")} FileSystemInfo */ /** @typedef {import("./ModuleGraphConnection").ConnectionState} ConnectionState */ +/** @typedef {import("./ModuleTypeConstants").ModuleTypes} ModuleTypes */ /** @typedef {import("./NormalModuleFactory")} NormalModuleFactory */ /** @typedef {import("./RequestShortener")} RequestShortener */ /** @typedef {import("./ResolverFactory").ResolverWithOptions} ResolverWithOptions */ /** @typedef {import("./RuntimeTemplate")} RuntimeTemplate */ /** @typedef {import("./WebpackError")} WebpackError */ +/** @typedef {import("./serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */ +/** @typedef {import("./serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */ /** @typedef {import("./util/Hash")} Hash */ /** @template T @typedef {import("./util/LazySet")} LazySet */ /** @template T @typedef {import("./util/SortableSet")} SortableSet */ @@ -77862,6 +79514,12 @@ const makeSerializable = __webpack_require__(23827); */ /** @typedef {KnownBuildMeta & Record} BuildMeta */ +/** @typedef {Record} BuildInfo */ + +/** + * @typedef {Object} FactoryMeta + * @property {boolean=} sideEffectFree + */ const EMPTY_RESOLVE_OPTIONS = {}; @@ -77871,6 +79529,11 @@ const DEFAULT_TYPES_UNKNOWN = new Set(["unknown"]); const DEFAULT_TYPES_JS = new Set(["javascript"]); const deprecatedNeedRebuild = util.deprecate( + /** + * @param {Module} module the module + * @param {NeedBuildContext} context context info + * @returns {boolean} true, when rebuild is needed + */ (module, context) => { return module.needRebuild( context.fileSystemInfo.getDeprecatedFileTimestamps(), @@ -77885,14 +79548,14 @@ const deprecatedNeedRebuild = util.deprecate( class Module extends DependenciesBlock { /** - * @param {string} type the module type - * @param {string=} context an optional context - * @param {string=} layer an optional layer in which the module is + * @param {ModuleTypes | ""} type the module type, when deserializing the type is not known and is an empty string + * @param {(string | null)=} context an optional context + * @param {(string | null)=} layer an optional layer in which the module is */ constructor(type, context = null, layer = null) { super(); - /** @type {string} */ + /** @type {ModuleTypes} */ this.type = type; /** @type {string | null} */ this.context = context; @@ -77906,9 +79569,9 @@ class Module extends DependenciesBlock { this.debugId = debugId++; // Info from Factory - /** @type {ResolveOptions} */ + /** @type {ResolveOptions | undefined} */ this.resolveOptions = EMPTY_RESOLVE_OPTIONS; - /** @type {object | undefined} */ + /** @type {FactoryMeta | undefined} */ this.factoryMeta = undefined; // TODO refactor this -> options object filled from Factory // TODO webpack 6: use an enum @@ -77922,9 +79585,9 @@ class Module extends DependenciesBlock { this._warnings = undefined; /** @type {WebpackError[] | undefined} */ this._errors = undefined; - /** @type {BuildMeta} */ + /** @type {BuildMeta | undefined} */ this.buildMeta = undefined; - /** @type {Record} */ + /** @type {BuildInfo | undefined} */ this.buildInfo = undefined; /** @type {Dependency[] | undefined} */ this.presentationalDependencies = undefined; @@ -78086,6 +79749,10 @@ class Module extends DependenciesBlock { ); } + /** + * @param {Chunk} chunk the chunk + * @returns {boolean} true, when the module was added + */ addChunk(chunk) { const chunkGraph = ChunkGraph.getChunkGraphForModule( this, @@ -78097,6 +79764,10 @@ class Module extends DependenciesBlock { return true; } + /** + * @param {Chunk} chunk the chunk + * @returns {void} + */ removeChunk(chunk) { return ChunkGraph.getChunkGraphForModule( this, @@ -78105,6 +79776,10 @@ class Module extends DependenciesBlock { ).disconnectChunkAndModule(chunk, this); } + /** + * @param {Chunk} chunk the chunk + * @returns {boolean} true, when the module is in the chunk + */ isInChunk(chunk) { return ChunkGraph.getChunkGraphForModule( this, @@ -78176,7 +79851,7 @@ class Module extends DependenciesBlock { /** * @param {ModuleGraph} moduleGraph the module graph - * @param {boolean} strict the importing module is strict + * @param {boolean | undefined} strict the importing module is strict * @returns {"namespace" | "default-only" | "default-with-named" | "dynamic"} export type * "namespace": Exports is already a namespace object. namespace = exports. * "dynamic": Check at runtime if __esModule is set. When set: namespace = { ...exports, default: exports }. When not set: namespace = { default: exports }. @@ -78190,7 +79865,7 @@ class Module extends DependenciesBlock { case "namespace": return "namespace"; case "default": - switch (this.buildMeta.defaultObject) { + switch (/** @type {BuildMeta} */ (this.buildMeta).defaultObject) { case "redirect": return "default-with-named"; case "redirect-warn": @@ -78202,7 +79877,7 @@ class Module extends DependenciesBlock { if (strict) return "default-with-named"; // Try to figure out value of __esModule by following reexports const handleDefault = () => { - switch (this.buildMeta.defaultObject) { + switch (/** @type {BuildMeta} */ (this.buildMeta).defaultObject) { case "redirect": case "redirect-warn": return "default-with-named"; @@ -78419,7 +80094,7 @@ class Module extends DependenciesBlock { ] of moduleGraph.getIncomingConnectionsByOriginModule(this)) { if (!connections.some(c => c.isTargetActive(chunk.runtime))) continue; for (const originChunk of chunkGraph.getModuleChunksIterable( - fromModule + /** @type {Module} */ (fromModule) )) { // return true if module this is not reachable from originChunk when ignoring chunk if (!this.isAccessibleInChunk(chunkGraph, originChunk, chunk)) @@ -78511,7 +80186,7 @@ class Module extends DependenciesBlock { * @returns {string} a unique identifier of the module */ identifier() { - const AbstractMethodError = __webpack_require__(26907); + const AbstractMethodError = __webpack_require__(9906); throw new AbstractMethodError(); } @@ -78522,7 +80197,7 @@ class Module extends DependenciesBlock { * @returns {string} a user readable identifier of the module */ readableIdentifier(requestShortener) { - const AbstractMethodError = __webpack_require__(26907); + const AbstractMethodError = __webpack_require__(9906); throw new AbstractMethodError(); } @@ -78537,7 +80212,7 @@ class Module extends DependenciesBlock { * @returns {void} */ build(options, compilation, resolver, fs, callback) { - const AbstractMethodError = __webpack_require__(26907); + const AbstractMethodError = __webpack_require__(9906); throw new AbstractMethodError(); } @@ -78564,7 +80239,7 @@ class Module extends DependenciesBlock { */ source(dependencyTemplates, runtimeTemplate, type = "javascript") { if (this.codeGeneration === Module.prototype.codeGeneration) { - const AbstractMethodError = __webpack_require__(26907); + const AbstractMethodError = __webpack_require__(9906); throw new AbstractMethodError(); } const chunkGraph = ChunkGraph.getChunkGraphForModule( @@ -78592,7 +80267,7 @@ class Module extends DependenciesBlock { * @returns {number} the estimated size of the module (must be non-zero) */ size(type) { - const AbstractMethodError = __webpack_require__(26907); + const AbstractMethodError = __webpack_require__(9906); throw new AbstractMethodError(); } @@ -78734,6 +80409,9 @@ class Module extends DependenciesBlock { buildDependencies ) {} + /** + * @param {ObjectSerializerContext} context context + */ serialize(context) { const { write } = context; write(this.type); @@ -78760,6 +80438,9 @@ class Module extends DependenciesBlock { super.serialize(context); } + /** + * @param {ObjectDeserializerContext} context context + */ deserialize(context) { const { read } = context; this.type = read(); @@ -78854,7 +80535,7 @@ module.exports = Module; /***/ }), -/***/ 88916: +/***/ 25055: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -78865,9 +80546,12 @@ module.exports = Module; -const { cutOffLoaderExecution } = __webpack_require__(68390); -const WebpackError = __webpack_require__(10841); -const makeSerializable = __webpack_require__(23827); +const { cutOffLoaderExecution } = __webpack_require__(65206); +const WebpackError = __webpack_require__(49999); +const makeSerializable = __webpack_require__(83626); + +/** @typedef {import("./serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */ +/** @typedef {import("./serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */ class ModuleBuildError extends WebpackError { /** @@ -78915,6 +80599,9 @@ class ModuleBuildError extends WebpackError { this.error = err; } + /** + * @param {ObjectSerializerContext} context context + */ serialize(context) { const { write } = context; @@ -78923,6 +80610,9 @@ class ModuleBuildError extends WebpackError { super.serialize(context); } + /** + * @param {ObjectDeserializerContext} context context + */ deserialize(context) { const { read } = context; @@ -78939,7 +80629,7 @@ module.exports = ModuleBuildError; /***/ }), -/***/ 66524: +/***/ 8885: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -78950,7 +80640,7 @@ module.exports = ModuleBuildError; -const WebpackError = __webpack_require__(10841); +const WebpackError = __webpack_require__(49999); /** @typedef {import("./Dependency").DependencyLocation} DependencyLocation */ /** @typedef {import("./Module")} Module */ @@ -78968,7 +80658,7 @@ class ModuleDependencyError extends WebpackError { this.name = "ModuleDependencyError"; this.details = err && !(/** @type {any} */ (err).hideStack) - ? err.stack.split("\n").slice(1).join("\n") + ? /** @type {string} */ (err.stack).split("\n").slice(1).join("\n") : undefined; this.module = module; this.loc = loc; @@ -78977,7 +80667,9 @@ class ModuleDependencyError extends WebpackError { if (err && /** @type {any} */ (err).hideStack) { this.stack = - err.stack.split("\n").slice(1).join("\n") + "\n\n" + this.stack; + /** @type {string} */ (err.stack).split("\n").slice(1).join("\n") + + "\n\n" + + this.stack; } } } @@ -78987,7 +80679,7 @@ module.exports = ModuleDependencyError; /***/ }), -/***/ 93492: +/***/ 99391: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -78998,8 +80690,8 @@ module.exports = ModuleDependencyError; -const WebpackError = __webpack_require__(10841); -const makeSerializable = __webpack_require__(23827); +const WebpackError = __webpack_require__(49999); +const makeSerializable = __webpack_require__(83626); /** @typedef {import("./Dependency").DependencyLocation} DependencyLocation */ /** @typedef {import("./Module")} Module */ @@ -79016,7 +80708,7 @@ class ModuleDependencyWarning extends WebpackError { this.name = "ModuleDependencyWarning"; this.details = err && !(/** @type {any} */ (err).hideStack) - ? err.stack.split("\n").slice(1).join("\n") + ? /** @type {string} */ (err.stack).split("\n").slice(1).join("\n") : undefined; this.module = module; this.loc = loc; @@ -79025,7 +80717,9 @@ class ModuleDependencyWarning extends WebpackError { if (err && /** @type {any} */ (err).hideStack) { this.stack = - err.stack.split("\n").slice(1).join("\n") + "\n\n" + this.stack; + /** @type {string} */ (err.stack).split("\n").slice(1).join("\n") + + "\n\n" + + this.stack; } } } @@ -79040,7 +80734,7 @@ module.exports = ModuleDependencyWarning; /***/ }), -/***/ 18463: +/***/ 82923: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -79051,9 +80745,12 @@ module.exports = ModuleDependencyWarning; -const { cleanUp } = __webpack_require__(68390); -const WebpackError = __webpack_require__(10841); -const makeSerializable = __webpack_require__(23827); +const { cleanUp } = __webpack_require__(65206); +const WebpackError = __webpack_require__(49999); +const makeSerializable = __webpack_require__(83626); + +/** @typedef {import("./serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */ +/** @typedef {import("./serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */ class ModuleError extends WebpackError { /** @@ -79085,6 +80782,9 @@ class ModuleError extends WebpackError { : undefined; } + /** + * @param {ObjectSerializerContext} context context + */ serialize(context) { const { write } = context; @@ -79093,6 +80793,9 @@ class ModuleError extends WebpackError { super.serialize(context); } + /** + * @param {ObjectDeserializerContext} context context + */ deserialize(context) { const { read } = context; @@ -79109,7 +80812,7 @@ module.exports = ModuleError; /***/ }), -/***/ 10149: +/***/ 60667: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -79153,11 +80856,11 @@ class ModuleFactory { /** * @abstract * @param {ModuleFactoryCreateData} data data object - * @param {function(Error=, ModuleFactoryResult=): void} callback callback + * @param {function((Error | null)=, ModuleFactoryResult=): void} callback callback * @returns {void} */ create(data, callback) { - const AbstractMethodError = __webpack_require__(26907); + const AbstractMethodError = __webpack_require__(9906); throw new AbstractMethodError(); } } @@ -79167,7 +80870,7 @@ module.exports = ModuleFactory; /***/ }), -/***/ 38738: +/***/ 82444: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; @@ -79178,15 +80881,18 @@ module.exports = ModuleFactory; -const NormalModule = __webpack_require__(55443); -const createHash = __webpack_require__(94624); -const memoize = __webpack_require__(27319); +const NormalModule = __webpack_require__(17318); +const createHash = __webpack_require__(31147); +const memoize = __webpack_require__(62377); /** @typedef {import("./ChunkGraph")} ChunkGraph */ /** @typedef {import("./Module")} Module */ /** @typedef {import("./RequestShortener")} RequestShortener */ /** @typedef {typeof import("./util/Hash")} Hash */ +/** @typedef {string | RegExp | (string | RegExp)[]} Matcher */ +/** @typedef {{test?: Matcher, include?: Matcher, exclude?: Matcher }} MatchObject */ + const ModuleFilenameHelpers = exports; // TODO webpack 6: consider removing these @@ -79216,6 +80922,12 @@ ModuleFilenameHelpers.REGEXP_HASH = /\[hash\]/gi; ModuleFilenameHelpers.NAMESPACE = "[namespace]"; ModuleFilenameHelpers.REGEXP_NAMESPACE = /\[namespace\]/gi; +/** + * Returns a function that returns the part of the string after the token + * @param {() => string} strFn the function to get the string + * @param {string} token the token to search for + * @returns {() => string} a function that returns the part of the string after the token + */ const getAfter = (strFn, token) => { return () => { const str = strFn(); @@ -79224,6 +80936,12 @@ const getAfter = (strFn, token) => { }; }; +/** + * Returns a function that returns the part of the string before the token + * @param {() => string} strFn the function to get the string + * @param {string} token the token to search for + * @returns {() => string} a function that returns the part of the string before the token + */ const getBefore = (strFn, token) => { return () => { const str = strFn(); @@ -79232,6 +80950,12 @@ const getBefore = (strFn, token) => { }; }; +/** + * Returns a function that returns a hash of the string + * @param {() => string} strFn the function to get the string + * @param {string | Hash} hashFunction the hash function to use + * @returns {() => string} a function that returns the hash of the string + */ const getHash = (strFn, hashFunction) => { return () => { const hash = createHash(hashFunction); @@ -79241,13 +80965,35 @@ const getHash = (strFn, hashFunction) => { }; }; +/** + * Returns a function that returns the string with the token replaced with the replacement + * @param {string|RegExp} test A regular expression string or Regular Expression object + * @returns {RegExp} A regular expression object + * @example + * ```js + * const test = asRegExp("test"); + * test.test("test"); // true + * + * const test2 = asRegExp(/test/); + * test2.test("test"); // true + * ``` + */ const asRegExp = test => { if (typeof test === "string") { + // Escape special characters in the string to prevent them from being interpreted as special characters in a regular expression. Do this by + // adding a backslash before each special character test = new RegExp("^" + test.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&")); } return test; }; +/** + * @template T + * Returns a lazy object. The object is lazy in the sense that the properties are + * only evaluated when they are accessed. This is only obtained by setting a function as the value for each key. + * @param {Record T>} obj the object to covert to a lazy access object + * @returns {Object} the lazy access object + */ const lazyObject = obj => { const newObj = {}; for (const key of Object.keys(obj)) { @@ -79268,7 +81014,7 @@ const lazyObject = obj => { return newObj; }; -const REGEXP = /\[\\*([\w-]+)\\*\]/gi; +const SQUARE_BRACKET_TAG_REGEXP = /\[\\*([\w-]+)\\*\]/gi; /** * @@ -79335,6 +81081,7 @@ ModuleFilenameHelpers.createFilename = ( resource: resource, resourcePath: memoize(resourcePath), absoluteResourcePath: memoize(absoluteResourcePath), + loaders: memoize(loaders), allLoaders: memoize(allLoaders), query: memoize(query), moduleId: memoize(moduleId), @@ -79384,7 +81131,7 @@ ModuleFilenameHelpers.createFilename = ( ModuleFilenameHelpers.REGEXP_LOADERS_RESOURCE, "[short-identifier]" ) - .replace(REGEXP, (match, content) => { + .replace(SQUARE_BRACKET_TAG_REGEXP, (match, content) => { if (content.length + 2 === match.length) { const replacement = replacements.get(content.toLowerCase()); if (replacement !== undefined) { @@ -79397,9 +81144,28 @@ ModuleFilenameHelpers.createFilename = ( }); }; +/** + * Replaces duplicate items in an array with new values generated by a callback function. + * The callback function is called with the duplicate item, the index of the duplicate item, and the number of times the item has been replaced. + * The callback function should return the new value for the duplicate item. + * + * @template T + * @param {T[]} array the array with duplicates to be replaced + * @param {(duplicateItem: T, duplicateItemIndex: number, numberOfTimesReplaced: number) => T} fn callback function to generate new values for the duplicate items + * @param {(firstElement:T, nextElement:T) => -1 | 0 | 1} [comparator] optional comparator function to sort the duplicate items + * @returns {T[]} the array with duplicates replaced + * + * @example + * ```js + * const array = ["a", "b", "c", "a", "b", "a"]; + * const result = ModuleFilenameHelpers.replaceDuplicates(array, (item, index, count) => `${item}-${count}`); + * // result: ["a-1", "b-1", "c", "a-2", "b-2", "a-3"] + * ``` + */ ModuleFilenameHelpers.replaceDuplicates = (array, fn, comparator) => { const countMap = Object.create(null); const posMap = Object.create(null); + array.forEach((item, idx) => { countMap[item] = countMap[item] || []; countMap[item].push(idx); @@ -79420,16 +81186,63 @@ ModuleFilenameHelpers.replaceDuplicates = (array, fn, comparator) => { }); }; +/** + * Tests if a string matches a RegExp or an array of RegExp. + * + * @param {string} str string to test + * @param {Matcher} test value which will be used to match against the string + * @returns {boolean} true, when the RegExp matches + * + * @example + * ```js + * ModuleFilenameHelpers.matchPart("foo.js", "foo"); // true + * ModuleFilenameHelpers.matchPart("foo.js", "foo.js"); // true + * ModuleFilenameHelpers.matchPart("foo.js", "foo."); // false + * ModuleFilenameHelpers.matchPart("foo.js", "foo*"); // false + * ModuleFilenameHelpers.matchPart("foo.js", "foo.*"); // true + * ModuleFilenameHelpers.matchPart("foo.js", /^foo/); // true + * ModuleFilenameHelpers.matchPart("foo.js", [/^foo/, "bar"]); // true + * ModuleFilenameHelpers.matchPart("foo.js", [/^foo/, "bar"]); // true + * ModuleFilenameHelpers.matchPart("foo.js", [/^foo/, /^bar/]); // true + * ModuleFilenameHelpers.matchPart("foo.js", [/^baz/, /^bar/]); // false + * ``` + */ ModuleFilenameHelpers.matchPart = (str, test) => { if (!test) return true; - test = asRegExp(test); + if (Array.isArray(test)) { return test.map(asRegExp).some(regExp => regExp.test(str)); } else { - return test.test(str); + return asRegExp(test).test(str); } }; +/** + * Tests if a string matches a match object. The match object can have the following properties: + * - `test`: a RegExp or an array of RegExp + * - `include`: a RegExp or an array of RegExp + * - `exclude`: a RegExp or an array of RegExp + * + * The `test` property is tested first, then `include` and then `exclude`. + * + * @param {MatchObject} obj a match object to test against the string + * @param {string} str string to test against the matching object + * @returns {boolean} true, when the object matches + * @example + * ```js + * ModuleFilenameHelpers.matchObject({ test: "foo.js" }, "foo.js"); // true + * ModuleFilenameHelpers.matchObject({ test: /^foo/ }, "foo.js"); // true + * ModuleFilenameHelpers.matchObject({ test: [/^foo/, "bar"] }, "foo.js"); // true + * ModuleFilenameHelpers.matchObject({ test: [/^foo/, "bar"] }, "baz.js"); // false + * ModuleFilenameHelpers.matchObject({ include: "foo.js" }, "foo.js"); // true + * ModuleFilenameHelpers.matchObject({ include: "foo.js" }, "bar.js"); // false + * ModuleFilenameHelpers.matchObject({ include: /^foo/ }, "foo.js"); // true + * ModuleFilenameHelpers.matchObject({ include: [/^foo/, "bar"] }, "foo.js"); // true + * ModuleFilenameHelpers.matchObject({ include: [/^foo/, "bar"] }, "baz.js"); // false + * ModuleFilenameHelpers.matchObject({ exclude: "foo.js" }, "foo.js"); // false + * ModuleFilenameHelpers.matchObject({ exclude: [/^foo/, "bar"] }, "foo.js"); // false + * ``` + */ ModuleFilenameHelpers.matchObject = (obj, str) => { if (obj.test) { if (!ModuleFilenameHelpers.matchPart(str, obj.test)) { @@ -79452,7 +81265,7 @@ ModuleFilenameHelpers.matchObject = (obj, str) => { /***/ }), -/***/ 85215: +/***/ 43714: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -79464,10 +81277,10 @@ ModuleFilenameHelpers.matchObject = (obj, str) => { const util = __webpack_require__(73837); -const ExportsInfo = __webpack_require__(1723); -const ModuleGraphConnection = __webpack_require__(17977); -const SortableSet = __webpack_require__(98203); -const WeakTupleMap = __webpack_require__(63887); +const ExportsInfo = __webpack_require__(14768); +const ModuleGraphConnection = __webpack_require__(7976); +const SortableSet = __webpack_require__(94845); +const WeakTupleMap = __webpack_require__(22435); /** @typedef {import("./DependenciesBlock")} DependenciesBlock */ /** @typedef {import("./Dependency")} Dependency */ @@ -79493,14 +81306,15 @@ const getConnectionsByOriginModule = set => { const map = new Map(); /** @type {Module | 0} */ let lastModule = 0; - /** @type {ModuleGraphConnection[]} */ + /** @type {ModuleGraphConnection[] | undefined} */ let lastList = undefined; for (const connection of set) { const { originModule } = connection; if (lastModule === originModule) { - lastList.push(connection); + /** @type {ModuleGraphConnection[]} */ + (lastList).push(connection); } else { - lastModule = originModule; + lastModule = /** @type {Module} */ (originModule); const list = map.get(originModule); if (list !== undefined) { lastList = list; @@ -79523,12 +81337,13 @@ const getConnectionsByModule = set => { const map = new Map(); /** @type {Module | 0} */ let lastModule = 0; - /** @type {ModuleGraphConnection[]} */ + /** @type {ModuleGraphConnection[] | undefined} */ let lastList = undefined; for (const connection of set) { const { module } = connection; if (lastModule === module) { - lastList.push(connection); + /** @type {ModuleGraphConnection[]} */ + (lastList).push(connection); } else { lastModule = module; const list = map.get(module); @@ -79557,13 +81372,13 @@ class ModuleGraphModule { this.optimizationBailout = []; /** @type {ExportsInfo} */ this.exports = new ExportsInfo(); - /** @type {number} */ + /** @type {number | null} */ this.preOrderIndex = null; - /** @type {number} */ + /** @type {number | null} */ this.postOrderIndex = null; - /** @type {number} */ + /** @type {number | null} */ this.depth = null; - /** @type {ModuleProfile} */ + /** @type {ModuleProfile | undefined | null} */ this.profile = undefined; /** @type {boolean} */ this.async = false; @@ -79574,18 +81389,21 @@ class ModuleGraphModule { class ModuleGraph { constructor() { - /** @type {WeakMap} */ + /** @type {WeakMap} */ this._dependencyMap = new WeakMap(); /** @type {Map} */ this._moduleMap = new Map(); /** @type {WeakMap} */ this._metaMap = new WeakMap(); - /** @type {WeakTupleMap} */ + /** @type {WeakTupleMap | undefined} */ this._cache = undefined; /** @type {Map>} */ this._moduleMemCaches = undefined; + + /** @type {string | undefined} */ + this._cacheStage = undefined; } /** @@ -79676,7 +81494,9 @@ class ModuleGraph { * @returns {void} */ updateModule(dependency, module) { - const connection = this.getConnection(dependency); + const connection = + /** @type {ModuleGraphConnection} */ + (this.getConnection(dependency)); if (connection.module === module) return; const newConnection = connection.clone(); newConnection.module = module; @@ -79830,7 +81650,7 @@ class ModuleGraph { /** * @param {Dependency} dependency the dependency to look for a referenced module - * @returns {Module} the referenced module + * @returns {Module | null} the referenced module */ getResolvedModule(dependency) { const connection = this.getConnection(dependency); @@ -79853,7 +81673,10 @@ class ModuleGraph { ) { let foundConnection; for (const connection of mgm._unassignedConnections) { - this._dependencyMap.set(connection.dependency, connection); + this._dependencyMap.set( + /** @type {Dependency} */ (connection.dependency), + connection + ); if (connection.dependency === dependency) foundConnection = connection; } @@ -79871,7 +81694,7 @@ class ModuleGraph { /** * @param {Dependency} dependency the dependency to look for a referenced module - * @returns {Module} the referenced module + * @returns {Module | null} the referenced module */ getModule(dependency) { const connection = this.getConnection(dependency); @@ -79880,7 +81703,7 @@ class ModuleGraph { /** * @param {Dependency} dependency the dependency to look for a referencing module - * @returns {Module} the referencing module + * @returns {Module | null} the referencing module */ getOrigin(dependency) { const connection = this.getConnection(dependency); @@ -79889,7 +81712,7 @@ class ModuleGraph { /** * @param {Dependency} dependency the dependency to look for a referencing module - * @returns {Module} the original referencing module + * @returns {Module | null} the original referencing module */ getResolvedOrigin(dependency) { const connection = this.getConnection(dependency); @@ -80059,7 +81882,7 @@ class ModuleGraph { /** * @param {Module} module the module - * @returns {number} the index of the module + * @returns {number | null} the index of the module */ getPreOrderIndex(module) { const mgm = this._getModuleGraphModule(module); @@ -80068,7 +81891,7 @@ class ModuleGraph { /** * @param {Module} module the module - * @returns {number} the index of the module + * @returns {number | null} the index of the module */ getPostOrderIndex(module) { const mgm = this._getModuleGraphModule(module); @@ -80125,7 +81948,7 @@ class ModuleGraph { /** * @param {Module} module the module - * @returns {number} the depth of the module + * @returns {number | null} the depth of the module */ getDepth(module) { const mgm = this._getModuleGraphModule(module); @@ -80182,14 +82005,14 @@ class ModuleGraph { let meta = this._metaMap.get(thing); if (meta === undefined) { meta = Object.create(null); - this._metaMap.set(thing, meta); + this._metaMap.set(thing, /** @type {Object} */ (meta)); } - return meta; + return /** @type {Object} */ (meta); } /** * @param {any} thing any thing - * @returns {Object} metadata + * @returns {Object | undefined} metadata */ getMetaIfExisting(thing) { return this._metaMap.get(thing); @@ -80316,7 +82139,7 @@ module.exports.ModuleGraphConnection = ModuleGraphConnection; /***/ }), -/***/ 17977: +/***/ 7976: /***/ (function(module) { "use strict"; @@ -80396,9 +82219,9 @@ class ModuleGraphConnection { this.weak = weak; this.conditional = !!condition; this._active = condition !== false; - /** @type {function(ModuleGraphConnection, RuntimeSpec): ConnectionState} */ + /** @type {(function(ModuleGraphConnection, RuntimeSpec): ConnectionState) | undefined} */ this.condition = condition || undefined; - /** @type {Set} */ + /** @type {Set | undefined} */ this.explanations = undefined; if (explanation) { this.explanations = new Set(); @@ -80429,7 +82252,9 @@ class ModuleGraphConnection { */ addCondition(condition) { if (this.conditional) { - const old = this.condition; + const old = + /** @type {(function(ModuleGraphConnection, RuntimeSpec): ConnectionState)} */ + (this.condition); this.condition = (c, r) => intersectConnectionStates(old(c, r), condition(c, r)); } else if (this._active) { @@ -80465,7 +82290,12 @@ class ModuleGraphConnection { */ isActive(runtime) { if (!this.conditional) return this._active; - return this.condition(this, runtime) !== false; + + return ( + /** @type {(function(ModuleGraphConnection, RuntimeSpec): ConnectionState)} */ ( + this.condition + )(this, runtime) !== false + ); } /** @@ -80474,7 +82304,11 @@ class ModuleGraphConnection { */ isTargetActive(runtime) { if (!this.conditional) return this._active; - return this.condition(this, runtime) === true; + return ( + /** @type {(function(ModuleGraphConnection, RuntimeSpec): ConnectionState)} */ ( + this.condition + )(this, runtime) === true + ); } /** @@ -80483,7 +82317,9 @@ class ModuleGraphConnection { */ getActiveState(runtime) { if (!this.conditional) return this._active; - return this.condition(this, runtime); + return /** @type {(function(ModuleGraphConnection, RuntimeSpec): ConnectionState)} */ ( + this.condition + )(this, runtime); } /** @@ -80515,7 +82351,7 @@ module.exports.CIRCULAR_CONNECTION = /** @type {typeof CIRCULAR_CONNECTION} */ ( /***/ }), -/***/ 75037: +/***/ 70044: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -80526,7 +82362,7 @@ module.exports.CIRCULAR_CONNECTION = /** @type {typeof CIRCULAR_CONNECTION} */ ( -const WebpackError = __webpack_require__(10841); +const WebpackError = __webpack_require__(49999); /** @typedef {import("./Module")} Module */ @@ -80552,7 +82388,7 @@ module.exports = ModuleHashingError; /***/ }), -/***/ 45684: +/***/ 4228: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -80564,19 +82400,25 @@ module.exports = ModuleHashingError; const { ConcatSource, RawSource, CachedSource } = __webpack_require__(59728); -const { UsageState } = __webpack_require__(1723); -const Template = __webpack_require__(88070); -const JavascriptModulesPlugin = __webpack_require__(96230); +const { UsageState } = __webpack_require__(14768); +const Template = __webpack_require__(88835); +const JavascriptModulesPlugin = __webpack_require__(70061); /** @typedef {import("webpack-sources").Source} Source */ /** @typedef {import("./Compiler")} Compiler */ /** @typedef {import("./ExportsInfo")} ExportsInfo */ /** @typedef {import("./ExportsInfo").ExportInfo} ExportInfo */ /** @typedef {import("./Module")} Module */ +/** @typedef {import("./Module").BuildMeta} BuildMeta */ /** @typedef {import("./ModuleGraph")} ModuleGraph */ /** @typedef {import("./ModuleTemplate")} ModuleTemplate */ /** @typedef {import("./RequestShortener")} RequestShortener */ +/** + * @template T + * @param {Iterable} iterable iterable + * @returns {string} joined with comma + */ const joinIterableWithComma = iterable => { // This is more performant than Array.from().join(", ") // as it doesn't create an array @@ -80697,7 +82539,7 @@ const printExportsInfoToSource = ( } }; -/** @type {WeakMap }>>} */ +/** @type {WeakMap }>>} */ const caches = new WeakMap(); class ModuleInfoHeaderPlugin { @@ -80755,7 +82597,8 @@ class ModuleInfoHeaderPlugin { } source.add(header); if (verbose) { - const exportsType = module.buildMeta.exportsType; + const exportsType = /** @type {BuildMeta} */ (module.buildMeta) + .exportsType; source.add( Template.toComment( exportsType @@ -80815,7 +82658,7 @@ module.exports = ModuleInfoHeaderPlugin; /***/ }), -/***/ 79150: +/***/ 32569: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -80826,7 +82669,7 @@ module.exports = ModuleInfoHeaderPlugin; -const WebpackError = __webpack_require__(10841); +const WebpackError = __webpack_require__(49999); /** @typedef {import("./Dependency").DependencyLocation} DependencyLocation */ /** @typedef {import("./Module")} Module */ @@ -80864,7 +82707,7 @@ const previouslyPolyfilledBuiltinModules = { class ModuleNotFoundError extends WebpackError { /** - * @param {Module} module module tied to dependency + * @param {Module | null} module module tied to dependency * @param {Error&any} err error thrown * @param {DependencyLocation} loc location of dependency */ @@ -80875,7 +82718,10 @@ class ModuleNotFoundError extends WebpackError { const match = err.message.match(/Can't resolve '([^']+)'/); if (match) { const request = match[1]; - const alias = previouslyPolyfilledBuiltinModules[request]; + const alias = + previouslyPolyfilledBuiltinModules[ + /** @type {keyof previouslyPolyfilledBuiltinModules} */ (request) + ]; if (alias) { const pathIndex = alias.indexOf("/"); const dependency = pathIndex > 0 ? alias.slice(0, pathIndex) : alias; @@ -80909,7 +82755,7 @@ module.exports = ModuleNotFoundError; /***/ }), -/***/ 73770: +/***/ 66190: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -80920,8 +82766,11 @@ module.exports = ModuleNotFoundError; -const WebpackError = __webpack_require__(10841); -const makeSerializable = __webpack_require__(23827); +const WebpackError = __webpack_require__(49999); +const makeSerializable = __webpack_require__(83626); + +/** @typedef {import("./serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */ +/** @typedef {import("./serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */ const WASM_HEADER = Buffer.from([0x00, 0x61, 0x73, 0x6d]); @@ -81002,6 +82851,9 @@ class ModuleParseError extends WebpackError { this.error = err; } + /** + * @param {ObjectSerializerContext} context context + */ serialize(context) { const { write } = context; @@ -81010,6 +82862,9 @@ class ModuleParseError extends WebpackError { super.serialize(context); } + /** + * @param {ObjectDeserializerContext} context context + */ deserialize(context) { const { read } = context; @@ -81026,7 +82881,7 @@ module.exports = ModuleParseError; /***/ }), -/***/ 68318: +/***/ 27981: /***/ (function(module) { "use strict"; @@ -81066,6 +82921,7 @@ class ModuleProfile { this.storing = 0; this.storingParallelismFactor = 0; + /** @type {{ start: number, end: number }[] | undefined } */ this.additionalFactoryTimes = undefined; this.additionalFactories = 0; this.additionalFactoriesParallelismFactor = 0; @@ -81141,7 +82997,7 @@ module.exports = ModuleProfile; /***/ }), -/***/ 77081: +/***/ 20130: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -81152,7 +83008,7 @@ module.exports = ModuleProfile; -const WebpackError = __webpack_require__(10841); +const WebpackError = __webpack_require__(49999); /** @typedef {import("./Module")} Module */ @@ -81163,6 +83019,7 @@ class ModuleRestoreError extends WebpackError { */ constructor(module, err) { let message = "Module restore failed: "; + /** @type {string | undefined} */ let details = undefined; if (err !== null && typeof err === "object") { if (typeof err.stack === "string" && err.stack) { @@ -81180,6 +83037,7 @@ class ModuleRestoreError extends WebpackError { super(message); this.name = "ModuleRestoreError"; + /** @type {string | undefined} */ this.details = details; this.module = module; this.error = err; @@ -81191,7 +83049,7 @@ module.exports = ModuleRestoreError; /***/ }), -/***/ 77963: +/***/ 59592: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -81202,7 +83060,7 @@ module.exports = ModuleRestoreError; -const WebpackError = __webpack_require__(10841); +const WebpackError = __webpack_require__(49999); /** @typedef {import("./Module")} Module */ @@ -81213,6 +83071,7 @@ class ModuleStoreError extends WebpackError { */ constructor(module, err) { let message = "Module storing failed: "; + /** @type {string | undefined} */ let details = undefined; if (err !== null && typeof err === "object") { if (typeof err.stack === "string" && err.stack) { @@ -81230,7 +83089,7 @@ class ModuleStoreError extends WebpackError { super(message); this.name = "ModuleStoreError"; - this.details = details; + this.details = /** @type {string | undefined} */ (details); this.module = module; this.error = err; } @@ -81241,7 +83100,7 @@ module.exports = ModuleStoreError; /***/ }), -/***/ 6927: +/***/ 69853: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -81253,7 +83112,7 @@ module.exports = ModuleStoreError; const util = __webpack_require__(73837); -const memoize = __webpack_require__(27319); +const memoize = __webpack_require__(62377); /** @typedef {import("webpack-sources").Source} Source */ /** @typedef {import("./Chunk")} Chunk */ @@ -81266,7 +83125,7 @@ const memoize = __webpack_require__(27319); /** @typedef {import("./util/Hash")} Hash */ const getJavascriptModulesPlugin = memoize(() => - __webpack_require__(96230) + __webpack_require__(70061) ); // TODO webpack 6: remove this class @@ -81391,7 +83250,184 @@ module.exports = ModuleTemplate; /***/ }), -/***/ 30657: +/***/ 92891: +/***/ (function(__unused_webpack_module, exports) { + +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Sean Larkin @TheLarkInn +*/ + + + +/** + * @type {Readonly<"javascript/auto">} + */ +const JAVASCRIPT_MODULE_TYPE_AUTO = "javascript/auto"; + +/** + * @type {Readonly<"javascript/dynamic">} + */ +const JAVASCRIPT_MODULE_TYPE_DYNAMIC = "javascript/dynamic"; + +/** + * @type {Readonly<"javascript/esm">} + * This is the module type used for _strict_ ES Module syntax. This means that all legacy formats + * that webpack supports (CommonJS, AMD, SystemJS) are not supported. + */ +const JAVASCRIPT_MODULE_TYPE_ESM = "javascript/esm"; + +/** + * @type {Readonly<"json">} + * This is the module type used for JSON files. JSON files are always parsed as ES Module. + */ +const JSON_MODULE_TYPE = "json"; + +/** + * @type {Readonly<"webassembly/async">} + * This is the module type used for WebAssembly modules. In webpack 5 they are always treated as async modules. + * + */ +const WEBASSEMBLY_MODULE_TYPE_ASYNC = "webassembly/async"; + +/** + * @type {Readonly<"webassembly/sync">} + * This is the module type used for WebAssembly modules. In webpack 4 they are always treated as sync modules. + * There is a legacy option to support this usage in webpack 5 and up. + */ +const WEBASSEMBLY_MODULE_TYPE_SYNC = "webassembly/sync"; + +/** + * @type {Readonly<"css">} + * This is the module type used for CSS files. + */ +const CSS_MODULE_TYPE = "css"; + +/** + * @type {Readonly<"css/global">} + * This is the module type used for CSS modules files where you need to use `:local` in selector list to hash classes. + */ +const CSS_MODULE_TYPE_GLOBAL = "css/global"; + +/** + * @type {Readonly<"css/module">} + * This is the module type used for CSS modules files, by default all classes are hashed. + */ +const CSS_MODULE_TYPE_MODULE = "css/module"; + +/** + * @type {Readonly<"css/auto">} + * This is the module type used for CSS files, the module will be parsed as CSS modules if it's filename contains `.module.` or `.modules.`. + */ +const CSS_MODULE_TYPE_AUTO = "css/auto"; + +/** + * @type {Readonly<"asset">} + * This is the module type used for automatically choosing between `asset/inline`, `asset/resource` based on asset size limit (8096). + */ +const ASSET_MODULE_TYPE = "asset"; + +/** + * @type {Readonly<"asset/inline">} + * This is the module type used for assets that are inlined as a data URI. This is the equivalent of `url-loader`. + */ +const ASSET_MODULE_TYPE_INLINE = "asset/inline"; + +/** + * @type {Readonly<"asset/resource">} + * This is the module type used for assets that are copied to the output directory. This is the equivalent of `file-loader`. + */ +const ASSET_MODULE_TYPE_RESOURCE = "asset/resource"; + +/** + * @type {Readonly<"asset/source">} + * This is the module type used for assets that are imported as source code. This is the equivalent of `raw-loader`. + */ +const ASSET_MODULE_TYPE_SOURCE = "asset/source"; + +/** + * @type {Readonly<"asset/raw-data-url">} + * TODO: Document what this asset type is for. See css-loader tests for its usage. + */ +const ASSET_MODULE_TYPE_RAW_DATA_URL = "asset/raw-data-url"; + +/** + * @type {Readonly<"runtime">} + * This is the module type used for the webpack runtime abstractions. + */ +const WEBPACK_MODULE_TYPE_RUNTIME = "runtime"; + +/** + * @type {Readonly<"fallback-module">} + * This is the module type used for the ModuleFederation feature's FallbackModule class. + * TODO: Document this better. + */ +const WEBPACK_MODULE_TYPE_FALLBACK = "fallback-module"; + +/** + * @type {Readonly<"remote-module">} + * This is the module type used for the ModuleFederation feature's RemoteModule class. + * TODO: Document this better. + */ +const WEBPACK_MODULE_TYPE_REMOTE = "remote-module"; + +/** + * @type {Readonly<"provide-module">} + * This is the module type used for the ModuleFederation feature's ProvideModule class. + * TODO: Document this better. + */ +const WEBPACK_MODULE_TYPE_PROVIDE = "provide-module"; + +/** + * @type {Readonly<"consume-shared-module">} + * This is the module type used for the ModuleFederation feature's ConsumeSharedModule class. + */ +const WEBPACK_MODULE_TYPE_CONSUME_SHARED_MODULE = "consume-shared-module"; + +/** + * @type {Readonly<"lazy-compilation-proxy">} + * Module type used for `experiments.lazyCompilation` feature. See `LazyCompilationPlugin` for more information. + */ +const WEBPACK_MODULE_TYPE_LAZY_COMPILATION_PROXY = "lazy-compilation-proxy"; + +/** @typedef {"javascript/auto" | "javascript/dynamic" | "javascript/esm"} JavaScriptModuleTypes */ +/** @typedef {"json"} JSONModuleType */ +/** @typedef {"webassembly/async" | "webassembly/sync"} WebAssemblyModuleTypes */ +/** @typedef {"css" | "css/global" | "css/module"} CSSModuleTypes */ +/** @typedef {"asset" | "asset/inline" | "asset/resource" | "asset/source" | "asset/raw-data-url"} AssetModuleTypes */ +/** @typedef {"runtime" | "fallback-module" | "remote-module" | "provide-module" | "consume-shared-module" | "lazy-compilation-proxy"} WebpackModuleTypes */ +/** @typedef {string} UnknownModuleTypes */ +/** @typedef {JavaScriptModuleTypes | JSONModuleType | WebAssemblyModuleTypes | CSSModuleTypes | AssetModuleTypes | WebpackModuleTypes | UnknownModuleTypes} ModuleTypes */ + +exports.ASSET_MODULE_TYPE = ASSET_MODULE_TYPE; +exports.ASSET_MODULE_TYPE_RAW_DATA_URL = ASSET_MODULE_TYPE_RAW_DATA_URL; +exports.ASSET_MODULE_TYPE_SOURCE = ASSET_MODULE_TYPE_SOURCE; +exports.ASSET_MODULE_TYPE_RESOURCE = ASSET_MODULE_TYPE_RESOURCE; +exports.ASSET_MODULE_TYPE_INLINE = ASSET_MODULE_TYPE_INLINE; +exports.JAVASCRIPT_MODULE_TYPE_AUTO = JAVASCRIPT_MODULE_TYPE_AUTO; +exports.JAVASCRIPT_MODULE_TYPE_DYNAMIC = JAVASCRIPT_MODULE_TYPE_DYNAMIC; +exports.JAVASCRIPT_MODULE_TYPE_ESM = JAVASCRIPT_MODULE_TYPE_ESM; +exports.JSON_MODULE_TYPE = JSON_MODULE_TYPE; +exports.WEBASSEMBLY_MODULE_TYPE_ASYNC = WEBASSEMBLY_MODULE_TYPE_ASYNC; +exports.WEBASSEMBLY_MODULE_TYPE_SYNC = WEBASSEMBLY_MODULE_TYPE_SYNC; +exports.CSS_MODULE_TYPE = CSS_MODULE_TYPE; +exports.CSS_MODULE_TYPE_GLOBAL = CSS_MODULE_TYPE_GLOBAL; +exports.CSS_MODULE_TYPE_MODULE = CSS_MODULE_TYPE_MODULE; +exports.CSS_MODULE_TYPE_AUTO = CSS_MODULE_TYPE_AUTO; +exports.WEBPACK_MODULE_TYPE_RUNTIME = WEBPACK_MODULE_TYPE_RUNTIME; +exports.WEBPACK_MODULE_TYPE_FALLBACK = WEBPACK_MODULE_TYPE_FALLBACK; +exports.WEBPACK_MODULE_TYPE_REMOTE = WEBPACK_MODULE_TYPE_REMOTE; +exports.WEBPACK_MODULE_TYPE_PROVIDE = WEBPACK_MODULE_TYPE_PROVIDE; +exports.WEBPACK_MODULE_TYPE_CONSUME_SHARED_MODULE = + WEBPACK_MODULE_TYPE_CONSUME_SHARED_MODULE; +exports.WEBPACK_MODULE_TYPE_LAZY_COMPILATION_PROXY = + WEBPACK_MODULE_TYPE_LAZY_COMPILATION_PROXY; + + +/***/ }), + +/***/ 65395: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -81402,9 +83438,12 @@ module.exports = ModuleTemplate; -const { cleanUp } = __webpack_require__(68390); -const WebpackError = __webpack_require__(10841); -const makeSerializable = __webpack_require__(23827); +const { cleanUp } = __webpack_require__(65206); +const WebpackError = __webpack_require__(49999); +const makeSerializable = __webpack_require__(83626); + +/** @typedef {import("./serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */ +/** @typedef {import("./serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */ class ModuleWarning extends WebpackError { /** @@ -81436,6 +83475,9 @@ class ModuleWarning extends WebpackError { : undefined; } + /** + * @param {ObjectSerializerContext} context context + */ serialize(context) { const { write } = context; @@ -81444,6 +83486,9 @@ class ModuleWarning extends WebpackError { super.serialize(context); } + /** + * @param {ObjectDeserializerContext} context context + */ deserialize(context) { const { read } = context; @@ -81460,7 +83505,7 @@ module.exports = ModuleWarning; /***/ }), -/***/ 25939: +/***/ 85694: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -81474,10 +83519,10 @@ module.exports = ModuleWarning; const asyncLib = __webpack_require__(47087); const { SyncHook, MultiHook } = __webpack_require__(70793); -const ConcurrentCompilationError = __webpack_require__(79831); -const MultiStats = __webpack_require__(38816); -const MultiWatching = __webpack_require__(29960); -const ArrayQueue = __webpack_require__(45596); +const ConcurrentCompilationError = __webpack_require__(86540); +const MultiStats = __webpack_require__(82861); +const MultiWatching = __webpack_require__(86766); +const ArrayQueue = __webpack_require__(49425); /** @template T @typedef {import("tapable").AsyncSeriesHook} AsyncSeriesHook */ /** @template T @template R @typedef {import("tapable").SyncBailHook} SyncBailHook */ @@ -82050,7 +84095,7 @@ module.exports = class MultiCompiler { /***/ }), -/***/ 38816: +/***/ 82861: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -82061,7 +84106,7 @@ module.exports = class MultiCompiler { -const identifierUtils = __webpack_require__(63146); +const identifierUtils = __webpack_require__(97451); /** @typedef {import("../declarations/WebpackOptions").StatsOptions} StatsOptions */ /** @typedef {import("./Stats")} Stats */ @@ -82224,7 +84269,7 @@ module.exports = MultiStats; /***/ }), -/***/ 29960: +/***/ 86766: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -82257,6 +84302,10 @@ class MultiWatching { this.compiler = compiler; } + /** + * @param {Callback=} callback signals when the build has completed again + * @returns {void} + */ invalidate(callback) { if (callback) { asyncLib.each( @@ -82309,7 +84358,7 @@ module.exports = MultiWatching; /***/ }), -/***/ 80388: +/***/ 90229: /***/ (function(module) { "use strict"; @@ -82345,7 +84394,7 @@ module.exports = NoEmitOnErrorsPlugin; /***/ }), -/***/ 10535: +/***/ 41702: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -82356,7 +84405,7 @@ module.exports = NoEmitOnErrorsPlugin; -const WebpackError = __webpack_require__(10841); +const WebpackError = __webpack_require__(49999); module.exports = class NoModeWarning extends WebpackError { constructor() { @@ -82375,7 +84424,7 @@ module.exports = class NoModeWarning extends WebpackError { /***/ }), -/***/ 29390: +/***/ 17623: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -82386,8 +84435,8 @@ module.exports = class NoModeWarning extends WebpackError { -const WebpackError = __webpack_require__(10841); -const makeSerializable = __webpack_require__(23827); +const WebpackError = __webpack_require__(49999); +const makeSerializable = __webpack_require__(83626); /** @typedef {import("./Dependency").DependencyLocation} DependencyLocation */ @@ -82417,7 +84466,7 @@ module.exports = NodeStuffInWebError; /***/ }), -/***/ 162: +/***/ 24193: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -82428,24 +84477,39 @@ module.exports = NodeStuffInWebError; -const NodeStuffInWebError = __webpack_require__(29390); -const RuntimeGlobals = __webpack_require__(34623); -const CachedConstDependency = __webpack_require__(12389); -const ConstDependency = __webpack_require__(78284); +const { + JAVASCRIPT_MODULE_TYPE_AUTO, + JAVASCRIPT_MODULE_TYPE_DYNAMIC +} = __webpack_require__(92891); +const NodeStuffInWebError = __webpack_require__(17623); +const RuntimeGlobals = __webpack_require__(61539); +const CachedConstDependency = __webpack_require__(346); +const ConstDependency = __webpack_require__(67538); const { evaluateToString, expressionIsUnsupported -} = __webpack_require__(645); -const { relative } = __webpack_require__(33139); -const { parseResource } = __webpack_require__(63146); +} = __webpack_require__(94213); +const { relative } = __webpack_require__(96220); +const { parseResource } = __webpack_require__(97451); /** @typedef {import("webpack-sources").ReplaceSource} ReplaceSource */ +/** @typedef {import("../declarations/WebpackOptions").JavascriptParserOptions} JavascriptParserOptions */ +/** @typedef {import("../declarations/WebpackOptions").NodeOptions} NodeOptions */ /** @typedef {import("./Compiler")} Compiler */ /** @typedef {import("./Dependency")} Dependency */ +/** @typedef {import("./Dependency").DependencyLocation} DependencyLocation */ /** @typedef {import("./DependencyTemplates")} DependencyTemplates */ +/** @typedef {import("./NormalModule")} NormalModule */ /** @typedef {import("./RuntimeTemplate")} RuntimeTemplate */ +/** @typedef {import("./javascript/JavascriptParser")} JavascriptParser */ +/** @typedef {import("./javascript/JavascriptParser").Range} Range */ + +const PLUGIN_NAME = "NodeStuffPlugin"; class NodeStuffPlugin { + /** + * @param {NodeOptions} options options + */ constructor(options) { this.options = options; } @@ -82458,8 +84522,13 @@ class NodeStuffPlugin { apply(compiler) { const options = this.options; compiler.hooks.compilation.tap( - "NodeStuffPlugin", + PLUGIN_NAME, (compilation, { normalModuleFactory }) => { + /** + * @param {JavascriptParser} parser the parser + * @param {JavascriptParserOptions} parserOptions options + * @returns {void} + */ const handler = (parser, parserOptions) => { if (parserOptions.node === false) return; @@ -82470,50 +84539,54 @@ class NodeStuffPlugin { if (localOptions.global !== false) { const withWarning = localOptions.global === "warn"; - parser.hooks.expression - .for("global") - .tap("NodeStuffPlugin", expr => { - const dep = new ConstDependency( - RuntimeGlobals.global, - expr.range, - [RuntimeGlobals.global] - ); - dep.loc = expr.loc; - parser.state.module.addPresentationalDependency(dep); + parser.hooks.expression.for("global").tap(PLUGIN_NAME, expr => { + const dep = new ConstDependency( + RuntimeGlobals.global, + /** @type {Range} */ (expr.range), + [RuntimeGlobals.global] + ); + dep.loc = /** @type {DependencyLocation} */ (expr.loc); + parser.state.module.addPresentationalDependency(dep); - // TODO webpack 6 remove - if (withWarning) { - parser.state.module.addWarning( - new NodeStuffInWebError( - dep.loc, - "global", - "The global namespace object is a Node.js feature and isn't available in browsers." - ) - ); - } - }); - parser.hooks.rename.for("global").tap("NodeStuffPlugin", expr => { + // TODO webpack 6 remove + if (withWarning) { + parser.state.module.addWarning( + new NodeStuffInWebError( + dep.loc, + "global", + "The global namespace object is a Node.js feature and isn't available in browsers." + ) + ); + } + }); + parser.hooks.rename.for("global").tap(PLUGIN_NAME, expr => { const dep = new ConstDependency( RuntimeGlobals.global, - expr.range, + /** @type {Range} */ (expr.range), [RuntimeGlobals.global] ); - dep.loc = expr.loc; + dep.loc = /** @type {DependencyLocation} */ (expr.loc); parser.state.module.addPresentationalDependency(dep); return false; }); } + /** + * @param {string} expressionName expression name + * @param {(module: NormalModule) => string} fn function + * @param {string=} warning warning + * @returns {void} + */ const setModuleConstant = (expressionName, fn, warning) => { parser.hooks.expression .for(expressionName) - .tap("NodeStuffPlugin", expr => { + .tap(PLUGIN_NAME, expr => { const dep = new CachedConstDependency( JSON.stringify(fn(parser.state.module)), - expr.range, + /** @type {Range} */ (expr.range), expressionName ); - dep.loc = expr.loc; + dep.loc = /** @type {DependencyLocation} */ (expr.loc); parser.state.module.addPresentationalDependency(dep); // TODO webpack 6 remove @@ -82527,6 +84600,12 @@ class NodeStuffPlugin { }); }; + /** + * @param {string} expressionName expression name + * @param {string} value value + * @param {string=} warning warning + * @returns {void} + */ const setConstant = (expressionName, value, warning) => setModuleConstant(expressionName, () => value, warning); @@ -82552,7 +84631,7 @@ class NodeStuffPlugin { parser.hooks.evaluateIdentifier .for("__filename") - .tap("NodeStuffPlugin", expr => { + .tap(PLUGIN_NAME, expr => { if (!parser.state.module) return; const resource = parseResource(parser.state.module.resource); return evaluateToString(resource.path)(expr); @@ -82579,7 +84658,7 @@ class NodeStuffPlugin { parser.hooks.evaluateIdentifier .for("__dirname") - .tap("NodeStuffPlugin", expr => { + .tap(PLUGIN_NAME, expr => { if (!parser.state.module) return; return evaluateToString(parser.state.module.context)(expr); }); @@ -82587,7 +84666,7 @@ class NodeStuffPlugin { parser.hooks.expression .for("require.extensions") .tap( - "NodeStuffPlugin", + PLUGIN_NAME, expressionIsUnsupported( parser, "require.extensions is not supported by webpack. Use a loader instead." @@ -82596,11 +84675,11 @@ class NodeStuffPlugin { }; normalModuleFactory.hooks.parser - .for("javascript/auto") - .tap("NodeStuffPlugin", handler); + .for(JAVASCRIPT_MODULE_TYPE_AUTO) + .tap(PLUGIN_NAME, handler); normalModuleFactory.hooks.parser - .for("javascript/dynamic") - .tap("NodeStuffPlugin", handler); + .for(JAVASCRIPT_MODULE_TYPE_DYNAMIC) + .tap(PLUGIN_NAME, handler); } ); } @@ -82611,7 +84690,7 @@ module.exports = NodeStuffPlugin; /***/ }), -/***/ 55443: +/***/ 17318: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -82632,37 +84711,38 @@ const { RawSource, SourceMapSource } = __webpack_require__(59728); -const Compilation = __webpack_require__(38292); -const HookWebpackError = __webpack_require__(88608); -const Module = __webpack_require__(96040); -const ModuleBuildError = __webpack_require__(88916); -const ModuleError = __webpack_require__(18463); -const ModuleGraphConnection = __webpack_require__(17977); -const ModuleParseError = __webpack_require__(73770); -const ModuleWarning = __webpack_require__(30657); -const RuntimeGlobals = __webpack_require__(34623); -const UnhandledSchemeError = __webpack_require__(29428); -const WebpackError = __webpack_require__(10841); -const formatLocation = __webpack_require__(49064); -const LazySet = __webpack_require__(66205); -const { isSubset } = __webpack_require__(97045); -const { getScheme } = __webpack_require__(22169); +const Compilation = __webpack_require__(20417); +const HookWebpackError = __webpack_require__(39319); +const Module = __webpack_require__(6309); +const ModuleBuildError = __webpack_require__(25055); +const ModuleError = __webpack_require__(82923); +const ModuleGraphConnection = __webpack_require__(7976); +const ModuleParseError = __webpack_require__(66190); +const { JAVASCRIPT_MODULE_TYPE_AUTO } = __webpack_require__(92891); +const ModuleWarning = __webpack_require__(65395); +const RuntimeGlobals = __webpack_require__(61539); +const UnhandledSchemeError = __webpack_require__(86943); +const WebpackError = __webpack_require__(49999); +const formatLocation = __webpack_require__(60246); +const LazySet = __webpack_require__(57876); +const { isSubset } = __webpack_require__(24352); +const { getScheme } = __webpack_require__(65598); const { compareLocations, concatComparators, compareSelect, keepOriginalOrder -} = __webpack_require__(29355); -const createHash = __webpack_require__(94624); -const { createFakeHook } = __webpack_require__(47762); -const { join } = __webpack_require__(33139); +} = __webpack_require__(95978); +const createHash = __webpack_require__(31147); +const { createFakeHook } = __webpack_require__(40630); +const { join } = __webpack_require__(96220); const { contextify, absolutify, makePathsRelative -} = __webpack_require__(63146); -const makeSerializable = __webpack_require__(23827); -const memoize = __webpack_require__(27319); +} = __webpack_require__(97451); +const makeSerializable = __webpack_require__(83626); +const memoize = __webpack_require__(62377); /** @typedef {import("webpack-sources").Source} Source */ /** @typedef {import("../declarations/LoaderContext").NormalModuleLoaderContext} NormalModuleLoaderContext */ @@ -82681,12 +84761,15 @@ const memoize = __webpack_require__(27319); /** @typedef {import("./Module").NeedBuildContext} NeedBuildContext */ /** @typedef {import("./ModuleGraph")} ModuleGraph */ /** @typedef {import("./ModuleGraphConnection").ConnectionState} ConnectionState */ +/** @typedef {import("./ModuleTypeConstants").JavaScriptModuleTypes} JavaScriptModuleTypes */ /** @typedef {import("./NormalModuleFactory")} NormalModuleFactory */ /** @typedef {import("./Parser")} Parser */ /** @typedef {import("./RequestShortener")} RequestShortener */ /** @typedef {import("./ResolverFactory").ResolverWithOptions} ResolverWithOptions */ /** @typedef {import("./RuntimeTemplate")} RuntimeTemplate */ /** @typedef {import("./logging/Logger").Logger} WebpackLogger */ +/** @typedef {import("./serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */ +/** @typedef {import("./serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */ /** @typedef {import("./util/Hash")} Hash */ /** @typedef {import("./util/fs").InputFileSystem} InputFileSystem */ /** @typedef {import("./util/runtime").RuntimeSpec} RuntimeSpec */ @@ -82703,9 +84786,9 @@ const memoize = __webpack_require__(27319); */ const getInvalidDependenciesModuleWarning = memoize(() => - __webpack_require__(33869) + __webpack_require__(14086) ); -const getValidate = memoize(() => (__webpack_require__(1489).validate)); +const getValidate = memoize(() => (__webpack_require__(16633).validate)); const ABSOLUTE_PATH_REGEX = /^([a-zA-Z]:\\|\\\\|\/)/; @@ -82815,7 +84898,7 @@ makeSerializable( /** * @typedef {Object} NormalModuleCreateData * @property {string=} layer an optional layer in which the module is - * @property {string} type module type + * @property {JavaScriptModuleTypes | ""} type module type. When deserializing, this is set to an empty string "". * @property {string} request request string * @property {string} userRequest request intended by user (without loaders from config) * @property {string} rawRequest request without resolving @@ -82956,7 +85039,7 @@ class NormalModule extends Module { */ identifier() { if (this.layer === null) { - if (this.type === "javascript/auto") { + if (this.type === JAVASCRIPT_MODULE_TYPE_AUTO) { return this.request; } else { return `${this.type}|${this.request}`; @@ -83981,6 +86064,9 @@ class NormalModule extends Module { super.updateHash(hash, context); } + /** + * @param {ObjectSerializerContext} context context + */ serialize(context) { const { write } = context; // deserialize @@ -84015,6 +86101,9 @@ class NormalModule extends Module { return obj; } + /** + * @param {ObjectDeserializerContext} context context + */ deserialize(context) { const { read } = context; this._source = read(); @@ -84033,7 +86122,7 @@ module.exports = NormalModule; /***/ }), -/***/ 51548: +/***/ 43329: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -84053,24 +86142,25 @@ const { SyncHook, HookMap } = __webpack_require__(70793); -const ChunkGraph = __webpack_require__(64438); -const Module = __webpack_require__(96040); -const ModuleFactory = __webpack_require__(10149); -const ModuleGraph = __webpack_require__(85215); -const NormalModule = __webpack_require__(55443); -const BasicEffectRulePlugin = __webpack_require__(24208); -const BasicMatcherRulePlugin = __webpack_require__(43759); -const ObjectMatcherRulePlugin = __webpack_require__(8465); -const RuleSetCompiler = __webpack_require__(89023); -const UseEffectRulePlugin = __webpack_require__(20552); -const LazySet = __webpack_require__(66205); -const { getScheme } = __webpack_require__(22169); -const { cachedCleverMerge, cachedSetProperty } = __webpack_require__(31074); -const { join } = __webpack_require__(33139); +const ChunkGraph = __webpack_require__(84275); +const Module = __webpack_require__(6309); +const ModuleFactory = __webpack_require__(60667); +const ModuleGraph = __webpack_require__(43714); +const { JAVASCRIPT_MODULE_TYPE_AUTO } = __webpack_require__(92891); +const NormalModule = __webpack_require__(17318); +const BasicEffectRulePlugin = __webpack_require__(22818); +const BasicMatcherRulePlugin = __webpack_require__(42510); +const ObjectMatcherRulePlugin = __webpack_require__(58927); +const RuleSetCompiler = __webpack_require__(49041); +const UseEffectRulePlugin = __webpack_require__(20110); +const LazySet = __webpack_require__(57876); +const { getScheme } = __webpack_require__(65598); +const { cachedCleverMerge, cachedSetProperty } = __webpack_require__(44639); +const { join } = __webpack_require__(96220); const { parseResource, parseResourceWithoutFragment -} = __webpack_require__(63146); +} = __webpack_require__(97451); /** @typedef {import("../declarations/WebpackOptions").ModuleOptionsNormalized} ModuleOptions */ /** @typedef {import("../declarations/WebpackOptions").RuleSetRule} RuleSetRule */ @@ -84124,6 +86214,7 @@ const EMPTY_GENERATOR_OPTIONS = {}; const EMPTY_ELEMENTS = []; const MATCH_RESOURCE_REGEX = /^([^!]+)!=!/; +const LEADING_DOT_EXTENSION_REGEX = /^[^.]/; const loaderToIdent = data => { if (!data.options) { @@ -84270,6 +86361,9 @@ class NormalModuleFactory extends ModuleFactory { ), generator: new HookMap( () => new SyncHook(["generator", "generatorOptions"]) + ), + createModuleClass: new HookMap( + () => new SyncBailHook(["createData", "resolveData"]) ) }); this.resolverFactory = resolverFactory; @@ -84345,9 +86439,18 @@ class NormalModuleFactory extends ModuleFactory { return callback(new Error("Empty dependency (no request)")); } - createdModule = new NormalModule( - /** @type {NormalModuleCreateData} */ (createData) - ); + // TODO webpack 6 make it required and move javascript/wasm/asset properties to own module + createdModule = this.hooks.createModuleClass + .for(createData.settings.type) + .call(createData, resolveData); + + if (!createdModule) { + createdModule = /** @type {Module} */ ( + new NormalModule( + /** @type {NormalModuleCreateData} */ (createData) + ) + ); + } } createdModule = this.hooks.module.call( @@ -84527,7 +86630,7 @@ class NormalModuleFactory extends ModuleFactory { -settings.type.length - 10 ); } else { - settings.type = "javascript/auto"; + settings.type = JAVASCRIPT_MODULE_TYPE_AUTO; const resourceDataForRules = matchResourceData || resourceData; const result = this.ruleSet.exec({ resource: resourceDataForRules.path, @@ -84548,6 +86651,11 @@ class NormalModuleFactory extends ModuleFactory { issuerLayer: contextInfo.issuerLayer || "" }); for (const r of result) { + // https://github.com/webpack/webpack/issues/16466 + // if a request exists PrePostAutoLoaders, should disable modifying Rule.type + if (r.type === "type" && noPrePostAutoLoaders) { + continue; + } if (r.type === "use") { if (!noAutoLoaders && !noPrePostAutoLoaders) { useLoaders.push(r.value); @@ -84773,7 +86881,7 @@ class NormalModuleFactory extends ModuleFactory { /** * @param {ModuleFactoryCreateData} data data object - * @param {function(Error=, ModuleFactoryResult=): void} callback callback + * @param {function((Error | null)=, ModuleFactoryResult=): void} callback callback * @returns {void} */ create(data, callback) { @@ -84880,10 +86988,10 @@ class NormalModuleFactory extends ModuleFactory { (err2, hints) => { if (err2) { err.message += ` -An fatal error happened during resolving additional hints for this error: ${err2.message}`; +A fatal error happened during resolving additional hints for this error: ${err2.message}`; err.stack += ` -An fatal error happened during resolving additional hints for this error: +A fatal error happened during resolving additional hints for this error: ${err2.stack}`; return callback(err); } @@ -84891,6 +86999,25 @@ ${err2.stack}`; err.message += ` ${hints.join("\n\n")}`; } + + // Check if the extension is missing a leading dot (e.g. "js" instead of ".js") + let appendResolveExtensionsHint = false; + const specifiedExtensions = Array.from( + resolver.options.extensions + ); + const expectedExtensions = specifiedExtensions.map(extension => { + if (LEADING_DOT_EXTENSION_REGEX.test(extension)) { + appendResolveExtensionsHint = true; + return `.${extension}`; + } + return extension; + }); + if (appendResolveExtensionsHint) { + err.message += `\nDid you miss the leading dot in 'resolve.extensions'? Did you mean '${JSON.stringify( + expectedExtensions + )}' instead of '${JSON.stringify(specifiedExtensions)}'?`; + } + callback(err); } ); @@ -85033,7 +87160,7 @@ If changing the source code is not an option there is also a resolve options cal context, item.loader, resolveContext, - (err, result) => { + (err, result, resolveRequest) => { if ( err && /^[^/]*$/.test(item.loader) && @@ -85060,8 +87187,18 @@ If changing the source code is not an option there is also a resolve options cal if (err) return callback(err); const parsedResult = this._parseResourceWithoutFragment(result); + + const type = /\.mjs$/i.test(parsedResult.path) + ? "module" + : /\.cjs$/i.test(parsedResult.path) + ? "commonjs" + : resolveRequest.descriptionFileData === undefined + ? undefined + : resolveRequest.descriptionFileData.type; + const resolved = { loader: parsedResult.path, + type, options: item.options === undefined ? parsedResult.query @@ -85159,7 +87296,7 @@ module.exports = NormalModuleFactory; /***/ }), -/***/ 83327: +/***/ 68787: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -85170,10 +87307,10 @@ module.exports = NormalModuleFactory; -const { join, dirname } = __webpack_require__(33139); +const { join, dirname } = __webpack_require__(96220); /** @typedef {import("./Compiler")} Compiler */ -/** @typedef {function(TODO): void} ModuleReplacer */ +/** @typedef {function(import("./NormalModuleFactory").ResolveData): void} ModuleReplacer */ class NormalModuleReplacementPlugin { /** @@ -85208,7 +87345,9 @@ class NormalModuleReplacementPlugin { }); nmf.hooks.afterResolve.tap("NormalModuleReplacementPlugin", result => { const createData = result.createData; - if (resourceRegExp.test(createData.resource)) { + if ( + resourceRegExp.test(/** @type {string} */ (createData.resource)) + ) { if (typeof newResource === "function") { newResource(result); } else { @@ -85221,7 +87360,7 @@ class NormalModuleReplacementPlugin { } else { createData.resource = join( fs, - dirname(fs, createData.resource), + dirname(fs, /** @type {string} */ (createData.resource)), newResource ); } @@ -85238,7 +87377,7 @@ module.exports = NormalModuleReplacementPlugin; /***/ }), -/***/ 36760: +/***/ 6537: /***/ (function(__unused_webpack_module, exports) { "use strict"; @@ -85256,7 +87395,7 @@ exports.STAGE_ADVANCED = 10; /***/ }), -/***/ 79535: +/***/ 28713: /***/ (function(module) { "use strict"; @@ -85275,7 +87414,7 @@ module.exports = OptionsApply; /***/ }), -/***/ 66425: +/***/ 76690: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -85311,7 +87450,7 @@ class Parser { * @returns {ParserState} the parser state */ parse(source, state) { - const AbstractMethodError = __webpack_require__(26907); + const AbstractMethodError = __webpack_require__(9906); throw new AbstractMethodError(); } } @@ -85321,7 +87460,7 @@ module.exports = Parser; /***/ }), -/***/ 80471: +/***/ 12630: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -85332,11 +87471,15 @@ module.exports = Parser; -const PrefetchDependency = __webpack_require__(51351); +const PrefetchDependency = __webpack_require__(98786); /** @typedef {import("./Compiler")} Compiler */ class PrefetchPlugin { + /** + * @param {string} context context or request if context is not set + * @param {string} [request] request + */ constructor(context, request) { if (request) { this.context = context; @@ -85379,7 +87522,7 @@ module.exports = PrefetchPlugin; /***/ }), -/***/ 25334: +/***/ 25483: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -85390,32 +87533,60 @@ module.exports = PrefetchPlugin; -const Compiler = __webpack_require__(27551); -const MultiCompiler = __webpack_require__(25939); -const NormalModule = __webpack_require__(55443); -const createSchemaValidation = __webpack_require__(94091); -const { contextify } = __webpack_require__(63146); +const Compiler = __webpack_require__(18771); +const MultiCompiler = __webpack_require__(85694); +const NormalModule = __webpack_require__(17318); +const createSchemaValidation = __webpack_require__(45488); +const { contextify } = __webpack_require__(97451); +/** @typedef {import("tapable").Tap} Tap */ /** @typedef {import("../declarations/plugins/ProgressPlugin").HandlerFunction} HandlerFunction */ /** @typedef {import("../declarations/plugins/ProgressPlugin").ProgressPluginArgument} ProgressPluginArgument */ /** @typedef {import("../declarations/plugins/ProgressPlugin").ProgressPluginOptions} ProgressPluginOptions */ +/** @typedef {import("./Dependency")} Dependency */ +/** @typedef {import("./Entrypoint").EntryOptions} EntryOptions */ +/** @typedef {import("./Module")} Module */ +/** @typedef {import("./logging/Logger").Logger} Logger */ + +/** + * @typedef {Object} CountsData + * @property {number} modulesCount modules count + * @property {number} dependenciesCount dependencies count + */ const validate = createSchemaValidation( - __webpack_require__(32122), - () => __webpack_require__(77155), + __webpack_require__(7373), + () => __webpack_require__(76423), { name: "Progress Plugin", baseDataPath: "options" } ); + +/** + * @param {number} a a + * @param {number} b b + * @param {number} c c + * @returns {number} median + */ const median3 = (a, b, c) => { return a + b + c - Math.max(a, b, c) - Math.min(a, b, c); }; +/** + * @param {boolean | null | undefined} profile need profile + * @param {Logger} logger logger + * @returns {defaultHandler} default handler + */ const createDefaultHandler = (profile, logger) => { - /** @type {{ value: string, time: number }[]} */ + /** @type {{ value: string | undefined, time: number }[]} */ const lastStateInfo = []; + /** + * @param {number} percentage percentage + * @param {string} msg message + * @param {...string} args additional arguments + */ const defaultHandler = (percentage, msg, ...args) => { if (profile) { if (percentage === 0) { @@ -85480,18 +87651,18 @@ const createDefaultHandler = (profile, logger) => { /** * @callback ReportProgress - * @param {number} p - * @param {...string} [args] + * @param {number} p percentage + * @param {...string} args additional arguments * @returns {void} */ -/** @type {WeakMap} */ +/** @type {WeakMap} */ const progressReporters = new WeakMap(); class ProgressPlugin { /** * @param {Compiler} compiler the current compiler - * @returns {ReportProgress} a progress reporter, if any + * @returns {ReportProgress | undefined} a progress reporter, if any */ static getReporter(compiler) { return progressReporters.get(compiler); @@ -85673,6 +87844,9 @@ class ProgressPlugin { }; // only used when showActiveModules is set + /** + * @param {Module} module the module + */ const moduleBuild = module => { const ident = module.identifier(); if (ident) { @@ -85682,11 +87856,18 @@ class ProgressPlugin { } }; + /** + * @param {Dependency} entry entry dependency + * @param {EntryOptions} options options object + */ const entryAdd = (entry, options) => { entriesCount++; if (entriesCount < 5 || entriesCount % 10 === 0) updateThrottled(); }; + /** + * @param {Module} module the module + */ const moduleDone = module => { doneModules++; if (showActiveModules) { @@ -85706,6 +87887,10 @@ class ProgressPlugin { if (doneModules < 50 || doneModules % 100 === 0) updateThrottled(); }; + /** + * @param {Dependency} entry entry dependency + * @param {EntryOptions} options options object + */ const entryDone = (entry, options) => { doneEntries++; update(); @@ -85715,6 +87900,7 @@ class ProgressPlugin { .getCache("ProgressPlugin") .getItemCache("counts", null); + /** @type {Promise | undefined} */ let cacheGetPromise; compiler.hooks.beforeCompile.tap("ProgressPlugin", () => { @@ -85737,15 +87923,17 @@ class ProgressPlugin { compiler.hooks.afterCompile.tapPromise("ProgressPlugin", compilation => { if (compilation.compiler.isChild()) return Promise.resolve(); - return cacheGetPromise.then(async oldData => { - if ( - !oldData || - oldData.modulesCount !== modulesCount || - oldData.dependenciesCount !== dependenciesCount - ) { - await cache.storePromise({ modulesCount, dependenciesCount }); + return /** @type {Promise} */ (cacheGetPromise).then( + async oldData => { + if ( + !oldData || + oldData.modulesCount !== modulesCount || + oldData.dependenciesCount !== dependenciesCount + ) { + await cache.storePromise({ modulesCount, dependenciesCount }); + } } - }); + ); }); compiler.hooks.compilation.tap("ProgressPlugin", compilation => { @@ -85826,9 +88014,9 @@ class ProgressPlugin { }; const numberOfHooks = Object.keys(hooks).length; Object.keys(hooks).forEach((name, idx) => { - const title = hooks[name]; + const title = hooks[/** @type {keyof typeof hooks} */ (name)]; const percentage = (idx / numberOfHooks) * 0.25 + 0.7; - compilation.hooks[name].intercept({ + compilation.hooks[/** @type {keyof typeof hooks} */ (name)].intercept({ name: "ProgressPlugin", call() { handler(percentage, "sealing", title); @@ -85863,6 +88051,12 @@ class ProgressPlugin { handler(0.65, "building"); } }); + /** + * @param {TODO} hook hook + * @param {number} progress progress from 0 to 1 + * @param {string} category category + * @param {string} name name + */ const interceptHook = (hook, progress, category, name) => { hook.intercept({ name: "ProgressPlugin", @@ -85879,6 +88073,9 @@ class ProgressPlugin { error() { handler(progress, category, name); }, + /** + * @param {Tap} tap tap + */ tap(tap) { progressReporters.set(compiler, (p, ...args) => { handler(progress, category, name, tap.name, ...args); @@ -85973,12 +88170,14 @@ ProgressPlugin.defaultOptions = { entries: true }; +ProgressPlugin.createDefaultHandler = createDefaultHandler; + module.exports = ProgressPlugin; /***/ }), -/***/ 41017: +/***/ 54404: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -85989,11 +88188,22 @@ module.exports = ProgressPlugin; -const ConstDependency = __webpack_require__(78284); -const ProvidedDependency = __webpack_require__(30927); -const { approve } = __webpack_require__(645); - +const { + JAVASCRIPT_MODULE_TYPE_AUTO, + JAVASCRIPT_MODULE_TYPE_DYNAMIC, + JAVASCRIPT_MODULE_TYPE_ESM +} = __webpack_require__(92891); +const ConstDependency = __webpack_require__(67538); +const ProvidedDependency = __webpack_require__(47468); +const { approve } = __webpack_require__(94213); + +/** @typedef {import("../declarations/WebpackOptions").JavascriptParserOptions} JavascriptParserOptions */ /** @typedef {import("./Compiler")} Compiler */ +/** @typedef {import("./Dependency").DependencyLocation} DependencyLocation */ +/** @typedef {import("./javascript/JavascriptParser")} JavascriptParser */ +/** @typedef {import("./javascript/JavascriptParser").Range} Range */ + +const PLUGIN_NAME = "ProvidePlugin"; class ProvidePlugin { /** @@ -86011,7 +88221,7 @@ class ProvidePlugin { apply(compiler) { const definitions = this.definitions; compiler.hooks.compilation.tap( - "ProvidePlugin", + PLUGIN_NAME, (compilation, { normalModuleFactory }) => { compilation.dependencyTemplates.set( ConstDependency, @@ -86025,6 +88235,11 @@ class ProvidePlugin { ProvidedDependency, new ProvidedDependency.Template() ); + /** + * @param {JavascriptParser} parser the parser + * @param {JavascriptParserOptions} parserOptions options + * @returns {void} + */ const handler = (parser, parserOptions) => { Object.keys(definitions).forEach(name => { const request = [].concat(definitions[name]); @@ -86032,11 +88247,11 @@ class ProvidePlugin { if (splittedName.length > 0) { splittedName.slice(1).forEach((_, i) => { const name = splittedName.slice(0, i + 1).join("."); - parser.hooks.canRename.for(name).tap("ProvidePlugin", approve); + parser.hooks.canRename.for(name).tap(PLUGIN_NAME, approve); }); } - parser.hooks.expression.for(name).tap("ProvidePlugin", expr => { + parser.hooks.expression.for(name).tap(PLUGIN_NAME, expr => { const nameIdentifier = name.includes(".") ? `__webpack_provided_${name.replace(/\./g, "_dot_")}` : name; @@ -86044,14 +88259,14 @@ class ProvidePlugin { request[0], nameIdentifier, request.slice(1), - expr.range + /** @type {Range} */ (expr.range) ); - dep.loc = expr.loc; + dep.loc = /** @type {DependencyLocation} */ (expr.loc); parser.state.module.addDependency(dep); return true; }); - parser.hooks.call.for(name).tap("ProvidePlugin", expr => { + parser.hooks.call.for(name).tap(PLUGIN_NAME, expr => { const nameIdentifier = name.includes(".") ? `__webpack_provided_${name.replace(/\./g, "_dot_")}` : name; @@ -86059,9 +88274,9 @@ class ProvidePlugin { request[0], nameIdentifier, request.slice(1), - expr.callee.range + /** @type {Range} */ (expr.callee.range) ); - dep.loc = expr.callee.loc; + dep.loc = /** @type {DependencyLocation} */ (expr.callee.loc); parser.state.module.addDependency(dep); parser.walkExpressions(expr.arguments); return true; @@ -86069,14 +88284,14 @@ class ProvidePlugin { }); }; normalModuleFactory.hooks.parser - .for("javascript/auto") - .tap("ProvidePlugin", handler); + .for(JAVASCRIPT_MODULE_TYPE_AUTO) + .tap(PLUGIN_NAME, handler); normalModuleFactory.hooks.parser - .for("javascript/dynamic") - .tap("ProvidePlugin", handler); + .for(JAVASCRIPT_MODULE_TYPE_DYNAMIC) + .tap(PLUGIN_NAME, handler); normalModuleFactory.hooks.parser - .for("javascript/esm") - .tap("ProvidePlugin", handler); + .for(JAVASCRIPT_MODULE_TYPE_ESM) + .tap(PLUGIN_NAME, handler); } ); } @@ -86087,7 +88302,7 @@ module.exports = ProvidePlugin; /***/ }), -/***/ 11794: +/***/ 74360: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -86099,8 +88314,9 @@ module.exports = ProvidePlugin; const { OriginalSource, RawSource } = __webpack_require__(59728); -const Module = __webpack_require__(96040); -const makeSerializable = __webpack_require__(23827); +const Module = __webpack_require__(6309); +const { JAVASCRIPT_MODULE_TYPE_DYNAMIC } = __webpack_require__(92891); +const makeSerializable = __webpack_require__(83626); /** @typedef {import("webpack-sources").Source} Source */ /** @typedef {import("../declarations/WebpackOptions").WebpackOptionsNormalized} WebpackOptions */ @@ -86115,6 +88331,8 @@ const makeSerializable = __webpack_require__(23827); /** @typedef {import("./ResolverFactory").ResolverWithOptions} ResolverWithOptions */ /** @typedef {import("./RuntimeTemplate")} RuntimeTemplate */ /** @typedef {import("./WebpackError")} WebpackError */ +/** @typedef {import("./serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */ +/** @typedef {import("./serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */ /** @typedef {import("./util/Hash")} Hash */ /** @typedef {import("./util/fs").InputFileSystem} InputFileSystem */ @@ -86128,7 +88346,7 @@ class RawModule extends Module { * @param {ReadonlySet=} runtimeRequirements runtime requirements needed for the source code */ constructor(source, identifier, readableIdentifier, runtimeRequirements) { - super("javascript/dynamic", null); + super(JAVASCRIPT_MODULE_TYPE_DYNAMIC, null); this.sourceStr = source; this.identifierStr = identifier || this.sourceStr; this.readableIdentifierStr = readableIdentifier || this.identifierStr; @@ -86162,7 +88380,9 @@ class RawModule extends Module { * @returns {string} a user readable identifier of the module */ readableIdentifier(requestShortener) { - return requestShortener.shorten(this.readableIdentifierStr); + return /** @type {string} */ ( + requestShortener.shorten(this.readableIdentifierStr) + ); } /** @@ -86217,6 +88437,9 @@ class RawModule extends Module { super.updateHash(hash, context); } + /** + * @param {ObjectSerializerContext} context context + */ serialize(context) { const { write } = context; @@ -86228,6 +88451,9 @@ class RawModule extends Module { super.serialize(context); } + /** + * @param {ObjectDeserializerContext} context context + */ deserialize(context) { const { read } = context; @@ -86247,7 +88473,7 @@ module.exports = RawModule; /***/ }), -/***/ 19180: +/***/ 56838: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -86258,8 +88484,8 @@ module.exports = RawModule; -const { compareNumbers } = __webpack_require__(29355); -const identifierUtils = __webpack_require__(63146); +const { compareNumbers } = __webpack_require__(95978); +const identifierUtils = __webpack_require__(97451); /** @typedef {import("./Chunk")} Chunk */ /** @typedef {import("./Compiler")} Compiler */ @@ -86322,7 +88548,7 @@ class RecordIdsPlugin { compilation.hooks.recordModules.tap( "RecordIdsPlugin", /** - * @param {Module[]} modules the modules array + * @param {Iterable} modules the modules array * @param {Records} records the records object * @returns {void} */ @@ -86345,7 +88571,7 @@ class RecordIdsPlugin { compilation.hooks.reviveModules.tap( "RecordIdsPlugin", /** - * @param {Module[]} modules the modules array + * @param {Iterable} modules the modules array * @param {Records} records the records object * @returns {void} */ @@ -86419,7 +88645,7 @@ class RecordIdsPlugin { compilation.hooks.recordChunks.tap( "RecordIdsPlugin", /** - * @param {Chunk[]} chunks the chunks array + * @param {Iterable} chunks the chunks array * @param {Records} records the records object * @returns {void} */ @@ -86445,7 +88671,7 @@ class RecordIdsPlugin { compilation.hooks.reviveChunks.tap( "RecordIdsPlugin", /** - * @param {Chunk[]} chunks the chunks array + * @param {Iterable} chunks the chunks array * @param {Records} records the records object * @returns {void} */ @@ -86493,7 +88719,7 @@ module.exports = RecordIdsPlugin; /***/ }), -/***/ 89692: +/***/ 25931: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -86504,7 +88730,7 @@ module.exports = RecordIdsPlugin; -const { contextify } = __webpack_require__(63146); +const { contextify } = __webpack_require__(97451); class RequestShortener { /** @@ -86535,7 +88761,7 @@ module.exports = RequestShortener; /***/ }), -/***/ 35662: +/***/ 81345: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -86546,13 +88772,21 @@ module.exports = RequestShortener; -const RuntimeGlobals = __webpack_require__(34623); -const ConstDependency = __webpack_require__(78284); +const { + JAVASCRIPT_MODULE_TYPE_AUTO, + JAVASCRIPT_MODULE_TYPE_DYNAMIC +} = __webpack_require__(92891); +const RuntimeGlobals = __webpack_require__(61539); +const ConstDependency = __webpack_require__(67538); const { toConstantDependency -} = __webpack_require__(645); +} = __webpack_require__(94213); +/** @typedef {import("../declarations/WebpackOptions").JavascriptParserOptions} JavascriptParserOptions */ /** @typedef {import("./Compiler")} Compiler */ +/** @typedef {import("./javascript/JavascriptParser")} JavascriptParser */ + +const PLUGIN_NAME = "RequireJsStuffPlugin"; module.exports = class RequireJsStuffPlugin { /** @@ -86562,12 +88796,17 @@ module.exports = class RequireJsStuffPlugin { */ apply(compiler) { compiler.hooks.compilation.tap( - "RequireJsStuffPlugin", + PLUGIN_NAME, (compilation, { normalModuleFactory }) => { compilation.dependencyTemplates.set( ConstDependency, new ConstDependency.Template() ); + /** + * @param {JavascriptParser} parser the parser + * @param {JavascriptParserOptions} parserOptions options + * @returns {void} + */ const handler = (parser, parserOptions) => { if ( parserOptions.requireJs === undefined || @@ -86578,27 +88817,21 @@ module.exports = class RequireJsStuffPlugin { parser.hooks.call .for("require.config") - .tap( - "RequireJsStuffPlugin", - toConstantDependency(parser, "undefined") - ); + .tap(PLUGIN_NAME, toConstantDependency(parser, "undefined")); parser.hooks.call .for("requirejs.config") - .tap( - "RequireJsStuffPlugin", - toConstantDependency(parser, "undefined") - ); + .tap(PLUGIN_NAME, toConstantDependency(parser, "undefined")); parser.hooks.expression .for("require.version") .tap( - "RequireJsStuffPlugin", + PLUGIN_NAME, toConstantDependency(parser, JSON.stringify("0.0.0")) ); parser.hooks.expression .for("requirejs.onError") .tap( - "RequireJsStuffPlugin", + PLUGIN_NAME, toConstantDependency( parser, RuntimeGlobals.uncaughtErrorHandler, @@ -86607,11 +88840,11 @@ module.exports = class RequireJsStuffPlugin { ); }; normalModuleFactory.hooks.parser - .for("javascript/auto") - .tap("RequireJsStuffPlugin", handler); + .for(JAVASCRIPT_MODULE_TYPE_AUTO) + .tap(PLUGIN_NAME, handler); normalModuleFactory.hooks.parser - .for("javascript/dynamic") - .tap("RequireJsStuffPlugin", handler); + .for(JAVASCRIPT_MODULE_TYPE_DYNAMIC) + .tap(PLUGIN_NAME, handler); } ); } @@ -86620,7 +88853,7 @@ module.exports = class RequireJsStuffPlugin { /***/ }), -/***/ 29955: +/***/ 639: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -86631,13 +88864,13 @@ module.exports = class RequireJsStuffPlugin { -const Factory = (__webpack_require__(65260).ResolverFactory); +const Factory = (__webpack_require__(83866).ResolverFactory); const { HookMap, SyncHook, SyncWaterfallHook } = __webpack_require__(70793); const { cachedCleverMerge, removeOperations, resolveByProperty -} = __webpack_require__(31074); +} = __webpack_require__(44639); /** @typedef {import("enhanced-resolve").ResolveOptions} ResolveOptions */ /** @typedef {import("enhanced-resolve").Resolver} Resolver */ @@ -86779,7 +89012,7 @@ module.exports = class ResolverFactory { /***/ }), -/***/ 34623: +/***/ 61539: /***/ (function(__unused_webpack_module, exports) { "use strict"; @@ -86973,6 +89206,11 @@ exports.createScriptUrl = "__webpack_require__.tu"; */ exports.getTrustedTypesPolicy = "__webpack_require__.tt"; +/** + * a flag when a chunk has a fetch priority + */ +exports.hasFetchPriority = "has fetch priority"; + /** * the chunk name of the chunk with the runtime */ @@ -87168,7 +89406,7 @@ exports.asyncModule = "__webpack_require__.a"; /***/ }), -/***/ 81196: +/***/ 21296: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -87181,7 +89419,8 @@ exports.asyncModule = "__webpack_require__.a"; const { RawSource } = __webpack_require__(59728); const OriginalSource = (__webpack_require__(59728).OriginalSource); -const Module = __webpack_require__(96040); +const Module = __webpack_require__(6309); +const { WEBPACK_MODULE_TYPE_RUNTIME } = __webpack_require__(92891); /** @typedef {import("webpack-sources").Source} Source */ /** @typedef {import("../declarations/WebpackOptions").WebpackOptionsNormalized} WebpackOptions */ @@ -87198,7 +89437,7 @@ const Module = __webpack_require__(96040); /** @typedef {import("./util/Hash")} Hash */ /** @typedef {import("./util/fs").InputFileSystem} InputFileSystem */ -const TYPES = new Set(["runtime"]); +const TYPES = new Set([WEBPACK_MODULE_TYPE_RUNTIME]); class RuntimeModule extends Module { /** @@ -87206,20 +89445,20 @@ class RuntimeModule extends Module { * @param {number=} stage an optional stage */ constructor(name, stage = 0) { - super("runtime"); + super(WEBPACK_MODULE_TYPE_RUNTIME); this.name = name; this.stage = stage; this.buildMeta = {}; this.buildInfo = {}; - /** @type {Compilation} */ + /** @type {Compilation | undefined} */ this.compilation = undefined; - /** @type {Chunk} */ + /** @type {Chunk | undefined} */ this.chunk = undefined; - /** @type {ChunkGraph} */ + /** @type {ChunkGraph | undefined} */ this.chunkGraph = undefined; this.fullHash = false; this.dependentHash = false; - /** @type {string} */ + /** @type {string | undefined} */ this._cachedGeneratedCode = undefined; } @@ -87290,7 +89529,7 @@ class RuntimeModule extends Module { hash.update(this.getGeneratedCode()); } } catch (err) { - hash.update(err.message); + hash.update(/** @type {Error} */ (err).message); } super.updateHash(hash, context); } @@ -87311,7 +89550,7 @@ class RuntimeModule extends Module { const generatedCode = this.getGeneratedCode(); if (generatedCode) { sources.set( - "runtime", + WEBPACK_MODULE_TYPE_RUNTIME, this.useSourceMap || this.useSimpleSourceMap ? new OriginalSource(generatedCode, this.identifier()) : new RawSource(generatedCode) @@ -87339,19 +89578,19 @@ class RuntimeModule extends Module { /* istanbul ignore next */ /** * @abstract - * @returns {string} runtime code + * @returns {string | null} runtime code */ generate() { - const AbstractMethodError = __webpack_require__(26907); + const AbstractMethodError = __webpack_require__(9906); throw new AbstractMethodError(); } /** - * @returns {string} runtime code + * @returns {string | null} runtime code */ getGeneratedCode() { if (this._cachedGeneratedCode) { - return this._cachedGeneratedCode; + return /** @type {string | null} */ (this._cachedGeneratedCode); } return (this._cachedGeneratedCode = this.generate()); } @@ -87389,7 +89628,7 @@ module.exports = RuntimeModule; /***/ }), -/***/ 78921: +/***/ 16697: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -87400,35 +89639,35 @@ module.exports = RuntimeModule; -const RuntimeGlobals = __webpack_require__(34623); -const { getChunkFilenameTemplate } = __webpack_require__(15405); -const RuntimeRequirementsDependency = __webpack_require__(72885); -const JavascriptModulesPlugin = __webpack_require__(96230); -const AsyncModuleRuntimeModule = __webpack_require__(92237); -const AutoPublicPathRuntimeModule = __webpack_require__(95055); -const BaseUriRuntimeModule = __webpack_require__(17661); -const CompatGetDefaultExportRuntimeModule = __webpack_require__(31480); -const CompatRuntimeModule = __webpack_require__(59758); -const CreateFakeNamespaceObjectRuntimeModule = __webpack_require__(45075); -const CreateScriptRuntimeModule = __webpack_require__(9682); -const CreateScriptUrlRuntimeModule = __webpack_require__(55414); -const DefinePropertyGettersRuntimeModule = __webpack_require__(47441); -const EnsureChunkRuntimeModule = __webpack_require__(73057); -const GetChunkFilenameRuntimeModule = __webpack_require__(77994); -const GetMainFilenameRuntimeModule = __webpack_require__(33847); -const GetTrustedTypesPolicyRuntimeModule = __webpack_require__(49622); -const GlobalRuntimeModule = __webpack_require__(16255); -const HasOwnPropertyRuntimeModule = __webpack_require__(41799); -const LoadScriptRuntimeModule = __webpack_require__(13139); -const MakeNamespaceObjectRuntimeModule = __webpack_require__(89195); -const NonceRuntimeModule = __webpack_require__(89287); -const OnChunksLoadedRuntimeModule = __webpack_require__(81417); -const PublicPathRuntimeModule = __webpack_require__(9079); -const RelativeUrlRuntimeModule = __webpack_require__(52945); -const RuntimeIdRuntimeModule = __webpack_require__(58771); -const SystemContextRuntimeModule = __webpack_require__(88194); -const ShareRuntimeModule = __webpack_require__(90182); -const StringXor = __webpack_require__(78565); +const RuntimeGlobals = __webpack_require__(61539); +const { getChunkFilenameTemplate } = __webpack_require__(90429); +const RuntimeRequirementsDependency = __webpack_require__(26068); +const JavascriptModulesPlugin = __webpack_require__(70061); +const AsyncModuleRuntimeModule = __webpack_require__(62985); +const AutoPublicPathRuntimeModule = __webpack_require__(74537); +const BaseUriRuntimeModule = __webpack_require__(33022); +const CompatGetDefaultExportRuntimeModule = __webpack_require__(85803); +const CompatRuntimeModule = __webpack_require__(19172); +const CreateFakeNamespaceObjectRuntimeModule = __webpack_require__(67032); +const CreateScriptRuntimeModule = __webpack_require__(15707); +const CreateScriptUrlRuntimeModule = __webpack_require__(27426); +const DefinePropertyGettersRuntimeModule = __webpack_require__(97053); +const EnsureChunkRuntimeModule = __webpack_require__(91492); +const GetChunkFilenameRuntimeModule = __webpack_require__(12664); +const GetMainFilenameRuntimeModule = __webpack_require__(51850); +const GetTrustedTypesPolicyRuntimeModule = __webpack_require__(4412); +const GlobalRuntimeModule = __webpack_require__(91708); +const HasOwnPropertyRuntimeModule = __webpack_require__(10590); +const LoadScriptRuntimeModule = __webpack_require__(94304); +const MakeNamespaceObjectRuntimeModule = __webpack_require__(92337); +const NonceRuntimeModule = __webpack_require__(39978); +const OnChunksLoadedRuntimeModule = __webpack_require__(82777); +const PublicPathRuntimeModule = __webpack_require__(28825); +const RelativeUrlRuntimeModule = __webpack_require__(4140); +const RuntimeIdRuntimeModule = __webpack_require__(25743); +const SystemContextRuntimeModule = __webpack_require__(58569); +const ShareRuntimeModule = __webpack_require__(71488); +const StringXor = __webpack_require__(81650); /** @typedef {import("./Chunk")} Chunk */ /** @typedef {import("./Compiler")} Compiler */ @@ -87494,6 +89733,10 @@ class RuntimePlugin { apply(compiler) { compiler.hooks.compilation.tap("RuntimePlugin", compilation => { const globalChunkLoading = compilation.outputOptions.chunkLoading; + /** + * @param {Chunk} chunk chunk + * @returns {boolean} true, when chunk loading is disabled for the chunk + */ const isChunkLoadingDisabledForChunk = chunk => { const options = chunk.getEntryOptions(); const chunkLoading = @@ -87519,7 +89762,8 @@ class RuntimePlugin { }); } for (const req of Object.keys(TREE_DEPENDENCIES)) { - const deps = TREE_DEPENDENCIES[req]; + const deps = + TREE_DEPENDENCIES[/** @type {keyof TREE_DEPENDENCIES} */ (req)]; compilation.hooks.runtimeRequirementInTree .for(req) .tap("RuntimePlugin", (chunk, set) => { @@ -87527,7 +89771,8 @@ class RuntimePlugin { }); } for (const req of Object.keys(MODULE_DEPENDENCIES)) { - const deps = MODULE_DEPENDENCIES[req]; + const deps = + MODULE_DEPENDENCIES[/** @type {keyof MODULE_DEPENDENCIES} */ (req)]; compilation.hooks.runtimeRequirementInModule .for(req) .tap("RuntimePlugin", (chunk, set) => { @@ -87768,9 +90013,10 @@ class RuntimePlugin { if (withCreateScriptUrl) { set.add(RuntimeGlobals.createScriptUrl); } + const withFetchPriority = set.has(RuntimeGlobals.hasFetchPriority); compilation.addRuntimeModule( chunk, - new LoadScriptRuntimeModule(withCreateScriptUrl) + new LoadScriptRuntimeModule(withCreateScriptUrl, withFetchPriority) ); return true; }); @@ -87866,7 +90112,7 @@ module.exports = RuntimePlugin; /***/ }), -/***/ 96303: +/***/ 42741: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -87877,13 +90123,13 @@ module.exports = RuntimePlugin; -const InitFragment = __webpack_require__(53658); -const RuntimeGlobals = __webpack_require__(34623); -const Template = __webpack_require__(88070); -const { equals } = __webpack_require__(91696); -const compileBooleanMatcher = __webpack_require__(25526); -const propertyAccess = __webpack_require__(92884); -const { forEachRuntime, subtractRuntime } = __webpack_require__(55693); +const InitFragment = __webpack_require__(44508); +const RuntimeGlobals = __webpack_require__(61539); +const Template = __webpack_require__(88835); +const { equals } = __webpack_require__(22150); +const compileBooleanMatcher = __webpack_require__(1258); +const propertyAccess = __webpack_require__(60305); +const { forEachRuntime, subtractRuntime } = __webpack_require__(69965); /** @typedef {import("../declarations/WebpackOptions").OutputNormalized} OutputOptions */ /** @typedef {import("./AsyncDependenciesBlock")} AsyncDependenciesBlock */ @@ -88268,7 +90514,7 @@ class RuntimeTemplate { /** * @param {Object} options options object - * @param {Module} options.module the module + * @param {Module | null} options.module the module * @param {ChunkGraph} options.chunkGraph the chunk graph * @param {string} options.request the request that should be printed as comment * @param {boolean=} options.weak if the dependency is weak (will create a nice error message) @@ -88301,7 +90547,7 @@ class RuntimeTemplate { ); } runtimeRequirements.add(RuntimeGlobals.require); - return `__webpack_require__(${this.moduleId({ + return `${RuntimeGlobals.require}(${this.moduleId({ module, chunkGraph, request, @@ -88311,7 +90557,7 @@ class RuntimeTemplate { /** * @param {Object} options options object - * @param {Module} options.module the module + * @param {Module | null} options.module the module * @param {ChunkGraph} options.chunkGraph the chunk graph * @param {string} options.request the request that should be printed as comment * @param {boolean=} options.weak if the dependency is weak (will create a nice error message) @@ -88497,7 +90743,7 @@ class RuntimeTemplate { )})`; } else { runtimeRequirements.add(RuntimeGlobals.require); - appending = `.then(__webpack_require__.bind(__webpack_require__, ${comment}${idExpr}))`; + appending = `.then(${RuntimeGlobals.require}.bind(${RuntimeGlobals.require}, ${comment}${idExpr}))`; } break; case "dynamic": @@ -88523,7 +90769,7 @@ class RuntimeTemplate { )})`; } else { runtimeRequirements.add(RuntimeGlobals.require); - appending = `.then(__webpack_require__.bind(__webpack_require__, ${comment}${idExpr}))`; + appending = `.then(${RuntimeGlobals.require}.bind(${RuntimeGlobals.require}, ${comment}${idExpr}))`; } appending += `.then(${this.returningFunction( `${RuntimeGlobals.createFakeNamespaceObject}(m, ${fakeType})`, @@ -88538,7 +90784,7 @@ class RuntimeTemplate { `${header}return ${returnExpression};` )})`; } else { - appending = `.then(${RuntimeGlobals.createFakeNamespaceObject}.bind(__webpack_require__, ${comment}${idExpr}, ${fakeType}))`; + appending = `.then(${RuntimeGlobals.createFakeNamespaceObject}.bind(${RuntimeGlobals.require}, ${comment}${idExpr}, ${fakeType}))`; } } break; @@ -88645,7 +90891,7 @@ class RuntimeTemplate { originModule.buildMeta.strictHarmonyModule ); runtimeRequirements.add(RuntimeGlobals.require); - const importContent = `/* harmony import */ ${optDeclaration}${importVar} = __webpack_require__(${moduleId});\n`; + const importContent = `/* harmony import */ ${optDeclaration}${importVar} = ${RuntimeGlobals.require}(${moduleId});\n`; if (exportsType === "dynamic") { runtimeRequirements.add(RuntimeGlobals.compatGetDefaultExport); @@ -88666,10 +90912,10 @@ class RuntimeTemplate { * @param {Module} options.originModule the origin module * @param {boolean|undefined} options.asiSafe true, if location is safe for ASI, a bracket can be emitted * @param {boolean} options.isCall true, if expression will be called - * @param {boolean} options.callContext when false, call context will not be preserved + * @param {boolean | null} options.callContext when false, call context will not be preserved * @param {boolean} options.defaultInterop when true and accessing the default exports, interop code will be generated * @param {string} options.importVar the identifier name of the import variable - * @param {InitFragment[]} options.initFragments init fragments will be added here + * @param {InitFragment[]} options.initFragments init fragments will be added here * @param {RuntimeSpec} options.runtime runtime for which this code will be generated * @param {Set} options.runtimeRequirements if set, will be filled with runtime requirements * @returns {string} expression @@ -88811,11 +91057,29 @@ class RuntimeTemplate { if (chunks.length === 1) { const chunkId = JSON.stringify(chunks[0].id); runtimeRequirements.add(RuntimeGlobals.ensureChunk); - return `${RuntimeGlobals.ensureChunk}(${comment}${chunkId})`; + + const fetchPriority = chunkGroup.options.fetchPriority; + + if (fetchPriority) { + runtimeRequirements.add(RuntimeGlobals.hasFetchPriority); + } + + return `${RuntimeGlobals.ensureChunk}(${comment}${chunkId}${ + fetchPriority ? `, ${JSON.stringify(fetchPriority)}` : "" + })`; } else if (chunks.length > 0) { runtimeRequirements.add(RuntimeGlobals.ensureChunk); + + const fetchPriority = chunkGroup.options.fetchPriority; + + if (fetchPriority) { + runtimeRequirements.add(RuntimeGlobals.hasFetchPriority); + } + const requireChunkId = chunk => - `${RuntimeGlobals.ensureChunk}(${JSON.stringify(chunk.id)})`; + `${RuntimeGlobals.ensureChunk}(${JSON.stringify(chunk.id)}${ + fetchPriority ? `, ${JSON.stringify(fetchPriority)}` : "" + })`; return `Promise.all(${comment.trim()}[${chunks .map(requireChunkId) .join(", ")}])`; @@ -88915,7 +91179,7 @@ module.exports = RuntimeTemplate; /***/ }), -/***/ 56967: +/***/ 48588: /***/ (function(module) { "use strict"; @@ -88926,11 +91190,23 @@ module.exports = RuntimeTemplate; +/** @typedef {import("./ModuleFactory").ModuleFactoryCreateData} ModuleFactoryCreateData */ +/** @typedef {import("./ModuleFactory").ModuleFactoryResult} ModuleFactoryResult */ +/** @typedef {import("./ModuleGraph")} ModuleGraph */ + class SelfModuleFactory { + /** + * @param {ModuleGraph} moduleGraph module graph + */ constructor(moduleGraph) { this.moduleGraph = moduleGraph; } + /** + * @param {ModuleFactoryCreateData} data data object + * @param {function((Error | null)=, ModuleFactoryResult=): void} callback callback + * @returns {void} + */ create(data, callback) { const module = this.moduleGraph.getParentModule(data.dependencies[0]); callback(null, { @@ -88944,7 +91220,7 @@ module.exports = SelfModuleFactory; /***/ }), -/***/ 53592: +/***/ 73273: /***/ (function(__unused_webpack_module, exports) { "use strict"; @@ -88979,7 +91255,7 @@ exports.formatSize = size => { /***/ }), -/***/ 58501: +/***/ 35449: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -88990,11 +91266,15 @@ exports.formatSize = size => { -const JavascriptModulesPlugin = __webpack_require__(96230); +const JavascriptModulesPlugin = __webpack_require__(70061); +/** @typedef {import("../declarations/plugins/SourceMapDevToolPlugin").SourceMapDevToolPluginOptions} SourceMapDevToolPluginOptions */ /** @typedef {import("./Compilation")} Compilation */ class SourceMapDevToolModuleOptionsPlugin { + /** + * @param {SourceMapDevToolPluginOptions} options options + */ constructor(options) { this.options = options; } @@ -89044,7 +91324,7 @@ module.exports = SourceMapDevToolModuleOptionsPlugin; /***/ }), -/***/ 92732: +/***/ 44937: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -89057,14 +91337,14 @@ module.exports = SourceMapDevToolModuleOptionsPlugin; const asyncLib = __webpack_require__(47087); const { ConcatSource, RawSource } = __webpack_require__(59728); -const Compilation = __webpack_require__(38292); -const ModuleFilenameHelpers = __webpack_require__(38738); -const ProgressPlugin = __webpack_require__(25334); -const SourceMapDevToolModuleOptionsPlugin = __webpack_require__(58501); -const createSchemaValidation = __webpack_require__(94091); -const createHash = __webpack_require__(94624); -const { relative, dirname } = __webpack_require__(33139); -const { makePathsAbsolute } = __webpack_require__(63146); +const Compilation = __webpack_require__(20417); +const ModuleFilenameHelpers = __webpack_require__(82444); +const ProgressPlugin = __webpack_require__(25483); +const SourceMapDevToolModuleOptionsPlugin = __webpack_require__(35449); +const createSchemaValidation = __webpack_require__(45488); +const createHash = __webpack_require__(31147); +const { relative, dirname } = __webpack_require__(96220); +const { makePathsAbsolute } = __webpack_require__(97451); /** @typedef {import("webpack-sources").MapOptions} MapOptions */ /** @typedef {import("webpack-sources").Source} Source */ @@ -89072,15 +91352,17 @@ const { makePathsAbsolute } = __webpack_require__(63146); /** @typedef {import("./Cache").Etag} Etag */ /** @typedef {import("./CacheFacade").ItemCacheFacade} ItemCacheFacade */ /** @typedef {import("./Chunk")} Chunk */ +/** @typedef {import("./Compilation").Asset} Asset */ /** @typedef {import("./Compilation").AssetInfo} AssetInfo */ +/** @typedef {import("./Compilation").PathData} PathData */ /** @typedef {import("./Compiler")} Compiler */ /** @typedef {import("./Module")} Module */ /** @typedef {import("./NormalModule").SourceMap} SourceMap */ /** @typedef {import("./util/Hash")} Hash */ const validate = createSchemaValidation( - __webpack_require__(3512), - () => __webpack_require__(90116), + __webpack_require__(90605), + () => __webpack_require__(74285), { name: "SourceMap DevTool Plugin", baseDataPath: "options" @@ -89097,13 +91379,32 @@ const validate = createSchemaValidation( * @property {ItemCacheFacade} cacheItem cache item */ +const METACHARACTERS_REGEXP = /[-[\]\\/{}()*+?.^$|]/g; +const CONTENT_HASH_DETECT_REGEXP = /\[contenthash(:\w+)?\]/; +const CSS_AND_JS_MODULE_EXTENSIONS_REGEXP = /\.((c|m)?js|css)($|\?)/i; +const CSS_EXTENSION_DETECT_REGEXP = /\.css($|\?)/i; +const MAP_URL_COMMENT_REGEXP = /\[map\]/g; +const URL_COMMENT_REGEXP = /\[url\]/g; +const URL_FORMATTING_REGEXP = /^\n\/\/(.*)$/; + +/** + * Reset's .lastIndex of stateful Regular Expressions + * For when `test` or `exec` is called on them + * @param {RegExp} regexp Stateful Regular Expression to be reset + * @returns {void} + * + */ +const resetRegexpState = regexp => { + regexp.lastIndex = -1; +}; + /** * Escapes regular expression metacharacters * @param {string} str String to quote * @returns {string} Escaped string */ const quoteMeta = str => { - return str.replace(/[-[\]\\/{}()*+?.^$|]/g, "\\$&"); + return str.replace(METACHARACTERS_REGEXP, "\\$&"); }; /** @@ -89170,7 +91471,7 @@ class SourceMapDevToolPlugin { /** @type {string | false} */ this.sourceMapFilename = options.filename; - /** @type {string | false} */ + /** @type {string | false | (function(PathData, AssetInfo=): string)}} */ this.sourceMappingURLComment = options.append === false ? false @@ -89202,7 +91503,7 @@ class SourceMapDevToolPlugin { const fallbackModuleFilenameTemplate = this.fallbackModuleFilenameTemplate; const requestShortener = compiler.requestShortener; const options = this.options; - options.test = options.test || /\.((c|m)?js|css)($|\?)/i; + options.test = options.test || CSS_AND_JS_MODULE_EXTENSIONS_REGEXP; const matchObject = ModuleFilenameHelpers.matchObject.bind( undefined, @@ -89257,7 +91558,9 @@ class SourceMapDevToolPlugin { asyncLib.each( files, (file, callback) => { - const asset = compilation.getAsset(file); + const asset = + /** @type {Readonly} */ + (compilation.getAsset(file)); if (asset.info.related && asset.info.related.sourceMap) { fileIndex++; return callback(); @@ -89393,7 +91696,9 @@ class SourceMapDevToolPlugin { // find modules with conflicting source names for (let idx = 0; idx < allModules.length; idx++) { const module = allModules[idx]; - let sourceName = moduleToSourceNameMapping.get(module); + let sourceName = + /** @type {string} */ + (moduleToSourceNameMapping.get(module)); let hasName = conflictDetectionSet.has(sourceName); if (!hasName) { conflictDetectionSet.add(sourceName); @@ -89459,7 +91764,9 @@ class SourceMapDevToolPlugin { sourceMap.file = file; const usesContentHash = sourceMapFilename && - /\[contenthash(:\w+)?\]/.test(sourceMapFilename); + CONTENT_HASH_DETECT_REGEXP.test(sourceMapFilename); + + resetRegexpState(CONTENT_HASH_DETECT_REGEXP); // If SourceMap and asset uses contenthash, avoid a circular dependency by hiding hash in `file` if (usesContentHash && task.assetInfo.contenthash) { @@ -89476,15 +91783,19 @@ class SourceMapDevToolPlugin { ); } - /** @type {string | false} */ + /** @type {string | false | (function(PathData, AssetInfo=): string)} */ let currentSourceMappingURLComment = sourceMappingURLComment; + let cssExtensionDetected = + CSS_EXTENSION_DETECT_REGEXP.test(file); + resetRegexpState(CSS_EXTENSION_DETECT_REGEXP); if ( currentSourceMappingURLComment !== false && - /\.css($|\?)/i.test(file) + typeof currentSourceMappingURLComment !== "function" && + cssExtensionDetected ) { currentSourceMappingURLComment = currentSourceMappingURLComment.replace( - /^\n\/\/(.*)$/, + URL_FORMATTING_REGEXP, "\n/*$1*/" ); } @@ -89560,15 +91871,20 @@ class SourceMapDevToolPlugin { "SourceMapDevToolPlugin: append can't be false when no filename is provided" ); } + if (typeof currentSourceMappingURLComment === "function") { + throw new Error( + "SourceMapDevToolPlugin: append can't be a function when no filename is provided" + ); + } /** * Add source map as data url to asset */ const asset = new ConcatSource( new RawSource(source), currentSourceMappingURLComment - .replace(/\[map\]/g, () => sourceMapString) + .replace(MAP_URL_COMMENT_REGEXP, () => sourceMapString) .replace( - /\[url\]/g, + URL_COMMENT_REGEXP, () => `data:application/json;charset=utf-8;base64,${Buffer.from( sourceMapString, @@ -89612,7 +91928,7 @@ module.exports = SourceMapDevToolPlugin; /***/ }), -/***/ 62218: +/***/ 92646: /***/ (function(module) { "use strict"; @@ -89704,7 +92020,7 @@ module.exports = Stats; /***/ }), -/***/ 88070: +/***/ 88835: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -89716,6 +92032,8 @@ module.exports = Stats; const { ConcatSource, PrefixSource } = __webpack_require__(59728); +const { WEBPACK_MODULE_TYPE_RUNTIME } = __webpack_require__(92891); +const RuntimeGlobals = __webpack_require__(61539); /** @typedef {import("webpack-sources").Source} Source */ /** @typedef {import("../declarations/WebpackOptions").Output} OutputOptions */ @@ -89998,7 +92316,7 @@ class Template { * @param {Module[]} modules modules to render (should be ordered by identifier) * @param {function(Module): Source} renderModule function to render a module * @param {string=} prefix applying prefix strings - * @returns {Source} rendered chunk modules in a Source object + * @returns {Source | null} rendered chunk modules in a Source object or null if no modules */ static renderChunkModules(renderContext, modules, renderModule, prefix = "") { const { chunkGraph } = renderContext; @@ -90072,7 +92390,7 @@ class Template { runtimeSource = codeGenerationResults.getSource( module, renderContext.chunk.runtime, - "runtime" + WEBPACK_MODULE_TYPE_RUNTIME ); } else { const codeGenResult = module.codeGeneration({ @@ -90114,7 +92432,7 @@ class Template { return new PrefixSource( "/******/ ", new ConcatSource( - "function(__webpack_require__) { // webpackRuntimeModules\n", + `function(${RuntimeGlobals.require}) { // webpackRuntimeModules\n`, this.renderRuntimeModules(runtimeModules, renderContext), "}\n" ) @@ -90131,7 +92449,7 @@ module.exports.NUMBER_OF_IDENTIFIER_CONTINUATION_CHARS = /***/ }), -/***/ 46954: +/***/ 54213: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -90145,9 +92463,9 @@ module.exports.NUMBER_OF_IDENTIFIER_CONTINUATION_CHARS = const mime = __webpack_require__(78306); const { basename, extname } = __webpack_require__(71017); const util = __webpack_require__(73837); -const Chunk = __webpack_require__(67732); -const Module = __webpack_require__(96040); -const { parseResource } = __webpack_require__(63146); +const Chunk = __webpack_require__(93399); +const Module = __webpack_require__(6309); +const { parseResource } = __webpack_require__(97451); /** @typedef {import("./Compilation").AssetInfo} AssetInfo */ /** @typedef {import("./Compilation").PathData} PathData */ @@ -90485,7 +92803,7 @@ module.exports = TemplatedPathPlugin; /***/ }), -/***/ 29428: +/***/ 86943: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -90496,8 +92814,8 @@ module.exports = TemplatedPathPlugin; -const WebpackError = __webpack_require__(10841); -const makeSerializable = __webpack_require__(23827); +const WebpackError = __webpack_require__(49999); +const makeSerializable = __webpack_require__(83626); class UnhandledSchemeError extends WebpackError { /** @@ -90526,7 +92844,7 @@ module.exports = UnhandledSchemeError; /***/ }), -/***/ 19290: +/***/ 84099: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -90537,8 +92855,8 @@ module.exports = UnhandledSchemeError; -const WebpackError = __webpack_require__(10841); -const makeSerializable = __webpack_require__(23827); +const WebpackError = __webpack_require__(49999); +const makeSerializable = __webpack_require__(83626); /** @typedef {import("./Dependency").DependencyLocation} DependencyLocation */ @@ -90566,7 +92884,7 @@ module.exports = UnsupportedFeatureWarning; /***/ }), -/***/ 32791: +/***/ 88917: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -90577,9 +92895,20 @@ module.exports = UnsupportedFeatureWarning; -const ConstDependency = __webpack_require__(78284); +const { + JAVASCRIPT_MODULE_TYPE_AUTO, + JAVASCRIPT_MODULE_TYPE_DYNAMIC, + JAVASCRIPT_MODULE_TYPE_ESM +} = __webpack_require__(92891); +const ConstDependency = __webpack_require__(67538); /** @typedef {import("./Compiler")} Compiler */ +/** @typedef {import("./Dependency").DependencyLocation} DependencyLocation */ +/** @typedef {import("./Module").BuildInfo} BuildInfo */ +/** @typedef {import("./javascript/JavascriptParser")} JavascriptParser */ +/** @typedef {import("./javascript/JavascriptParser").Range} Range */ + +const PLUGIN_NAME = "UseStrictPlugin"; class UseStrictPlugin { /** @@ -90589,10 +92918,13 @@ class UseStrictPlugin { */ apply(compiler) { compiler.hooks.compilation.tap( - "UseStrictPlugin", + PLUGIN_NAME, (compilation, { normalModuleFactory }) => { + /** + * @param {JavascriptParser} parser the parser + */ const handler = parser => { - parser.hooks.program.tap("UseStrictPlugin", ast => { + parser.hooks.program.tap(PLUGIN_NAME, ast => { const firstNode = ast.body[0]; if ( firstNode && @@ -90603,23 +92935,27 @@ class UseStrictPlugin { // Remove "use strict" expression. It will be added later by the renderer again. // This is necessary in order to not break the strict mode when webpack prepends code. // @see https://github.com/webpack/webpack/issues/1970 - const dep = new ConstDependency("", firstNode.range); - dep.loc = firstNode.loc; + const dep = new ConstDependency( + "", + /** @type {Range} */ (firstNode.range) + ); + dep.loc = /** @type {DependencyLocation} */ (firstNode.loc); parser.state.module.addPresentationalDependency(dep); - parser.state.module.buildInfo.strict = true; + /** @type {BuildInfo} */ + (parser.state.module.buildInfo).strict = true; } }); }; normalModuleFactory.hooks.parser - .for("javascript/auto") - .tap("UseStrictPlugin", handler); + .for(JAVASCRIPT_MODULE_TYPE_AUTO) + .tap(PLUGIN_NAME, handler); normalModuleFactory.hooks.parser - .for("javascript/dynamic") - .tap("UseStrictPlugin", handler); + .for(JAVASCRIPT_MODULE_TYPE_DYNAMIC) + .tap(PLUGIN_NAME, handler); normalModuleFactory.hooks.parser - .for("javascript/esm") - .tap("UseStrictPlugin", handler); + .for(JAVASCRIPT_MODULE_TYPE_ESM) + .tap(PLUGIN_NAME, handler); } ); } @@ -90630,7 +92966,7 @@ module.exports = UseStrictPlugin; /***/ }), -/***/ 404: +/***/ 74126: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -90641,10 +92977,11 @@ module.exports = UseStrictPlugin; -const CaseSensitiveModulesWarning = __webpack_require__(27763); +const CaseSensitiveModulesWarning = __webpack_require__(75408); /** @typedef {import("./Compiler")} Compiler */ /** @typedef {import("./Module")} Module */ +/** @typedef {import("./NormalModule")} NormalModule */ class WarnCaseSensitiveModulesPlugin { /** @@ -90661,6 +92998,17 @@ class WarnCaseSensitiveModulesPlugin { const moduleWithoutCase = new Map(); for (const module of compilation.modules) { const identifier = module.identifier(); + + // Ignore `data:` URLs, because it's not a real path + if ( + /** @type {NormalModule} */ + (module).resourceResolveData !== undefined && + /** @type {NormalModule} */ + (module).resourceResolveData.encodedContent !== undefined + ) { + continue; + } + const lowerIdentifier = identifier.toLowerCase(); let map = moduleWithoutCase.get(lowerIdentifier); if (map === undefined) { @@ -90691,7 +93039,7 @@ module.exports = WarnCaseSensitiveModulesPlugin; /***/ }), -/***/ 49832: +/***/ 40601: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -90702,7 +93050,7 @@ module.exports = WarnCaseSensitiveModulesPlugin; -const WebpackError = __webpack_require__(10841); +const WebpackError = __webpack_require__(49999); /** @typedef {import("./Compiler")} Compiler */ @@ -90737,6 +93085,13 @@ class WarnDeprecatedOptionPlugin { } class DeprecatedOptionWarning extends WebpackError { + /** + * Create an instance deprecated option warning + * + * @param {string} option the target option + * @param {string | number} value the deprecated option value + * @param {string} suggestion the suggestion replacement + */ constructor(option, value, suggestion) { super(); @@ -90753,7 +93108,7 @@ module.exports = WarnDeprecatedOptionPlugin; /***/ }), -/***/ 56481: +/***/ 91221: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -90764,7 +93119,7 @@ module.exports = WarnDeprecatedOptionPlugin; -const NoModeWarning = __webpack_require__(10535); +const NoModeWarning = __webpack_require__(41702); /** @typedef {import("./Compiler")} Compiler */ @@ -90786,7 +93141,7 @@ module.exports = WarnNoModeSetPlugin; /***/ }), -/***/ 47231: +/***/ 27349: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -90797,16 +93152,16 @@ module.exports = WarnNoModeSetPlugin; -const { groupBy } = __webpack_require__(91696); -const createSchemaValidation = __webpack_require__(94091); +const { groupBy } = __webpack_require__(22150); +const createSchemaValidation = __webpack_require__(45488); /** @typedef {import("../declarations/plugins/WatchIgnorePlugin").WatchIgnorePluginOptions} WatchIgnorePluginOptions */ /** @typedef {import("./Compiler")} Compiler */ /** @typedef {import("./util/fs").WatchFileSystem} WatchFileSystem */ const validate = createSchemaValidation( - __webpack_require__(15880), - () => __webpack_require__(29625), + __webpack_require__(50243), + () => __webpack_require__(51554), { name: "Watch Ignore Plugin", baseDataPath: "options" @@ -90828,6 +93183,10 @@ class IgnoringWatchFileSystem { watch(files, dirs, missing, startTime, options, callback, callbackUndelayed) { files = Array.from(files); dirs = Array.from(dirs); + /** + * @param {string} path path to check + * @returns {boolean} true, if path is ignored + */ const ignored = path => this.paths.some(p => p instanceof RegExp ? p.test(path) : path.indexOf(p) === 0 @@ -90926,7 +93285,7 @@ module.exports = WatchIgnorePlugin; /***/ }), -/***/ 91561: +/***/ 41951: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -90937,12 +93296,14 @@ module.exports = WatchIgnorePlugin; -const Stats = __webpack_require__(62218); +const Stats = __webpack_require__(92646); /** @typedef {import("../declarations/WebpackOptions").WatchOptions} WatchOptions */ /** @typedef {import("./Compilation")} Compilation */ /** @typedef {import("./Compiler")} Compiler */ /** @typedef {import("./FileSystemInfo").FileSystemInfoEntry} FileSystemInfoEntry */ +/** @typedef {import("./WebpackError")} WebpackError */ +/** @typedef {import("./logging/Logger").Logger} Logger */ /** * @template T @@ -90990,9 +93351,9 @@ class Watching { this._needRecords = true; this.watcher = undefined; this.pausedWatcher = undefined; - /** @type {Set} */ + /** @type {Set | undefined} */ this._collectedChangedFiles = undefined; - /** @type {Set} */ + /** @type {Set | undefined} */ this._collectedRemovedFiles = undefined; this._done = this._done.bind(this); process.nextTick(() => { @@ -91001,8 +93362,8 @@ class Watching { } /** - * @param {ReadonlySet} changedFiles changed files - * @param {ReadonlySet} removedFiles removed files + * @param {ReadonlySet=} changedFiles changed files + * @param {ReadonlySet=} removedFiles removed files */ _mergeWithCollected(changedFiles, removedFiles) { if (!changedFiles) return; @@ -91012,11 +93373,13 @@ class Watching { } else { for (const file of changedFiles) { this._collectedChangedFiles.add(file); - this._collectedRemovedFiles.delete(file); + /** @type {Set} */ + (this._collectedRemovedFiles).delete(file); } - for (const file of removedFiles) { + for (const file of /** @type {ReadonlySet} */ (removedFiles)) { this._collectedChangedFiles.delete(file); - this._collectedRemovedFiles.add(file); + /** @type {Set} */ + (this._collectedRemovedFiles).add(file); } } } @@ -91160,7 +93523,7 @@ class Watching { } /** - * @param {Error=} err an optional error + * @param {(Error | null)=} err an optional error * @param {Compilation=} compilation the compilation * @returns {void} */ @@ -91169,13 +93532,18 @@ class Watching { const logger = compilation && compilation.getLogger("webpack.Watching"); + /** @type {Stats | null} */ let stats = null; + /** + * @param {Error} err error + * @param {Callback[]=} cbs callbacks + */ const handleError = (err, cbs) => { this.compiler.hooks.failed.call(err); this.compiler.cache.beginIdle(); this.compiler.idle = true; - this.handler(err, stats); + this.handler(err, /** @type {Stats} */ (stats)); if (!cbs) { cbs = this.callbacks; this.callbacks = []; @@ -91190,11 +93558,13 @@ class Watching { !(this._isBlocked() && (this.blocked = true)) ) { if (compilation) { - logger.time("storeBuildDependencies"); + /** @type {Logger} */ + (logger).time("storeBuildDependencies"); this.compiler.cache.storeBuildDependencies( compilation.buildDependencies, err => { - logger.timeEnd("storeBuildDependencies"); + /** @type {Logger} */ + (logger).timeEnd("storeBuildDependencies"); if (err) return handleError(err); this._go(); } @@ -91215,32 +93585,42 @@ class Watching { const cbs = this.callbacks; this.callbacks = []; - logger.time("done hook"); - this.compiler.hooks.done.callAsync(stats, err => { - logger.timeEnd("done hook"); + /** @type {Logger} */ + (logger).time("done hook"); + this.compiler.hooks.done.callAsync(/** @type {Stats} */ (stats), err => { + /** @type {Logger} */ + (logger).timeEnd("done hook"); if (err) return handleError(err, cbs); - this.handler(null, stats); - logger.time("storeBuildDependencies"); + this.handler(null, /** @type {Stats} */ (stats)); + /** @type {Logger} */ + (logger).time("storeBuildDependencies"); this.compiler.cache.storeBuildDependencies( - compilation.buildDependencies, + /** @type {Compilation} */ + (compilation).buildDependencies, err => { - logger.timeEnd("storeBuildDependencies"); + /** @type {Logger} */ + (logger).timeEnd("storeBuildDependencies"); if (err) return handleError(err, cbs); - logger.time("beginIdle"); + /** @type {Logger} */ + (logger).time("beginIdle"); this.compiler.cache.beginIdle(); this.compiler.idle = true; - logger.timeEnd("beginIdle"); + /** @type {Logger} */ + (logger).timeEnd("beginIdle"); process.nextTick(() => { if (!this.closed) { this.watch( - compilation.fileDependencies, - compilation.contextDependencies, - compilation.missingDependencies + /** @type {Compilation} */ + (compilation).fileDependencies, + /** @type {Compilation} */ + (compilation).contextDependencies, + /** @type {Compilation} */ + (compilation).missingDependencies ); } }); for (const cb of cbs) cb(null); - this.compiler.hooks.afterDone.call(stats); + this.compiler.hooks.afterDone.call(/** @type {Stats} */ (stats)); } ); }); @@ -91309,6 +93689,13 @@ class Watching { this._invalidate(); } + /** + * @param {ReadonlyMap=} fileTimeInfoEntries info for files + * @param {ReadonlyMap=} contextTimeInfoEntries info for directories + * @param {ReadonlySet=} changedFiles changed files + * @param {ReadonlySet=} removedFiles removed files + * @returns {void} + */ _invalidate( fileTimeInfoEntries, contextTimeInfoEntries, @@ -91355,6 +93742,10 @@ class Watching { } return; } + /** + * @param {(WebpackError | null)=} err error if any + * @param {Compilation=} compilation compilation if any + */ const finalCallback = (err, compilation) => { this.running = false; this.compiler.running = false; @@ -91365,9 +93756,14 @@ class Watching { this.compiler.fileTimestamps = undefined; this.compiler.contextTimestamps = undefined; this.compiler.fsStartTime = undefined; + /** + * @param {(WebpackError | null)=} err error if any + */ const shutdown = err => { this.compiler.hooks.watchClose.call(); - const closeCallbacks = this._closeCallbacks; + const closeCallbacks = + /** @type {Callback[]} */ + (this._closeCallbacks); this._closeCallbacks = undefined; for (const cb of closeCallbacks) cb(err); }; @@ -91413,7 +93809,7 @@ module.exports = Watching; /***/ }), -/***/ 10841: +/***/ 49999: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -91425,11 +93821,13 @@ module.exports = Watching; const inspect = (__webpack_require__(73837).inspect.custom); -const makeSerializable = __webpack_require__(23827); +const makeSerializable = __webpack_require__(83626); /** @typedef {import("./Chunk")} Chunk */ /** @typedef {import("./Dependency").DependencyLocation} DependencyLocation */ /** @typedef {import("./Module")} Module */ +/** @typedef {import("./serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */ +/** @typedef {import("./serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */ class WebpackError extends Error { /** @@ -91439,16 +93837,17 @@ class WebpackError extends Error { constructor(message) { super(message); + /** @type {string | undefined} */ this.details = undefined; - /** @type {Module} */ + /** @type {Module | undefined | null} */ this.module = undefined; - /** @type {DependencyLocation} */ + /** @type {DependencyLocation | undefined} */ this.loc = undefined; - /** @type {boolean} */ + /** @type {boolean | undefined} */ this.hideStack = undefined; - /** @type {Chunk} */ + /** @type {Chunk | undefined} */ this.chunk = undefined; - /** @type {string} */ + /** @type {string | undefined} */ this.file = undefined; } @@ -91456,6 +93855,9 @@ class WebpackError extends Error { return this.stack + (this.details ? `\n${this.details}` : ""); } + /** + * @param {ObjectSerializerContext} context context + */ serialize({ write }) { write(this.name); write(this.message); @@ -91465,6 +93867,9 @@ class WebpackError extends Error { write(this.hideStack); } + /** + * @param {ObjectDeserializerContext} context context + */ deserialize({ read }) { this.name = read(); this.message = read(); @@ -91482,7 +93887,7 @@ module.exports = WebpackError; /***/ }), -/***/ 81759: +/***/ 63983: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -91493,16 +93898,25 @@ module.exports = WebpackError; -const IgnoreErrorModuleFactory = __webpack_require__(78625); -const WebpackIsIncludedDependency = __webpack_require__(13470); +const IgnoreErrorModuleFactory = __webpack_require__(46837); +const { + JAVASCRIPT_MODULE_TYPE_AUTO, + JAVASCRIPT_MODULE_TYPE_DYNAMIC, + JAVASCRIPT_MODULE_TYPE_ESM +} = __webpack_require__(92891); +const WebpackIsIncludedDependency = __webpack_require__(98343); const { toConstantDependency -} = __webpack_require__(645); +} = __webpack_require__(94213); -/** @typedef {import("enhanced-resolve/lib/Resolver")} Resolver */ +/** @typedef {import("enhanced-resolve").Resolver} Resolver */ /** @typedef {import("./Compiler")} Compiler */ +/** @typedef {import("./Dependency").DependencyLocation} DependencyLocation */ /** @typedef {import("./Module")} Module */ /** @typedef {import("./javascript/JavascriptParser")} JavascriptParser */ +/** @typedef {import("./javascript/JavascriptParser").Range} Range */ + +const PLUGIN_NAME = "WebpackIsIncludedPlugin"; class WebpackIsIncludedPlugin { /** @@ -91511,7 +93925,7 @@ class WebpackIsIncludedPlugin { */ apply(compiler) { compiler.hooks.compilation.tap( - "WebpackIsIncludedPlugin", + PLUGIN_NAME, (compilation, { normalModuleFactory }) => { compilation.dependencyFactories.set( WebpackIsIncludedDependency, @@ -91529,7 +93943,7 @@ class WebpackIsIncludedPlugin { const handler = parser => { parser.hooks.call .for("__webpack_is_included__") - .tap("WebpackIsIncludedPlugin", expr => { + .tap(PLUGIN_NAME, expr => { if ( expr.type !== "CallExpression" || expr.arguments.length !== 1 || @@ -91542,29 +93956,29 @@ class WebpackIsIncludedPlugin { if (!request.isString()) return; const dep = new WebpackIsIncludedDependency( - request.string, - expr.range + /** @type {string} */ (request.string), + /** @type {Range} */ (expr.range) ); - dep.loc = expr.loc; + dep.loc = /** @type {DependencyLocation} */ (expr.loc); parser.state.module.addDependency(dep); return true; }); parser.hooks.typeof .for("__webpack_is_included__") .tap( - "WebpackIsIncludedPlugin", + PLUGIN_NAME, toConstantDependency(parser, JSON.stringify("function")) ); }; normalModuleFactory.hooks.parser - .for("javascript/auto") - .tap("WebpackIsIncludedPlugin", handler); + .for(JAVASCRIPT_MODULE_TYPE_AUTO) + .tap(PLUGIN_NAME, handler); normalModuleFactory.hooks.parser - .for("javascript/dynamic") - .tap("WebpackIsIncludedPlugin", handler); + .for(JAVASCRIPT_MODULE_TYPE_DYNAMIC) + .tap(PLUGIN_NAME, handler); normalModuleFactory.hooks.parser - .for("javascript/esm") - .tap("WebpackIsIncludedPlugin", handler); + .for(JAVASCRIPT_MODULE_TYPE_ESM) + .tap(PLUGIN_NAME, handler); } ); } @@ -91575,7 +93989,7 @@ module.exports = WebpackIsIncludedPlugin; /***/ }), -/***/ 77815: +/***/ 62721: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -91586,55 +94000,55 @@ module.exports = WebpackIsIncludedPlugin; -const OptionsApply = __webpack_require__(79535); +const OptionsApply = __webpack_require__(28713); -const AssetModulesPlugin = __webpack_require__(27762); -const JavascriptModulesPlugin = __webpack_require__(96230); -const JsonModulesPlugin = __webpack_require__(86857); +const AssetModulesPlugin = __webpack_require__(38757); +const JavascriptModulesPlugin = __webpack_require__(70061); +const JsonModulesPlugin = __webpack_require__(33202); -const ChunkPrefetchPreloadPlugin = __webpack_require__(66294); +const ChunkPrefetchPreloadPlugin = __webpack_require__(527); -const EntryOptionPlugin = __webpack_require__(87685); -const RecordIdsPlugin = __webpack_require__(19180); +const EntryOptionPlugin = __webpack_require__(98397); +const RecordIdsPlugin = __webpack_require__(56838); -const RuntimePlugin = __webpack_require__(78921); +const RuntimePlugin = __webpack_require__(16697); -const APIPlugin = __webpack_require__(46); -const CompatibilityPlugin = __webpack_require__(89354); -const ConstPlugin = __webpack_require__(58425); -const ExportsInfoApiPlugin = __webpack_require__(98869); -const WebpackIsIncludedPlugin = __webpack_require__(81759); +const APIPlugin = __webpack_require__(60592); +const CompatibilityPlugin = __webpack_require__(35197); +const ConstPlugin = __webpack_require__(46523); +const ExportsInfoApiPlugin = __webpack_require__(78575); +const WebpackIsIncludedPlugin = __webpack_require__(63983); -const TemplatedPathPlugin = __webpack_require__(46954); -const UseStrictPlugin = __webpack_require__(32791); -const WarnCaseSensitiveModulesPlugin = __webpack_require__(404); +const TemplatedPathPlugin = __webpack_require__(54213); +const UseStrictPlugin = __webpack_require__(88917); +const WarnCaseSensitiveModulesPlugin = __webpack_require__(74126); -const DataUriPlugin = __webpack_require__(12877); -const FileUriPlugin = __webpack_require__(93300); +const DataUriPlugin = __webpack_require__(14610); +const FileUriPlugin = __webpack_require__(33405); -const ResolverCachePlugin = __webpack_require__(28563); +const ResolverCachePlugin = __webpack_require__(26133); -const CommonJsPlugin = __webpack_require__(81907); -const HarmonyModulesPlugin = __webpack_require__(1055); -const ImportMetaContextPlugin = __webpack_require__(38437); -const ImportMetaPlugin = __webpack_require__(34004); -const ImportPlugin = __webpack_require__(9265); -const LoaderPlugin = __webpack_require__(80402); -const RequireContextPlugin = __webpack_require__(84209); -const RequireEnsurePlugin = __webpack_require__(54560); -const RequireIncludePlugin = __webpack_require__(77209); -const SystemPlugin = __webpack_require__(21835); -const URLPlugin = __webpack_require__(55437); -const WorkerPlugin = __webpack_require__(2447); +const CommonJsPlugin = __webpack_require__(35892); +const HarmonyModulesPlugin = __webpack_require__(17775); +const ImportMetaContextPlugin = __webpack_require__(61860); +const ImportMetaPlugin = __webpack_require__(27987); +const ImportPlugin = __webpack_require__(47673); +const LoaderPlugin = __webpack_require__(13585); +const RequireContextPlugin = __webpack_require__(99322); +const RequireEnsurePlugin = __webpack_require__(47276); +const RequireIncludePlugin = __webpack_require__(71912); +const SystemPlugin = __webpack_require__(89277); +const URLPlugin = __webpack_require__(10937); +const WorkerPlugin = __webpack_require__(3065); -const InferAsyncModulesPlugin = __webpack_require__(44803); +const InferAsyncModulesPlugin = __webpack_require__(96681); -const JavascriptMetaInfoPlugin = __webpack_require__(46056); -const DefaultStatsFactoryPlugin = __webpack_require__(90010); -const DefaultStatsPresetPlugin = __webpack_require__(89279); -const DefaultStatsPrinterPlugin = __webpack_require__(84840); +const JavascriptMetaInfoPlugin = __webpack_require__(12506); +const DefaultStatsFactoryPlugin = __webpack_require__(80355); +const DefaultStatsPresetPlugin = __webpack_require__(76453); +const DefaultStatsPrinterPlugin = __webpack_require__(13770); -const { cleverMerge } = __webpack_require__(31074); +const { cleverMerge } = __webpack_require__(44639); /** @typedef {import("../declarations/WebpackOptions").WebpackOptionsNormalized} WebpackOptions */ /** @typedef {import("./Compiler")} Compiler */ @@ -91657,29 +94071,29 @@ class WebpackOptionsApply extends OptionsApply { if (options.externals) { //@ts-expect-error https://github.com/microsoft/TypeScript/issues/41697 - const ExternalsPlugin = __webpack_require__(3021); + const ExternalsPlugin = __webpack_require__(42605); new ExternalsPlugin(options.externalsType, options.externals).apply( compiler ); } if (options.externalsPresets.node) { - const NodeTargetPlugin = __webpack_require__(6640); + const NodeTargetPlugin = __webpack_require__(63887); new NodeTargetPlugin().apply(compiler); } if (options.externalsPresets.electronMain) { //@ts-expect-error https://github.com/microsoft/TypeScript/issues/41697 - const ElectronTargetPlugin = __webpack_require__(71888); + const ElectronTargetPlugin = __webpack_require__(20205); new ElectronTargetPlugin("main").apply(compiler); } if (options.externalsPresets.electronPreload) { //@ts-expect-error https://github.com/microsoft/TypeScript/issues/41697 - const ElectronTargetPlugin = __webpack_require__(71888); + const ElectronTargetPlugin = __webpack_require__(20205); new ElectronTargetPlugin("preload").apply(compiler); } if (options.externalsPresets.electronRenderer) { //@ts-expect-error https://github.com/microsoft/TypeScript/issues/41697 - const ElectronTargetPlugin = __webpack_require__(71888); + const ElectronTargetPlugin = __webpack_require__(20205); new ElectronTargetPlugin("renderer").apply(compiler); } if ( @@ -91689,70 +94103,63 @@ class WebpackOptionsApply extends OptionsApply { !options.externalsPresets.electronRenderer ) { //@ts-expect-error https://github.com/microsoft/TypeScript/issues/41697 - const ElectronTargetPlugin = __webpack_require__(71888); + const ElectronTargetPlugin = __webpack_require__(20205); new ElectronTargetPlugin().apply(compiler); } if (options.externalsPresets.nwjs) { //@ts-expect-error https://github.com/microsoft/TypeScript/issues/41697 - const ExternalsPlugin = __webpack_require__(3021); + const ExternalsPlugin = __webpack_require__(42605); new ExternalsPlugin("node-commonjs", "nw.gui").apply(compiler); } if (options.externalsPresets.webAsync) { //@ts-expect-error https://github.com/microsoft/TypeScript/issues/41697 - const ExternalsPlugin = __webpack_require__(3021); - new ExternalsPlugin( - "import", - options.experiments.css - ? ({ request, dependencyType }, callback) => { - if (dependencyType === "url") { - if (/^(\/\/|https?:\/\/)/.test(request)) - return callback(null, `asset ${request}`); - } else if (dependencyType === "css-import") { - if (/^(\/\/|https?:\/\/)/.test(request)) - return callback(null, `css-import ${request}`); - } else if (/^(\/\/|https?:\/\/|std:)/.test(request)) { - if (/^\.css(\?|$)/.test(request)) - return callback(null, `css-import ${request}`); - return callback(null, `import ${request}`); - } - callback(); - } - : /^(\/\/|https?:\/\/|std:)/ - ).apply(compiler); + const ExternalsPlugin = __webpack_require__(42605); + new ExternalsPlugin("import", ({ request, dependencyType }, callback) => { + if (dependencyType === "url") { + if (/^(\/\/|https?:\/\/|#)/.test(request)) + return callback(null, `asset ${request}`); + } else if (options.experiments.css && dependencyType === "css-import") { + if (/^(\/\/|https?:\/\/|#)/.test(request)) + return callback(null, `css-import ${request}`); + } else if ( + options.experiments.css && + /^(\/\/|https?:\/\/|std:)/.test(request) + ) { + if (/^\.css(\?|$)/.test(request)) + return callback(null, `css-import ${request}`); + return callback(null, `import ${request}`); + } + callback(); + }).apply(compiler); } else if (options.externalsPresets.web) { //@ts-expect-error https://github.com/microsoft/TypeScript/issues/41697 - const ExternalsPlugin = __webpack_require__(3021); - new ExternalsPlugin( - "module", - options.experiments.css - ? ({ request, dependencyType }, callback) => { - if (dependencyType === "url") { - if (/^(\/\/|https?:\/\/)/.test(request)) - return callback(null, `asset ${request}`); - } else if (dependencyType === "css-import") { - if (/^(\/\/|https?:\/\/)/.test(request)) - return callback(null, `css-import ${request}`); - } else if (/^(\/\/|https?:\/\/|std:)/.test(request)) { - if (/^\.css(\?|$)/.test(request)) - return callback(null, `css-import ${request}`); - return callback(null, `module ${request}`); - } - callback(); - } - : /^(\/\/|https?:\/\/|std:)/ - ).apply(compiler); + const ExternalsPlugin = __webpack_require__(42605); + new ExternalsPlugin("module", ({ request, dependencyType }, callback) => { + if (dependencyType === "url") { + if (/^(\/\/|https?:\/\/|#)/.test(request)) + return callback(null, `asset ${request}`); + } else if (options.experiments.css && dependencyType === "css-import") { + if (/^(\/\/|https?:\/\/|#)/.test(request)) + return callback(null, `css-import ${request}`); + } else if (/^(\/\/|https?:\/\/|std:)/.test(request)) { + if (options.experiments.css && /^\.css((\?)|$)/.test(request)) + return callback(null, `css-import ${request}`); + return callback(null, `module ${request}`); + } + callback(); + }).apply(compiler); } else if (options.externalsPresets.node) { if (options.experiments.css) { //@ts-expect-error https://github.com/microsoft/TypeScript/issues/41697 - const ExternalsPlugin = __webpack_require__(3021); + const ExternalsPlugin = __webpack_require__(42605); new ExternalsPlugin( "module", ({ request, dependencyType }, callback) => { if (dependencyType === "url") { - if (/^(\/\/|https?:\/\/)/.test(request)) + if (/^(\/\/|https?:\/\/|#)/.test(request)) return callback(null, `asset ${request}`); } else if (dependencyType === "css-import") { - if (/^(\/\/|https?:\/\/)/.test(request)) + if (/^(\/\/|https?:\/\/|#)/.test(request)) return callback(null, `css-import ${request}`); } else if (/^(\/\/|https?:\/\/|std:)/.test(request)) { if (/^\.css(\?|$)/.test(request)) @@ -91770,17 +94177,17 @@ class WebpackOptionsApply extends OptionsApply { if (typeof options.output.chunkFormat === "string") { switch (options.output.chunkFormat) { case "array-push": { - const ArrayPushCallbackChunkFormatPlugin = __webpack_require__(15006); + const ArrayPushCallbackChunkFormatPlugin = __webpack_require__(44717); new ArrayPushCallbackChunkFormatPlugin().apply(compiler); break; } case "commonjs": { - const CommonJsChunkFormatPlugin = __webpack_require__(19398); + const CommonJsChunkFormatPlugin = __webpack_require__(77422); new CommonJsChunkFormatPlugin().apply(compiler); break; } case "module": { - const ModuleChunkFormatPlugin = __webpack_require__(9416); + const ModuleChunkFormatPlugin = __webpack_require__(73918); new ModuleChunkFormatPlugin().apply(compiler); break; } @@ -91793,34 +94200,34 @@ class WebpackOptionsApply extends OptionsApply { if (options.output.enabledChunkLoadingTypes.length > 0) { for (const type of options.output.enabledChunkLoadingTypes) { - const EnableChunkLoadingPlugin = __webpack_require__(14622); + const EnableChunkLoadingPlugin = __webpack_require__(51050); new EnableChunkLoadingPlugin(type).apply(compiler); } } if (options.output.enabledWasmLoadingTypes.length > 0) { for (const type of options.output.enabledWasmLoadingTypes) { - const EnableWasmLoadingPlugin = __webpack_require__(15102); + const EnableWasmLoadingPlugin = __webpack_require__(25240); new EnableWasmLoadingPlugin(type).apply(compiler); } } if (options.output.enabledLibraryTypes.length > 0) { for (const type of options.output.enabledLibraryTypes) { - const EnableLibraryPlugin = __webpack_require__(3580); + const EnableLibraryPlugin = __webpack_require__(90487); new EnableLibraryPlugin(type).apply(compiler); } } if (options.output.pathinfo) { - const ModuleInfoHeaderPlugin = __webpack_require__(45684); + const ModuleInfoHeaderPlugin = __webpack_require__(4228); new ModuleInfoHeaderPlugin(options.output.pathinfo !== true).apply( compiler ); } if (options.output.clean) { - const CleanPlugin = __webpack_require__(25358); + const CleanPlugin = __webpack_require__(9110); new CleanPlugin( options.output.clean === true ? {} : options.output.clean ).apply(compiler); @@ -91835,8 +94242,8 @@ class WebpackOptionsApply extends OptionsApply { const moduleMaps = options.devtool.includes("module"); const noSources = options.devtool.includes("nosources"); const Plugin = evalWrapped - ? __webpack_require__(99849) - : __webpack_require__(92732); + ? __webpack_require__(35920) + : __webpack_require__(44937); new Plugin({ filename: inline ? null : options.output.sourceMapFilename, moduleFilenameTemplate: options.output.devtoolModuleFilenameTemplate, @@ -91849,7 +94256,7 @@ class WebpackOptionsApply extends OptionsApply { namespace: options.output.devtoolNamespace }).apply(compiler); } else if (options.devtool.includes("eval")) { - const EvalDevToolModulePlugin = __webpack_require__(11929); + const EvalDevToolModulePlugin = __webpack_require__(83204); new EvalDevToolModulePlugin({ moduleFilenameTemplate: options.output.devtoolModuleFilenameTemplate, namespace: options.output.devtoolNamespace @@ -91880,26 +94287,26 @@ class WebpackOptionsApply extends OptionsApply { } if (options.experiments.syncWebAssembly) { - const WebAssemblyModulesPlugin = __webpack_require__(798); + const WebAssemblyModulesPlugin = __webpack_require__(57253); new WebAssemblyModulesPlugin({ mangleImports: options.optimization.mangleWasmImports }).apply(compiler); } if (options.experiments.asyncWebAssembly) { - const AsyncWebAssemblyModulesPlugin = __webpack_require__(1768); + const AsyncWebAssemblyModulesPlugin = __webpack_require__(37390); new AsyncWebAssemblyModulesPlugin({ mangleImports: options.optimization.mangleWasmImports }).apply(compiler); } if (options.experiments.css) { - const CssModulesPlugin = __webpack_require__(15405); + const CssModulesPlugin = __webpack_require__(90429); new CssModulesPlugin(options.experiments.css).apply(compiler); } if (options.experiments.lazyCompilation) { - const LazyCompilationPlugin = __webpack_require__(51094); + const LazyCompilationPlugin = __webpack_require__(5696); const lazyOptions = typeof options.experiments.lazyCompilation === "object" ? options.experiments.lazyCompilation @@ -91908,7 +94315,7 @@ class WebpackOptionsApply extends OptionsApply { backend: typeof lazyOptions.backend === "function" ? lazyOptions.backend - : __webpack_require__(43888)({ + : __webpack_require__(80924)({ ...lazyOptions.backend, client: (lazyOptions.backend && lazyOptions.backend.client) || @@ -91921,7 +94328,7 @@ class WebpackOptionsApply extends OptionsApply { } if (options.experiments.buildHttp) { - const HttpUriPlugin = __webpack_require__(15660); + const HttpUriPlugin = __webpack_require__(5662); const httpOptions = options.experiments.buildHttp; new HttpUriPlugin(httpOptions).apply(compiler); } @@ -91941,18 +94348,20 @@ class WebpackOptionsApply extends OptionsApply { topLevelAwait: options.experiments.topLevelAwait }).apply(compiler); if (options.amd !== false) { - const AMDPlugin = __webpack_require__(77549); - const RequireJsStuffPlugin = __webpack_require__(35662); + const AMDPlugin = __webpack_require__(12340); + const RequireJsStuffPlugin = __webpack_require__(81345); new AMDPlugin(options.amd || {}).apply(compiler); new RequireJsStuffPlugin().apply(compiler); } new CommonJsPlugin().apply(compiler); new LoaderPlugin({}).apply(compiler); if (options.node !== false) { - const NodeStuffPlugin = __webpack_require__(162); + const NodeStuffPlugin = __webpack_require__(24193); new NodeStuffPlugin(options.node).apply(compiler); } - new APIPlugin().apply(compiler); + new APIPlugin({ + module: options.output.module + }).apply(compiler); new ExportsInfoApiPlugin().apply(compiler); new WebpackIsIncludedPlugin().apply(compiler); new ConstPlugin().apply(compiler); @@ -91968,7 +94377,8 @@ class WebpackOptionsApply extends OptionsApply { new WorkerPlugin( options.output.workerChunkLoading, options.output.workerWasmLoading, - options.output.module + options.output.module, + options.output.workerPublicPath ).apply(compiler); new DefaultStatsFactoryPlugin().apply(compiler); @@ -91978,97 +94388,97 @@ class WebpackOptionsApply extends OptionsApply { new JavascriptMetaInfoPlugin().apply(compiler); if (typeof options.mode !== "string") { - const WarnNoModeSetPlugin = __webpack_require__(56481); + const WarnNoModeSetPlugin = __webpack_require__(91221); new WarnNoModeSetPlugin().apply(compiler); } - const EnsureChunkConditionsPlugin = __webpack_require__(20612); + const EnsureChunkConditionsPlugin = __webpack_require__(76949); new EnsureChunkConditionsPlugin().apply(compiler); if (options.optimization.removeAvailableModules) { - const RemoveParentModulesPlugin = __webpack_require__(17936); + const RemoveParentModulesPlugin = __webpack_require__(59426); new RemoveParentModulesPlugin().apply(compiler); } if (options.optimization.removeEmptyChunks) { - const RemoveEmptyChunksPlugin = __webpack_require__(3469); + const RemoveEmptyChunksPlugin = __webpack_require__(52793); new RemoveEmptyChunksPlugin().apply(compiler); } if (options.optimization.mergeDuplicateChunks) { - const MergeDuplicateChunksPlugin = __webpack_require__(16767); + const MergeDuplicateChunksPlugin = __webpack_require__(43505); new MergeDuplicateChunksPlugin().apply(compiler); } if (options.optimization.flagIncludedChunks) { - const FlagIncludedChunksPlugin = __webpack_require__(47354); + const FlagIncludedChunksPlugin = __webpack_require__(33613); new FlagIncludedChunksPlugin().apply(compiler); } if (options.optimization.sideEffects) { - const SideEffectsFlagPlugin = __webpack_require__(35762); + const SideEffectsFlagPlugin = __webpack_require__(29848); new SideEffectsFlagPlugin( options.optimization.sideEffects === true ).apply(compiler); } if (options.optimization.providedExports) { - const FlagDependencyExportsPlugin = __webpack_require__(54621); + const FlagDependencyExportsPlugin = __webpack_require__(42229); new FlagDependencyExportsPlugin().apply(compiler); } if (options.optimization.usedExports) { - const FlagDependencyUsagePlugin = __webpack_require__(3232); + const FlagDependencyUsagePlugin = __webpack_require__(46360); new FlagDependencyUsagePlugin( options.optimization.usedExports === "global" ).apply(compiler); } if (options.optimization.innerGraph) { - const InnerGraphPlugin = __webpack_require__(99231); + const InnerGraphPlugin = __webpack_require__(96404); new InnerGraphPlugin().apply(compiler); } if (options.optimization.mangleExports) { - const MangleExportsPlugin = __webpack_require__(11179); + const MangleExportsPlugin = __webpack_require__(19966); new MangleExportsPlugin( options.optimization.mangleExports !== "size" ).apply(compiler); } if (options.optimization.concatenateModules) { - const ModuleConcatenationPlugin = __webpack_require__(2410); + const ModuleConcatenationPlugin = __webpack_require__(11837); new ModuleConcatenationPlugin().apply(compiler); } if (options.optimization.splitChunks) { - const SplitChunksPlugin = __webpack_require__(53443); + const SplitChunksPlugin = __webpack_require__(39834); new SplitChunksPlugin(options.optimization.splitChunks).apply(compiler); } if (options.optimization.runtimeChunk) { - const RuntimeChunkPlugin = __webpack_require__(32015); + const RuntimeChunkPlugin = __webpack_require__(70522); new RuntimeChunkPlugin(options.optimization.runtimeChunk).apply(compiler); } if (!options.optimization.emitOnErrors) { - const NoEmitOnErrorsPlugin = __webpack_require__(80388); + const NoEmitOnErrorsPlugin = __webpack_require__(90229); new NoEmitOnErrorsPlugin().apply(compiler); } if (options.optimization.realContentHash) { - const RealContentHashPlugin = __webpack_require__(30471); + const RealContentHashPlugin = __webpack_require__(79512); new RealContentHashPlugin({ hashFunction: options.output.hashFunction, hashDigest: options.output.hashDigest }).apply(compiler); } if (options.optimization.checkWasmTypes) { - const WasmFinalizeExportsPlugin = __webpack_require__(29874); + const WasmFinalizeExportsPlugin = __webpack_require__(56508); new WasmFinalizeExportsPlugin().apply(compiler); } const moduleIds = options.optimization.moduleIds; if (moduleIds) { switch (moduleIds) { case "natural": { - const NaturalModuleIdsPlugin = __webpack_require__(77636); + const NaturalModuleIdsPlugin = __webpack_require__(63136); new NaturalModuleIdsPlugin().apply(compiler); break; } case "named": { - const NamedModuleIdsPlugin = __webpack_require__(10006); + const NamedModuleIdsPlugin = __webpack_require__(1089); new NamedModuleIdsPlugin().apply(compiler); break; } case "hashed": { - const WarnDeprecatedOptionPlugin = __webpack_require__(49832); - const HashedModuleIdsPlugin = __webpack_require__(55513); + const WarnDeprecatedOptionPlugin = __webpack_require__(40601); + const HashedModuleIdsPlugin = __webpack_require__(12793); new WarnDeprecatedOptionPlugin( "optimization.moduleIds", "hashed", @@ -92080,12 +94490,12 @@ class WebpackOptionsApply extends OptionsApply { break; } case "deterministic": { - const DeterministicModuleIdsPlugin = __webpack_require__(72488); + const DeterministicModuleIdsPlugin = __webpack_require__(11018); new DeterministicModuleIdsPlugin().apply(compiler); break; } case "size": { - const OccurrenceModuleIdsPlugin = __webpack_require__(54475); + const OccurrenceModuleIdsPlugin = __webpack_require__(25909); new OccurrenceModuleIdsPlugin({ prioritiseInitial: true }).apply(compiler); @@ -92101,23 +94511,23 @@ class WebpackOptionsApply extends OptionsApply { if (chunkIds) { switch (chunkIds) { case "natural": { - const NaturalChunkIdsPlugin = __webpack_require__(7274); + const NaturalChunkIdsPlugin = __webpack_require__(44185); new NaturalChunkIdsPlugin().apply(compiler); break; } case "named": { - const NamedChunkIdsPlugin = __webpack_require__(39116); + const NamedChunkIdsPlugin = __webpack_require__(44246); new NamedChunkIdsPlugin().apply(compiler); break; } case "deterministic": { - const DeterministicChunkIdsPlugin = __webpack_require__(17209); + const DeterministicChunkIdsPlugin = __webpack_require__(59501); new DeterministicChunkIdsPlugin().apply(compiler); break; } case "size": { //@ts-expect-error https://github.com/microsoft/TypeScript/issues/41697 - const OccurrenceChunkIdsPlugin = __webpack_require__(80031); + const OccurrenceChunkIdsPlugin = __webpack_require__(32789); new OccurrenceChunkIdsPlugin({ prioritiseInitial: true }).apply(compiler); @@ -92125,7 +94535,7 @@ class WebpackOptionsApply extends OptionsApply { } case "total-size": { //@ts-expect-error https://github.com/microsoft/TypeScript/issues/41697 - const OccurrenceChunkIdsPlugin = __webpack_require__(80031); + const OccurrenceChunkIdsPlugin = __webpack_require__(32789); new OccurrenceChunkIdsPlugin({ prioritiseInitial: false }).apply(compiler); @@ -92138,7 +94548,7 @@ class WebpackOptionsApply extends OptionsApply { } } if (options.optimization.nodeEnv) { - const DefinePlugin = __webpack_require__(84036); + const DefinePlugin = __webpack_require__(7628); new DefinePlugin({ "process.env.NODE_ENV": JSON.stringify(options.optimization.nodeEnv) }).apply(compiler); @@ -92147,14 +94557,14 @@ class WebpackOptionsApply extends OptionsApply { for (const minimizer of options.optimization.minimizer) { if (typeof minimizer === "function") { minimizer.call(compiler, compiler); - } else if (minimizer !== "...") { + } else if (minimizer !== "..." && minimizer) { minimizer.apply(compiler); } } } if (options.performance) { - const SizeLimitsPlugin = __webpack_require__(256); + const SizeLimitsPlugin = __webpack_require__(80028); new SizeLimitsPlugin(options.performance).apply(compiler); } @@ -92166,7 +94576,7 @@ class WebpackOptionsApply extends OptionsApply { new WarnCaseSensitiveModulesPlugin().apply(compiler); - const AddManagedPathsPlugin = __webpack_require__(47956); + const AddManagedPathsPlugin = __webpack_require__(33514); new AddManagedPathsPlugin( options.snapshot.managedPaths, options.snapshot.immutablePaths @@ -92178,13 +94588,13 @@ class WebpackOptionsApply extends OptionsApply { case "memory": { if (isFinite(cacheOptions.maxGenerations)) { //@ts-expect-error https://github.com/microsoft/TypeScript/issues/41697 - const MemoryWithGcCachePlugin = __webpack_require__(24971); + const MemoryWithGcCachePlugin = __webpack_require__(99243); new MemoryWithGcCachePlugin({ maxGenerations: cacheOptions.maxGenerations }).apply(compiler); } else { //@ts-expect-error https://github.com/microsoft/TypeScript/issues/41697 - const MemoryCachePlugin = __webpack_require__(45864); + const MemoryCachePlugin = __webpack_require__(21429); new MemoryCachePlugin().apply(compiler); } if (cacheOptions.cacheUnaffected) { @@ -92198,18 +94608,18 @@ class WebpackOptionsApply extends OptionsApply { break; } case "filesystem": { - const AddBuildDependenciesPlugin = __webpack_require__(31264); + const AddBuildDependenciesPlugin = __webpack_require__(89741); for (const key in cacheOptions.buildDependencies) { const list = cacheOptions.buildDependencies[key]; new AddBuildDependenciesPlugin(list).apply(compiler); } if (!isFinite(cacheOptions.maxMemoryGenerations)) { //@ts-expect-error https://github.com/microsoft/TypeScript/issues/41697 - const MemoryCachePlugin = __webpack_require__(45864); + const MemoryCachePlugin = __webpack_require__(21429); new MemoryCachePlugin().apply(compiler); } else if (cacheOptions.maxMemoryGenerations !== 0) { //@ts-expect-error https://github.com/microsoft/TypeScript/issues/41697 - const MemoryWithGcCachePlugin = __webpack_require__(24971); + const MemoryWithGcCachePlugin = __webpack_require__(99243); new MemoryWithGcCachePlugin({ maxGenerations: cacheOptions.maxMemoryGenerations }).apply(compiler); @@ -92224,8 +94634,8 @@ class WebpackOptionsApply extends OptionsApply { } switch (cacheOptions.store) { case "pack": { - const IdleFileCachePlugin = __webpack_require__(97392); - const PackFileCacheStrategy = __webpack_require__(27002); + const IdleFileCachePlugin = __webpack_require__(46450); + const PackFileCacheStrategy = __webpack_require__(98743); new IdleFileCachePlugin( new PackFileCacheStrategy({ compiler, @@ -92240,7 +94650,8 @@ class WebpackOptionsApply extends OptionsApply { maxAge: cacheOptions.maxAge, profile: cacheOptions.profile, allowCollectingMemory: cacheOptions.allowCollectingMemory, - compression: cacheOptions.compression + compression: cacheOptions.compression, + readonly: cacheOptions.readonly }), cacheOptions.idleTimeout, cacheOptions.idleTimeoutForInitialStore, @@ -92261,7 +94672,7 @@ class WebpackOptionsApply extends OptionsApply { new ResolverCachePlugin().apply(compiler); if (options.ignoreWarnings && options.ignoreWarnings.length > 0) { - const IgnoreWarningsPlugin = __webpack_require__(1220); + const IgnoreWarningsPlugin = __webpack_require__(54251); new IgnoreWarningsPlugin(options.ignoreWarnings).apply(compiler); } @@ -92301,7 +94712,7 @@ module.exports = WebpackOptionsApply; /***/ }), -/***/ 7123: +/***/ 46389: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -92312,14 +94723,21 @@ module.exports = WebpackOptionsApply; -const { applyWebpackOptionsDefaults } = __webpack_require__(62484); -const { getNormalizedWebpackOptions } = __webpack_require__(22941); +const { applyWebpackOptionsDefaults } = __webpack_require__(36569); +const { getNormalizedWebpackOptions } = __webpack_require__(69645); + +/** @typedef {import("./config/normalization").WebpackOptions} WebpackOptions */ +/** @typedef {import("./config/normalization").WebpackOptionsNormalized} WebpackOptionsNormalized */ class WebpackOptionsDefaulter { + /** + * @param {WebpackOptions} options webpack options + * @returns {WebpackOptionsNormalized} normalized webpack options + */ process(options) { - options = getNormalizedWebpackOptions(options); - applyWebpackOptionsDefaults(options); - return options; + const normalizedOptions = getNormalizedWebpackOptions(options); + applyWebpackOptionsDefaults(normalizedOptions); + return normalizedOptions; } } @@ -92328,7 +94746,7 @@ module.exports = WebpackOptionsDefaulter; /***/ }), -/***/ 40620: +/***/ 67965: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -92342,12 +94760,13 @@ module.exports = WebpackOptionsDefaulter; const mimeTypes = __webpack_require__(78306); const path = __webpack_require__(71017); const { RawSource } = __webpack_require__(59728); -const ConcatenationScope = __webpack_require__(68645); -const Generator = __webpack_require__(8635); -const RuntimeGlobals = __webpack_require__(34623); -const createHash = __webpack_require__(94624); -const { makePathsRelative } = __webpack_require__(63146); -const nonNumericOnlyHash = __webpack_require__(12993); +const ConcatenationScope = __webpack_require__(92811); +const Generator = __webpack_require__(58387); +const { ASSET_MODULE_TYPE } = __webpack_require__(92891); +const RuntimeGlobals = __webpack_require__(61539); +const createHash = __webpack_require__(31147); +const { makePathsRelative } = __webpack_require__(97451); +const nonNumericOnlyHash = __webpack_require__(95162); /** @typedef {import("webpack-sources").Source} Source */ /** @typedef {import("../../declarations/WebpackOptions").AssetGeneratorOptions} AssetGeneratorOptions */ @@ -92440,15 +94859,28 @@ const encodeDataUri = (encoding, source) => { return encodedContent; }; +/** + * @param {string} encoding encoding + * @param {string} content content + * @returns {Buffer} decoded content + */ const decodeDataUriContent = (encoding, content) => { const isBase64 = encoding === "base64"; - return isBase64 - ? Buffer.from(content, "base64") - : Buffer.from(decodeURIComponent(content), "ascii"); + + if (isBase64) { + return Buffer.from(content, "base64"); + } + + // If we can't decode return the original body + try { + return Buffer.from(decodeURIComponent(content), "ascii"); + } catch (_) { + return Buffer.from(content, "ascii"); + } }; const JS_TYPES = new Set(["javascript"]); -const JS_AND_ASSET_TYPES = new Set(["javascript", "asset"]); +const JS_AND_ASSET_TYPES = new Set(["javascript", ASSET_MODULE_TYPE]); const DEFAULT_ENCODING = "base64"; class AssetGenerator extends Generator { @@ -92501,6 +94933,7 @@ class AssetGenerator extends Generator { ); } + /** @type {string | boolean | undefined} */ let mimeType = this.dataUrlOptions.mimetype; if (mimeType === undefined) { const ext = path.extname(module.nameForCondition()); @@ -92533,7 +94966,7 @@ class AssetGenerator extends Generator { ); } - return mimeType; + return /** @type {string} */ (mimeType); } /** @@ -92554,11 +94987,11 @@ class AssetGenerator extends Generator { } ) { switch (type) { - case "asset": - return module.originalSource(); + case ASSET_MODULE_TYPE: + return /** @type {Source} */ (module.originalSource()); default: { let content; - const originalSource = module.originalSource(); + const originalSource = /** @type {Source} */ (module.originalSource()); if (module.buildInfo.dataUrl) { let encodedSource; if (typeof this.dataUrlOptions === "function") { @@ -92732,7 +95165,7 @@ class AssetGenerator extends Generator { */ getSize(module, type) { switch (type) { - case "asset": { + case ASSET_MODULE_TYPE: { const originalSource = module.originalSource(); if (!originalSource) { @@ -92827,7 +95260,7 @@ module.exports = AssetGenerator; /***/ }), -/***/ 27762: +/***/ 38757: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -92838,18 +95271,28 @@ module.exports = AssetGenerator; -const { cleverMerge } = __webpack_require__(31074); -const { compareModulesByIdentifier } = __webpack_require__(29355); -const createSchemaValidation = __webpack_require__(94091); -const memoize = __webpack_require__(27319); +const { + ASSET_MODULE_TYPE_RESOURCE, + ASSET_MODULE_TYPE_INLINE, + ASSET_MODULE_TYPE, + ASSET_MODULE_TYPE_SOURCE +} = __webpack_require__(92891); +const { cleverMerge } = __webpack_require__(44639); +const { compareModulesByIdentifier } = __webpack_require__(95978); +const createSchemaValidation = __webpack_require__(45488); +const memoize = __webpack_require__(62377); /** @typedef {import("webpack-sources").Source} Source */ /** @typedef {import("../Chunk")} Chunk */ /** @typedef {import("../Compiler")} Compiler */ /** @typedef {import("../Module")} Module */ +/** + * @param {string} name name of definitions + * @returns {TODO} definition + */ const getSchema = name => { - const { definitions } = __webpack_require__(9183); + const { definitions } = __webpack_require__(40138); return { definitions, oneOf: [{ $ref: `#/definitions/${name}` }] @@ -92862,24 +95305,24 @@ const generatorValidationOptions = { }; const validateGeneratorOptions = { asset: createSchemaValidation( - __webpack_require__(42235), + __webpack_require__(40202), () => getSchema("AssetGeneratorOptions"), generatorValidationOptions ), "asset/resource": createSchemaValidation( - __webpack_require__(54395), + __webpack_require__(94391), () => getSchema("AssetResourceGeneratorOptions"), generatorValidationOptions ), "asset/inline": createSchemaValidation( - __webpack_require__(61484), + __webpack_require__(38956), () => getSchema("AssetInlineGeneratorOptions"), generatorValidationOptions ) }; const validateParserOptions = createSchemaValidation( - __webpack_require__(84621), + __webpack_require__(96165), () => getSchema("AssetParserOptions"), { name: "Asset Modules Plugin", @@ -92887,14 +95330,14 @@ const validateParserOptions = createSchemaValidation( } ); -const getAssetGenerator = memoize(() => __webpack_require__(40620)); -const getAssetParser = memoize(() => __webpack_require__(40940)); -const getAssetSourceParser = memoize(() => __webpack_require__(18415)); +const getAssetGenerator = memoize(() => __webpack_require__(67965)); +const getAssetParser = memoize(() => __webpack_require__(36577)); +const getAssetSourceParser = memoize(() => __webpack_require__(963)); const getAssetSourceGenerator = memoize(() => - __webpack_require__(9688) + __webpack_require__(56648) ); -const type = "asset"; +const type = ASSET_MODULE_TYPE; const plugin = "AssetModulesPlugin"; class AssetModulesPlugin { @@ -92908,7 +95351,7 @@ class AssetModulesPlugin { plugin, (compilation, { normalModuleFactory }) => { normalModuleFactory.hooks.createParser - .for("asset") + .for(ASSET_MODULE_TYPE) .tap(plugin, parserOptions => { validateParserOptions(parserOptions); parserOptions = cleverMerge( @@ -92929,35 +95372,39 @@ class AssetModulesPlugin { return new AssetParser(dataUrlCondition); }); normalModuleFactory.hooks.createParser - .for("asset/inline") + .for(ASSET_MODULE_TYPE_INLINE) .tap(plugin, parserOptions => { const AssetParser = getAssetParser(); return new AssetParser(true); }); normalModuleFactory.hooks.createParser - .for("asset/resource") + .for(ASSET_MODULE_TYPE_RESOURCE) .tap(plugin, parserOptions => { const AssetParser = getAssetParser(); return new AssetParser(false); }); normalModuleFactory.hooks.createParser - .for("asset/source") + .for(ASSET_MODULE_TYPE_SOURCE) .tap(plugin, parserOptions => { const AssetSourceParser = getAssetSourceParser(); return new AssetSourceParser(); }); - for (const type of ["asset", "asset/inline", "asset/resource"]) { + for (const type of [ + ASSET_MODULE_TYPE, + ASSET_MODULE_TYPE_INLINE, + ASSET_MODULE_TYPE_RESOURCE + ]) { normalModuleFactory.hooks.createGenerator .for(type) .tap(plugin, generatorOptions => { validateGeneratorOptions[type](generatorOptions); let dataUrl = undefined; - if (type !== "asset/resource") { + if (type !== ASSET_MODULE_TYPE_RESOURCE) { dataUrl = generatorOptions.dataUrl; if (!dataUrl || typeof dataUrl === "object") { dataUrl = { @@ -92971,7 +95418,7 @@ class AssetModulesPlugin { let filename = undefined; let publicPath = undefined; let outputPath = undefined; - if (type !== "asset/inline") { + if (type !== ASSET_MODULE_TYPE_INLINE) { filename = generatorOptions.filename; publicPath = generatorOptions.publicPath; outputPath = generatorOptions.outputPath; @@ -92989,7 +95436,7 @@ class AssetModulesPlugin { }); } normalModuleFactory.hooks.createGenerator - .for("asset/source") + .for(ASSET_MODULE_TYPE_SOURCE) .tap(plugin, () => { const AssetSourceGenerator = getAssetSourceGenerator(); @@ -93002,7 +95449,7 @@ class AssetModulesPlugin { const modules = chunkGraph.getOrderedChunkModulesIterableBySourceType( chunk, - "asset", + ASSET_MODULE_TYPE, compareModulesByIdentifier ); if (modules) { @@ -93027,7 +95474,9 @@ class AssetModulesPlugin { codeGenResult.data.get("fullContentHash") }); } catch (e) { - e.message += `\nduring rendering of asset ${module.identifier()}`; + /** @type {Error} */ ( + e + ).message += `\nduring rendering of asset ${module.identifier()}`; throw e; } } @@ -93040,7 +95489,7 @@ class AssetModulesPlugin { "AssetModulesPlugin", (options, context) => { const { codeGenerationResult } = options; - const source = codeGenerationResult.sources.get("asset"); + const source = codeGenerationResult.sources.get(ASSET_MODULE_TYPE); if (source === undefined) return; context.assets.set(codeGenerationResult.data.get("filename"), { source, @@ -93058,7 +95507,7 @@ module.exports = AssetModulesPlugin; /***/ }), -/***/ 40940: +/***/ 36577: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -93069,9 +95518,12 @@ module.exports = AssetModulesPlugin; -const Parser = __webpack_require__(66425); +const Parser = __webpack_require__(76690); +/** @typedef {import("../../declarations/WebpackOptions").AssetParserDataUrlOptions} AssetParserDataUrlOptions */ /** @typedef {import("../../declarations/WebpackOptions").AssetParserOptions} AssetParserOptions */ +/** @typedef {import("../Module").BuildInfo} BuildInfo */ +/** @typedef {import("../Module").BuildMeta} BuildMeta */ /** @typedef {import("../Parser").ParserState} ParserState */ /** @typedef {import("../Parser").PreparsedAst} PreparsedAst */ @@ -93093,23 +95545,28 @@ class AssetParser extends Parser { if (typeof source === "object" && !Buffer.isBuffer(source)) { throw new Error("AssetParser doesn't accept preparsed AST"); } - state.module.buildInfo.strict = true; - state.module.buildMeta.exportsType = "default"; - state.module.buildMeta.defaultObject = false; + + const buildInfo = /** @type {BuildInfo} */ (state.module.buildInfo); + buildInfo.strict = true; + const buildMeta = /** @type {BuildMeta} */ (state.module.buildMeta); + buildMeta.exportsType = "default"; + buildMeta.defaultObject = false; if (typeof this.dataUrlCondition === "function") { - state.module.buildInfo.dataUrl = this.dataUrlCondition(source, { + buildInfo.dataUrl = this.dataUrlCondition(source, { filename: state.module.matchResource || state.module.resource, module: state.module }); } else if (typeof this.dataUrlCondition === "boolean") { - state.module.buildInfo.dataUrl = this.dataUrlCondition; + buildInfo.dataUrl = this.dataUrlCondition; } else if ( this.dataUrlCondition && typeof this.dataUrlCondition === "object" ) { - state.module.buildInfo.dataUrl = - Buffer.byteLength(source) <= this.dataUrlCondition.maxSize; + buildInfo.dataUrl = + Buffer.byteLength(source) <= + /** @type {NonNullable} */ + (this.dataUrlCondition.maxSize); } else { throw new Error("Unexpected dataUrlCondition type"); } @@ -93123,7 +95580,7 @@ module.exports = AssetParser; /***/ }), -/***/ 9688: +/***/ 56648: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -93135,9 +95592,9 @@ module.exports = AssetParser; const { RawSource } = __webpack_require__(59728); -const ConcatenationScope = __webpack_require__(68645); -const Generator = __webpack_require__(8635); -const RuntimeGlobals = __webpack_require__(34623); +const ConcatenationScope = __webpack_require__(92811); +const Generator = __webpack_require__(58387); +const RuntimeGlobals = __webpack_require__(61539); /** @typedef {import("webpack-sources").Source} Source */ /** @typedef {import("../Generator").GenerateContext} GenerateContext */ @@ -93227,7 +95684,7 @@ module.exports = AssetSourceGenerator; /***/ }), -/***/ 18415: +/***/ 963: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -93238,8 +95695,10 @@ module.exports = AssetSourceGenerator; -const Parser = __webpack_require__(66425); +const Parser = __webpack_require__(76690); +/** @typedef {import("../Module").BuildInfo} BuildInfo */ +/** @typedef {import("../Module").BuildMeta} BuildMeta */ /** @typedef {import("../Parser").ParserState} ParserState */ /** @typedef {import("../Parser").PreparsedAst} PreparsedAst */ @@ -93254,9 +95713,12 @@ class AssetSourceParser extends Parser { throw new Error("AssetSourceParser doesn't accept preparsed AST"); } const { module } = state; - module.buildInfo.strict = true; - module.buildMeta.exportsType = "default"; - state.module.buildMeta.defaultObject = false; + /** @type {BuildInfo} */ + (module.buildInfo).strict = true; + /** @type {BuildMeta} */ + (module.buildMeta).exportsType = "default"; + /** @type {BuildMeta} */ + (state.module.buildMeta).defaultObject = false; return state; } @@ -93267,7 +95729,7 @@ module.exports = AssetSourceParser; /***/ }), -/***/ 90144: +/***/ 69762: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -93279,9 +95741,10 @@ module.exports = AssetSourceParser; const { RawSource } = __webpack_require__(59728); -const Module = __webpack_require__(96040); -const RuntimeGlobals = __webpack_require__(34623); -const makeSerializable = __webpack_require__(23827); +const Module = __webpack_require__(6309); +const { ASSET_MODULE_TYPE_RAW_DATA_URL } = __webpack_require__(92891); +const RuntimeGlobals = __webpack_require__(61539); +const makeSerializable = __webpack_require__(83626); /** @typedef {import("../../declarations/WebpackOptions").WebpackOptionsNormalized} WebpackOptions */ /** @typedef {import("../Compilation")} Compilation */ @@ -93292,6 +95755,8 @@ const makeSerializable = __webpack_require__(23827); /** @typedef {import("../RequestShortener")} RequestShortener */ /** @typedef {import("../ResolverFactory").ResolverWithOptions} ResolverWithOptions */ /** @typedef {import("../WebpackError")} WebpackError */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */ /** @typedef {import("../util/Hash")} Hash */ /** @typedef {import("../util/fs").InputFileSystem} InputFileSystem */ @@ -93304,7 +95769,7 @@ class RawDataUrlModule extends Module { * @param {string=} readableIdentifier readable identifier */ constructor(url, identifier, readableIdentifier) { - super("asset/raw-data-url", null); + super(ASSET_MODULE_TYPE_RAW_DATA_URL, null); this.url = url; this.urlBuffer = url ? Buffer.from(url) : undefined; this.identifierStr = identifier || this.url; @@ -93330,7 +95795,8 @@ class RawDataUrlModule extends Module { * @returns {number} the estimated size of the module (must be non-zero) */ size(type) { - if (this.url === undefined) this.url = this.urlBuffer.toString(); + if (this.url === undefined) + this.url = /** @type {Buffer} */ (this.urlBuffer).toString(); return Math.max(1, this.url.length); } @@ -93372,7 +95838,8 @@ class RawDataUrlModule extends Module { * @returns {CodeGenerationResult} result */ codeGeneration(context) { - if (this.url === undefined) this.url = this.urlBuffer.toString(); + if (this.url === undefined) + this.url = /** @type {Buffer} */ (this.urlBuffer).toString(); const sources = new Map(); sources.set( "javascript", @@ -93391,10 +95858,13 @@ class RawDataUrlModule extends Module { * @returns {void} */ updateHash(hash, context) { - hash.update(this.urlBuffer); + hash.update(/** @type {Buffer} */ (this.urlBuffer)); super.updateHash(hash, context); } + /** + * @param {ObjectSerializerContext} context context + */ serialize(context) { const { write } = context; @@ -93405,6 +95875,9 @@ class RawDataUrlModule extends Module { super.serialize(context); } + /** + * @param {ObjectDeserializerContext} context context + */ deserialize(context) { const { read } = context; @@ -93423,7 +95896,7 @@ module.exports = RawDataUrlModule; /***/ }), -/***/ 76425: +/***/ 37153: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -93434,9 +95907,9 @@ module.exports = RawDataUrlModule; -const InitFragment = __webpack_require__(53658); -const RuntimeGlobals = __webpack_require__(34623); -const Template = __webpack_require__(88070); +const InitFragment = __webpack_require__(44508); +const RuntimeGlobals = __webpack_require__(61539); +const Template = __webpack_require__(88835); /** @typedef {import("webpack-sources").Source} Source */ /** @typedef {import("../Generator").GenerateContext} GenerateContext */ @@ -93458,6 +95931,10 @@ class AwaitDependenciesInitFragment extends InitFragment { this.promises = promises; } + /** + * @param {AwaitDependenciesInitFragment} other other AwaitDependenciesInitFragment + * @returns {AwaitDependenciesInitFragment} AwaitDependenciesInitFragment + */ merge(other) { const promises = new Set(other.promises); for (const p of this.promises) { @@ -93500,7 +95977,7 @@ module.exports = AwaitDependenciesInitFragment; /***/ }), -/***/ 44803: +/***/ 96681: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -93511,7 +95988,7 @@ module.exports = AwaitDependenciesInitFragment; -const HarmonyImportDependency = __webpack_require__(52405); +const HarmonyImportDependency = __webpack_require__(75650); /** @typedef {import("../Compiler")} Compiler */ /** @typedef {import("../Module")} Module */ @@ -93548,7 +96025,7 @@ class InferAsyncModulesPlugin { c.isTargetActive(undefined) ) ) { - queue.add(originModule); + queue.add(/** @type {Module} */ (originModule)); } } } @@ -93563,7 +96040,7 @@ module.exports = InferAsyncModulesPlugin; /***/ }), -/***/ 84217: +/***/ 6501: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -93574,10 +96051,10 @@ module.exports = InferAsyncModulesPlugin; -const AsyncDependencyToInitialChunkError = __webpack_require__(83514); -const { connectChunkGroupParentAndChild } = __webpack_require__(3093); -const ModuleGraphConnection = __webpack_require__(17977); -const { getEntryRuntime, mergeRuntime } = __webpack_require__(55693); +const AsyncDependencyToInitialChunkError = __webpack_require__(3634); +const { connectChunkGroupParentAndChild } = __webpack_require__(90461); +const ModuleGraphConnection = __webpack_require__(7976); +const { getEntryRuntime, mergeRuntime } = __webpack_require__(69965); /** @typedef {import("./AsyncDependenciesBlock")} AsyncDependenciesBlock */ /** @typedef {import("./Chunk")} Chunk */ @@ -93585,6 +96062,7 @@ const { getEntryRuntime, mergeRuntime } = __webpack_require__(55693); /** @typedef {import("./Compilation")} Compilation */ /** @typedef {import("./DependenciesBlock")} DependenciesBlock */ /** @typedef {import("./Dependency")} Dependency */ +/** @typedef {import("./Dependency").DependencyLocation} DependencyLocation */ /** @typedef {import("./Entrypoint")} Entrypoint */ /** @typedef {import("./Module")} Module */ /** @typedef {import("./ModuleGraph")} ModuleGraph */ @@ -93608,15 +96086,15 @@ const { getEntryRuntime, mergeRuntime } = __webpack_require__(55693); * @typedef {Object} ChunkGroupInfo * @property {ChunkGroup} chunkGroup the chunk group * @property {RuntimeSpec} runtime the runtimes - * @property {ModuleSetPlus} minAvailableModules current minimal set of modules available at this point - * @property {boolean} minAvailableModulesOwned true, if minAvailableModules is owned and can be modified + * @property {ModuleSetPlus | undefined} minAvailableModules current minimal set of modules available at this point + * @property {boolean | undefined} minAvailableModulesOwned true, if minAvailableModules is owned and can be modified * @property {ModuleSetPlus[]} availableModulesToBeMerged enqueued updates to the minimal set of available modules * @property {Set=} skippedItems modules that were skipped because module is already available in parent chunks (need to reconsider when minAvailableModules is shrinking) * @property {Set<[Module, ConnectionState]>=} skippedModuleConnections referenced modules that where skipped because they were not active in this runtime - * @property {ModuleSetPlus} resultingAvailableModules set of modules available including modules from this chunk group - * @property {Set} children set of children chunk groups, that will be revisited when availableModules shrink - * @property {Set} availableSources set of chunk groups that are the source for minAvailableModules - * @property {Set} availableChildren set of chunk groups which depend on the this chunk group as availableSource + * @property {ModuleSetPlus | undefined} resultingAvailableModules set of modules available including modules from this chunk group + * @property {Set | undefined} children set of children chunk groups, that will be revisited when availableModules shrink + * @property {Set | undefined} availableSources set of chunk groups that are the source for minAvailableModules + * @property {Set | undefined} availableChildren set of chunk groups which depend on the this chunk group as availableSource * @property {number} preOrderIndex next pre order index * @property {number} postOrderIndex next post order index * @property {boolean} chunkLoading has a chunk loading mechanism @@ -93768,6 +96246,7 @@ const visitModules = ( /** @type {RuntimeSpec | false} */ let blockModulesMapRuntime = false; + /** @type {Map} */ let blockModulesMap; /** @@ -93808,7 +96287,7 @@ const visitModules = ( extractBlockModules(module, moduleGraph, runtime, blockModulesMap); blockModules = blockModulesMap.get(block); logger.timeAggregate("visitModules: prepare"); - return blockModules; + return /** @type {(Module | ConnectionState)[]} */ (blockModules); } }; @@ -93859,7 +96338,7 @@ const visitModules = ( for (const [chunkGroup, modules] of inputEntrypointsAndModules) { const runtime = getEntryRuntime( compilation, - chunkGroup.name, + /** @type {string} */ (chunkGroup.name), chunkGroup.options ); /** @type {ChunkGroupInfo} */ @@ -93921,7 +96400,9 @@ const visitModules = ( const { chunkGroup } = chunkGroupInfo; chunkGroupInfo.availableSources = new Set(); for (const parent of chunkGroup.parentsIterable) { - const parentChunkGroupInfo = chunkGroupInfoMap.get(parent); + const parentChunkGroupInfo = + /** @type {ChunkGroupInfo} */ + (chunkGroupInfoMap.get(parent)); chunkGroupInfo.availableSources.add(parentChunkGroupInfo); if (parentChunkGroupInfo.availableChildren === undefined) { parentChunkGroupInfo.availableChildren = new Set(); @@ -93968,15 +96449,15 @@ const visitModules = ( // 1. We create a chunk group with single chunk in it for this Block // but only once (blockChunkGroups map) let cgi = blockChunkGroups.get(b); - /** @type {ChunkGroup} */ + /** @type {ChunkGroup | undefined} */ let c; - /** @type {Entrypoint} */ + /** @type {Entrypoint | undefined} */ let entrypoint; const entryOptions = b.groupOptions && b.groupOptions.entryOptions; if (cgi === undefined) { const chunkName = (b.groupOptions && b.groupOptions.name) || b.chunkName; if (entryOptions) { - cgi = namedAsyncEntrypoints.get(chunkName); + cgi = namedAsyncEntrypoints.get(/** @type {string} */ (chunkName)); if (!cgi) { entrypoint = compilation.addAsyncEntrypoint( entryOptions, @@ -94074,7 +96555,11 @@ const visitModules = ( c = cgi.chunkGroup; if (c.isInitial()) { compilation.errors.push( - new AsyncDependencyToInitialChunkError(chunkName, module, b.loc) + new AsyncDependencyToInitialChunkError( + /** @type {string} */ (chunkName), + module, + b.loc + ) ); c = chunkGroup; } else { @@ -94084,7 +96569,7 @@ const visitModules = ( } blockConnections.set(b, []); } - blockChunkGroups.set(b, cgi); + blockChunkGroups.set(b, /** @type {ChunkGroupInfo} */ (cgi)); } else if (entryOptions) { entrypoint = /** @type {Entrypoint} */ (cgi.chunkGroup); } else { @@ -94105,7 +96590,7 @@ const visitModules = ( connectList = new Set(); queueConnect.set(chunkGroupInfo, connectList); } - connectList.add(cgi); + connectList.add(/** @type {ChunkGroupInfo} */ (cgi)); // TODO check if this really need to be done for each traversal // or if it is enough when it's queued when created @@ -94116,7 +96601,7 @@ const visitModules = ( module: module, chunk: c.chunks[0], chunkGroup: c, - chunkGroupInfo: cgi + chunkGroupInfo: /** @type {ChunkGroupInfo} */ (cgi) }); } else if (entrypoint !== undefined) { chunkGroupInfo.chunkGroup.addAsyncEntrypoint(entrypoint); @@ -94259,7 +96744,7 @@ const visitModules = ( const processQueue = () => { while (queue.length) { statProcessedQueueItems++; - const queueItem = queue.pop(); + const queueItem = /** @type {QueueItem} */ (queue.pop()); module = queueItem.module; block = queueItem.block; chunk = queueItem.chunk; @@ -94656,7 +97141,9 @@ const visitModules = ( const processChunkGroupsForCombining = () => { for (const info of chunkGroupsForCombining) { - for (const source of info.availableSources) { + for (const source of /** @type {Set} */ ( + info.availableSources + )) { if (!source.minAvailableModules) { chunkGroupsForCombining.delete(info); break; @@ -94675,7 +97162,9 @@ const visitModules = ( } }; // combine minAvailableModules from all resultingAvailableModules - for (const source of info.availableSources) { + for (const source of /** @type {Set} */ ( + info.availableSources + )) { const resultingAvailableModules = calculateResultingAvailableModules(source); mergeSet(resultingAvailableModules); @@ -94695,7 +97184,9 @@ const visitModules = ( for (const info of outdatedChunkGroupInfo) { // 1. Reconsider skipped items if (info.skippedItems !== undefined) { - const { minAvailableModules } = info; + const minAvailableModules = + /** @type {ModuleSetPlus} */ + (info.minAvailableModules); for (const module of info.skippedItems) { if ( !minAvailableModules.has(module) && @@ -94716,7 +97207,9 @@ const visitModules = ( // 2. Reconsider skipped connections if (info.skippedModuleConnections !== undefined) { - const { minAvailableModules } = info; + const minAvailableModules = + /** @type {ModuleSetPlus} */ + (info.minAvailableModules); for (const entry of info.skippedModuleConnections) { const [module, activeState] = entry; if (activeState === false) continue; @@ -94973,7 +97466,7 @@ module.exports = buildChunkGraph; /***/ }), -/***/ 31264: +/***/ 89741: /***/ (function(module) { "use strict"; @@ -95014,7 +97507,7 @@ module.exports = AddBuildDependenciesPlugin; /***/ }), -/***/ 47956: +/***/ 33514: /***/ (function(module) { "use strict"; @@ -95057,7 +97550,7 @@ module.exports = AddManagedPathsPlugin; /***/ }), -/***/ 97392: +/***/ 46450: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -95068,8 +97561,8 @@ module.exports = AddManagedPathsPlugin; -const Cache = __webpack_require__(20130); -const ProgressPlugin = __webpack_require__(25334); +const Cache = __webpack_require__(11948); +const ProgressPlugin = __webpack_require__(25483); /** @typedef {import("../Compiler")} Compiler */ @@ -95113,7 +97606,7 @@ class IdleFileCachePlugin { let timeSpendInStore = 0; let avgTimeSpendInStore = 0; - /** @type {Map Promise>} */ + /** @type {Map Promise>} */ const pendingIdleTasks = new Map(); compiler.cache.hooks.store.tap( @@ -95234,6 +97727,7 @@ class IdleFileCachePlugin { isInitialStore = false; } }; + /** @type {ReturnType | undefined} */ let idleTimer = undefined; compiler.cache.hooks.beginIdle.tap( { name: "IdleFileCachePlugin", stage: Cache.STAGE_DISK }, @@ -95292,7 +97786,7 @@ module.exports = IdleFileCachePlugin; /***/ }), -/***/ 45864: +/***/ 21429: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -95303,7 +97797,7 @@ module.exports = IdleFileCachePlugin; -const Cache = __webpack_require__(20130); +const Cache = __webpack_require__(11948); /** @typedef {import("webpack-sources").Source} Source */ /** @typedef {import("../Cache").Etag} Etag */ @@ -95357,7 +97851,7 @@ module.exports = MemoryCachePlugin; /***/ }), -/***/ 24971: +/***/ 99243: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -95368,7 +97862,7 @@ module.exports = MemoryCachePlugin; -const Cache = __webpack_require__(20130); +const Cache = __webpack_require__(11948); /** @typedef {import("webpack-sources").Source} Source */ /** @typedef {import("../Cache").Etag} Etag */ @@ -95397,6 +97891,8 @@ class MemoryWithGcCachePlugin { generation++; let clearedEntries = 0; let lastClearedIdentifier; + // Avoid coverage problems due indirect changes + /* istanbul ignore next */ for (const [identifier, entry] of oldCache) { if (entry.until > generation) break; @@ -95494,7 +97990,7 @@ module.exports = MemoryWithGcCachePlugin; /***/ }), -/***/ 27002: +/***/ 98743: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -95505,32 +98001,37 @@ module.exports = MemoryWithGcCachePlugin; -const FileSystemInfo = __webpack_require__(1120); -const ProgressPlugin = __webpack_require__(25334); -const { formatSize } = __webpack_require__(53592); -const SerializerMiddleware = __webpack_require__(80021); -const LazySet = __webpack_require__(66205); -const makeSerializable = __webpack_require__(23827); -const memoize = __webpack_require__(27319); +const FileSystemInfo = __webpack_require__(18509); +const ProgressPlugin = __webpack_require__(25483); +const { formatSize } = __webpack_require__(73273); +const SerializerMiddleware = __webpack_require__(41565); +const LazySet = __webpack_require__(57876); +const makeSerializable = __webpack_require__(83626); +const memoize = __webpack_require__(62377); const { createFileSerializer, NOT_SERIALIZABLE -} = __webpack_require__(94965); +} = __webpack_require__(93141); /** @typedef {import("../../declarations/WebpackOptions").SnapshotOptions} SnapshotOptions */ /** @typedef {import("../Cache").Etag} Etag */ /** @typedef {import("../Compiler")} Compiler */ +/** @typedef {import("../FileSystemInfo").ResolveBuildDependenciesResult} ResolveBuildDependenciesResult */ /** @typedef {import("../FileSystemInfo").Snapshot} Snapshot */ /** @typedef {import("../logging/Logger").Logger} Logger */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */ /** @typedef {import("../util/fs").IntermediateFileSystem} IntermediateFileSystem */ +/** @typedef {Map} ResolveResults */ + class PackContainer { /** * @param {Object} data stored data * @param {string} version version identifier * @param {Snapshot} buildSnapshot snapshot of all build dependencies * @param {Set} buildDependencies list of all unresolved build dependencies captured - * @param {Map} resolveResults result of the resolved build dependencies + * @param {ResolveResults} resolveResults result of the resolved build dependencies * @param {Snapshot} resolveBuildDependenciesSnapshot snapshot of the dependencies of the build dependencies resolving */ constructor( @@ -95558,6 +98059,9 @@ class PackContainer { writeLazy(this.data); } + /** + * @param {ObjectDeserializerContext} context context + */ deserialize({ read }) { this.version = read(); this.buildSnapshot = read(); @@ -95599,7 +98103,7 @@ class Pack { constructor(logger, maxAge) { /** @type {Map} */ this.itemInfo = new Map(); - /** @type {string[]} */ + /** @type {(string | undefined)[]} */ this.requests = []; this.requestsTimeout = undefined; /** @type {Map} */ @@ -95611,6 +98115,9 @@ class Pack { this.maxAge = maxAge; } + /** + * @param {string} identifier identifier + */ _addRequest(identifier) { this.requests.push(identifier); if (this.requestsTimeout === undefined) { @@ -95649,7 +98156,7 @@ class Pack { if (!this.content[loc]) { return undefined; } - return this.content[loc].get(identifier); + return /** @type {PackContent} */ (this.content[loc]).get(identifier); } } @@ -95675,7 +98182,7 @@ class Pack { if (loc >= 0) { this._addRequest(identifier); this.freshContent.set(identifier, info); - const content = this.content[loc]; + const content = /** @type {PackContent} */ (this.content[loc]); content.delete(identifier); if (content.items.size === 0) { this.content[loc] = undefined; @@ -95851,11 +98358,12 @@ class Pack { mergedIndices = smallUnusedContents; } else return; + /** @type {PackContent[] } */ const mergedContent = []; // 3. Remove old content entries for (const i of mergedIndices) { - mergedContent.push(this.content[i]); + mergedContent.push(/** @type {PackContent} */ (this.content[i])); this.content[i] = undefined; } @@ -95864,7 +98372,7 @@ class Pack { const mergedItems = new Set(); /** @type {Set} */ const mergedUsedItems = new Set(); - /** @type {(function(Map): Promise)[]} */ + /** @type {(function(Map): Promise)[]} */ const addToMergedMap = []; for (const content of mergedContent) { for (const identifier of content.items) { @@ -95998,17 +98506,20 @@ class Pack { * Only runs for one content to avoid large invalidation. */ _gcOldestContent() { - /** @type {PackItemInfo} */ + /** @type {PackItemInfo | undefined} */ let oldest = undefined; for (const info of this.itemInfo.values()) { if (oldest === undefined || info.lastAccess < oldest.lastAccess) { oldest = info; } } - if (Date.now() - oldest.lastAccess > this.maxAge) { - const loc = oldest.location; + if ( + Date.now() - /** @type {PackItemInfo} */ (oldest).lastAccess > + this.maxAge + ) { + const loc = /** @type {PackItemInfo} */ (oldest).location; if (loc < 0) return; - const content = this.content[loc]; + const content = /** @type {PackContent} */ (this.content[loc]); const items = new Set(content.items); const usedItems = new Set(content.used); this._gcAndUpdateLocation(items, usedItems, loc); @@ -96271,6 +98782,7 @@ class PackContent { // We are in state B const { lazyName } = this; + /** @type {string | undefined} */ let timeMessage; if (lazyName) { // only log once @@ -96311,7 +98823,7 @@ class PackContent { /** * @param {string} reason explanation why unpack is necessary - * @returns {void | Promise} maybe a promise if lazy + * @returns {void | Promise} maybe a promise if lazy */ unpack(reason) { if (this.content) return; @@ -96319,6 +98831,7 @@ class PackContent { // Move from state B to C if (this.lazy) { const { lazyName } = this; + /** @type {string | undefined} */ let timeMessage; if (lazyName) { // only log once @@ -96362,6 +98875,9 @@ class PackContent { return size; } + /** + * @param {string} identifier identifier + */ delete(identifier) { this.items.delete(identifier); this.used.delete(identifier); @@ -96406,6 +98922,7 @@ class PackContent { } // State B2 const { lazyName } = this; + /** @type {string | undefined} */ let timeMessage; if (lazyName) { // only log once @@ -96459,6 +98976,10 @@ class PackContent { } } +/** + * @param {Buffer} buf buffer + * @returns {Buffer} buffer that can be collected + */ const allowCollectingMemory = buf => { const wasted = buf.buffer.byteLength - buf.byteLength; if (wasted > 8192 && (wasted > 1048576 || wasted > buf.byteLength)) { @@ -96478,9 +98999,10 @@ class PackFileCacheStrategy { * @param {Logger} options.logger a logger * @param {SnapshotOptions} options.snapshot options regarding snapshotting * @param {number} options.maxAge max age of cache items - * @param {boolean} options.profile track and log detailed timing information for individual cache items - * @param {boolean} options.allowCollectingMemory allow to collect unused memory created during deserialization - * @param {false | "gzip" | "brotli"} options.compression compression used + * @param {boolean | undefined} options.profile track and log detailed timing information for individual cache items + * @param {boolean | undefined} options.allowCollectingMemory allow to collect unused memory created during deserialization + * @param {false | "gzip" | "brotli" | undefined} options.compression compression used + * @param {boolean | undefined} options.readonly disable storing cache into filesystem */ constructor({ compiler, @@ -96493,7 +99015,8 @@ class PackFileCacheStrategy { maxAge, profile, allowCollectingMemory, - compression + compression, + readonly }) { this.fileSerializer = createFileSerializer( fs, @@ -96512,6 +99035,7 @@ class PackFileCacheStrategy { this.logger = logger; this.maxAge = maxAge; this.profile = profile; + this.readonly = readonly; this.allowCollectingMemory = allowCollectingMemory; this.compression = compression; this._extension = @@ -96525,17 +99049,20 @@ class PackFileCacheStrategy { this.buildDependencies = new Set(); /** @type {LazySet} */ this.newBuildDependencies = new LazySet(); - /** @type {Snapshot} */ + /** @type {Snapshot | undefined} */ this.resolveBuildDependenciesSnapshot = undefined; - /** @type {Map} */ + /** @type {ResolveResults | undefined} */ this.resolveResults = undefined; - /** @type {Snapshot} */ + /** @type {Snapshot | undefined} */ this.buildSnapshot = undefined; - /** @type {Promise} */ + /** @type {Promise | undefined} */ this.packPromise = this._openPack(); this.storePromise = Promise.resolve(); } + /** + * @returns {Promise} pack + */ _getPack() { if (this.packPromise === undefined) { this.packPromise = this.storePromise.then(() => this._openPack()); @@ -96556,7 +99083,7 @@ class PackFileCacheStrategy { let newBuildDependencies; /** @type {Snapshot} */ let resolveBuildDependenciesSnapshot; - /** @type {Map} */ + /** @type {ResolveResults | undefined} */ let resolveResults; logger.time("restore cache container"); return this.fileSerializer @@ -96713,6 +99240,8 @@ class PackFileCacheStrategy { * @returns {Promise} promise */ store(identifier, etag, data) { + if (this.readonly) return Promise.resolve(); + return this._getPack().then(pack => { pack.set(identifier, etag === null ? null : etag.toString(), data); }); @@ -96738,7 +99267,11 @@ class PackFileCacheStrategy { }); } + /** + * @param {LazySet} dependencies dependencies to store + */ storeBuildDependencies(dependencies) { + if (this.readonly) return; this.newBuildDependencies.addAll(dependencies); } @@ -96782,7 +99315,7 @@ class PackFileCacheStrategy { missing, resolveResults, resolveDependencies - } = result; + } = /** @type {ResolveBuildDependenciesResult} */ (result); if (this.resolveResults) { for (const [key, value] of resolveResults) { this.resolveResults.set(key, value); @@ -96877,7 +99410,7 @@ class PackFileCacheStrategy { const content = new PackContainer( pack, this.version, - this.buildSnapshot, + /** @type {Snapshot} */ (this.buildSnapshot), updatedBuildDependencies, this.resolveResults, this.resolveBuildDependenciesSnapshot @@ -96932,7 +99465,7 @@ module.exports = PackFileCacheStrategy; /***/ }), -/***/ 28563: +/***/ 26133: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -96943,8 +99476,8 @@ module.exports = PackFileCacheStrategy; -const LazySet = __webpack_require__(66205); -const makeSerializable = __webpack_require__(23827); +const LazySet = __webpack_require__(57876); +const makeSerializable = __webpack_require__(83626); /** @typedef {import("enhanced-resolve/lib/Resolver")} Resolver */ /** @typedef {import("../CacheFacade").ItemCacheFacade} ItemCacheFacade */ @@ -97062,8 +99595,11 @@ class ResolverCachePlugin { const newResolveContext = { ...resolveContext, stack: new Set(), + /** @type {LazySet} */ missingDependencies: new LazySet(), + /** @type {LazySet} */ fileDependencies: new LazySet(), + /** @type {LazySet} */ contextDependencies: new LazySet() }; let yieldResult; @@ -97294,7 +99830,7 @@ module.exports = ResolverCachePlugin; /***/ }), -/***/ 36899: +/***/ 64968: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -97305,7 +99841,7 @@ module.exports = ResolverCachePlugin; -const createHash = __webpack_require__(94624); +const createHash = __webpack_require__(31147); /** @typedef {import("../util/Hash")} Hash */ /** @typedef {typeof import("../util/Hash")} HashConstructor */ @@ -97383,7 +99919,7 @@ module.exports = getter; /***/ }), -/***/ 60302: +/***/ 34408: /***/ (function(module) { "use strict"; @@ -97465,7 +100001,7 @@ module.exports = mergeEtags; /***/ }), -/***/ 6676: +/***/ 33698: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; @@ -97477,7 +100013,7 @@ module.exports = mergeEtags; const path = __webpack_require__(71017); -const webpackSchema = __webpack_require__(9183); +const webpackSchema = __webpack_require__(40138); // TODO add originPath to PathItem for better errors /** @@ -98128,7 +100664,7 @@ exports.processArguments = processArguments; /***/ }), -/***/ 34110: +/***/ 48137: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -98157,7 +100693,7 @@ const inputRx = /^(?:((?:[A-Z]:)?[/\\].*?))?(?::(.+?))?$/i; */ /** - * @param {string} input input string + * @param {string | null | undefined} input input string * @param {string} context the context directory * @returns {BrowserslistHandlerConfig} config */ @@ -98181,7 +100717,7 @@ const parse = (input, context) => { }; /** - * @param {string} input input string + * @param {string | null | undefined} input input string * @param {string} context the context directory * @returns {string[] | undefined} selected browsers */ @@ -98200,7 +100736,7 @@ const load = (input, context) => { }) : browserslist.loadConfig({ path: context, env }); - if (!config) return null; + if (!config) return; return browserslist(config); }; @@ -98254,7 +100790,7 @@ const resolve = browsers => { and_qq: [10, 4], // baidu: Not supported // and_uc: Not supported - // kaios: Not supported + kaios: [3, 0], node: [12, 17] }); @@ -98321,7 +100857,7 @@ const resolve = browsers => { // and_qq: Unknown support // baidu: Unknown support // and_uc: Unknown support - // kaios: Unknown support + kaios: [3, 0], node: [0, 12] }), destructuring: rawChecker({ @@ -98340,7 +100876,7 @@ const resolve = browsers => { // and_qq: Unknown support // baidu: Unknown support // and_uc: Unknown support - // kaios: Unknown support + kaios: [2, 5], node: [6, 0] }), bigIntLiteral: rawChecker({ @@ -98359,7 +100895,7 @@ const resolve = browsers => { // and_qq: Not supported // baidu: Not supported // and_uc: Not supported - // kaios: Not supported + kaios: [3, 0], node: [10, 4] }), // Support syntax `import` and `export` and no limitations and bugs on Node.js @@ -98380,7 +100916,7 @@ const resolve = browsers => { and_qq: [10, 4], // baidu: Not supported // and_uc: Not supported - // kaios: Not supported + kaios: [3, 0], node: [12, 17] }), dynamicImport: es6DynamicImport, @@ -98403,7 +100939,7 @@ const resolve = browsers => { // and_qq: Unknown support // baidu: Unknown support // and_uc: Unknown support - // kaios: Unknown support + kaios: [3, 0], node: 12 }), optionalChaining: rawChecker({ @@ -98422,7 +100958,7 @@ const resolve = browsers => { // and_qq: Not supported // baidu: Not supported // and_uc: Not supported - // kaios: Not supported + kaios: [3, 0], node: 14 }), templateLiteral: rawChecker({ @@ -98469,7 +101005,7 @@ module.exports = { /***/ }), -/***/ 62484: +/***/ 36569: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; @@ -98482,39 +101018,60 @@ module.exports = { const fs = __webpack_require__(57147); const path = __webpack_require__(71017); -const Template = __webpack_require__(88070); -const { cleverMerge } = __webpack_require__(31074); +const { + JAVASCRIPT_MODULE_TYPE_AUTO, + JSON_MODULE_TYPE, + WEBASSEMBLY_MODULE_TYPE_ASYNC, + JAVASCRIPT_MODULE_TYPE_ESM, + JAVASCRIPT_MODULE_TYPE_DYNAMIC, + WEBASSEMBLY_MODULE_TYPE_SYNC, + ASSET_MODULE_TYPE, + CSS_MODULE_TYPE_AUTO, + CSS_MODULE_TYPE, + CSS_MODULE_TYPE_MODULE +} = __webpack_require__(92891); +const Template = __webpack_require__(88835); +const { cleverMerge } = __webpack_require__(44639); const { getTargetsProperties, getTargetProperties, getDefaultTarget -} = __webpack_require__(38949); +} = __webpack_require__(62672); /** @typedef {import("../../declarations/WebpackOptions").CacheOptionsNormalized} CacheOptions */ +/** @typedef {import("../../declarations/WebpackOptions").Context} Context */ /** @typedef {import("../../declarations/WebpackOptions").CssExperimentOptions} CssExperimentOptions */ /** @typedef {import("../../declarations/WebpackOptions").EntryDescription} EntryDescription */ /** @typedef {import("../../declarations/WebpackOptions").EntryNormalized} Entry */ +/** @typedef {import("../../declarations/WebpackOptions").EntryStaticNormalized} EntryStaticNormalized */ +/** @typedef {import("../../declarations/WebpackOptions").Environment} Environment */ /** @typedef {import("../../declarations/WebpackOptions").Experiments} Experiments */ /** @typedef {import("../../declarations/WebpackOptions").ExperimentsNormalized} ExperimentsNormalized */ /** @typedef {import("../../declarations/WebpackOptions").ExternalsPresets} ExternalsPresets */ /** @typedef {import("../../declarations/WebpackOptions").ExternalsType} ExternalsType */ +/** @typedef {import("../../declarations/WebpackOptions").FileCacheOptions} FileCacheOptions */ /** @typedef {import("../../declarations/WebpackOptions").InfrastructureLogging} InfrastructureLogging */ /** @typedef {import("../../declarations/WebpackOptions").JavascriptParserOptions} JavascriptParserOptions */ /** @typedef {import("../../declarations/WebpackOptions").Library} Library */ /** @typedef {import("../../declarations/WebpackOptions").LibraryName} LibraryName */ /** @typedef {import("../../declarations/WebpackOptions").LibraryOptions} LibraryOptions */ +/** @typedef {import("../../declarations/WebpackOptions").LibraryType} LibraryType */ /** @typedef {import("../../declarations/WebpackOptions").Loader} Loader */ /** @typedef {import("../../declarations/WebpackOptions").Mode} Mode */ /** @typedef {import("../../declarations/WebpackOptions").ModuleOptionsNormalized} ModuleOptions */ /** @typedef {import("../../declarations/WebpackOptions").Node} WebpackNode */ /** @typedef {import("../../declarations/WebpackOptions").Optimization} Optimization */ +/** @typedef {import("../../declarations/WebpackOptions").OptimizationSplitChunksOptions} OptimizationSplitChunksOptions */ /** @typedef {import("../../declarations/WebpackOptions").OutputNormalized} Output */ +/** @typedef {import("../../declarations/WebpackOptions").ParserOptionsByModuleTypeKnown} ParserOptionsByModuleTypeKnown */ /** @typedef {import("../../declarations/WebpackOptions").Performance} Performance */ /** @typedef {import("../../declarations/WebpackOptions").ResolveOptions} ResolveOptions */ /** @typedef {import("../../declarations/WebpackOptions").RuleSetRules} RuleSetRules */ /** @typedef {import("../../declarations/WebpackOptions").SnapshotOptions} SnapshotOptions */ /** @typedef {import("../../declarations/WebpackOptions").Target} Target */ /** @typedef {import("../../declarations/WebpackOptions").WebpackOptionsNormalized} WebpackOptions */ +/** @typedef {import("../Compiler")} Compiler */ +/** @typedef {import("../Module")} Module */ /** @typedef {import("./target").TargetProperties} TargetProperties */ const NODE_MODULES_REGEXP = /[\\/]node_modules[\\/]/i; @@ -98566,7 +101123,7 @@ const A = (obj, prop, factory) => { if (value === undefined) { obj[prop] = factory(); } else if (Array.isArray(value)) { - /** @type {any[]} */ + /** @type {any[] | undefined} */ let newArray = undefined; for (let i = 0; i < value.length; i++) { const item = value[i]; @@ -98604,7 +101161,7 @@ const applyWebpackOptionsBaseDefaults = options => { const applyWebpackOptionsDefaults = options => { F(options, "context", () => process.cwd()); F(options, "target", () => { - return getDefaultTarget(options.context); + return getDefaultTarget(/** @type {string} */ (options.context)); }); const { mode, name, target } = options; @@ -98613,8 +101170,11 @@ const applyWebpackOptionsDefaults = options => { target === false ? /** @type {false} */ (false) : typeof target === "string" - ? getTargetProperties(target, options.context) - : getTargetsProperties(target, options.context); + ? getTargetProperties(target, /** @type {Context} */ (options.context)) + : getTargetsProperties( + /** @type {string[]} */ (target), + /** @type {Context} */ (options.context) + ); const development = mode === "development"; const production = mode === "production" || !mode; @@ -98642,7 +101202,9 @@ const applyWebpackOptionsDefaults = options => { targetProperties }); - const futureDefaults = options.experiments.futureDefaults; + const futureDefaults = + /** @type {NonNullable} */ + (options.experiments.futureDefaults); F(options, "cache", () => development ? { type: /** @type {"memory"} */ ("memory") } : false @@ -98662,22 +101224,30 @@ const applyWebpackOptionsDefaults = options => { applyModuleDefaults(options.module, { cache, - syncWebAssembly: options.experiments.syncWebAssembly, - asyncWebAssembly: options.experiments.asyncWebAssembly, - css: options.experiments.css, + syncWebAssembly: + /** @type {NonNullable} */ + (options.experiments.syncWebAssembly), + asyncWebAssembly: + /** @type {NonNullable} */ + (options.experiments.asyncWebAssembly), + css: + /** @type {NonNullable} */ + (options.experiments.css), futureDefaults, isNode: targetProperties && targetProperties.node === true }); applyOutputDefaults(options.output, { - context: options.context, + context: /** @type {Context} */ (options.context), targetProperties, isAffectedByBrowserslist: target === undefined || (typeof target === "string" && target.startsWith("browserslist")) || (Array.isArray(target) && target.some(target => target.startsWith("browserslist"))), - outputModule: options.experiments.outputModule, + outputModule: + /** @type {NonNullable} */ + (options.experiments.outputModule), development, entry: options.entry, module: options.module, @@ -98689,10 +101259,13 @@ const applyWebpackOptionsDefaults = options => { buildHttp: !!options.experiments.buildHttp }); - applyLoaderDefaults(options.loader, { targetProperties }); + applyLoaderDefaults( + /** @type {NonNullable} */ (options.loader), + { targetProperties, environment: options.output.environment } + ); F(options, "externalsType", () => { - const validExternalTypes = (__webpack_require__(9183).definitions.ExternalsType["enum"]); + const validExternalTypes = (__webpack_require__(40138).definitions.ExternalsType["enum"]); return options.output.library && validExternalTypes.includes(options.output.library.type) ? /** @type {ExternalsType} */ (options.output.library.type) @@ -98702,7 +101275,9 @@ const applyWebpackOptionsDefaults = options => { }); applyNodeDefaults(options.node, { - futureDefaults: options.experiments.futureDefaults, + futureDefaults: + /** @type {NonNullable} */ + (options.experiments.futureDefaults), targetProperties }); @@ -98713,23 +101288,32 @@ const applyWebpackOptionsDefaults = options => { ? {} : false ); - applyPerformanceDefaults(options.performance, { - production - }); + applyPerformanceDefaults( + /** @type {NonNullable} */ + (options.performance), + { + production + } + ); applyOptimizationDefaults(options.optimization, { development, production, - css: options.experiments.css, + css: + /** @type {NonNullable} */ + (options.experiments.css), records: !!(options.recordsInputPath || options.recordsOutputPath) }); options.resolve = cleverMerge( getResolveDefaults({ cache, - context: options.context, + context: /** @type {Context} */ (options.context), targetProperties, - mode: options.mode + mode: /** @type {Mode} */ (options.mode), + css: + /** @type {NonNullable} */ + (options.experiments.css) }), options.resolve ); @@ -98754,7 +101338,6 @@ const applyExperimentsDefaults = ( ) => { D(experiments, "futureDefaults", false); D(experiments, "backCompat", !experiments.futureDefaults); - D(experiments, "topLevelAwait", experiments.futureDefaults); D(experiments, "syncWebAssembly", false); D(experiments, "asyncWebAssembly", experiments.futureDefaults); D(experiments, "outputModule", false); @@ -98764,6 +101347,13 @@ const applyExperimentsDefaults = ( D(experiments, "cacheUnaffected", experiments.futureDefaults); F(experiments, "css", () => (experiments.futureDefaults ? {} : undefined)); + // TODO webpack 6: remove this. topLevelAwait should be enabled by default + let shouldEnableTopLevelAwait = true; + if (typeof experiments.topLevelAwait === "boolean") { + shouldEnableTopLevelAwait = experiments.topLevelAwait; + } + D(experiments, "topLevelAwait", shouldEnableTopLevelAwait); + if (typeof experiments.buildHttp === "object") { D(experiments.buildHttp, "frozen", production); D(experiments.buildHttp, "upgrade", false); @@ -98782,9 +101372,9 @@ const applyExperimentsDefaults = ( * @param {CacheOptions} cache options * @param {Object} options options * @param {string} options.name name - * @param {string} options.mode mode + * @param {Mode} options.mode mode * @param {boolean} options.development is development mode - * @param {boolean} options.cacheUnaffected the cacheUnaffected experiment is enabled + * @param {Experiments["cacheUnaffected"]} options.cacheUnaffected the cacheUnaffected experiment is enabled * @returns {void} */ const applyCacheDefaults = ( @@ -98798,6 +101388,7 @@ const applyCacheDefaults = ( D(cache, "version", ""); F(cache, "cacheDirectory", () => { const cwd = process.cwd(); + /** @type {string | undefined} */ let dir = cwd; for (;;) { try { @@ -98822,7 +101413,11 @@ const applyCacheDefaults = ( } }); F(cache, "cacheLocation", () => - path.resolve(cache.cacheDirectory, cache.name) + path.resolve( + /** @type {NonNullable} */ + (cache.cacheDirectory), + /** @type {NonNullable} */ (cache.name) + ) ); D(cache, "hashAlgorithm", "md4"); D(cache, "store", "pack"); @@ -98835,9 +101430,13 @@ const applyCacheDefaults = ( D(cache, "maxAge", 1000 * 60 * 60 * 24 * 60); // 1 month D(cache, "allowCollectingMemory", development); D(cache, "memoryCacheUnaffected", development && cacheUnaffected); - D(cache.buildDependencies, "defaultWebpack", [ - path.resolve(__dirname, "..") + path.sep - ]); + D(cache, "readonly", false); + D( + /** @type {NonNullable} */ + (cache.buildDependencies), + "defaultWebpack", + [path.resolve(__dirname, "..") + path.sep] + ); break; case "memory": D(cache, "maxGenerations", Infinity); @@ -98949,6 +101548,7 @@ const applyJavascriptParserOptionsDefaults = ( D(parserOptions, "dynamicImportMode", "lazy"); D(parserOptions, "dynamicImportPrefetch", false); D(parserOptions, "dynamicImportPreload", false); + D(parserOptions, "dynamicImportFetchPriority", false); D(parserOptions, "createRequire", isNode); if (futureDefaults) D(parserOptions, "exportsPresence", "error"); }; @@ -98969,29 +101569,57 @@ const applyModuleDefaults = ( { cache, syncWebAssembly, asyncWebAssembly, css, futureDefaults, isNode } ) => { if (cache) { - D(module, "unsafeCache", module => { - const name = module.nameForCondition(); - return name && NODE_MODULES_REGEXP.test(name); - }); + D( + module, + "unsafeCache", + /** + * @param {Module} module module + * @returns {boolean | null | string} true, if we want to cache the module + */ + module => { + const name = module.nameForCondition(); + return name && NODE_MODULES_REGEXP.test(name); + } + ); } else { D(module, "unsafeCache", false); } - F(module.parser, "asset", () => ({})); - F(module.parser.asset, "dataUrlCondition", () => ({})); - if (typeof module.parser.asset.dataUrlCondition === "object") { - D(module.parser.asset.dataUrlCondition, "maxSize", 8096); + F(module.parser, ASSET_MODULE_TYPE, () => ({})); + F( + /** @type {NonNullable} */ + (module.parser.asset), + "dataUrlCondition", + () => ({}) + ); + if ( + typeof ( + /** @type {NonNullable} */ + (module.parser.asset).dataUrlCondition + ) === "object" + ) { + D( + /** @type {NonNullable} */ + (module.parser.asset).dataUrlCondition, + "maxSize", + 8096 + ); } F(module.parser, "javascript", () => ({})); - applyJavascriptParserOptionsDefaults(module.parser.javascript, { - futureDefaults, - isNode - }); + + applyJavascriptParserOptionsDefaults( + /** @type {NonNullable} */ + (module.parser.javascript), + { + futureDefaults, + isNode + } + ); A(module, "defaultRules", () => { const esm = { - type: "javascript/esm", + type: JAVASCRIPT_MODULE_TYPE_ESM, resolve: { byDependency: { esm: { @@ -99001,21 +101629,21 @@ const applyModuleDefaults = ( } }; const commonjs = { - type: "javascript/dynamic" + type: JAVASCRIPT_MODULE_TYPE_DYNAMIC }; /** @type {RuleSetRules} */ const rules = [ { mimetype: "application/node", - type: "javascript/auto" + type: JAVASCRIPT_MODULE_TYPE_AUTO }, { test: /\.json$/i, - type: "json" + type: JSON_MODULE_TYPE }, { mimetype: "application/json", - type: "json" + type: JSON_MODULE_TYPE }, { test: /\.mjs$/i, @@ -99048,7 +101676,7 @@ const applyModuleDefaults = ( ]; if (asyncWebAssembly) { const wasm = { - type: "webassembly/async", + type: WEBASSEMBLY_MODULE_TYPE_ASYNC, rules: [ { descriptionData: { @@ -99070,7 +101698,7 @@ const applyModuleDefaults = ( }); } else if (syncWebAssembly) { const wasm = { - type: "webassembly/sync", + type: WEBASSEMBLY_MODULE_TYPE_SYNC, rules: [ { descriptionData: { @@ -99092,38 +101720,24 @@ const applyModuleDefaults = ( }); } if (css) { - const cssRule = { - type: "css", - resolve: { - fullySpecified: true, - preferRelative: true - } - }; - const cssModulesRule = { - type: "css/module", - resolve: { - fullySpecified: true - } + const resolve = { + fullySpecified: true, + preferRelative: true }; rules.push({ test: /\.css$/i, - oneOf: [ - { - test: /\.module\.css$/i, - ...cssModulesRule - }, - { - ...cssRule - } - ] + type: CSS_MODULE_TYPE_AUTO, + resolve }); rules.push({ mimetype: "text/css+module", - ...cssModulesRule + type: CSS_MODULE_TYPE_MODULE, + resolve }); rules.push({ mimetype: "text/css", - ...cssRule + type: CSS_MODULE_TYPE, + resolve }); } rules.push( @@ -99141,7 +101755,7 @@ const applyModuleDefaults = ( }, { assert: { type: "json" }, - type: "json" + type: JSON_MODULE_TYPE } ); return rules; @@ -99185,7 +101799,7 @@ const applyOutputDefaults = ( !Array.isArray(library) && "type" in library ? library.name - : /** @type {LibraryName=} */ (library); + : /** @type {LibraryName} */ (library); if (Array.isArray(libraryName)) { return libraryName.join("."); } else if (typeof libraryName === "object") { @@ -99212,8 +101826,11 @@ const applyOutputDefaults = ( const packageInfo = JSON.parse(fs.readFileSync(pkgPath, "utf-8")); return packageInfo.name || ""; } catch (e) { - if (e.code !== "ENOENT") { - e.message += `\nwhile determining default 'output.uniqueName' from 'name' in ${pkgPath}`; + if (/** @type {Error & { code: string }} */ (e).code !== "ENOENT") { + /** @type {Error & { code: string }} */ + ( + e + ).message += `\nwhile determining default 'output.uniqueName' from 'name' in ${pkgPath}`; throw e; } return ""; @@ -99226,7 +101843,9 @@ const applyOutputDefaults = ( D(output, "importFunctionName", "import"); D(output, "importMetaName", "import.meta"); F(output, "chunkFilename", () => { - const filename = output.filename; + const filename = + /** @type {NonNullable} */ + (output.filename); if (typeof filename !== "function") { const hasName = filename.includes("[name]"); const hasId = filename.includes("[id]"); @@ -99240,14 +101859,18 @@ const applyOutputDefaults = ( return output.module ? "[id].mjs" : "[id].js"; }); F(output, "cssFilename", () => { - const filename = output.filename; + const filename = + /** @type {NonNullable} */ + (output.filename); if (typeof filename !== "function") { return filename.replace(/\.[mc]?js(\?|$)/, ".css$1"); } return "[id].css"; }); F(output, "cssChunkFilename", () => { - const chunkFilename = output.chunkFilename; + const chunkFilename = + /** @type {NonNullable} */ + (output.chunkFilename); if (typeof chunkFilename !== "function") { return chunkFilename.replace(/\.[mc]?js(\?|$)/, ".css$1"); } @@ -99259,12 +101882,18 @@ const applyOutputDefaults = ( D(output, "charset", true); F(output, "hotUpdateGlobal", () => Template.toIdentifier( - "webpackHotUpdate" + Template.toIdentifier(output.uniqueName) + "webpackHotUpdate" + + Template.toIdentifier( + /** @type {NonNullable} */ (output.uniqueName) + ) ) ); F(output, "chunkLoadingGlobal", () => Template.toIdentifier( - "webpackChunk" + Template.toIdentifier(output.uniqueName) + "webpackChunk" + + Template.toIdentifier( + /** @type {NonNullable} */ (output.uniqueName) + ) ) ); F(output, "globalObject", () => { @@ -99390,32 +102019,87 @@ const applyOutputDefaults = ( ? "auto" : "" ); + D(output, "workerPublicPath", ""); D(output, "chunkLoadTimeout", 120000); D(output, "hashFunction", futureDefaults ? "xxhash64" : "md4"); D(output, "hashDigest", "hex"); D(output, "hashDigestLength", futureDefaults ? 16 : 20); D(output, "strictModuleExceptionHandling", false); + const environment = /** @type {Environment} */ (output.environment); + /** + * @param {boolean | undefined} v value + * @returns {boolean} true, when v is truthy or undefined + */ const optimistic = v => v || v === undefined; + /** + * @param {boolean | undefined} v value + * @param {boolean | undefined} c condition + * @returns {boolean | undefined} true, when v is truthy or undefined, or c is truthy + */ const conditionallyOptimistic = (v, c) => (v === undefined && c) || v; + + F( + environment, + "globalThis", + () => /** @type {boolean | undefined} */ (tp && tp.globalThis) + ); + F( + environment, + "bigIntLiteral", + () => /** @type {boolean | undefined} */ (tp && tp.bigIntLiteral) + ); + F( + environment, + "const", + () => tp && optimistic(/** @type {boolean | undefined} */ (tp.const)) + ); F( - output.environment, + environment, "arrowFunction", - () => tp && optimistic(tp.arrowFunction) + () => + tp && optimistic(/** @type {boolean | undefined} */ (tp.arrowFunction)) + ); + F( + environment, + "forOf", + () => tp && optimistic(/** @type {boolean | undefined} */ (tp.forOf)) ); - F(output.environment, "const", () => tp && optimistic(tp.const)); F( - output.environment, + environment, "destructuring", - () => tp && optimistic(tp.destructuring) + () => + tp && optimistic(/** @type {boolean | undefined} */ (tp.destructuring)) ); - F(output.environment, "forOf", () => tp && optimistic(tp.forOf)); - F(output.environment, "bigIntLiteral", () => tp && tp.bigIntLiteral); - F(output.environment, "dynamicImport", () => - conditionallyOptimistic(tp && tp.dynamicImport, output.module) + F( + environment, + "optionalChaining", + () => + tp && optimistic(/** @type {boolean | undefined} */ (tp.optionalChaining)) ); - F(output.environment, "module", () => - conditionallyOptimistic(tp && tp.module, output.module) + F( + environment, + "templateLiteral", + () => + tp && optimistic(/** @type {boolean | undefined} */ (tp.templateLiteral)) + ); + F(environment, "dynamicImport", () => + conditionallyOptimistic( + /** @type {boolean | undefined} */ (tp && tp.dynamicImport), + output.module + ) + ); + F(environment, "dynamicImportInWorker", () => + conditionallyOptimistic( + /** @type {boolean | undefined} */ (tp && tp.dynamicImportInWorker), + output.module + ) + ); + F(environment, "module", () => + conditionallyOptimistic( + /** @type {boolean | undefined} */ (tp && tp.module), + output.module + ) ); const { trustedTypes } = output; @@ -99424,8 +102108,10 @@ const applyOutputDefaults = ( trustedTypes, "policyName", () => - output.uniqueName.replace(/[^a-zA-Z0-9\-#=_/@.%]+/g, "_") || "webpack" + /** @type {NonNullable} */ + (output.uniqueName).replace(/[^a-zA-Z0-9\-#=_/@.%]+/g, "_") || "webpack" ); + D(trustedTypes, "onPolicyCreationFailure", "stop"); } /** @@ -99434,10 +102120,11 @@ const applyOutputDefaults = ( */ const forEachEntry = fn => { for (const name of Object.keys(entry)) { - fn(entry[name]); + fn(/** @type {{[k: string] : EntryDescription}} */ (entry)[name]); } }; A(output, "enabledLibraryTypes", () => { + /** @type {LibraryType[]} */ const enabledLibraryTypes = []; if (output.library) { enabledLibraryTypes.push(output.library.type); @@ -99497,35 +102184,56 @@ const applyExternalsPresetsDefaults = ( D( externalsPresets, "web", - !buildHttp && targetProperties && targetProperties.web + /** @type {boolean | undefined} */ + (!buildHttp && targetProperties && targetProperties.web) + ); + D( + externalsPresets, + "node", + /** @type {boolean | undefined} */ + (targetProperties && targetProperties.node) + ); + D( + externalsPresets, + "nwjs", + /** @type {boolean | undefined} */ + (targetProperties && targetProperties.nwjs) ); - D(externalsPresets, "node", targetProperties && targetProperties.node); - D(externalsPresets, "nwjs", targetProperties && targetProperties.nwjs); D( externalsPresets, "electron", - targetProperties && targetProperties.electron + /** @type {boolean | undefined} */ + (targetProperties && targetProperties.electron) ); D( externalsPresets, "electronMain", - targetProperties && - targetProperties.electron && - targetProperties.electronMain + /** @type {boolean | undefined} */ + ( + targetProperties && + targetProperties.electron && + targetProperties.electronMain + ) ); D( externalsPresets, "electronPreload", - targetProperties && - targetProperties.electron && - targetProperties.electronPreload + /** @type {boolean | undefined} */ + ( + targetProperties && + targetProperties.electron && + targetProperties.electronPreload + ) ); D( externalsPresets, "electronRenderer", - targetProperties && - targetProperties.electron && - targetProperties.electronRenderer + /** @type {boolean | undefined} */ + ( + targetProperties && + targetProperties.electron && + targetProperties.electronRenderer + ) ); }; @@ -99533,9 +102241,10 @@ const applyExternalsPresetsDefaults = ( * @param {Loader} loader options * @param {Object} options options * @param {TargetProperties | false} options.targetProperties target properties + * @param {Environment} options.environment environment * @returns {void} */ -const applyLoaderDefaults = (loader, { targetProperties }) => { +const applyLoaderDefaults = (loader, { targetProperties, environment }) => { F(loader, "target", () => { if (targetProperties) { if (targetProperties.electron) { @@ -99549,6 +102258,7 @@ const applyLoaderDefaults = (loader, { targetProperties }) => { if (targetProperties.web) return "web"; } }); + D(loader, "environment", environment); }; /** @@ -99666,7 +102376,9 @@ const applyOptimizationDefaults = ( F(splitChunks, "maxAsyncRequests", () => (production ? 30 : Infinity)); F(splitChunks, "maxInitialRequests", () => (production ? 30 : Infinity)); D(splitChunks, "automaticNameDelimiter", "-"); - const { cacheGroups } = splitChunks; + const cacheGroups = + /** @type {NonNullable} */ + (splitChunks.cacheGroups); F(cacheGroups, "default", () => ({ idHint: "", reuseExistingChunk: true, @@ -99688,9 +102400,16 @@ const applyOptimizationDefaults = ( * @param {string} options.context build context * @param {TargetProperties | false} options.targetProperties target properties * @param {Mode} options.mode mode + * @param {CssExperimentOptions|false} options.css is css enabled * @returns {ResolveOptions} resolve options */ -const getResolveDefaults = ({ cache, context, targetProperties, mode }) => { +const getResolveDefaults = ({ + cache, + context, + targetProperties, + mode, + css +}) => { /** @type {string[]} */ const conditions = ["webpack"]; @@ -99758,6 +102477,24 @@ const getResolveDefaults = ({ cache, context, targetProperties, mode }) => { } }; + if (css) { + const styleConditions = []; + + styleConditions.push("webpack"); + styleConditions.push(mode === "development" ? "development" : "production"); + styleConditions.push("style"); + + resolveOptions.byDependency["css-import"] = { + // We avoid using any main files because we have to be consistent with CSS `@import` + // and CSS `@import` does not handle `main` files in directories, + // you should always specify the full URL for styles + mainFiles: [], + mainFields: ["style", "..."], + conditionNames: styleConditions, + extensions: [".css"] + }; + } + return resolveOptions; }; @@ -99801,7 +102538,7 @@ exports.applyWebpackOptionsDefaults = applyWebpackOptionsDefaults; /***/ }), -/***/ 22941: +/***/ 69645: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; @@ -99814,17 +102551,28 @@ exports.applyWebpackOptionsDefaults = applyWebpackOptionsDefaults; const util = __webpack_require__(73837); +/** @typedef {import("../../declarations/WebpackOptions").CacheOptionsNormalized} CacheOptions */ +/** @typedef {import("../../declarations/WebpackOptions").EntryDescriptionNormalized} EntryDescriptionNormalized */ /** @typedef {import("../../declarations/WebpackOptions").EntryStatic} EntryStatic */ /** @typedef {import("../../declarations/WebpackOptions").EntryStaticNormalized} EntryStaticNormalized */ +/** @typedef {import("../../declarations/WebpackOptions").Externals} Externals */ /** @typedef {import("../../declarations/WebpackOptions").LibraryName} LibraryName */ /** @typedef {import("../../declarations/WebpackOptions").LibraryOptions} LibraryOptions */ +/** @typedef {import("../../declarations/WebpackOptions").ModuleOptionsNormalized} ModuleOptionsNormalized */ /** @typedef {import("../../declarations/WebpackOptions").OptimizationRuntimeChunk} OptimizationRuntimeChunk */ /** @typedef {import("../../declarations/WebpackOptions").OptimizationRuntimeChunkNormalized} OptimizationRuntimeChunkNormalized */ /** @typedef {import("../../declarations/WebpackOptions").OutputNormalized} OutputNormalized */ +/** @typedef {import("../../declarations/WebpackOptions").Plugins} Plugins */ /** @typedef {import("../../declarations/WebpackOptions").WebpackOptions} WebpackOptions */ /** @typedef {import("../../declarations/WebpackOptions").WebpackOptionsNormalized} WebpackOptionsNormalized */ +/** @typedef {import("../Entrypoint")} Entrypoint */ const handledDeprecatedNoEmitOnErrors = util.deprecate( + /** + * @param {boolean} noEmitOnErrors no emit on errors + * @param {boolean | undefined} emitOnErrors emit on errors + * @returns {boolean} emit on errors + */ (noEmitOnErrors, emitOnErrors) => { if (emitOnErrors !== undefined && !noEmitOnErrors === !emitOnErrors) { throw new Error( @@ -99924,45 +102672,51 @@ const getNormalizedWebpackOptions = config => { return { amd: config.amd, bail: config.bail, - cache: optionalNestedConfig(config.cache, cache => { - if (cache === false) return false; - if (cache === true) { - return { - type: "memory", - maxGenerations: undefined - }; - } - switch (cache.type) { - case "filesystem": - return { - type: "filesystem", - allowCollectingMemory: cache.allowCollectingMemory, - maxMemoryGenerations: cache.maxMemoryGenerations, - maxAge: cache.maxAge, - profile: cache.profile, - buildDependencies: cloneObject(cache.buildDependencies), - cacheDirectory: cache.cacheDirectory, - cacheLocation: cache.cacheLocation, - hashAlgorithm: cache.hashAlgorithm, - compression: cache.compression, - idleTimeout: cache.idleTimeout, - idleTimeoutForInitialStore: cache.idleTimeoutForInitialStore, - idleTimeoutAfterLargeChanges: cache.idleTimeoutAfterLargeChanges, - name: cache.name, - store: cache.store, - version: cache.version - }; - case undefined: - case "memory": - return { - type: "memory", - maxGenerations: cache.maxGenerations - }; - default: - // @ts-expect-error Property 'type' does not exist on type 'never'. ts(2339) - throw new Error(`Not implemented cache.type ${cache.type}`); - } - }), + cache: + /** @type {NonNullable} */ + ( + optionalNestedConfig(config.cache, cache => { + if (cache === false) return false; + if (cache === true) { + return { + type: "memory", + maxGenerations: undefined + }; + } + switch (cache.type) { + case "filesystem": + return { + type: "filesystem", + allowCollectingMemory: cache.allowCollectingMemory, + maxMemoryGenerations: cache.maxMemoryGenerations, + maxAge: cache.maxAge, + profile: cache.profile, + buildDependencies: cloneObject(cache.buildDependencies), + cacheDirectory: cache.cacheDirectory, + cacheLocation: cache.cacheLocation, + hashAlgorithm: cache.hashAlgorithm, + compression: cache.compression, + idleTimeout: cache.idleTimeout, + idleTimeoutForInitialStore: cache.idleTimeoutForInitialStore, + idleTimeoutAfterLargeChanges: + cache.idleTimeoutAfterLargeChanges, + name: cache.name, + store: cache.store, + version: cache.version, + readonly: cache.readonly + }; + case undefined: + case "memory": + return { + type: "memory", + maxGenerations: cache.maxGenerations + }; + default: + // @ts-expect-error Property 'type' does not exist on type 'never'. ts(2339) + throw new Error(`Not implemented cache.type ${cache.type}`); + } + }) + ), context: config.context, dependencies: config.dependencies, devServer: optionalNestedConfig(config.devServer, devServer => ({ @@ -99991,7 +102745,7 @@ const getNormalizedWebpackOptions = config => { options === true ? {} : options ) })), - externals: config.externals, + externals: /** @type {NonNullable} */ (config.externals), externalsPresets: cloneObject(config.externalsPresets), externalsType: config.externalsType, ignoreWarnings: config.ignoreWarnings @@ -100022,32 +102776,36 @@ const getNormalizedWebpackOptions = config => { infrastructureLogging: cloneObject(config.infrastructureLogging), loader: cloneObject(config.loader), mode: config.mode, - module: nestedConfig(config.module, module => ({ - noParse: module.noParse, - unsafeCache: module.unsafeCache, - parser: keyedNestedConfig(module.parser, cloneObject, { - javascript: parserOptions => ({ - unknownContextRequest: module.unknownContextRequest, - unknownContextRegExp: module.unknownContextRegExp, - unknownContextRecursive: module.unknownContextRecursive, - unknownContextCritical: module.unknownContextCritical, - exprContextRequest: module.exprContextRequest, - exprContextRegExp: module.exprContextRegExp, - exprContextRecursive: module.exprContextRecursive, - exprContextCritical: module.exprContextCritical, - wrappedContextRegExp: module.wrappedContextRegExp, - wrappedContextRecursive: module.wrappedContextRecursive, - wrappedContextCritical: module.wrappedContextCritical, - // TODO webpack 6 remove - strictExportPresence: module.strictExportPresence, - strictThisContextOnImports: module.strictThisContextOnImports, - ...parserOptions - }) - }), - generator: cloneObject(module.generator), - defaultRules: optionalNestedArray(module.defaultRules, r => [...r]), - rules: nestedArray(module.rules, r => [...r]) - })), + module: + /** @type {ModuleOptionsNormalized} */ + ( + nestedConfig(config.module, module => ({ + noParse: module.noParse, + unsafeCache: module.unsafeCache, + parser: keyedNestedConfig(module.parser, cloneObject, { + javascript: parserOptions => ({ + unknownContextRequest: module.unknownContextRequest, + unknownContextRegExp: module.unknownContextRegExp, + unknownContextRecursive: module.unknownContextRecursive, + unknownContextCritical: module.unknownContextCritical, + exprContextRequest: module.exprContextRequest, + exprContextRegExp: module.exprContextRegExp, + exprContextRecursive: module.exprContextRecursive, + exprContextCritical: module.exprContextCritical, + wrappedContextRegExp: module.wrappedContextRegExp, + wrappedContextRecursive: module.wrappedContextRecursive, + wrappedContextCritical: module.wrappedContextCritical, + // TODO webpack 6 remove + strictExportPresence: module.strictExportPresence, + strictThisContextOnImports: module.strictThisContextOnImports, + ...parserOptions + }) + }), + generator: cloneObject(module.generator), + defaultRules: optionalNestedArray(module.defaultRules, r => [...r]), + rules: nestedArray(module.rules, r => [...r]) + })) + ), name: config.name, node: nestedConfig( config.node, @@ -100134,6 +102892,7 @@ const getNormalizedWebpackOptions = config => { hotUpdateChunkFilename: output.hotUpdateChunkFilename, hotUpdateGlobal: output.hotUpdateGlobal, hotUpdateMainFilename: output.hotUpdateMainFilename, + ignoreBrowserWarnings: output.ignoreBrowserWarnings, iife: output.iife, importFunctionName: output.importFunctionName, importMetaName: output.importMetaName, @@ -100147,6 +102906,10 @@ const getNormalizedWebpackOptions = config => { output.auxiliaryComment !== undefined ? output.auxiliaryComment : libraryBase.auxiliaryComment, + amdContainer: + output.amdContainer !== undefined + ? output.amdContainer + : libraryBase.amdContainer, export: output.libraryExport !== undefined ? output.libraryExport @@ -100176,6 +102939,7 @@ const getNormalizedWebpackOptions = config => { uniqueName: output.uniqueName, wasmLoading: output.wasmLoading, webassemblyModuleFilename: output.webassemblyModuleFilename, + workerPublicPath: output.workerPublicPath, workerChunkLoading: output.workerChunkLoading, workerWasmLoading: output.workerWasmLoading }; @@ -100188,7 +102952,7 @@ const getNormalizedWebpackOptions = config => { ...performance }; }), - plugins: nestedArray(config.plugins, p => [...p]), + plugins: /** @type {Plugins} */ (nestedArray(config.plugins, p => [...p])), profile: config.profile, recordsInputPath: config.recordsInputPath !== undefined @@ -100289,8 +103053,11 @@ const getNormalizedEntryStatic = entry => { } else { result[key] = { import: - value.import && - (Array.isArray(value.import) ? value.import : [value.import]), + /** @type {EntryDescriptionNormalized["import"]} */ + ( + value.import && + (Array.isArray(value.import) ? value.import : [value.import]) + ), filename: value.filename, layer: value.layer, runtime: value.runtime, @@ -100300,8 +103067,13 @@ const getNormalizedEntryStatic = entry => { asyncChunks: value.asyncChunks, wasmLoading: value.wasmLoading, dependOn: - value.dependOn && - (Array.isArray(value.dependOn) ? value.dependOn : [value.dependOn]), + /** @type {EntryDescriptionNormalized["dependOn"]} */ + ( + value.dependOn && + (Array.isArray(value.dependOn) + ? value.dependOn + : [value.dependOn]) + ), library: value.library }; } @@ -100323,6 +103095,10 @@ const getNormalizedOptimizationRuntimeChunk = runtimeChunk => { } if (runtimeChunk === true || runtimeChunk === "multiple") { return { + /** + * @param {Entrypoint} entrypoint entrypoint + * @returns {string} runtime chunk name + */ name: entrypoint => `runtime~${entrypoint.name}` }; } @@ -100337,7 +103113,7 @@ exports.getNormalizedWebpackOptions = getNormalizedWebpackOptions; /***/ }), -/***/ 38949: +/***/ 62672: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; @@ -100348,10 +103124,10 @@ exports.getNormalizedWebpackOptions = getNormalizedWebpackOptions; -const memoize = __webpack_require__(27319); +const memoize = __webpack_require__(62377); const getBrowserslistTargetHandler = memoize(() => - __webpack_require__(34110) + __webpack_require__(48137) ); /** @@ -100407,20 +103183,39 @@ const getDefaultTarget = context => { */ ///** @typedef {PlatformTargetProperties | ApiTargetProperties | EcmaTargetProperties | PlatformTargetProperties & ApiTargetProperties | PlatformTargetProperties & EcmaTargetProperties | ApiTargetProperties & EcmaTargetProperties} TargetProperties */ -/** @template T @typedef {{ [P in keyof T]?: never }} Never */ -/** @template A @template B @typedef {(A & Never) | (Never & B) | (A & B)} Mix */ + +/** + * @template T + * @typedef {{ [P in keyof T]?: never }} Never + */ + +/** + * @template A + * @template B + * @typedef {(A & Never) | (Never & B) | (A & B)} Mix + */ + /** @typedef {Mix, Mix>} TargetProperties */ +/** + * @param {string} major major version + * @param {string | undefined} minor minor version + * @returns {(vMajor: number, vMinor?: number) => boolean | undefined} check if version is greater or equal + */ const versionDependent = (major, minor) => { - if (!major) return () => /** @type {undefined} */ (undefined); - major = +major; - minor = minor ? +minor : 0; + if (!major) { + return () => /** @type {undefined} */ (undefined); + } + /** @type {number} */ + const nMajor = +major; + /** @type {number} */ + const nMinor = minor ? +minor : 0; return (vMajor, vMinor = 0) => { - return major > vMajor || (major === vMajor && minor >= vMinor); + return nMajor > vMajor || (nMajor === vMajor && nMinor >= vMinor); }; }; -/** @type {[string, string, RegExp, (...args: string[]) => TargetProperties | false][]} */ +/** @type {[string, string, RegExp, (...args: string[]) => Partial][]} */ const TARGETS = [ [ "browserslist / browserslist:env / browserslist:query / browserslist:path-to-config / browserslist:path-to-config:env", @@ -100438,6 +103233,7 @@ See https://github.com/browserslist/browserslist#queries for possible ways to pr The recommended way is to add a 'browserslist' key to your package.json and list supported browsers (resp. node.js versions). You can also more options via the 'target' option: 'browserslist' / 'browserslist:env' / 'browserslist:query' / 'browserslist:path-to-config' / 'browserslist:path-to-config:env'`); } + return browserslistTargetHandler.resolve(browsers); } ], @@ -100637,7 +103433,7 @@ const getTargetProperties = (target, context) => { if (match) { const [, ...args] = match; const result = handler(...args, context); - if (result) return result; + if (result) return /** @type {TargetProperties} */ (result); } } throw new Error( @@ -100647,13 +103443,19 @@ const getTargetProperties = (target, context) => { ); }; +/** + * @param {TargetProperties[]} targetProperties array of target properties + * @returns {TargetProperties} merged target properties + */ const mergeTargetProperties = targetProperties => { + /** @type {Set} */ const keys = new Set(); for (const tp of targetProperties) { for (const key of Object.keys(tp)) { - keys.add(key); + keys.add(/** @type {keyof TargetProperties} */ (key)); } } + /** @type {Object} */ const result = {}; for (const key of keys) { let hasTrue = false; @@ -100670,7 +103472,8 @@ const mergeTargetProperties = targetProperties => { } } if (hasTrue || hasFalse) - result[key] = hasFalse && hasTrue ? null : hasTrue ? true : false; + /** @type {TargetProperties} */ + (result)[key] = hasFalse && hasTrue ? null : hasTrue ? true : false; } return /** @type {TargetProperties} */ (result); }; @@ -100693,7 +103496,7 @@ exports.getTargetsProperties = getTargetsProperties; /***/ }), -/***/ 76909: +/***/ 94774: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -100704,8 +103507,8 @@ exports.getTargetsProperties = getTargetsProperties; -const Dependency = __webpack_require__(68242); -const makeSerializable = __webpack_require__(23827); +const Dependency = __webpack_require__(504); +const makeSerializable = __webpack_require__(83626); /** @typedef {import("./ContainerEntryModule").ExposeOptions} ExposeOptions */ @@ -100748,7 +103551,7 @@ module.exports = ContainerEntryDependency; /***/ }), -/***/ 85755: +/***/ 59162: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -100760,13 +103563,14 @@ module.exports = ContainerEntryDependency; const { OriginalSource, RawSource } = __webpack_require__(59728); -const AsyncDependenciesBlock = __webpack_require__(54823); -const Module = __webpack_require__(96040); -const RuntimeGlobals = __webpack_require__(34623); -const Template = __webpack_require__(88070); -const StaticExportsDependency = __webpack_require__(64422); -const makeSerializable = __webpack_require__(23827); -const ContainerExposedDependency = __webpack_require__(92744); +const AsyncDependenciesBlock = __webpack_require__(27973); +const Module = __webpack_require__(6309); +const { JAVASCRIPT_MODULE_TYPE_DYNAMIC } = __webpack_require__(92891); +const RuntimeGlobals = __webpack_require__(61539); +const Template = __webpack_require__(88835); +const StaticExportsDependency = __webpack_require__(71444); +const makeSerializable = __webpack_require__(83626); +const ContainerExposedDependency = __webpack_require__(47663); /** @typedef {import("../../declarations/WebpackOptions").WebpackOptionsNormalized} WebpackOptions */ /** @typedef {import("../ChunkGraph")} ChunkGraph */ @@ -100779,6 +103583,8 @@ const ContainerExposedDependency = __webpack_require__(92744); /** @typedef {import("../RequestShortener")} RequestShortener */ /** @typedef {import("../ResolverFactory").ResolverWithOptions} ResolverWithOptions */ /** @typedef {import("../WebpackError")} WebpackError */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */ /** @typedef {import("../util/Hash")} Hash */ /** @typedef {import("../util/fs").InputFileSystem} InputFileSystem */ /** @typedef {import("./ContainerEntryDependency")} ContainerEntryDependency */ @@ -100798,7 +103604,7 @@ class ContainerEntryModule extends Module { * @param {string} shareScope name of the share scope */ constructor(name, exposes, shareScope) { - super("javascript/dynamic", null); + super(JAVASCRIPT_MODULE_TYPE_DYNAMIC, null); this._name = name; this._exposes = exposes; this._shareScope = shareScope; @@ -101013,6 +103819,9 @@ class ContainerEntryModule extends Module { return 42; } + /** + * @param {ObjectSerializerContext} context context + */ serialize(context) { const { write } = context; write(this._name); @@ -101021,6 +103830,10 @@ class ContainerEntryModule extends Module { super.serialize(context); } + /** + * @param {ObjectDeserializerContext} context context + * @returns {ContainerEntryModule} deserialized container entry module + */ static deserialize(context) { const { read } = context; const obj = new ContainerEntryModule(read(), read(), read()); @@ -101039,7 +103852,7 @@ module.exports = ContainerEntryModule; /***/ }), -/***/ 98734: +/***/ 80074: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -101050,8 +103863,8 @@ module.exports = ContainerEntryModule; -const ModuleFactory = __webpack_require__(10149); -const ContainerEntryModule = __webpack_require__(85755); +const ModuleFactory = __webpack_require__(60667); +const ContainerEntryModule = __webpack_require__(59162); /** @typedef {import("../ModuleFactory").ModuleFactoryCreateData} ModuleFactoryCreateData */ /** @typedef {import("../ModuleFactory").ModuleFactoryResult} ModuleFactoryResult */ @@ -101060,7 +103873,7 @@ const ContainerEntryModule = __webpack_require__(85755); module.exports = class ContainerEntryModuleFactory extends ModuleFactory { /** * @param {ModuleFactoryCreateData} data data object - * @param {function(Error=, ModuleFactoryResult=): void} callback callback + * @param {function((Error | null)=, ModuleFactoryResult=): void} callback callback * @returns {void} */ create({ dependencies: [dependency] }, callback) { @@ -101074,7 +103887,7 @@ module.exports = class ContainerEntryModuleFactory extends ModuleFactory { /***/ }), -/***/ 92744: +/***/ 47663: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -101085,8 +103898,11 @@ module.exports = class ContainerEntryModuleFactory extends ModuleFactory { -const ModuleDependency = __webpack_require__(22994); -const makeSerializable = __webpack_require__(23827); +const ModuleDependency = __webpack_require__(10931); +const makeSerializable = __webpack_require__(83626); + +/** @typedef {import("../serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */ class ContainerExposedDependency extends ModuleDependency { /** @@ -101113,11 +103929,17 @@ class ContainerExposedDependency extends ModuleDependency { return `exposed dependency ${this.exposedName}=${this.request}`; } + /** + * @param {ObjectSerializerContext} context context + */ serialize(context) { context.write(this.exposedName); super.serialize(context); } + /** + * @param {ObjectDeserializerContext} context context + */ deserialize(context) { this.exposedName = context.read(); super.deserialize(context); @@ -101134,7 +103956,7 @@ module.exports = ContainerExposedDependency; /***/ }), -/***/ 61706: +/***/ 18010: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -101145,18 +103967,18 @@ module.exports = ContainerExposedDependency; -const createSchemaValidation = __webpack_require__(94091); -const ContainerEntryDependency = __webpack_require__(76909); -const ContainerEntryModuleFactory = __webpack_require__(98734); -const ContainerExposedDependency = __webpack_require__(92744); -const { parseOptions } = __webpack_require__(14846); +const createSchemaValidation = __webpack_require__(45488); +const ContainerEntryDependency = __webpack_require__(94774); +const ContainerEntryModuleFactory = __webpack_require__(80074); +const ContainerExposedDependency = __webpack_require__(47663); +const { parseOptions } = __webpack_require__(4584); /** @typedef {import("../../declarations/plugins/container/ContainerPlugin").ContainerPluginOptions} ContainerPluginOptions */ /** @typedef {import("../Compiler")} Compiler */ const validate = createSchemaValidation( - __webpack_require__(14007), - () => __webpack_require__(94674), + __webpack_require__(82868), + () => __webpack_require__(94769), { name: "Container Plugin", baseDataPath: "options" @@ -101204,7 +104026,9 @@ class ContainerPlugin { const { name, exposes, shareScope, filename, library, runtime } = this._options; - compiler.options.output.enabledLibraryTypes.push(library.type); + if (!compiler.options.output.enabledLibraryTypes.includes(library.type)) { + compiler.options.output.enabledLibraryTypes.push(library.type); + } compiler.hooks.make.tapAsync(PLUGIN_NAME, (compilation, callback) => { const dep = new ContainerEntryDependency(name, exposes, shareScope); @@ -101247,7 +104071,7 @@ module.exports = ContainerPlugin; /***/ }), -/***/ 41496: +/***/ 76141: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -101258,25 +104082,25 @@ module.exports = ContainerPlugin; -const ExternalsPlugin = __webpack_require__(3021); -const RuntimeGlobals = __webpack_require__(34623); -const createSchemaValidation = __webpack_require__(94091); -const FallbackDependency = __webpack_require__(4391); -const FallbackItemDependency = __webpack_require__(9482); -const FallbackModuleFactory = __webpack_require__(74198); -const RemoteModule = __webpack_require__(10982); -const RemoteRuntimeModule = __webpack_require__(62004); -const RemoteToExternalDependency = __webpack_require__(44686); -const { parseOptions } = __webpack_require__(14846); +const ExternalsPlugin = __webpack_require__(42605); +const RuntimeGlobals = __webpack_require__(61539); +const createSchemaValidation = __webpack_require__(45488); +const FallbackDependency = __webpack_require__(92962); +const FallbackItemDependency = __webpack_require__(45866); +const FallbackModuleFactory = __webpack_require__(61688); +const RemoteModule = __webpack_require__(33545); +const RemoteRuntimeModule = __webpack_require__(49442); +const RemoteToExternalDependency = __webpack_require__(70991); +const { parseOptions } = __webpack_require__(4584); /** @typedef {import("../../declarations/plugins/container/ContainerReferencePlugin").ContainerReferencePluginOptions} ContainerReferencePluginOptions */ /** @typedef {import("../../declarations/plugins/container/ContainerReferencePlugin").RemotesConfig} RemotesConfig */ /** @typedef {import("../Compiler")} Compiler */ const validate = createSchemaValidation( - __webpack_require__(84639), + __webpack_require__(50037), () => - __webpack_require__(39902), + __webpack_require__(61748), { name: "Container Reference Plugin", baseDataPath: "options" @@ -101397,7 +104221,7 @@ module.exports = ContainerReferencePlugin; /***/ }), -/***/ 4391: +/***/ 92962: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -101408,10 +104232,16 @@ module.exports = ContainerReferencePlugin; -const Dependency = __webpack_require__(68242); -const makeSerializable = __webpack_require__(23827); +const Dependency = __webpack_require__(504); +const makeSerializable = __webpack_require__(83626); + +/** @typedef {import("../serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */ class FallbackDependency extends Dependency { + /** + * @param {string[]} requests requests + */ constructor(requests) { super(); this.requests = requests; @@ -101432,12 +104262,19 @@ class FallbackDependency extends Dependency { return "esm"; } + /** + * @param {ObjectSerializerContext} context context + */ serialize(context) { const { write } = context; write(this.requests); super.serialize(context); } + /** + * @param {ObjectDeserializerContext} context context + * @returns {FallbackDependency} deserialize fallback dependency + */ static deserialize(context) { const { read } = context; const obj = new FallbackDependency(read()); @@ -101456,7 +104293,7 @@ module.exports = FallbackDependency; /***/ }), -/***/ 9482: +/***/ 45866: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -101467,10 +104304,13 @@ module.exports = FallbackDependency; -const ModuleDependency = __webpack_require__(22994); -const makeSerializable = __webpack_require__(23827); +const ModuleDependency = __webpack_require__(10931); +const makeSerializable = __webpack_require__(83626); class FallbackItemDependency extends ModuleDependency { + /** + * @param {string} request request + */ constructor(request) { super(request); } @@ -101494,7 +104334,7 @@ module.exports = FallbackItemDependency; /***/ }), -/***/ 24148: +/***/ 28513: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -101506,11 +104346,12 @@ module.exports = FallbackItemDependency; const { RawSource } = __webpack_require__(59728); -const Module = __webpack_require__(96040); -const RuntimeGlobals = __webpack_require__(34623); -const Template = __webpack_require__(88070); -const makeSerializable = __webpack_require__(23827); -const FallbackItemDependency = __webpack_require__(9482); +const Module = __webpack_require__(6309); +const { WEBPACK_MODULE_TYPE_FALLBACK } = __webpack_require__(92891); +const RuntimeGlobals = __webpack_require__(61539); +const Template = __webpack_require__(88835); +const makeSerializable = __webpack_require__(83626); +const FallbackItemDependency = __webpack_require__(45866); /** @typedef {import("../../declarations/WebpackOptions").WebpackOptionsNormalized} WebpackOptions */ /** @typedef {import("../Chunk")} Chunk */ @@ -101524,6 +104365,8 @@ const FallbackItemDependency = __webpack_require__(9482); /** @typedef {import("../RequestShortener")} RequestShortener */ /** @typedef {import("../ResolverFactory").ResolverWithOptions} ResolverWithOptions */ /** @typedef {import("../WebpackError")} WebpackError */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */ /** @typedef {import("../util/Hash")} Hash */ /** @typedef {import("../util/fs").InputFileSystem} InputFileSystem */ @@ -101535,7 +104378,7 @@ class FallbackModule extends Module { * @param {string[]} requests list of requests to choose one */ constructor(requests) { - super("fallback-module"); + super(WEBPACK_MODULE_TYPE_FALLBACK); this.requests = requests; this._identifier = `fallback ${this.requests.join(" ")}`; } @@ -101633,7 +104476,7 @@ class FallbackModule extends Module { `var loop = ${runtimeTemplate.basicFunction("next", [ "while(i < ids.length) {", Template.indent([ - "try { next = __webpack_require__(ids[i++]); } catch(e) { return handleError(e); }", + `try { next = ${RuntimeGlobals.require}(ids[i++]); } catch(e) { return handleError(e); }`, "if(next) return next.then ? next.then(handleResult, handleError) : handleResult(next);" ]), "}", @@ -101654,12 +104497,19 @@ class FallbackModule extends Module { return { sources, runtimeRequirements: RUNTIME_REQUIREMENTS }; } + /** + * @param {ObjectSerializerContext} context context + */ serialize(context) { const { write } = context; write(this.requests); super.serialize(context); } + /** + * @param {ObjectDeserializerContext} context context + * @returns {FallbackModule} deserialized fallback module + */ static deserialize(context) { const { read } = context; const obj = new FallbackModule(read()); @@ -101675,7 +104525,7 @@ module.exports = FallbackModule; /***/ }), -/***/ 74198: +/***/ 61688: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -101686,8 +104536,8 @@ module.exports = FallbackModule; -const ModuleFactory = __webpack_require__(10149); -const FallbackModule = __webpack_require__(24148); +const ModuleFactory = __webpack_require__(60667); +const FallbackModule = __webpack_require__(28513); /** @typedef {import("../ModuleFactory").ModuleFactoryCreateData} ModuleFactoryCreateData */ /** @typedef {import("../ModuleFactory").ModuleFactoryResult} ModuleFactoryResult */ @@ -101696,7 +104546,7 @@ const FallbackModule = __webpack_require__(24148); module.exports = class FallbackModuleFactory extends ModuleFactory { /** * @param {ModuleFactoryCreateData} data data object - * @param {function(Error=, ModuleFactoryResult=): void} callback callback + * @param {function((Error | null)=, ModuleFactoryResult=): void} callback callback * @returns {void} */ create({ dependencies: [dependency] }, callback) { @@ -101710,7 +104560,7 @@ module.exports = class FallbackModuleFactory extends ModuleFactory { /***/ }), -/***/ 37596: +/***/ 10561: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -101721,11 +104571,11 @@ module.exports = class FallbackModuleFactory extends ModuleFactory { -const isValidExternalsType = __webpack_require__(95172); -const SharePlugin = __webpack_require__(7833); -const createSchemaValidation = __webpack_require__(94091); -const ContainerPlugin = __webpack_require__(61706); -const ContainerReferencePlugin = __webpack_require__(41496); +const isValidExternalsType = __webpack_require__(91385); +const SharePlugin = __webpack_require__(80584); +const createSchemaValidation = __webpack_require__(45488); +const ContainerPlugin = __webpack_require__(18010); +const ContainerReferencePlugin = __webpack_require__(76141); /** @typedef {import("../../declarations/plugins/container/ModuleFederationPlugin").ExternalsType} ExternalsType */ /** @typedef {import("../../declarations/plugins/container/ModuleFederationPlugin").ModuleFederationPluginOptions} ModuleFederationPluginOptions */ @@ -101733,8 +104583,8 @@ const ContainerReferencePlugin = __webpack_require__(41496); /** @typedef {import("../Compiler")} Compiler */ const validate = createSchemaValidation( - __webpack_require__(70530), - () => __webpack_require__(64549), + __webpack_require__(33970), + () => __webpack_require__(66132), { name: "Module Federation Plugin", baseDataPath: "options" @@ -101812,7 +104662,7 @@ module.exports = ModuleFederationPlugin; /***/ }), -/***/ 10982: +/***/ 33545: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -101824,11 +104674,12 @@ module.exports = ModuleFederationPlugin; const { RawSource } = __webpack_require__(59728); -const Module = __webpack_require__(96040); -const RuntimeGlobals = __webpack_require__(34623); -const makeSerializable = __webpack_require__(23827); -const FallbackDependency = __webpack_require__(4391); -const RemoteToExternalDependency = __webpack_require__(44686); +const Module = __webpack_require__(6309); +const { WEBPACK_MODULE_TYPE_REMOTE } = __webpack_require__(92891); +const RuntimeGlobals = __webpack_require__(61539); +const makeSerializable = __webpack_require__(83626); +const FallbackDependency = __webpack_require__(92962); +const RemoteToExternalDependency = __webpack_require__(70991); /** @typedef {import("../../declarations/WebpackOptions").WebpackOptionsNormalized} WebpackOptions */ /** @typedef {import("../ChunkGraph")} ChunkGraph */ @@ -101841,6 +104692,8 @@ const RemoteToExternalDependency = __webpack_require__(44686); /** @typedef {import("../RequestShortener")} RequestShortener */ /** @typedef {import("../ResolverFactory").ResolverWithOptions} ResolverWithOptions */ /** @typedef {import("../WebpackError")} WebpackError */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */ /** @typedef {import("../util/Hash")} Hash */ /** @typedef {import("../util/fs").InputFileSystem} InputFileSystem */ @@ -101855,7 +104708,7 @@ class RemoteModule extends Module { * @param {string} shareScope the used share scope name */ constructor(request, externalRequests, internalRequest, shareScope) { - super("remote-module"); + super(WEBPACK_MODULE_TYPE_REMOTE); this.request = request; this.externalRequests = externalRequests; this.internalRequest = internalRequest; @@ -101967,6 +104820,9 @@ class RemoteModule extends Module { return { sources, data, runtimeRequirements: RUNTIME_REQUIREMENTS }; } + /** + * @param {ObjectSerializerContext} context context + */ serialize(context) { const { write } = context; write(this.request); @@ -101976,6 +104832,10 @@ class RemoteModule extends Module { super.serialize(context); } + /** + * @param {ObjectDeserializerContext} context context + * @returns {RemoteModule} deserialized module + */ static deserialize(context) { const { read } = context; const obj = new RemoteModule(read(), read(), read(), read()); @@ -101991,7 +104851,7 @@ module.exports = RemoteModule; /***/ }), -/***/ 62004: +/***/ 49442: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -102002,10 +104862,11 @@ module.exports = RemoteModule; -const RuntimeGlobals = __webpack_require__(34623); -const RuntimeModule = __webpack_require__(81196); -const Template = __webpack_require__(88070); +const RuntimeGlobals = __webpack_require__(61539); +const RuntimeModule = __webpack_require__(21296); +const Template = __webpack_require__(88835); +/** @typedef {import("../Chunk")} Chunk */ /** @typedef {import("./RemoteModule")} RemoteModule */ class RemoteRuntimeModule extends RuntimeModule { @@ -102014,7 +104875,7 @@ class RemoteRuntimeModule extends RuntimeModule { } /** - * @returns {string} runtime code + * @returns {string | null} runtime code */ generate() { const { compilation, chunkGraph } = this; @@ -102114,7 +104975,7 @@ class RemoteRuntimeModule extends RuntimeModule { "module.exports = factory();" ])}` ])};`, - "handleFunction(__webpack_require__, data[2], 0, 0, onExternal, 1);" + `handleFunction(${RuntimeGlobals.require}, data[2], 0, 0, onExternal, 1);` ])});` ]), "}" @@ -102128,7 +104989,7 @@ module.exports = RemoteRuntimeModule; /***/ }), -/***/ 44686: +/***/ 70991: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -102139,10 +105000,13 @@ module.exports = RemoteRuntimeModule; -const ModuleDependency = __webpack_require__(22994); -const makeSerializable = __webpack_require__(23827); +const ModuleDependency = __webpack_require__(10931); +const makeSerializable = __webpack_require__(83626); class RemoteToExternalDependency extends ModuleDependency { + /** + * @param {string} request request + */ constructor(request) { super(request); } @@ -102166,7 +105030,7 @@ module.exports = RemoteToExternalDependency; /***/ }), -/***/ 14846: +/***/ 4584: /***/ (function(__unused_webpack_module, exports) { "use strict"; @@ -102265,7 +105129,7 @@ exports.scope = scope; /***/ }), -/***/ 66255: +/***/ 9014: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -102277,10 +105141,10 @@ exports.scope = scope; const { ReplaceSource, RawSource, ConcatSource } = __webpack_require__(59728); -const { UsageState } = __webpack_require__(1723); -const Generator = __webpack_require__(8635); -const RuntimeGlobals = __webpack_require__(34623); -const Template = __webpack_require__(88070); +const { UsageState } = __webpack_require__(14768); +const Generator = __webpack_require__(58387); +const RuntimeGlobals = __webpack_require__(61539); +const Template = __webpack_require__(88835); /** @typedef {import("webpack-sources").Source} Source */ /** @typedef {import("../Dependency")} Dependency */ @@ -102290,6 +105154,11 @@ const Template = __webpack_require__(88070); /** @typedef {import("../NormalModule")} NormalModule */ /** @typedef {import("../util/Hash")} Hash */ +/** + * @template T + * @typedef {import("../InitFragment")} InitFragment + */ + const TYPES = new Set(["javascript"]); class CssExportsGenerator extends Generator { @@ -102307,6 +105176,7 @@ class CssExportsGenerator extends Generator { */ generate(module, generateContext) { const source = new ReplaceSource(new RawSource("")); + /** @type {InitFragment[]} */ const initFragments = []; const cssExports = new Map(); @@ -102328,6 +105198,9 @@ class CssExportsGenerator extends Generator { cssExports }; + /** + * @param {Dependency} dependency the dependency + */ const handleDependency = dependency => { const constructor = /** @type {new (...args: any[]) => Dependency} */ ( dependency.constructor @@ -102412,7 +105285,7 @@ module.exports = CssExportsGenerator; /***/ }), -/***/ 23119: +/***/ 96481: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -102424,9 +105297,9 @@ module.exports = CssExportsGenerator; const { ReplaceSource } = __webpack_require__(59728); -const Generator = __webpack_require__(8635); -const InitFragment = __webpack_require__(53658); -const RuntimeGlobals = __webpack_require__(34623); +const Generator = __webpack_require__(58387); +const InitFragment = __webpack_require__(44508); +const RuntimeGlobals = __webpack_require__(61539); /** @typedef {import("webpack-sources").Source} Source */ /** @typedef {import("../Dependency")} Dependency */ @@ -102448,8 +105321,9 @@ class CssGenerator extends Generator { * @returns {Source} generated code */ generate(module, generateContext) { - const originalSource = module.originalSource(); + const originalSource = /** @type {Source} */ (module.originalSource()); const source = new ReplaceSource(originalSource); + /** @type {InitFragment[]} */ const initFragments = []; const cssExports = new Map(); @@ -102469,6 +105343,9 @@ class CssGenerator extends Generator { cssExports }; + /** + * @param {Dependency} dependency dependency + */ const handleDependency = dependency => { const constructor = /** @type {new (...args: any[]) => Dependency} */ ( dependency.constructor @@ -102529,7 +105406,7 @@ module.exports = CssGenerator; /***/ }), -/***/ 23575: +/***/ 88137: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -102541,14 +105418,16 @@ module.exports = CssGenerator; const { SyncWaterfallHook } = __webpack_require__(70793); -const Compilation = __webpack_require__(38292); -const RuntimeGlobals = __webpack_require__(34623); -const RuntimeModule = __webpack_require__(81196); -const Template = __webpack_require__(88070); -const compileBooleanMatcher = __webpack_require__(25526); -const { chunkHasCss } = __webpack_require__(15405); +const Compilation = __webpack_require__(20417); +const RuntimeGlobals = __webpack_require__(61539); +const RuntimeModule = __webpack_require__(21296); +const Template = __webpack_require__(88835); +const compileBooleanMatcher = __webpack_require__(1258); +const { chunkHasCss } = __webpack_require__(90429); /** @typedef {import("../Chunk")} Chunk */ +/** @typedef {import("../ChunkGraph")} ChunkGraph */ +/** @typedef {import("../Compilation").RuntimeRequirementsContext} RuntimeRequirementsContext */ /** * @typedef {Object} JsonpCompilationPluginHooks @@ -102579,15 +105458,17 @@ class CssLoadingRuntimeModule extends RuntimeModule { return hooks; } - constructor(runtimeRequirements, runtimeOptions) { + /** + * @param {Set} runtimeRequirements runtime requirements + */ + constructor(runtimeRequirements) { super("css loading", 10); this._runtimeRequirements = runtimeRequirements; - this.runtimeOptions = runtimeOptions; } /** - * @returns {string} runtime code + * @returns {string | null} runtime code */ generate() { const { compilation, chunk, _runtimeRequirements } = this; @@ -102599,10 +105480,15 @@ class CssLoadingRuntimeModule extends RuntimeModule { uniqueName, chunkLoadTimeout: loadTimeout } - } = compilation; + } = /** @type {Compilation} */ (compilation); const fn = RuntimeGlobals.ensureChunkHandlers; const conditionMap = chunkGraph.getChunkConditionMap( - chunk, + /** @type {Chunk} */ (chunk), + /** + * @param {Chunk} chunk the chunk + * @param {ChunkGraph} chunkGraph the chunk graph + * @returns {boolean} true, if the chunk has css + */ (chunk, chunkGraph) => !!chunkGraph.getChunkModulesIterableBySourceType(chunk, "css") ); @@ -102611,12 +105497,15 @@ class CssLoadingRuntimeModule extends RuntimeModule { const withLoading = _runtimeRequirements.has(RuntimeGlobals.ensureChunkHandlers) && hasCssMatcher !== false; + /** @type {boolean} */ const withHmr = _runtimeRequirements.has( RuntimeGlobals.hmrDownloadUpdateHandlers ); + /** @type {Set} */ const initialChunkIdsWithCss = new Set(); + /** @type {Set} */ const initialChunkIdsWithoutCss = new Set(); - for (const c of chunk.getAllInitialChunks()) { + for (const c of /** @type {Chunk} */ (chunk).getAllInitialChunks()) { (chunkHasCss(c, chunkGraph) ? initialChunkIdsWithCss : initialChunkIdsWithoutCss @@ -102627,8 +105516,9 @@ class CssLoadingRuntimeModule extends RuntimeModule { return null; } - const { createStylesheet } = - CssLoadingRuntimeModule.getCompilationHooks(compilation); + const { createStylesheet } = CssLoadingRuntimeModule.getCompilationHooks( + /** @type {Compilation} */ (compilation) + ); const stateExpression = withHmr ? `${RuntimeGlobals.hmrRuntimeStatePrefix}_css` @@ -102646,7 +105536,7 @@ class CssLoadingRuntimeModule extends RuntimeModule { ? crossOriginLoading === "use-credentials" ? 'link.crossOrigin = "use-credentials";' : Template.asString([ - "if (link.src.indexOf(window.location.origin + '/') !== 0) {", + "if (link.href.indexOf(window.location.origin + '/') !== 0) {", Template.indent( `link.crossOrigin = ${JSON.stringify(crossOriginLoading)};` ), @@ -102655,7 +105545,16 @@ class CssLoadingRuntimeModule extends RuntimeModule { : "" ]); + /** @type {(str: string) => number} */ const cc = str => str.charCodeAt(0); + const name = uniqueName + ? runtimeTemplate.concatenation( + "--webpack-", + { expr: "uniqueName" }, + "-", + { expr: "chunkId" } + ) + : runtimeTemplate.concatenation("--webpack-", { expr: "chunkId" }); return Template.asString([ "// object to store loaded and loading chunks", @@ -102678,18 +105577,27 @@ class CssLoadingRuntimeModule extends RuntimeModule { [ `var data, token = "", token2, exports = {}, exportsWithId = [], exportsWithDashes = [], ${ withHmr ? "moduleIds = [], " : "" - }i = 0, cc = 1;`, - "try { if(!link) link = loadStylesheet(chunkId); data = link.sheet.cssRules; data = data[data.length - 1].style; } catch(e) { data = getComputedStyle(document.head); }", - `data = data.getPropertyValue(${ - uniqueName - ? runtimeTemplate.concatenation( - "--webpack-", - { expr: "uniqueName" }, - "-", - { expr: "chunkId" } - ) - : runtimeTemplate.concatenation("--webpack-", { expr: "chunkId" }) - });`, + }name = ${name}, i = 0, cc = 1;`, + "try {", + Template.indent([ + "if(!link) link = loadStylesheet(chunkId);", + // `link.sheet.rules` for legacy browsers + "var cssRules = link.sheet.cssRules || link.sheet.rules;", + "var j = cssRules.length - 1;", + "while(j > -1 && !data) {", + Template.indent([ + "var style = cssRules[j--].style;", + "if(!style) continue;", + `data = style.getPropertyValue(name);` + ]), + "}" + ]), + "}catch(e){}", + "if(!data) {", + Template.indent([ + "data = getComputedStyle(document.head).getPropertyValue(name);" + ]), + "}", "if(!data) return [];", "for(; cc; i++) {", Template.indent([ @@ -102767,7 +105675,7 @@ class CssLoadingRuntimeModule extends RuntimeModule { "if(!link) {", Template.indent([ "needAttach = true;", - createStylesheet.call(code, this.chunk) + createStylesheet.call(code, /** @type {Chunk} */ (this.chunk)) ]), "}", `var onLinkComplete = ${runtimeTemplate.basicFunction( @@ -102979,7 +105887,7 @@ module.exports = CssLoadingRuntimeModule; /***/ }), -/***/ 15405: +/***/ 90429: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -102990,37 +105898,54 @@ module.exports = CssLoadingRuntimeModule; -const { ConcatSource } = __webpack_require__(59728); -const HotUpdateChunk = __webpack_require__(72873); -const RuntimeGlobals = __webpack_require__(34623); -const SelfModuleFactory = __webpack_require__(56967); -const CssExportDependency = __webpack_require__(22201); -const CssImportDependency = __webpack_require__(26282); -const CssLocalIdentifierDependency = __webpack_require__(13230); -const CssSelfLocalIdentifierDependency = __webpack_require__(11310); -const CssUrlDependency = __webpack_require__(78700); -const StaticExportsDependency = __webpack_require__(64422); -const { compareModulesByIdentifier } = __webpack_require__(29355); -const createSchemaValidation = __webpack_require__(94091); -const createHash = __webpack_require__(94624); -const memoize = __webpack_require__(27319); -const nonNumericOnlyHash = __webpack_require__(12993); -const CssExportsGenerator = __webpack_require__(66255); -const CssGenerator = __webpack_require__(23119); -const CssParser = __webpack_require__(92486); +const { ConcatSource, PrefixSource } = __webpack_require__(59728); +const CssModule = __webpack_require__(46555); +const HotUpdateChunk = __webpack_require__(80065); +const { + CSS_MODULE_TYPE, + CSS_MODULE_TYPE_GLOBAL, + CSS_MODULE_TYPE_MODULE, + CSS_MODULE_TYPE_AUTO +} = __webpack_require__(92891); +const RuntimeGlobals = __webpack_require__(61539); +const SelfModuleFactory = __webpack_require__(48588); +const WebpackError = __webpack_require__(49999); +const CssExportDependency = __webpack_require__(54990); +const CssImportDependency = __webpack_require__(88587); +const CssLocalIdentifierDependency = __webpack_require__(90055); +const CssSelfLocalIdentifierDependency = __webpack_require__(15050); +const CssUrlDependency = __webpack_require__(93920); +const StaticExportsDependency = __webpack_require__(71444); +const { compareModulesByIdentifier } = __webpack_require__(95978); +const createSchemaValidation = __webpack_require__(45488); +const createHash = __webpack_require__(31147); +const memoize = __webpack_require__(62377); +const nonNumericOnlyHash = __webpack_require__(95162); +const CssExportsGenerator = __webpack_require__(9014); +const CssGenerator = __webpack_require__(96481); +const CssParser = __webpack_require__(69301); /** @typedef {import("webpack-sources").Source} Source */ /** @typedef {import("../../declarations/WebpackOptions").CssExperimentOptions} CssExperimentOptions */ +/** @typedef {import("../../declarations/WebpackOptions").Output} OutputOptions */ /** @typedef {import("../Chunk")} Chunk */ +/** @typedef {import("../ChunkGraph")} ChunkGraph */ +/** @typedef {import("../CodeGenerationResults")} CodeGenerationResults */ +/** @typedef {import("../Compilation")} Compilation */ /** @typedef {import("../Compiler")} Compiler */ /** @typedef {import("../Module")} Module */ +/** @typedef {import("../util/memoize")} Memoize */ const getCssLoadingRuntimeModule = memoize(() => - __webpack_require__(23575) + __webpack_require__(88137) ); +/** + * @param {string} name name + * @returns {{oneOf: [{$ref: string}], definitions: *}} schema + */ const getSchema = name => { - const { definitions } = __webpack_require__(9183); + const { definitions } = __webpack_require__(40138); return { definitions, oneOf: [{ $ref: `#/definitions/${name}` }] @@ -103028,7 +105953,7 @@ const getSchema = name => { }; const validateGeneratorOptions = createSchemaValidation( - __webpack_require__(76280), + __webpack_require__(70604), () => getSchema("CssGeneratorOptions"), { name: "Css Modules Plugin", @@ -103036,7 +105961,7 @@ const validateGeneratorOptions = createSchemaValidation( } ); const validateParserOptions = createSchemaValidation( - __webpack_require__(99181), + __webpack_require__(32391), () => getSchema("CssParserOptions"), { name: "Css Modules Plugin", @@ -103044,6 +105969,11 @@ const validateParserOptions = createSchemaValidation( } ); +/** + * @param {string} str string + * @param {boolean=} omitOptionalUnderscore if true, optional underscore is not added + * @returns {string} escaped string + */ const escapeCss = (str, omitOptionalUnderscore) => { const escaped = `${str}`.replace( // cspell:word uffff @@ -103110,53 +106040,101 @@ class CssModulesPlugin { StaticExportsDependency, new StaticExportsDependency.Template() ); - normalModuleFactory.hooks.createParser - .for("css") - .tap(plugin, parserOptions => { - validateParserOptions(parserOptions); - return new CssParser(); - }); - normalModuleFactory.hooks.createParser - .for("css/global") - .tap(plugin, parserOptions => { - validateParserOptions(parserOptions); - return new CssParser({ - allowPseudoBlocks: false, - allowModeSwitch: false + for (const type of [ + CSS_MODULE_TYPE, + CSS_MODULE_TYPE_GLOBAL, + CSS_MODULE_TYPE_MODULE, + CSS_MODULE_TYPE_AUTO + ]) { + normalModuleFactory.hooks.createParser + .for(type) + .tap(plugin, parserOptions => { + validateParserOptions(parserOptions); + + switch (type) { + case CSS_MODULE_TYPE: + case CSS_MODULE_TYPE_AUTO: + return new CssParser(); + case CSS_MODULE_TYPE_GLOBAL: + return new CssParser({ + allowModeSwitch: false + }); + case CSS_MODULE_TYPE_MODULE: + return new CssParser({ + defaultMode: "local" + }); + } }); - }); - normalModuleFactory.hooks.createParser - .for("css/module") - .tap(plugin, parserOptions => { - validateParserOptions(parserOptions); - return new CssParser({ - defaultMode: "local" + normalModuleFactory.hooks.createGenerator + .for(type) + .tap(plugin, generatorOptions => { + validateGeneratorOptions(generatorOptions); + return this._exportsOnly + ? new CssExportsGenerator() + : new CssGenerator(); }); - }); - normalModuleFactory.hooks.createGenerator - .for("css") - .tap(plugin, generatorOptions => { - validateGeneratorOptions(generatorOptions); - return this._exportsOnly - ? new CssExportsGenerator() - : new CssGenerator(); - }); - normalModuleFactory.hooks.createGenerator - .for("css/global") - .tap(plugin, generatorOptions => { - validateGeneratorOptions(generatorOptions); - return this._exportsOnly - ? new CssExportsGenerator() - : new CssGenerator(); - }); - normalModuleFactory.hooks.createGenerator - .for("css/module") - .tap(plugin, generatorOptions => { - validateGeneratorOptions(generatorOptions); - return this._exportsOnly - ? new CssExportsGenerator() - : new CssGenerator(); - }); + normalModuleFactory.hooks.createModuleClass + .for(type) + .tap(plugin, (createData, resolveData) => { + if (resolveData.dependencies.length > 0) { + // When CSS is imported from CSS there is only one dependency + const dependency = resolveData.dependencies[0]; + + if (dependency instanceof CssImportDependency) { + const parent = + /** @type {CssModule} */ + (compilation.moduleGraph.getParentModule(dependency)); + + if (parent instanceof CssModule) { + /** @type {import("../CssModule").Inheritance | undefined} */ + let inheritance; + + if ( + (parent.cssLayer !== null && + parent.cssLayer !== undefined) || + parent.supports || + parent.media + ) { + if (!inheritance) { + inheritance = []; + } + + inheritance.push([ + parent.cssLayer, + parent.supports, + parent.media + ]); + } + + if (parent.inheritance) { + if (!inheritance) { + inheritance = []; + } + + inheritance.push(...parent.inheritance); + } + + return new CssModule({ + ...createData, + cssLayer: dependency.layer, + supports: dependency.supports, + media: dependency.media, + inheritance + }); + } + + return new CssModule({ + ...createData, + cssLayer: dependency.layer, + supports: dependency.supports, + media: dependency.media + }); + } + } + + return new CssModule(createData); + }); + } const orderedCssModulesPerChunk = new WeakMap(); compilation.hooks.afterCodeGeneration.tap("CssModulesPlugin", () => { const { chunkGraph } = compilation; @@ -103195,6 +106173,7 @@ class CssModulesPlugin { if (chunk instanceof HotUpdateChunk) return result; + /** @type {CssModule[] | undefined} */ const modules = orderedCssModulesPerChunk.get(chunk); if (modules !== undefined) { result.push({ @@ -103222,12 +106201,28 @@ class CssModulesPlugin { } return result; }); - const enabledChunks = new WeakSet(); + const globalChunkLoading = compilation.outputOptions.chunkLoading; + /** + * @param {Chunk} chunk the chunk + * @returns {boolean} true, when enabled + */ + const isEnabledForChunk = chunk => { + const options = chunk.getEntryOptions(); + const chunkLoading = + options && options.chunkLoading !== undefined + ? options.chunkLoading + : globalChunkLoading; + return chunkLoading === "jsonp"; + }; + const onceForChunkSet = new WeakSet(); + /** + * @param {Chunk} chunk chunk to check + * @param {Set} set runtime requirements + */ const handler = (chunk, set) => { - if (enabledChunks.has(chunk)) { - return; - } - enabledChunks.add(chunk); + if (onceForChunkSet.has(chunk)) return; + onceForChunkSet.add(chunk); + if (!isEnabledForChunk(chunk)) return; set.add(RuntimeGlobals.publicPath); set.add(RuntimeGlobals.getChunkCssFilename); @@ -103251,9 +106246,16 @@ class CssModulesPlugin { ); } + /** + * @param {Chunk} chunk chunk + * @param {Iterable} modules unordered modules + * @param {Compilation} compilation compilation + * @returns {Module[]} ordered modules + */ getModulesInOrder(chunk, modules, compilation) { if (!modules) return []; + /** @type {Module[]} */ const modulesList = [...modules]; // Get ordered list of modules per chunk group @@ -103267,7 +106269,10 @@ class CssModulesPlugin { }; }) .filter(item => item.index !== undefined) - .sort((a, b) => b.index - a.index) + .sort( + (a, b) => + /** @type {number} */ (b.index) - /** @type {number} */ (a.index) + ) .map(item => item.module); return { list: sortedModules, set: new Set(sortedModules) }; @@ -103287,6 +106292,7 @@ class CssModulesPlugin { modulesByChunkGroup.sort(compareModuleLists); + /** @type {Module[]} */ const finalModules = []; for (;;) { @@ -103296,6 +106302,7 @@ class CssModulesPlugin { // done, everything empty break; } + /** @type {Module} */ let selectedModule = list[list.length - 1]; let hasFailed = undefined; outer: for (;;) { @@ -103321,18 +106328,17 @@ class CssModulesPlugin { if (compilation) { // TODO print better warning compilation.warnings.push( - new Error( - `chunk ${ - chunk.name || chunk.id - }\nConflicting order between ${hasFailed.readableIdentifier( - compilation.requestShortener - )} and ${selectedModule.readableIdentifier( + new WebpackError( + `chunk ${chunk.name || chunk.id}\nConflicting order between ${ + /** @type {Module} */ + (hasFailed).readableIdentifier(compilation.requestShortener) + } and ${selectedModule.readableIdentifier( compilation.requestShortener )}` ) ); } - selectedModule = hasFailed; + selectedModule = /** @type {Module} */ (hasFailed); } // Insert the selected module into the final modules list finalModules.push(selectedModule); @@ -103350,29 +106356,50 @@ class CssModulesPlugin { return finalModules; } + /** + * @param {Chunk} chunk chunk + * @param {ChunkGraph} chunkGraph chunk graph + * @param {Compilation} compilation compilation + * @returns {Module[]} ordered css modules + */ getOrderedChunkCssModules(chunk, chunkGraph, compilation) { return [ ...this.getModulesInOrder( chunk, - chunkGraph.getOrderedChunkModulesIterableBySourceType( - chunk, - "css-import", - compareModulesByIdentifier + /** @type {Iterable} */ + ( + chunkGraph.getOrderedChunkModulesIterableBySourceType( + chunk, + "css-import", + compareModulesByIdentifier + ) ), compilation ), ...this.getModulesInOrder( chunk, - chunkGraph.getOrderedChunkModulesIterableBySourceType( - chunk, - "css", - compareModulesByIdentifier + /** @type {Iterable} */ + ( + chunkGraph.getOrderedChunkModulesIterableBySourceType( + chunk, + "css", + compareModulesByIdentifier + ) ), compilation ) ]; } + /** + * @param {Object} options options + * @param {string | undefined} options.uniqueName unique name + * @param {Chunk} options.chunk chunk + * @param {ChunkGraph} options.chunkGraph chunk graph + * @param {CodeGenerationResults} options.codeGenerationResults code generation results + * @param {CssModule[]} options.modules ordered css modules + * @returns {Source} generated source + */ renderChunk({ uniqueName, chunk, @@ -103381,21 +106408,70 @@ class CssModulesPlugin { modules }) { const source = new ConcatSource(); + /** @type {string[]} */ const metaData = []; for (const module of modules) { try { const codeGenResult = codeGenerationResults.get(module, chunk.runtime); - const s = - codeGenResult.sources.get("css") || - codeGenResult.sources.get("css-import"); - if (s) { - source.add(s); + let moduleSource = + /** @type {Source} */ + ( + codeGenResult.sources.get("css") || + codeGenResult.sources.get("css-import") + ); + + let inheritance = [[module.cssLayer, module.supports, module.media]]; + + if (module.inheritance) { + inheritance.push(...module.inheritance); + } + + for (let i = 0; i < inheritance.length; i++) { + const layer = inheritance[i][0]; + const supports = inheritance[i][1]; + const media = inheritance[i][2]; + + if (media) { + moduleSource = new ConcatSource( + `@media ${media} {\n`, + new PrefixSource("\t", moduleSource), + "}\n" + ); + } + + if (supports) { + moduleSource = new ConcatSource( + `@supports (${supports}) {\n`, + new PrefixSource("\t", moduleSource), + "}\n" + ); + } + + // Layer can be anonymous + if (layer !== undefined && layer !== null) { + moduleSource = new ConcatSource( + `@layer${layer ? ` ${layer}` : ""} {\n`, + new PrefixSource("\t", moduleSource), + "}\n" + ); + } + } + + if (moduleSource) { + source.add(moduleSource); source.add("\n"); } + /** @type {Map | undefined} */ const exports = codeGenResult.data && codeGenResult.data.get("css-exports"); - const moduleId = chunkGraph.getModuleId(module) + ""; + let moduleId = chunkGraph.getModuleId(module) + ""; + + // When `optimization.moduleIds` is `named` the module id is a path, so we need to normalize it between platforms + if (typeof moduleId === "string") { + moduleId = moduleId.replace(/\\/g, "/"); + } + metaData.push( `${ exports @@ -103413,7 +106489,8 @@ class CssModulesPlugin { }${escapeCss(moduleId)}` ); } catch (e) { - e.message += `\nduring rendering of css ${module.identifier()}`; + /** @type {Error} */ + (e).message += `\nduring rendering of css ${module.identifier()}`; throw e; } } @@ -103426,6 +106503,11 @@ class CssModulesPlugin { return source; } + /** + * @param {Chunk} chunk chunk + * @param {OutputOptions} outputOptions output options + * @returns {Chunk["cssFilenameTemplate"] | OutputOptions["cssFilename"] | OutputOptions["cssChunkFilename"]} used filename template + */ static getChunkFilenameTemplate(chunk, outputOptions) { if (chunk.cssFilenameTemplate) { return chunk.cssFilenameTemplate; @@ -103436,6 +106518,11 @@ class CssModulesPlugin { } } + /** + * @param {Chunk} chunk chunk + * @param {ChunkGraph} chunkGraph chunk graph + * @returns {boolean} true, when the chunk has css + */ static chunkHasCss(chunk, chunkGraph) { return ( !!chunkGraph.getChunkModulesIterableBySourceType(chunk, "css") || @@ -103449,7 +106536,7 @@ module.exports = CssModulesPlugin; /***/ }), -/***/ 92486: +/***/ 69301: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -103460,18 +106547,23 @@ module.exports = CssModulesPlugin; -const Parser = __webpack_require__(66425); -const ConstDependency = __webpack_require__(78284); -const CssExportDependency = __webpack_require__(22201); -const CssImportDependency = __webpack_require__(26282); -const CssLocalIdentifierDependency = __webpack_require__(13230); -const CssSelfLocalIdentifierDependency = __webpack_require__(11310); -const CssUrlDependency = __webpack_require__(78700); -const StaticExportsDependency = __webpack_require__(64422); -const walkCssTokens = __webpack_require__(98118); +const ModuleDependencyWarning = __webpack_require__(99391); +const { CSS_MODULE_TYPE_AUTO } = __webpack_require__(92891); +const Parser = __webpack_require__(76690); +const WebpackError = __webpack_require__(49999); +const ConstDependency = __webpack_require__(67538); +const CssExportDependency = __webpack_require__(54990); +const CssImportDependency = __webpack_require__(88587); +const CssLocalIdentifierDependency = __webpack_require__(90055); +const CssSelfLocalIdentifierDependency = __webpack_require__(15050); +const CssUrlDependency = __webpack_require__(93920); +const StaticExportsDependency = __webpack_require__(71444); +const { parseResource } = __webpack_require__(97451); +const walkCssTokens = __webpack_require__(8893); /** @typedef {import("../Parser").ParserState} ParserState */ /** @typedef {import("../Parser").PreparsedAst} PreparsedAst */ +/** @typedef {[number, number]} Range */ const CC_LEFT_CURLY = "{".charCodeAt(0); const CC_RIGHT_CURLY = "}".charCodeAt(0); @@ -103479,17 +106571,63 @@ const CC_COLON = ":".charCodeAt(0); const CC_SLASH = "/".charCodeAt(0); const CC_SEMICOLON = ";".charCodeAt(0); -const cssUnescape = str => { - return str.replace(/\\([0-9a-fA-F]{1,6}[ \t\n\r\f]?|[\s\S])/g, match => { - if (match.length > 2) { - return String.fromCharCode(parseInt(match.slice(1).trim(), 16)); - } else { - return match[1]; +// https://www.w3.org/TR/css-syntax-3/#newline +// We don't have `preprocessing` stage, so we need specify all of them +const STRING_MULTILINE = /\\[\n\r\f]/g; +// https://www.w3.org/TR/css-syntax-3/#whitespace +const TRIM_WHITE_SPACES = /(^[ \t\n\r\f]*|[ \t\n\r\f]*$)/g; +const UNESCAPE = /\\([0-9a-fA-F]{1,6}[ \t\n\r\f]?|[\s\S])/g; +const IMAGE_SET_FUNCTION = /^(-\w+-)?image-set$/i; +const OPTIONALLY_VENDOR_PREFIXED_KEYFRAMES_AT_RULE = /^@(-\w+-)?keyframes$/; +const OPTIONALLY_VENDOR_PREFIXED_ANIMATION_PROPERTY = + /^(-\w+-)?animation(-name)?$/i; +const IS_MODULES = /\.module(s)?\.[^.]+$/i; + +/** + * @param {string} str url string + * @param {boolean} isString is url wrapped in quotes + * @returns {string} normalized url + */ +const normalizeUrl = (str, isString) => { + // Remove extra spaces and newlines: + // `url("im\ + // g.png")` + if (isString) { + str = str.replace(STRING_MULTILINE, ""); + } + + str = str + // Remove unnecessary spaces from `url(" img.png ")` + .replace(TRIM_WHITE_SPACES, "") + // Unescape + .replace(UNESCAPE, match => { + if (match.length > 2) { + return String.fromCharCode(parseInt(match.slice(1).trim(), 16)); + } else { + return match[1]; + } + }); + + if (/^data:/i.test(str)) { + return str; + } + + if (str.includes("%")) { + // Convert `url('%2E/img.png')` -> `url('./img.png')` + try { + str = decodeURIComponent(str); + } catch (error) { + // Ignore } - }); + } + + return str; }; class LocConverter { + /** + * @param {string} input input + */ constructor(input) { this._input = input; this.line = 1; @@ -103497,6 +106635,10 @@ class LocConverter { this.pos = 0; } + /** + * @param {number} pos position + * @returns {LocConverter} location converter + */ get(pos) { if (this.pos !== pos) { if (this.pos < pos) { @@ -103525,47 +106667,37 @@ class LocConverter { } const CSS_MODE_TOP_LEVEL = 0; -const CSS_MODE_IN_RULE = 1; -const CSS_MODE_IN_LOCAL_RULE = 2; -const CSS_MODE_AT_IMPORT_EXPECT_URL = 3; -// TODO implement layer and supports for @import -const CSS_MODE_AT_IMPORT_EXPECT_SUPPORTS = 4; -const CSS_MODE_AT_IMPORT_EXPECT_MEDIA = 5; -const CSS_MODE_AT_OTHER = 6; - -const explainMode = mode => { - switch (mode) { - case CSS_MODE_TOP_LEVEL: - return "parsing top level css"; - case CSS_MODE_IN_RULE: - return "parsing css rule content (global)"; - case CSS_MODE_IN_LOCAL_RULE: - return "parsing css rule content (local)"; - case CSS_MODE_AT_IMPORT_EXPECT_URL: - return "parsing @import (expecting url)"; - case CSS_MODE_AT_IMPORT_EXPECT_SUPPORTS: - return "parsing @import (expecting optionally supports or media query)"; - case CSS_MODE_AT_IMPORT_EXPECT_MEDIA: - return "parsing @import (expecting optionally media query)"; - case CSS_MODE_AT_OTHER: - return "parsing at-rule"; - default: - return mode; - } -}; +const CSS_MODE_IN_BLOCK = 1; +const CSS_MODE_IN_AT_IMPORT = 2; +const CSS_MODE_AT_IMPORT_INVALID = 3; +const CSS_MODE_AT_NAMESPACE_INVALID = 4; class CssParser extends Parser { - constructor({ - allowPseudoBlocks = true, - allowModeSwitch = true, - defaultMode = "global" - } = {}) { + constructor({ allowModeSwitch = true, defaultMode = "global" } = {}) { super(); - this.allowPseudoBlocks = allowPseudoBlocks; this.allowModeSwitch = allowModeSwitch; this.defaultMode = defaultMode; } + /** + * @param {ParserState} state parser state + * @param {string} message warning message + * @param {LocConverter} locConverter location converter + * @param {number} start start offset + * @param {number} end end offset + */ + _emitWarning(state, message, locConverter, start, end) { + const { line: sl, column: sc } = locConverter.get(start); + const { line: el, column: ec } = locConverter.get(end); + + state.current.addWarning( + new ModuleDependencyWarning(state.module, new WebpackError(message), { + start: { line: sl, column: sc }, + end: { line: el, column: ec } + }) + ); + } + /** * @param {string | Buffer | PreparsedAst} source the source to parse * @param {ParserState} state the parser state @@ -103583,31 +106715,71 @@ class CssParser extends Parser { const module = state.module; - const declaredCssVariables = new Set(); + /** @type {string | undefined} */ + let oldDefaultMode; + + if ( + module.type === CSS_MODULE_TYPE_AUTO && + IS_MODULES.test( + parseResource(module.matchResource || module.resource).path + ) + ) { + oldDefaultMode = this.defaultMode; + + this.defaultMode = "local"; + } const locConverter = new LocConverter(source); - let mode = CSS_MODE_TOP_LEVEL; - let modePos = 0; - let modeNestingLevel = 0; + /** @type {Set}*/ + const declaredCssVariables = new Set(); + /** @type {number} */ + let scope = CSS_MODE_TOP_LEVEL; + /** @type {number} */ + let blockNestingLevel = 0; + /** @type {boolean} */ + let allowImportAtRule = true; + /** @type {"local" | "global" | undefined} */ let modeData = undefined; - let singleClassSelector = undefined; + /** @type {[number, number] | undefined} */ let lastIdentifier = undefined; - const modeStack = []; - const isTopLevelLocal = () => - modeData === "local" || - (this.defaultMode === "local" && modeData === undefined); - const eatWhiteLine = (input, pos) => { - for (;;) { - const cc = input.charCodeAt(pos); - if (cc === 32 || cc === 9) { - pos++; - continue; - } - if (cc === 10) pos++; - break; + /** @type [string, number, number][] */ + let balanced = []; + /** @type {undefined | { start: number, url?: string, urlStart?: number, urlEnd?: number, layer?: string, layerStart?: number, layerEnd?: number, supports?: string, supportsStart?: number, supportsEnd?: number, inSupports?:boolean, media?: string }} */ + let importData = undefined; + /** @type {boolean} */ + let inAnimationProperty = false; + /** @type {boolean} */ + let isNextRulePrelude = true; + + /** + * @param {string} input input + * @param {number} pos position + * @returns {boolean} true, when next is nested syntax + */ + const isNextNestedSyntax = (input, pos) => { + pos = walkCssTokens.eatWhitespaceAndComments(input, pos); + + if (input[pos] === "}") { + return false; } - return pos; + + // According spec only identifier can be used as a property name + const isIdentifier = walkCssTokens.isIdentStartCodePoint( + input.charCodeAt(pos) + ); + + return !isIdentifier; }; + /** + * @returns {boolean} true, when in local scope + */ + const isLocalMode = () => + modeData === "local" || + (this.defaultMode === "local" && modeData === undefined); + /** + * @param {string} chars characters + * @returns {(input: string, pos: number) => number} function to eat characters + */ const eatUntil = chars => { const charCodes = Array.from({ length: chars.length }, (_, i) => chars.charCodeAt(i) @@ -103628,6 +106800,12 @@ class CssParser extends Parser { } }; }; + /** + * @param {string} input input + * @param {number} pos start position + * @param {(input: string, pos: number) => number} eater eater + * @returns {[number,string]} new position and text + */ const eatText = (input, pos, eater) => { let text = ""; for (;;) { @@ -103655,13 +106833,24 @@ class CssParser extends Parser { }; const eatExportName = eatUntil(":};/"); const eatExportValue = eatUntil("};/"); + /** + * @param {string} input input + * @param {number} pos start position + * @returns {number} position after parse + */ const parseExports = (input, pos) => { pos = walkCssTokens.eatWhitespaceAndComments(input, pos); const cc = input.charCodeAt(pos); - if (cc !== CC_LEFT_CURLY) - throw new Error( - `Unexpected ${input[pos]} at ${pos} during parsing of ':export' (expected '{')` + if (cc !== CC_LEFT_CURLY) { + this._emitWarning( + state, + `Unexpected '${input[pos]}' at ${pos} during parsing of ':export' (expected '{')`, + locConverter, + pos, + pos ); + return pos; + } pos++; pos = walkCssTokens.eatWhitespaceAndComments(input, pos); for (;;) { @@ -103673,9 +106862,14 @@ class CssParser extends Parser { [pos, name] = eatText(input, pos, eatExportName); if (pos === input.length) return pos; if (input.charCodeAt(pos) !== CC_COLON) { - throw new Error( - `Unexpected ${input[pos]} at ${pos} during parsing of export name in ':export' (expected ':')` + this._emitWarning( + state, + `Unexpected '${input[pos]}' at ${pos} during parsing of export name in ':export' (expected ':')`, + locConverter, + start, + pos ); + return pos; } pos++; if (pos === input.length) return pos; @@ -103691,9 +106885,14 @@ class CssParser extends Parser { pos = walkCssTokens.eatWhitespaceAndComments(input, pos); if (pos === input.length) return pos; } else if (cc !== CC_RIGHT_CURLY) { - throw new Error( - `Unexpected ${input[pos]} at ${pos} during parsing of export value in ':export' (expected ';' or '}')` + this._emitWarning( + state, + `Unexpected '${input[pos]}' at ${pos} during parsing of export value in ':export' (expected ';' or '}')`, + locConverter, + start, + pos ); + return pos; } const dep = new CssExportDependency(name, value); const { line: sl, column: sc } = locConverter.get(start); @@ -103703,13 +106902,18 @@ class CssParser extends Parser { } pos++; if (pos === input.length) return pos; - pos = eatWhiteLine(input, pos); + pos = walkCssTokens.eatWhiteLine(input, pos); return pos; }; const eatPropertyName = eatUntil(":{};"); - const processLocalDeclaration = (input, pos) => { + /** + * @param {string} input input + * @param {number} pos name start position + * @param {number} end name end position + * @returns {number} position after handling + */ + const processLocalDeclaration = (input, pos, end) => { modeData = undefined; - const start = pos; pos = walkCssTokens.eatWhitespaceAndComments(input, pos); const propertyNameStart = pos; const [propertyNameEnd, propertyName] = eatText( @@ -103717,7 +106921,7 @@ class CssParser extends Parser { pos, eatPropertyName ); - if (input.charCodeAt(propertyNameEnd) !== CC_COLON) return start; + if (input.charCodeAt(propertyNameEnd) !== CC_COLON) return end; pos = propertyNameEnd + 1; if (propertyName.startsWith("--")) { // CSS Variable @@ -103733,47 +106937,74 @@ class CssParser extends Parser { module.addDependency(dep); declaredCssVariables.add(name); } else if ( - propertyName === "animation-name" || - propertyName === "animation" + !propertyName.startsWith("--") && + OPTIONALLY_VENDOR_PREFIXED_ANIMATION_PROPERTY.test(propertyName) ) { - modeData = "animation"; - lastIdentifier = undefined; + inAnimationProperty = true; } return pos; }; - const processDeclarationValueDone = (input, pos) => { - if (modeData === "animation" && lastIdentifier) { + /** + * @param {string} input input + */ + const processDeclarationValueDone = input => { + if (inAnimationProperty && lastIdentifier) { const { line: sl, column: sc } = locConverter.get(lastIdentifier[0]); const { line: el, column: ec } = locConverter.get(lastIdentifier[1]); const name = input.slice(lastIdentifier[0], lastIdentifier[1]); const dep = new CssSelfLocalIdentifierDependency(name, lastIdentifier); dep.setLoc(sl, sc, el, ec); module.addDependency(dep); + lastIdentifier = undefined; } }; const eatKeyframes = eatUntil("{};/"); const eatNameInVar = eatUntil(",)};/"); walkCssTokens(source, { isSelector: () => { - return mode !== CSS_MODE_IN_RULE && mode !== CSS_MODE_IN_LOCAL_RULE; + return isNextRulePrelude; }, url: (input, start, end, contentStart, contentEnd) => { - const value = cssUnescape(input.slice(contentStart, contentEnd)); - switch (mode) { - case CSS_MODE_AT_IMPORT_EXPECT_URL: { - modeData.url = value; - mode = CSS_MODE_AT_IMPORT_EXPECT_SUPPORTS; - break; - } - case CSS_MODE_AT_IMPORT_EXPECT_SUPPORTS: - case CSS_MODE_AT_IMPORT_EXPECT_MEDIA: - throw new Error( - `Unexpected ${input.slice( + let value = normalizeUrl(input.slice(contentStart, contentEnd), false); + + switch (scope) { + case CSS_MODE_IN_AT_IMPORT: { + // Do not parse URLs in `supports(...)` + if (importData.inSupports) { + break; + } + + if (importData.url) { + this._emitWarning( + state, + `Duplicate of 'url(...)' in '${input.slice( + importData.start, + end + )}'`, + locConverter, start, end - )} at ${start} during ${explainMode(mode)}` - ); - default: { + ); + + break; + } + + importData.url = value; + importData.urlStart = start; + importData.urlEnd = end; + break; + } + // Do not parse URLs in import between rules + case CSS_MODE_AT_NAMESPACE_INVALID: + case CSS_MODE_AT_IMPORT_INVALID: { + break; + } + case CSS_MODE_IN_BLOCK: { + // Ignore `url()`, `url('')` and `url("")`, they are valid by spec + if (value.length === 0) { + break; + } + const dep = new CssUrlDependency(value, [start, end], "url"); const { line: sl, column: sc } = locConverter.get(start); const { line: el, column: ec } = locConverter.get(end); @@ -103786,283 +107017,554 @@ class CssParser extends Parser { return end; }, string: (input, start, end) => { - switch (mode) { - case CSS_MODE_AT_IMPORT_EXPECT_URL: { - modeData.url = cssUnescape(input.slice(start + 1, end - 1)); - mode = CSS_MODE_AT_IMPORT_EXPECT_SUPPORTS; + switch (scope) { + case CSS_MODE_IN_AT_IMPORT: { + const insideURLFunction = + balanced[balanced.length - 1] && + balanced[balanced.length - 1][0] === "url"; + + // Do not parse URLs in `supports(...)` and other strings if we already have a URL + if ( + importData.inSupports || + (!insideURLFunction && importData.url) + ) { + break; + } + + if (insideURLFunction && importData.url) { + this._emitWarning( + state, + `Duplicate of 'url(...)' in '${input.slice( + importData.start, + end + )}'`, + locConverter, + start, + end + ); + + break; + } + + importData.url = normalizeUrl( + input.slice(start + 1, end - 1), + true + ); + + if (!insideURLFunction) { + importData.urlStart = start; + importData.urlEnd = end; + } + break; } + case CSS_MODE_IN_BLOCK: { + // TODO move escaped parsing to tokenizer + const last = balanced[balanced.length - 1]; + + if ( + last && + (last[0].replace(/\\/g, "").toLowerCase() === "url" || + IMAGE_SET_FUNCTION.test(last[0].replace(/\\/g, ""))) + ) { + let value = normalizeUrl(input.slice(start + 1, end - 1), true); + + // Ignore `url()`, `url('')` and `url("")`, they are valid by spec + if (value.length === 0) { + break; + } + + const isUrl = last[0].replace(/\\/g, "").toLowerCase() === "url"; + const dep = new CssUrlDependency( + value, + [start, end], + isUrl ? "string" : "url" + ); + const { line: sl, column: sc } = locConverter.get(start); + const { line: el, column: ec } = locConverter.get(end); + dep.setLoc(sl, sc, el, ec); + module.addDependency(dep); + module.addCodeGenerationDependency(dep); + } + } } return end; }, atKeyword: (input, start, end) => { - const name = input.slice(start, end); + const name = input.slice(start, end).toLowerCase(); if (name === "@namespace") { - throw new Error("@namespace is not supported in bundled CSS"); - } - if (name === "@import") { - if (mode !== CSS_MODE_TOP_LEVEL) { - throw new Error( - `Unexpected @import at ${start} during ${explainMode(mode)}` + scope = CSS_MODE_AT_NAMESPACE_INVALID; + this._emitWarning( + state, + "'@namespace' is not supported in bundled CSS", + locConverter, + start, + end + ); + return end; + } else if (name === "@import") { + if (!allowImportAtRule) { + scope = CSS_MODE_AT_IMPORT_INVALID; + this._emitWarning( + state, + "Any '@import' rules must precede all other rules", + locConverter, + start, + end ); + return end; } - mode = CSS_MODE_AT_IMPORT_EXPECT_URL; - modePos = end; - modeData = { - start: start, - url: undefined, - supports: undefined - }; - } - if (name === "@keyframes") { + + scope = CSS_MODE_IN_AT_IMPORT; + importData = { start }; + } else if ( + this.allowModeSwitch && + OPTIONALLY_VENDOR_PREFIXED_KEYFRAMES_AT_RULE.test(name) + ) { let pos = end; pos = walkCssTokens.eatWhitespaceAndComments(input, pos); if (pos === input.length) return pos; const [newPos, name] = eatText(input, pos, eatKeyframes); + if (newPos === input.length) return newPos; + if (input.charCodeAt(newPos) !== CC_LEFT_CURLY) { + this._emitWarning( + state, + `Unexpected '${input[newPos]}' at ${newPos} during parsing of @keyframes (expected '{')`, + locConverter, + start, + end + ); + + return newPos; + } const { line: sl, column: sc } = locConverter.get(pos); const { line: el, column: ec } = locConverter.get(newPos); const dep = new CssLocalIdentifierDependency(name, [pos, newPos]); dep.setLoc(sl, sc, el, ec); module.addDependency(dep); pos = newPos; + return pos + 1; + } else if (this.allowModeSwitch && name === "@property") { + let pos = end; + pos = walkCssTokens.eatWhitespaceAndComments(input, pos); if (pos === input.length) return pos; - if (input.charCodeAt(pos) !== CC_LEFT_CURLY) { - throw new Error( - `Unexpected ${input[pos]} at ${pos} during parsing of @keyframes (expected '{')` + const propertyNameStart = pos; + const [propertyNameEnd, propertyName] = eatText( + input, + pos, + eatKeyframes + ); + if (propertyNameEnd === input.length) return propertyNameEnd; + if (!propertyName.startsWith("--")) return propertyNameEnd; + if (input.charCodeAt(propertyNameEnd) !== CC_LEFT_CURLY) { + this._emitWarning( + state, + `Unexpected '${input[propertyNameEnd]}' at ${propertyNameEnd} during parsing of @property (expected '{')`, + locConverter, + start, + end ); + + return propertyNameEnd; } - mode = CSS_MODE_IN_LOCAL_RULE; - modeNestingLevel = 1; + const { line: sl, column: sc } = locConverter.get(pos); + const { line: el, column: ec } = locConverter.get(propertyNameEnd); + const name = propertyName.slice(2); + const dep = new CssLocalIdentifierDependency( + name, + [propertyNameStart, propertyNameEnd], + "--" + ); + dep.setLoc(sl, sc, el, ec); + module.addDependency(dep); + declaredCssVariables.add(name); + pos = propertyNameEnd; return pos + 1; + } else if ( + name === "@media" || + name === "@supports" || + name === "@layer" || + name === "@container" + ) { + modeData = isLocalMode() ? "local" : "global"; + isNextRulePrelude = true; + return end; + } else if (this.allowModeSwitch) { + modeData = "global"; + isNextRulePrelude = false; } return end; }, semicolon: (input, start, end) => { - switch (mode) { - case CSS_MODE_AT_IMPORT_EXPECT_URL: - throw new Error(`Expected URL for @import at ${start}`); - case CSS_MODE_AT_IMPORT_EXPECT_MEDIA: - case CSS_MODE_AT_IMPORT_EXPECT_SUPPORTS: { - const { line: sl, column: sc } = locConverter.get(modeData.start); + switch (scope) { + case CSS_MODE_IN_AT_IMPORT: { + const { start } = importData; + + if (importData.url === undefined) { + this._emitWarning( + state, + `Expected URL in '${input.slice(start, end)}'`, + locConverter, + start, + end + ); + importData = undefined; + scope = CSS_MODE_TOP_LEVEL; + return end; + } + if ( + importData.urlStart > importData.layerStart || + importData.urlStart > importData.supportsStart + ) { + this._emitWarning( + state, + `An URL in '${input.slice( + start, + end + )}' should be before 'layer(...)' or 'supports(...)'`, + locConverter, + start, + end + ); + importData = undefined; + scope = CSS_MODE_TOP_LEVEL; + return end; + } + if (importData.layerStart > importData.supportsStart) { + this._emitWarning( + state, + `The 'layer(...)' in '${input.slice( + start, + end + )}' should be before 'supports(...)'`, + locConverter, + start, + end + ); + importData = undefined; + scope = CSS_MODE_TOP_LEVEL; + return end; + } + + const semicolonPos = end; + end = walkCssTokens.eatWhiteLine(input, end + 1); + const { line: sl, column: sc } = locConverter.get(start); const { line: el, column: ec } = locConverter.get(end); - end = eatWhiteLine(input, end); - const media = input.slice(modePos, start).trim(); - const dep = new CssImportDependency( - modeData.url, - [modeData.start, end], - modeData.supports, - media - ); - dep.setLoc(sl, sc, el, ec); - module.addDependency(dep); + const lastEnd = + importData.supportsEnd || + importData.layerEnd || + importData.urlEnd || + start; + const pos = walkCssTokens.eatWhitespaceAndComments(input, lastEnd); + // Prevent to consider comments as a part of media query + if (pos !== semicolonPos - 1) { + importData.media = input.slice(lastEnd, semicolonPos - 1).trim(); + } + + const url = importData.url.trim(); + + if (url.length === 0) { + const dep = new ConstDependency("", [start, end]); + module.addPresentationalDependency(dep); + dep.setLoc(sl, sc, el, ec); + } else { + const dep = new CssImportDependency( + url, + [start, end], + importData.layer, + importData.supports, + importData.media && importData.media.length > 0 + ? importData.media + : undefined + ); + dep.setLoc(sl, sc, el, ec); + module.addDependency(dep); + } + + importData = undefined; + scope = CSS_MODE_TOP_LEVEL; + break; } - case CSS_MODE_IN_LOCAL_RULE: { - processDeclarationValueDone(input, start); - return processLocalDeclaration(input, end); + case CSS_MODE_AT_IMPORT_INVALID: + case CSS_MODE_AT_NAMESPACE_INVALID: { + scope = CSS_MODE_TOP_LEVEL; + + break; } - case CSS_MODE_IN_RULE: { - return end; + case CSS_MODE_IN_BLOCK: { + if (this.allowModeSwitch) { + processDeclarationValueDone(input); + inAnimationProperty = false; + isNextRulePrelude = isNextNestedSyntax(input, end); + } + break; } } - mode = CSS_MODE_TOP_LEVEL; - modeData = undefined; - singleClassSelector = undefined; return end; }, leftCurlyBracket: (input, start, end) => { - switch (mode) { - case CSS_MODE_TOP_LEVEL: - mode = isTopLevelLocal() - ? CSS_MODE_IN_LOCAL_RULE - : CSS_MODE_IN_RULE; - modeNestingLevel = 1; - if (mode === CSS_MODE_IN_LOCAL_RULE) - return processLocalDeclaration(input, end); + switch (scope) { + case CSS_MODE_TOP_LEVEL: { + allowImportAtRule = false; + scope = CSS_MODE_IN_BLOCK; + blockNestingLevel = 1; + + if (this.allowModeSwitch) { + isNextRulePrelude = isNextNestedSyntax(input, end); + } + break; - case CSS_MODE_IN_RULE: - case CSS_MODE_IN_LOCAL_RULE: - modeNestingLevel++; + } + case CSS_MODE_IN_BLOCK: { + blockNestingLevel++; + + if (this.allowModeSwitch) { + isNextRulePrelude = isNextNestedSyntax(input, end); + } break; + } } return end; }, rightCurlyBracket: (input, start, end) => { - switch (mode) { - case CSS_MODE_IN_LOCAL_RULE: - processDeclarationValueDone(input, start); - /* falls through */ - case CSS_MODE_IN_RULE: - if (--modeNestingLevel === 0) { - mode = CSS_MODE_TOP_LEVEL; - modeData = undefined; - singleClassSelector = undefined; + switch (scope) { + case CSS_MODE_IN_BLOCK: { + if (isLocalMode()) { + processDeclarationValueDone(input); + inAnimationProperty = false; + } + if (--blockNestingLevel === 0) { + scope = CSS_MODE_TOP_LEVEL; + + if (this.allowModeSwitch) { + isNextRulePrelude = true; + modeData = undefined; + } + } else if (this.allowModeSwitch) { + isNextRulePrelude = isNextNestedSyntax(input, end); } break; + } } return end; }, - id: (input, start, end) => { - singleClassSelector = false; - switch (mode) { - case CSS_MODE_TOP_LEVEL: - if (isTopLevelLocal()) { - const name = input.slice(start + 1, end); - const dep = new CssLocalIdentifierDependency(name, [ - start + 1, - end - ]); - const { line: sl, column: sc } = locConverter.get(start); - const { line: el, column: ec } = locConverter.get(end); - dep.setLoc(sl, sc, el, ec); - module.addDependency(dep); + identifier: (input, start, end) => { + switch (scope) { + case CSS_MODE_IN_BLOCK: { + if (isLocalMode()) { + // Handle only top level values and not inside functions + if (inAnimationProperty && balanced.length === 0) { + lastIdentifier = [start, end]; + } else { + return processLocalDeclaration(input, start, end); + } } break; - } - return end; - }, - identifier: (input, start, end) => { - singleClassSelector = false; - switch (mode) { - case CSS_MODE_IN_LOCAL_RULE: - if (modeData === "animation") { - lastIdentifier = [start, end]; + } + case CSS_MODE_IN_AT_IMPORT: { + if (input.slice(start, end).toLowerCase() === "layer") { + importData.layer = ""; + importData.layerStart = start; + importData.layerEnd = end; } break; + } } return end; }, class: (input, start, end) => { - switch (mode) { - case CSS_MODE_TOP_LEVEL: { - if (isTopLevelLocal()) { - const name = input.slice(start + 1, end); - const dep = new CssLocalIdentifierDependency(name, [ - start + 1, - end - ]); - const { line: sl, column: sc } = locConverter.get(start); - const { line: el, column: ec } = locConverter.get(end); - dep.setLoc(sl, sc, el, ec); - module.addDependency(dep); - if (singleClassSelector === undefined) singleClassSelector = name; - } else { - singleClassSelector = false; - } - break; - } + if (isLocalMode()) { + const name = input.slice(start + 1, end); + const dep = new CssLocalIdentifierDependency(name, [start + 1, end]); + const { line: sl, column: sc } = locConverter.get(start); + const { line: el, column: ec } = locConverter.get(end); + dep.setLoc(sl, sc, el, ec); + module.addDependency(dep); } + return end; }, - leftParenthesis: (input, start, end) => { - switch (mode) { - case CSS_MODE_TOP_LEVEL: { - modeStack.push(false); - break; + id: (input, start, end) => { + if (isLocalMode()) { + const name = input.slice(start + 1, end); + const dep = new CssLocalIdentifierDependency(name, [start + 1, end]); + const { line: sl, column: sc } = locConverter.get(start); + const { line: el, column: ec } = locConverter.get(end); + dep.setLoc(sl, sc, el, ec); + module.addDependency(dep); + } + return end; + }, + function: (input, start, end) => { + let name = input.slice(start, end - 1); + + balanced.push([name, start, end]); + + if ( + scope === CSS_MODE_IN_AT_IMPORT && + name.toLowerCase() === "supports" + ) { + importData.inSupports = true; + } + + if (isLocalMode()) { + name = name.toLowerCase(); + + // Don't rename animation name when we have `var()` function + if (inAnimationProperty && balanced.length === 1) { + lastIdentifier = undefined; + } + + if (name === "var") { + let pos = walkCssTokens.eatWhitespaceAndComments(input, end); + if (pos === input.length) return pos; + const [newPos, name] = eatText(input, pos, eatNameInVar); + if (!name.startsWith("--")) return end; + const { line: sl, column: sc } = locConverter.get(pos); + const { line: el, column: ec } = locConverter.get(newPos); + const dep = new CssSelfLocalIdentifierDependency( + name.slice(2), + [pos, newPos], + "--", + declaredCssVariables + ); + dep.setLoc(sl, sc, el, ec); + module.addDependency(dep); + return newPos; } } + + return end; + }, + leftParenthesis: (input, start, end) => { + balanced.push(["(", start, end]); + return end; }, rightParenthesis: (input, start, end) => { - switch (mode) { - case CSS_MODE_TOP_LEVEL: { - const newModeData = modeStack.pop(); - if (newModeData !== false) { - modeData = newModeData; - const dep = new ConstDependency("", [start, end]); - module.addPresentationalDependency(dep); + const last = balanced[balanced.length - 1]; + const popped = balanced.pop(); + + if ( + this.allowModeSwitch && + popped && + (popped[0] === ":local" || popped[0] === ":global") + ) { + modeData = balanced[balanced.length - 1] + ? /** @type {"local" | "global"} */ + (balanced[balanced.length - 1][0]) + : undefined; + const dep = new ConstDependency("", [start, end]); + module.addPresentationalDependency(dep); + + return end; + } + + switch (scope) { + case CSS_MODE_IN_AT_IMPORT: { + if (last && last[0] === "url" && !importData.inSupports) { + importData.urlStart = last[1]; + importData.urlEnd = end; + } else if ( + last && + last[0].toLowerCase() === "layer" && + !importData.inSupports + ) { + importData.layer = input.slice(last[2], end - 1).trim(); + importData.layerStart = last[1]; + importData.layerEnd = end; + } else if (last && last[0].toLowerCase() === "supports") { + importData.supports = input.slice(last[2], end - 1).trim(); + importData.supportsStart = last[1]; + importData.supportsEnd = end; + importData.inSupports = false; } break; } } + return end; }, pseudoClass: (input, start, end) => { - singleClassSelector = false; - switch (mode) { - case CSS_MODE_TOP_LEVEL: { - const name = input.slice(start, end); - if (this.allowModeSwitch && name === ":global") { - modeData = "global"; - const dep = new ConstDependency("", [start, end]); - module.addPresentationalDependency(dep); - } else if (this.allowModeSwitch && name === ":local") { - modeData = "local"; - const dep = new ConstDependency("", [start, end]); - module.addPresentationalDependency(dep); - } else if (this.allowPseudoBlocks && name === ":export") { - const pos = parseExports(input, end); - const dep = new ConstDependency("", [start, pos]); - module.addPresentationalDependency(dep); - return pos; + if (this.allowModeSwitch) { + const name = input.slice(start, end).toLowerCase(); + + if (name === ":global") { + modeData = "global"; + // Eat extra whitespace and comments + end = walkCssTokens.eatWhitespace(input, end); + const dep = new ConstDependency("", [start, end]); + module.addPresentationalDependency(dep); + return end; + } else if (name === ":local") { + modeData = "local"; + // Eat extra whitespace and comments + end = walkCssTokens.eatWhitespace(input, end); + const dep = new ConstDependency("", [start, end]); + module.addPresentationalDependency(dep); + return end; + } + + switch (scope) { + case CSS_MODE_TOP_LEVEL: { + if (name === ":export") { + const pos = parseExports(input, end); + const dep = new ConstDependency("", [start, pos]); + module.addPresentationalDependency(dep); + return pos; + } + break; } - break; } } + return end; }, pseudoFunction: (input, start, end) => { - switch (mode) { - case CSS_MODE_TOP_LEVEL: { - const name = input.slice(start, end - 1); - if (this.allowModeSwitch && name === ":global") { - modeStack.push(modeData); - modeData = "global"; - const dep = new ConstDependency("", [start, end]); - module.addPresentationalDependency(dep); - } else if (this.allowModeSwitch && name === ":local") { - modeStack.push(modeData); - modeData = "local"; - const dep = new ConstDependency("", [start, end]); - module.addPresentationalDependency(dep); - } else { - modeStack.push(false); - } - break; + let name = input.slice(start, end - 1); + + balanced.push([name, start, end]); + + if (this.allowModeSwitch) { + name = name.toLowerCase(); + + if (name === ":global") { + modeData = "global"; + const dep = new ConstDependency("", [start, end]); + module.addPresentationalDependency(dep); + } else if (name === ":local") { + modeData = "local"; + const dep = new ConstDependency("", [start, end]); + module.addPresentationalDependency(dep); } } + return end; }, - function: (input, start, end) => { - switch (mode) { - case CSS_MODE_IN_LOCAL_RULE: { - const name = input.slice(start, end - 1); - if (name === "var") { - let pos = walkCssTokens.eatWhitespaceAndComments(input, end); - if (pos === input.length) return pos; - const [newPos, name] = eatText(input, pos, eatNameInVar); - if (!name.startsWith("--")) return end; - const { line: sl, column: sc } = locConverter.get(pos); - const { line: el, column: ec } = locConverter.get(newPos); - const dep = new CssSelfLocalIdentifierDependency( - name.slice(2), - [pos, newPos], - "--", - declaredCssVariables - ); - dep.setLoc(sl, sc, el, ec); - module.addDependency(dep); - return newPos; + comma: (input, start, end) => { + if (this.allowModeSwitch) { + // Reset stack for `:global .class :local .class-other` selector after + modeData = undefined; + + switch (scope) { + case CSS_MODE_IN_BLOCK: { + if (isLocalMode()) { + processDeclarationValueDone(input); + } + + break; } - break; } } return end; - }, - comma: (input, start, end) => { - switch (mode) { - case CSS_MODE_TOP_LEVEL: - modeData = undefined; - modeStack.length = 0; - break; - case CSS_MODE_IN_LOCAL_RULE: - processDeclarationValueDone(input, start); - break; - } - return end; } }); + if (oldDefaultMode) { + this.defaultMode = oldDefaultMode; + } + module.buildInfo.strict = true; module.buildMeta.exportsType = "namespace"; module.addDependency(new StaticExportsDependency([], true)); @@ -104075,7 +107577,7 @@ module.exports = CssParser; /***/ }), -/***/ 98118: +/***/ 8893: /***/ (function(module) { "use strict"; @@ -104088,7 +107590,7 @@ module.exports = CssParser; /** * @typedef {Object} CssTokenCallbacks - * @property {function(string, number): boolean} isSelector + * @property {function(string, number): boolean=} isSelector * @property {function(string, number, number, number, number): number=} url * @property {function(string, number, number): number=} string * @property {function(string, number, number): number=} leftParenthesis @@ -104117,14 +107619,16 @@ const CC_FORM_FEED = "\f".charCodeAt(0); const CC_TAB = "\t".charCodeAt(0); const CC_SPACE = " ".charCodeAt(0); -const CC_SLASH = "/".charCodeAt(0); -const CC_BACK_SLASH = "\\".charCodeAt(0); +const CC_SOLIDUS = "/".charCodeAt(0); +const CC_REVERSE_SOLIDUS = "\\".charCodeAt(0); const CC_ASTERISK = "*".charCodeAt(0); const CC_LEFT_PARENTHESIS = "(".charCodeAt(0); const CC_RIGHT_PARENTHESIS = ")".charCodeAt(0); const CC_LEFT_CURLY = "{".charCodeAt(0); const CC_RIGHT_CURLY = "}".charCodeAt(0); +const CC_LEFT_SQUARE = "[".charCodeAt(0); +const CC_RIGHT_SQUARE = "]".charCodeAt(0); const CC_QUOTATION_MARK = '"'.charCodeAt(0); const CC_APOSTROPHE = "'".charCodeAt(0); @@ -104143,6 +107647,7 @@ const CC_LOWER_E = "e".charCodeAt(0); const CC_LOWER_Z = "z".charCodeAt(0); const CC_UPPER_A = "A".charCodeAt(0); const CC_UPPER_E = "E".charCodeAt(0); +const CC_UPPER_U = "U".charCodeAt(0); const CC_UPPER_Z = "Z".charCodeAt(0); const CC_0 = "0".charCodeAt(0); const CC_9 = "9".charCodeAt(0); @@ -104154,6 +107659,10 @@ const CC_HYPHEN_MINUS = "-".charCodeAt(0); const CC_LESS_THAN_SIGN = "<".charCodeAt(0); const CC_GREATER_THAN_SIGN = ">".charCodeAt(0); +/** + * @param {number} cc char code + * @returns {boolean} true, if cc is a newline + */ const _isNewLine = cc => { return ( cc === CC_LINE_FEED || cc === CC_CARRIAGE_RETURN || cc === CC_FORM_FEED @@ -104162,6 +107671,7 @@ const _isNewLine = cc => { /** @type {CharHandler} */ const consumeSpace = (input, pos, callbacks) => { + /** @type {number} */ let cc; do { pos++; @@ -104170,61 +107680,109 @@ const consumeSpace = (input, pos, callbacks) => { return pos; }; +/** + * @param {number} cc char code + * @returns {boolean} true, if cc is a newline + */ +const _isNewline = cc => { + return ( + cc === CC_LINE_FEED || cc === CC_CARRIAGE_RETURN || cc === CC_FORM_FEED + ); +}; + +/** + * @param {number} cc char code + * @returns {boolean} true, if cc is a space (U+0009 CHARACTER TABULATION or U+0020 SPACE) + */ +const _isSpace = cc => { + return cc === CC_TAB || cc === CC_SPACE; +}; + +/** + * @param {number} cc char code + * @returns {boolean} true, if cc is a whitespace + */ const _isWhiteSpace = cc => { + return _isNewline(cc) || _isSpace(cc); +}; + +/** + * ident-start code point + * + * A letter, a non-ASCII code point, or U+005F LOW LINE (_). + * + * @param {number} cc char code + * @returns {boolean} true, if cc is a start code point of an identifier + */ +const isIdentStartCodePoint = cc => { return ( - cc === CC_LINE_FEED || - cc === CC_CARRIAGE_RETURN || - cc === CC_FORM_FEED || - cc === CC_TAB || - cc === CC_SPACE + (cc >= CC_LOWER_A && cc <= CC_LOWER_Z) || + (cc >= CC_UPPER_A && cc <= CC_UPPER_Z) || + cc === CC_LOW_LINE || + cc >= 0x80 ); }; /** @type {CharHandler} */ -const consumeSingleCharToken = (input, pos, callbacks) => { +const consumeDelimToken = (input, pos, callbacks) => { return pos + 1; }; /** @type {CharHandler} */ -const consumePotentialComment = (input, pos, callbacks) => { - pos++; - if (pos === input.length) return pos; - let cc = input.charCodeAt(pos); - if (cc !== CC_ASTERISK) return pos; - for (;;) { - pos++; - if (pos === input.length) return pos; - cc = input.charCodeAt(pos); - while (cc === CC_ASTERISK) { +const consumeComments = (input, pos, callbacks) => { + // If the next two input code point are U+002F SOLIDUS (/) followed by a U+002A + // ASTERISK (*), consume them and all following code points up to and including + // the first U+002A ASTERISK (*) followed by a U+002F SOLIDUS (/), or up to an + // EOF code point. Return to the start of this step. + // + // If the preceding paragraph ended by consuming an EOF code point, this is a parse error. + // But we are silent on errors. + if ( + input.charCodeAt(pos) === CC_SOLIDUS && + input.charCodeAt(pos + 1) === CC_ASTERISK + ) { + pos += 1; + while (pos < input.length) { + if ( + input.charCodeAt(pos) === CC_ASTERISK && + input.charCodeAt(pos + 1) === CC_SOLIDUS + ) { + pos += 2; + break; + } pos++; - if (pos === input.length) return pos; - cc = input.charCodeAt(pos); - if (cc === CC_SLASH) return pos + 1; } } + return pos; }; /** @type {function(number): CharHandler} */ -const consumeString = end => (input, pos, callbacks) => { +const consumeString = quote_cc => (input, pos, callbacks) => { const start = pos; - pos = _consumeString(input, pos, end); + pos = _consumeString(input, pos, quote_cc); if (callbacks.string !== undefined) { pos = callbacks.string(input, start, pos); } return pos; }; -const _consumeString = (input, pos, end) => { +/** + * @param {string} input input + * @param {number} pos position + * @param {number} quote_cc quote char code + * @returns {number} new position + */ +const _consumeString = (input, pos, quote_cc) => { pos++; for (;;) { if (pos === input.length) return pos; const cc = input.charCodeAt(pos); - if (cc === end) return pos + 1; + if (cc === quote_cc) return pos + 1; if (_isNewLine(cc)) { // bad string return pos; } - if (cc === CC_BACK_SLASH) { + if (cc === CC_REVERSE_SOLIDUS) { // we don't need to fully parse the escaped code point // just skip over a potential new line pos++; @@ -104236,6 +107794,10 @@ const _consumeString = (input, pos, end) => { } }; +/** + * @param {number} cc char code + * @returns {boolean} is identifier start code + */ const _isIdentifierStartCode = cc => { return ( cc === CC_LOW_LINE || @@ -104245,23 +107807,43 @@ const _isIdentifierStartCode = cc => { ); }; +/** + * @param {number} first first code point + * @param {number} second second code point + * @returns {boolean} true if two code points are a valid escape + */ +const _isTwoCodePointsAreValidEscape = (first, second) => { + if (first !== CC_REVERSE_SOLIDUS) return false; + if (_isNewLine(second)) return false; + return true; +}; + +/** + * @param {number} cc char code + * @returns {boolean} is digit + */ const _isDigit = cc => { return cc >= CC_0 && cc <= CC_9; }; +/** + * @param {string} input input + * @param {number} pos position + * @returns {boolean} true, if input at pos starts an identifier + */ const _startsIdentifier = (input, pos) => { const cc = input.charCodeAt(pos); if (cc === CC_HYPHEN_MINUS) { if (pos === input.length) return false; const cc = input.charCodeAt(pos + 1); if (cc === CC_HYPHEN_MINUS) return true; - if (cc === CC_BACK_SLASH) { + if (cc === CC_REVERSE_SOLIDUS) { const cc = input.charCodeAt(pos + 2); return !_isNewLine(cc); } return _isIdentifierStartCode(cc); } - if (cc === CC_BACK_SLASH) { + if (cc === CC_REVERSE_SOLIDUS) { const cc = input.charCodeAt(pos + 1); return !_isNewLine(cc); } @@ -104274,7 +107856,7 @@ const consumeNumberSign = (input, pos, callbacks) => { pos++; if (pos === input.length) return pos; if (callbacks.isSelector(input, pos) && _startsIdentifier(input, pos)) { - pos = _consumeIdentifier(input, pos); + pos = _consumeIdentifier(input, pos, callbacks); if (callbacks.id !== undefined) { return callbacks.id(input, start, pos); } @@ -104288,6 +107870,7 @@ const consumeMinus = (input, pos, callbacks) => { pos++; if (pos === input.length) return pos; const cc = input.charCodeAt(pos); + // If the input stream starts with a number, reconsume the current input code point, consume a numeric token, and return it. if (cc === CC_FULL_STOP || _isDigit(cc)) { return consumeNumericToken(input, pos, callbacks); } else if (cc === CC_HYPHEN_MINUS) { @@ -104297,25 +107880,21 @@ const consumeMinus = (input, pos, callbacks) => { if (cc === CC_GREATER_THAN_SIGN) { return pos + 1; } else { - pos = _consumeIdentifier(input, pos); + pos = _consumeIdentifier(input, pos, callbacks); if (callbacks.identifier !== undefined) { return callbacks.identifier(input, start, pos); } } - } else if (cc === CC_BACK_SLASH) { + } else if (cc === CC_REVERSE_SOLIDUS) { if (pos + 1 === input.length) return pos; const cc = input.charCodeAt(pos + 1); if (_isNewLine(cc)) return pos; - pos = _consumeIdentifier(input, pos); + pos = _consumeIdentifier(input, pos, callbacks); if (callbacks.identifier !== undefined) { return callbacks.identifier(input, start, pos); } } else if (_isIdentifierStartCode(cc)) { - pos++; - pos = _consumeIdentifier(input, pos); - if (callbacks.identifier !== undefined) { - return callbacks.identifier(input, start, pos); - } + pos = consumeOtherIdentifier(input, pos - 1, callbacks); } return pos; }; @@ -104329,16 +107908,17 @@ const consumeDot = (input, pos, callbacks) => { if (_isDigit(cc)) return consumeNumericToken(input, pos - 2, callbacks); if (!callbacks.isSelector(input, pos) || !_startsIdentifier(input, pos)) return pos; - pos = _consumeIdentifier(input, pos); + pos = _consumeIdentifier(input, pos, callbacks); if (callbacks.class !== undefined) return callbacks.class(input, start, pos); return pos; }; /** @type {CharHandler} */ const consumeNumericToken = (input, pos, callbacks) => { - pos = _consumeNumber(input, pos); + pos = _consumeNumber(input, pos, callbacks); if (pos === input.length) return pos; - if (_startsIdentifier(input, pos)) return _consumeIdentifier(input, pos); + if (_startsIdentifier(input, pos)) + return _consumeIdentifier(input, pos, callbacks); const cc = input.charCodeAt(pos); if (cc === CC_PERCENTAGE) return pos + 1; return pos; @@ -104347,12 +107927,8 @@ const consumeNumericToken = (input, pos, callbacks) => { /** @type {CharHandler} */ const consumeOtherIdentifier = (input, pos, callbacks) => { const start = pos; - pos = _consumeIdentifier(input, pos); - if ( - pos !== input.length && - !callbacks.isSelector(input, pos) && - input.charCodeAt(pos) === CC_LEFT_PARENTHESIS - ) { + pos = _consumeIdentifier(input, pos, callbacks); + if (pos !== input.length && input.charCodeAt(pos) === CC_LEFT_PARENTHESIS) { pos++; if (callbacks.function !== undefined) { return callbacks.function(input, start, pos); @@ -104368,8 +107944,12 @@ const consumeOtherIdentifier = (input, pos, callbacks) => { /** @type {CharHandler} */ const consumePotentialUrl = (input, pos, callbacks) => { const start = pos; - pos = _consumeIdentifier(input, pos); - if (pos === start + 3 && input.slice(start, pos + 1) === "url(") { + pos = _consumeIdentifier(input, pos, callbacks); + const nextPos = pos + 1; + if ( + pos === start + 3 && + input.slice(start, nextPos).toLowerCase() === "url(" + ) { pos++; let cc = input.charCodeAt(pos); while (_isWhiteSpace(cc)) { @@ -104378,26 +107958,16 @@ const consumePotentialUrl = (input, pos, callbacks) => { cc = input.charCodeAt(pos); } if (cc === CC_QUOTATION_MARK || cc === CC_APOSTROPHE) { - pos++; - const contentStart = pos; - pos = _consumeString(input, pos, cc); - const contentEnd = pos - 1; - cc = input.charCodeAt(pos); - while (_isWhiteSpace(cc)) { - pos++; - if (pos === input.length) return pos; - cc = input.charCodeAt(pos); + if (callbacks.function !== undefined) { + return callbacks.function(input, start, nextPos); } - if (cc !== CC_RIGHT_PARENTHESIS) return pos; - pos++; - if (callbacks.url !== undefined) - return callbacks.url(input, start, pos, contentStart, contentEnd); - return pos; + return nextPos; } else { const contentStart = pos; + /** @type {number} */ let contentEnd; for (;;) { - if (cc === CC_BACK_SLASH) { + if (cc === CC_REVERSE_SOLIDUS) { pos++; if (pos === input.length) return pos; pos++; @@ -104444,7 +108014,7 @@ const consumePotentialPseudo = (input, pos, callbacks) => { pos++; if (!callbacks.isSelector(input, pos) || !_startsIdentifier(input, pos)) return pos; - pos = _consumeIdentifier(input, pos); + pos = _consumeIdentifier(input, pos, callbacks); let cc = input.charCodeAt(pos); if (cc === CC_LEFT_PARENTHESIS) { pos++; @@ -104513,10 +108083,11 @@ const consumeComma = (input, pos, callbacks) => { return pos; }; +/** @type {CharHandler} */ const _consumeIdentifier = (input, pos) => { for (;;) { const cc = input.charCodeAt(pos); - if (cc === CC_BACK_SLASH) { + if (cc === CC_REVERSE_SOLIDUS) { pos++; if (pos === input.length) return pos; pos++; @@ -104532,6 +108103,7 @@ const _consumeIdentifier = (input, pos) => { } }; +/** @type {CharHandler} */ const _consumeNumber = (input, pos) => { pos++; if (pos === input.length) return pos; @@ -104596,7 +108168,7 @@ const consumeAt = (input, pos, callbacks) => { pos++; if (pos === input.length) return pos; if (_startsIdentifier(input, pos)) { - pos = _consumeIdentifier(input, pos); + pos = _consumeIdentifier(input, pos, callbacks); if (callbacks.atKeyword !== undefined) { pos = callbacks.atKeyword(input, start, pos); } @@ -104604,64 +108176,102 @@ const consumeAt = (input, pos, callbacks) => { return pos; }; +/** @type {CharHandler} */ +const consumeReverseSolidus = (input, pos, callbacks) => { + const start = pos; + pos++; + if (pos === input.length) return pos; + // If the input stream starts with a valid escape, reconsume the current input code point, consume an ident-like token, and return it. + if ( + _isTwoCodePointsAreValidEscape( + input.charCodeAt(start), + input.charCodeAt(pos) + ) + ) { + return consumeOtherIdentifier(input, pos - 1, callbacks); + } + // Otherwise, this is a parse error. Return a with its value set to the current input code point. + return pos; +}; + const CHAR_MAP = Array.from({ length: 0x80 }, (_, cc) => { // https://drafts.csswg.org/css-syntax/#consume-token switch (cc) { + // whitespace case CC_LINE_FEED: case CC_CARRIAGE_RETURN: case CC_FORM_FEED: case CC_TAB: case CC_SPACE: return consumeSpace; + // U+0022 QUOTATION MARK (") case CC_QUOTATION_MARK: - case CC_APOSTROPHE: return consumeString(cc); + // U+0023 NUMBER SIGN (#) case CC_NUMBER_SIGN: return consumeNumberSign; - case CC_SLASH: - return consumePotentialComment; - // case CC_LEFT_SQUARE: - // case CC_RIGHT_SQUARE: - // case CC_COMMA: - // case CC_COLON: - // return consumeSingleCharToken; - case CC_COMMA: - return consumeComma; - case CC_SEMICOLON: - return consumeSemicolon; + // U+0027 APOSTROPHE (') + case CC_APOSTROPHE: + return consumeString(cc); + // U+0028 LEFT PARENTHESIS (() case CC_LEFT_PARENTHESIS: return consumeLeftParenthesis; + // U+0029 RIGHT PARENTHESIS ()) case CC_RIGHT_PARENTHESIS: return consumeRightParenthesis; - case CC_LEFT_CURLY: - return consumeLeftCurlyBracket; - case CC_RIGHT_CURLY: - return consumeRightCurlyBracket; - case CC_COLON: - return consumePotentialPseudo; + // U+002B PLUS SIGN (+) case CC_PLUS_SIGN: return consumeNumericToken; - case CC_FULL_STOP: - return consumeDot; + // U+002C COMMA (,) + case CC_COMMA: + return consumeComma; + // U+002D HYPHEN-MINUS (-) case CC_HYPHEN_MINUS: return consumeMinus; + // U+002E FULL STOP (.) + case CC_FULL_STOP: + return consumeDot; + // U+003A COLON (:) + case CC_COLON: + return consumePotentialPseudo; + // U+003B SEMICOLON (;) + case CC_SEMICOLON: + return consumeSemicolon; + // U+003C LESS-THAN SIGN (<) case CC_LESS_THAN_SIGN: return consumeLessThan; + // U+0040 COMMERCIAL AT (@) case CC_AT_SIGN: return consumeAt; + // U+005B LEFT SQUARE BRACKET ([) + case CC_LEFT_SQUARE: + return consumeDelimToken; + // U+005C REVERSE SOLIDUS (\) + case CC_REVERSE_SOLIDUS: + return consumeReverseSolidus; + // U+005D RIGHT SQUARE BRACKET (]) + case CC_RIGHT_SQUARE: + return consumeDelimToken; + // U+007B LEFT CURLY BRACKET ({) + case CC_LEFT_CURLY: + return consumeLeftCurlyBracket; + // U+007D RIGHT CURLY BRACKET (}) + case CC_RIGHT_CURLY: + return consumeRightCurlyBracket; + // Optimization case CC_LOWER_U: + case CC_UPPER_U: return consumePotentialUrl; - case CC_LOW_LINE: - return consumeOtherIdentifier; default: + // digit if (_isDigit(cc)) return consumeNumericToken; - if ( - (cc >= CC_LOWER_A && cc <= CC_LOWER_Z) || - (cc >= CC_UPPER_A && cc <= CC_UPPER_Z) - ) { + // ident-start code point + if (isIdentStartCodePoint(cc)) { return consumeOtherIdentifier; } - return consumeSingleCharToken; + // EOF, but we don't have it + // anything else + return consumeDelimToken; } }); @@ -104671,9 +108281,15 @@ const CHAR_MAP = Array.from({ length: 0x80 }, (_, cc) => { * @returns {void} */ module.exports = (input, callbacks) => { + // This section describes how to consume a token from a stream of code points. It will return a single token of any type. let pos = 0; while (pos < input.length) { + // Consume comments. + pos = consumeComments(input, pos, callbacks); + const cc = input.charCodeAt(pos); + + // Consume the next input code point. if (cc < 0x80) { pos = CHAR_MAP[cc](input, pos, callbacks); } else { @@ -104682,67 +108298,84 @@ module.exports = (input, callbacks) => { } }; +module.exports.isIdentStartCodePoint = isIdentStartCodePoint; + +/** + * @param {string} input input + * @param {number} pos position + * @returns {number} position after comments + */ module.exports.eatComments = (input, pos) => { - loop: for (;;) { - const cc = input.charCodeAt(pos); - if (cc === CC_SLASH) { - if (pos === input.length) return pos; - let cc = input.charCodeAt(pos + 1); - if (cc !== CC_ASTERISK) return pos; - pos++; - for (;;) { - pos++; - if (pos === input.length) return pos; - cc = input.charCodeAt(pos); - while (cc === CC_ASTERISK) { - pos++; - if (pos === input.length) return pos; - cc = input.charCodeAt(pos); - if (cc === CC_SLASH) { - pos++; - continue loop; - } - } - } + for (;;) { + let originalPos = pos; + pos = consumeComments(input, pos, {}); + if (originalPos === pos) { + break; } - return pos; } + + return pos; +}; + +/** + * @param {string} input input + * @param {number} pos position + * @returns {number} position after whitespace + */ +module.exports.eatWhitespace = (input, pos) => { + while (_isWhiteSpace(input.charCodeAt(pos))) { + pos++; + } + + return pos; }; +/** + * @param {string} input input + * @param {number} pos position + * @returns {number} position after whitespace and comments + */ module.exports.eatWhitespaceAndComments = (input, pos) => { - loop: for (;;) { - const cc = input.charCodeAt(pos); - if (cc === CC_SLASH) { - if (pos === input.length) return pos; - let cc = input.charCodeAt(pos + 1); - if (cc !== CC_ASTERISK) return pos; + for (;;) { + let originalPos = pos; + pos = consumeComments(input, pos, {}); + while (_isWhiteSpace(input.charCodeAt(pos))) { pos++; - for (;;) { - pos++; - if (pos === input.length) return pos; - cc = input.charCodeAt(pos); - while (cc === CC_ASTERISK) { - pos++; - if (pos === input.length) return pos; - cc = input.charCodeAt(pos); - if (cc === CC_SLASH) { - pos++; - continue loop; - } - } - } - } else if (_isWhiteSpace(cc)) { + } + if (originalPos === pos) { + break; + } + } + + return pos; +}; + +/** + * @param {string} input input + * @param {number} pos position + * @returns {number} position after whitespace + */ +module.exports.eatWhiteLine = (input, pos) => { + for (;;) { + const cc = input.charCodeAt(pos); + if (_isSpace(cc)) { pos++; continue; } - return pos; + if (_isNewLine(cc)) pos++; + // For `\r\n` + if (cc === CC_CARRIAGE_RETURN && input.charCodeAt(pos + 1) === CC_LINE_FEED) + pos++; + break; } + + return pos; }; /***/ }), -/***/ 93359: +/***/ 46731: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -104753,15 +108386,24 @@ module.exports.eatWhitespaceAndComments = (input, pos) => { const { Tracer } = __webpack_require__(16361); -const createSchemaValidation = __webpack_require__(94091); -const { dirname, mkdirpSync } = __webpack_require__(33139); +const { + JAVASCRIPT_MODULE_TYPE_AUTO, + JAVASCRIPT_MODULE_TYPE_DYNAMIC, + JAVASCRIPT_MODULE_TYPE_ESM, + WEBASSEMBLY_MODULE_TYPE_ASYNC, + WEBASSEMBLY_MODULE_TYPE_SYNC, + JSON_MODULE_TYPE +} = __webpack_require__(92891); +const createSchemaValidation = __webpack_require__(45488); +const { dirname, mkdirpSync } = __webpack_require__(96220); /** @typedef {import("../../declarations/plugins/debug/ProfilingPlugin").ProfilingPluginOptions} ProfilingPluginOptions */ +/** @typedef {import("../Compiler")} Compiler */ /** @typedef {import("../util/fs").IntermediateFileSystem} IntermediateFileSystem */ const validate = createSchemaValidation( - __webpack_require__(92398), - () => __webpack_require__(34399), + __webpack_require__(70429), + () => __webpack_require__(88962), { name: "Profiling Plugin", baseDataPath: "options" @@ -104812,6 +108454,11 @@ class Profiler { ]); } + /** + * @param {string} method method name + * @param {object} [params] params + * @returns {Promise} Promise for the result + */ sendCommand(method, params) { if (this.hasSession()) { return new Promise((res, rej) => { @@ -104840,6 +108487,8 @@ class Profiler { return this.sendCommand("Profiler.stop").then(({ profile }) => { const hrtime = process.hrtime(); const endTime = hrtime[0] * 1000000 + Math.round(hrtime[1] / 1000); + // Avoid coverage problems due indirect changes + /* istanbul ignore next */ if (profile.startTime < this._startTime || profile.endTime > endTime) { // In some cases timestamps mismatch and we need to adjust them // Both process.hrtime and the inspector timestamps claim to be relative @@ -104930,7 +108579,7 @@ const createTrace = (fs, outputPath) => { }; }; -const pluginName = "ProfilingPlugin"; +const PLUGIN_NAME = "ProfilingPlugin"; class ProfilingPlugin { /** @@ -104941,6 +108590,11 @@ class ProfilingPlugin { this.outputPath = options.outputPath || "events.json"; } + /** + * Apply the plugin + * @param {Compiler} compiler the compiler instance + * @returns {void} + */ apply(compiler) { const tracer = createTrace( compiler.intermediateFileSystem, @@ -104964,7 +108618,7 @@ class ProfilingPlugin { }); compiler.hooks.compilation.tap( - pluginName, + PLUGIN_NAME, (compilation, { normalModuleFactory, contextModuleFactory }) => { interceptAllHooksFor(compilation, tracer, "Compilation"); interceptAllHooksFor( @@ -104985,7 +108639,7 @@ class ProfilingPlugin { // We need to write out the CPU profile when we are all done. compiler.hooks.done.tapAsync( { - name: pluginName, + name: PLUGIN_NAME, stage: Infinity }, (stats, callback) => { @@ -105060,18 +108714,18 @@ const interceptAllHooksFor = (instance, tracer, logLabel) => { const interceptAllParserHooks = (moduleFactory, tracer) => { const moduleTypes = [ - "javascript/auto", - "javascript/dynamic", - "javascript/esm", - "json", - "webassembly/async", - "webassembly/sync" + JAVASCRIPT_MODULE_TYPE_AUTO, + JAVASCRIPT_MODULE_TYPE_DYNAMIC, + JAVASCRIPT_MODULE_TYPE_ESM, + JSON_MODULE_TYPE, + WEBASSEMBLY_MODULE_TYPE_ASYNC, + WEBASSEMBLY_MODULE_TYPE_SYNC ]; moduleTypes.forEach(moduleType => { moduleFactory.hooks.parser .for(moduleType) - .tap("ProfilingPlugin", (parser, parserOpts) => { + .tap(PLUGIN_NAME, (parser, parserOpts) => { interceptAllHooksFor(parser, tracer, "Parser"); }); }); @@ -105081,7 +108735,7 @@ const interceptAllJavascriptModulesPluginHooks = (compilation, tracer) => { interceptAllHooksFor( { hooks: - (__webpack_require__(96230).getCompilationHooks)( + (__webpack_require__(70061).getCompilationHooks)( compilation ) }, @@ -105095,7 +108749,7 @@ const makeInterceptorFor = (instance, tracer) => hookName => ({ const { name, type, fn } = tapInfo; const newFn = // Don't tap our own hooks to ensure stream can close cleanly - name === pluginName + name === PLUGIN_NAME ? fn : makeNewProfiledTapFn(hookName, tracer, { name, @@ -105166,7 +108820,7 @@ const makeNewProfiledTapFn = (hookName, tracer, { name, type, fn }) => { const id = ++tracer.counter; // Do not instrument ourself due to the CPU // profile needing to be the last event in the trace. - if (name === pluginName) { + if (name === PLUGIN_NAME) { return fn(...args); } @@ -105204,7 +108858,7 @@ module.exports.Profiler = Profiler; /***/ }), -/***/ 12083: +/***/ 43955: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -105215,19 +108869,22 @@ module.exports.Profiler = Profiler; -const RuntimeGlobals = __webpack_require__(34623); -const makeSerializable = __webpack_require__(23827); -const NullDependency = __webpack_require__(74263); +const RuntimeGlobals = __webpack_require__(61539); +const makeSerializable = __webpack_require__(83626); +const NullDependency = __webpack_require__(87568); /** @typedef {import("webpack-sources").ReplaceSource} ReplaceSource */ /** @typedef {import("../Dependency")} Dependency */ /** @typedef {import("../DependencyTemplate").DependencyTemplateContext} DependencyTemplateContext */ +/** @typedef {import("../javascript/JavascriptParser").Range} Range */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */ /** @type {Record} */ const DEFINITIONS = { f: { definition: "var __WEBPACK_AMD_DEFINE_RESULT__;", - content: `!(__WEBPACK_AMD_DEFINE_RESULT__ = (#).call(exports, __webpack_require__, exports, module), + content: `!(__WEBPACK_AMD_DEFINE_RESULT__ = (#).call(exports, ${RuntimeGlobals.require}, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__))`, requests: [ RuntimeGlobals.require, @@ -105245,7 +108902,7 @@ const DEFINITIONS = { "var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;", content: `!(__WEBPACK_AMD_DEFINE_FACTORY__ = (#), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) : + (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, ${RuntimeGlobals.require}, exports, module)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__))`, requests: [ @@ -105277,8 +108934,7 @@ const DEFINITIONS = { }, lf: { definition: "var XXX, XXXmodule;", - content: - "!(XXXmodule = { id: YYY, exports: {}, loaded: false }, XXX = (#).call(XXXmodule.exports, __webpack_require__, XXXmodule.exports, XXXmodule), XXXmodule.loaded = true, XXX === undefined && (XXX = XXXmodule.exports))", + content: `!(XXXmodule = { id: YYY, exports: {}, loaded: false }, XXX = (#).call(XXXmodule.exports, ${RuntimeGlobals.require}, XXXmodule.exports, XXXmodule), XXXmodule.loaded = true, XXX === undefined && (XXX = XXXmodule.exports))`, requests: [RuntimeGlobals.require, RuntimeGlobals.module] }, lo: { @@ -105288,8 +108944,7 @@ const DEFINITIONS = { }, lof: { definition: "var XXX, XXXfactory, XXXmodule;", - content: - "!(XXXfactory = (#), (typeof XXXfactory === 'function' ? ((XXXmodule = { id: YYY, exports: {}, loaded: false }), (XXX = XXXfactory.call(XXXmodule.exports, __webpack_require__, XXXmodule.exports, XXXmodule)), (XXXmodule.loaded = true), XXX === undefined && (XXX = XXXmodule.exports)) : XXX = XXXfactory))", + content: `!(XXXfactory = (#), (typeof XXXfactory === 'function' ? ((XXXmodule = { id: YYY, exports: {}, loaded: false }), (XXX = XXXfactory.call(XXXmodule.exports, ${RuntimeGlobals.require}, XXXmodule.exports, XXXmodule)), (XXXmodule.loaded = true), XXX === undefined && (XXX = XXXmodule.exports)) : XXX = XXXfactory))`, requests: [RuntimeGlobals.require, RuntimeGlobals.module] }, laf: { @@ -105315,6 +108970,13 @@ const DEFINITIONS = { }; class AMDDefineDependency extends NullDependency { + /** + * @param {Range} range range + * @param {Range} arrayRange array range + * @param {Range} functionRange function range + * @param {Range} objectRange object range + * @param {boolean} namedModule true, when define is called with a name + */ constructor(range, arrayRange, functionRange, objectRange, namedModule) { super(); this.range = range; @@ -105329,6 +108991,9 @@ class AMDDefineDependency extends NullDependency { return "amd define"; } + /** + * @param {ObjectSerializerContext} context context + */ serialize(context) { const { write } = context; write(this.range); @@ -105340,6 +109005,9 @@ class AMDDefineDependency extends NullDependency { super.serialize(context); } + /** + * @param {ObjectDeserializerContext} context context + */ deserialize(context) { const { read } = context; this.range = read(); @@ -105376,6 +109044,10 @@ AMDDefineDependency.Template = class AMDDefineDependencyTemplate extends ( this.replace(dep, source, definition, content); } + /** + * @param {AMDDefineDependency} dependency dependency + * @returns {string} variable name + */ localModuleVar(dependency) { return ( dependency.localModule && @@ -105384,6 +109056,10 @@ AMDDefineDependency.Template = class AMDDefineDependencyTemplate extends ( ); } + /** + * @param {AMDDefineDependency} dependency dependency + * @returns {string} branch + */ branch(dependency) { const localModuleVar = this.localModuleVar(dependency) ? "l" : ""; const arrayRange = dependency.arrayRange ? "a" : ""; @@ -105392,6 +109068,12 @@ AMDDefineDependency.Template = class AMDDefineDependencyTemplate extends ( return localModuleVar + arrayRange + objectRange + functionRange; } + /** + * @param {AMDDefineDependency} dependency dependency + * @param {ReplaceSource} source source + * @param {string} definition definition + * @param {string} text text + */ replace(dependency, source, definition, text) { const localModuleVar = this.localModuleVar(dependency); if (localModuleVar) { @@ -105412,18 +109094,34 @@ AMDDefineDependency.Template = class AMDDefineDependencyTemplate extends ( let current = dependency.range[0]; if (dependency.arrayRange) { - source.replace(current, dependency.arrayRange[0] - 1, texts.shift()); + source.replace( + current, + dependency.arrayRange[0] - 1, + /** @type {string} */ (texts.shift()) + ); current = dependency.arrayRange[1]; } if (dependency.objectRange) { - source.replace(current, dependency.objectRange[0] - 1, texts.shift()); + source.replace( + current, + dependency.objectRange[0] - 1, + /** @type {string} */ (texts.shift()) + ); current = dependency.objectRange[1]; } else if (dependency.functionRange) { - source.replace(current, dependency.functionRange[0] - 1, texts.shift()); + source.replace( + current, + dependency.functionRange[0] - 1, + /** @type {string} */ (texts.shift()) + ); current = dependency.functionRange[1]; } - source.replace(current, dependency.range[1] - 1, texts.shift()); + source.replace( + current, + dependency.range[1] - 1, + /** @type {string} */ (texts.shift()) + ); if (texts.length > 0) throw new Error("Implementation error"); } }; @@ -105433,7 +109131,7 @@ module.exports = AMDDefineDependency; /***/ }), -/***/ 11224: +/***/ 916: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -105444,17 +109142,24 @@ module.exports = AMDDefineDependency; -const RuntimeGlobals = __webpack_require__(34623); -const AMDDefineDependency = __webpack_require__(12083); -const AMDRequireArrayDependency = __webpack_require__(56714); -const AMDRequireContextDependency = __webpack_require__(40198); -const AMDRequireItemDependency = __webpack_require__(35105); -const ConstDependency = __webpack_require__(78284); -const ContextDependencyHelpers = __webpack_require__(84555); -const DynamicExports = __webpack_require__(51930); -const LocalModuleDependency = __webpack_require__(86333); -const { addLocalModule, getLocalModule } = __webpack_require__(96183); +const RuntimeGlobals = __webpack_require__(61539); +const AMDDefineDependency = __webpack_require__(43955); +const AMDRequireArrayDependency = __webpack_require__(61339); +const AMDRequireContextDependency = __webpack_require__(6199); +const AMDRequireItemDependency = __webpack_require__(99905); +const ConstDependency = __webpack_require__(67538); +const ContextDependencyHelpers = __webpack_require__(61200); +const DynamicExports = __webpack_require__(24974); +const LocalModuleDependency = __webpack_require__(32637); +const { addLocalModule, getLocalModule } = __webpack_require__(62693); + +/** @typedef {import("estree").CallExpression} CallExpression */ +/** @typedef {import("../javascript/JavascriptParser")} JavascriptParser */ +/** + * @param {CallExpression} expr expression + * @returns {boolean} true if it's a bound function expression + */ const isBoundFunctionExpression = expr => { if (expr.type !== "CallExpression") return false; if (expr.callee.type !== "MemberExpression") return false; @@ -105482,6 +109187,10 @@ class AMDDefineDependencyParserPlugin { this.options = options; } + /** + * @param {JavascriptParser} parser the parser + * @returns {void} + */ apply(parser) { parser.hooks.call .for("define") @@ -105512,7 +109221,7 @@ class AMDDefineDependencyParserPlugin { let localModule; if (request === "require") { identifiers[idx] = request; - dep = "__webpack_require__"; + dep = RuntimeGlobals.require; } else if (["exports", "module"].includes(request)) { identifiers[idx] = request; dep = request; @@ -105548,7 +109257,7 @@ class AMDDefineDependencyParserPlugin { } else if (param.isString()) { let dep, localModule; if (param.string === "require") { - dep = new ConstDependency("__webpack_require__", param.range, [ + dep = new ConstDependency(RuntimeGlobals.require, param.range, [ RuntimeGlobals.require ]); } else if (param.string === "exports") { @@ -105795,7 +109504,7 @@ module.exports = AMDDefineDependencyParserPlugin; /***/ }), -/***/ 77549: +/***/ 12340: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -105806,31 +109515,39 @@ module.exports = AMDDefineDependencyParserPlugin; -const RuntimeGlobals = __webpack_require__(34623); +const { + JAVASCRIPT_MODULE_TYPE_AUTO, + JAVASCRIPT_MODULE_TYPE_DYNAMIC +} = __webpack_require__(92891); +const RuntimeGlobals = __webpack_require__(61539); const { approve, evaluateToIdentifier, evaluateToString, toConstantDependency -} = __webpack_require__(645); - -const AMDDefineDependency = __webpack_require__(12083); -const AMDDefineDependencyParserPlugin = __webpack_require__(11224); -const AMDRequireArrayDependency = __webpack_require__(56714); -const AMDRequireContextDependency = __webpack_require__(40198); -const AMDRequireDependenciesBlockParserPlugin = __webpack_require__(91069); -const AMDRequireDependency = __webpack_require__(91281); -const AMDRequireItemDependency = __webpack_require__(35105); +} = __webpack_require__(94213); + +const AMDDefineDependency = __webpack_require__(43955); +const AMDDefineDependencyParserPlugin = __webpack_require__(916); +const AMDRequireArrayDependency = __webpack_require__(61339); +const AMDRequireContextDependency = __webpack_require__(6199); +const AMDRequireDependenciesBlockParserPlugin = __webpack_require__(47838); +const AMDRequireDependency = __webpack_require__(77178); +const AMDRequireItemDependency = __webpack_require__(99905); const { AMDDefineRuntimeModule, AMDOptionsRuntimeModule -} = __webpack_require__(45897); -const ConstDependency = __webpack_require__(78284); -const LocalModuleDependency = __webpack_require__(86333); -const UnsupportedDependency = __webpack_require__(72557); +} = __webpack_require__(34792); +const ConstDependency = __webpack_require__(67538); +const LocalModuleDependency = __webpack_require__(32637); +const UnsupportedDependency = __webpack_require__(93761); +/** @typedef {import("../../declarations/WebpackOptions").JavascriptParserOptions} JavascriptParserOptions */ /** @typedef {import("../../declarations/WebpackOptions").ModuleOptionsNormalized} ModuleOptions */ /** @typedef {import("../Compiler")} Compiler */ +/** @typedef {import("../javascript/JavascriptParser")} Parser */ + +const PLUGIN_NAME = "AMDPlugin"; class AMDPlugin { /** @@ -105848,7 +109565,7 @@ class AMDPlugin { apply(compiler) { const amdOptions = this.amdOptions; compiler.hooks.compilation.tap( - "AMDPlugin", + PLUGIN_NAME, (compilation, { contextModuleFactory, normalModuleFactory }) => { compilation.dependencyTemplates.set( AMDRequireDependency, @@ -105895,31 +109612,36 @@ class AMDPlugin { compilation.hooks.runtimeRequirementInModule .for(RuntimeGlobals.amdDefine) - .tap("AMDPlugin", (module, set) => { + .tap(PLUGIN_NAME, (module, set) => { set.add(RuntimeGlobals.require); }); compilation.hooks.runtimeRequirementInModule .for(RuntimeGlobals.amdOptions) - .tap("AMDPlugin", (module, set) => { + .tap(PLUGIN_NAME, (module, set) => { set.add(RuntimeGlobals.requireScope); }); compilation.hooks.runtimeRequirementInTree .for(RuntimeGlobals.amdDefine) - .tap("AMDPlugin", (chunk, set) => { + .tap(PLUGIN_NAME, (chunk, set) => { compilation.addRuntimeModule(chunk, new AMDDefineRuntimeModule()); }); compilation.hooks.runtimeRequirementInTree .for(RuntimeGlobals.amdOptions) - .tap("AMDPlugin", (chunk, set) => { + .tap(PLUGIN_NAME, (chunk, set) => { compilation.addRuntimeModule( chunk, new AMDOptionsRuntimeModule(amdOptions) ); }); + /** + * @param {Parser} parser parser parser + * @param {JavascriptParserOptions} parserOptions parserOptions + * @returns {void} + */ const handler = (parser, parserOptions) => { if (parserOptions.amd !== undefined && !parserOptions.amd) return; @@ -105927,7 +109649,7 @@ class AMDPlugin { parser.hooks.expression .for(optionExpr) .tap( - "AMDPlugin", + PLUGIN_NAME, toConstantDependency(parser, RuntimeGlobals.amdOptions, [ RuntimeGlobals.amdOptions ]) @@ -105935,16 +109657,16 @@ class AMDPlugin { parser.hooks.evaluateIdentifier .for(optionExpr) .tap( - "AMDPlugin", + PLUGIN_NAME, evaluateToIdentifier(optionExpr, rootName, getMembers, true) ); parser.hooks.evaluateTypeof .for(optionExpr) - .tap("AMDPlugin", evaluateToString("object")); + .tap(PLUGIN_NAME, evaluateToString("object")); parser.hooks.typeof .for(optionExpr) .tap( - "AMDPlugin", + PLUGIN_NAME, toConstantDependency(parser, JSON.stringify("object")) ); }; @@ -105962,7 +109684,7 @@ class AMDPlugin { () => [] ); - parser.hooks.expression.for("define").tap("AMDPlugin", expr => { + parser.hooks.expression.for("define").tap(PLUGIN_NAME, expr => { const dep = new ConstDependency( RuntimeGlobals.amdDefine, expr.range, @@ -105975,14 +109697,14 @@ class AMDPlugin { parser.hooks.typeof .for("define") .tap( - "AMDPlugin", + PLUGIN_NAME, toConstantDependency(parser, JSON.stringify("function")) ); parser.hooks.evaluateTypeof .for("define") - .tap("AMDPlugin", evaluateToString("function")); - parser.hooks.canRename.for("define").tap("AMDPlugin", approve); - parser.hooks.rename.for("define").tap("AMDPlugin", expr => { + .tap(PLUGIN_NAME, evaluateToString("function")); + parser.hooks.canRename.for("define").tap(PLUGIN_NAME, approve); + parser.hooks.rename.for("define").tap(PLUGIN_NAME, expr => { const dep = new ConstDependency( RuntimeGlobals.amdDefine, expr.range, @@ -105995,20 +109717,20 @@ class AMDPlugin { parser.hooks.typeof .for("require") .tap( - "AMDPlugin", + PLUGIN_NAME, toConstantDependency(parser, JSON.stringify("function")) ); parser.hooks.evaluateTypeof .for("require") - .tap("AMDPlugin", evaluateToString("function")); + .tap(PLUGIN_NAME, evaluateToString("function")); }; normalModuleFactory.hooks.parser - .for("javascript/auto") - .tap("AMDPlugin", handler); + .for(JAVASCRIPT_MODULE_TYPE_AUTO) + .tap(PLUGIN_NAME, handler); normalModuleFactory.hooks.parser - .for("javascript/dynamic") - .tap("AMDPlugin", handler); + .for(JAVASCRIPT_MODULE_TYPE_DYNAMIC) + .tap(PLUGIN_NAME, handler); } ); } @@ -106019,7 +109741,7 @@ module.exports = AMDPlugin; /***/ }), -/***/ 56714: +/***/ 61339: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -106030,15 +109752,22 @@ module.exports = AMDPlugin; -const DependencyTemplate = __webpack_require__(26472); -const makeSerializable = __webpack_require__(23827); -const NullDependency = __webpack_require__(74263); +const DependencyTemplate = __webpack_require__(17043); +const makeSerializable = __webpack_require__(83626); +const NullDependency = __webpack_require__(87568); /** @typedef {import("webpack-sources").ReplaceSource} ReplaceSource */ /** @typedef {import("../Dependency")} Dependency */ /** @typedef {import("../DependencyTemplate").DependencyTemplateContext} DependencyTemplateContext */ +/** @typedef {import("../javascript/JavascriptParser").Range} Range */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */ class AMDRequireArrayDependency extends NullDependency { + /** + * @param {TODO} depsArray deps array + * @param {Range} range range + */ constructor(depsArray, range) { super(); @@ -106054,6 +109783,9 @@ class AMDRequireArrayDependency extends NullDependency { return "amd"; } + /** + * @param {ObjectSerializerContext} context context + */ serialize(context) { const { write } = context; @@ -106063,6 +109795,9 @@ class AMDRequireArrayDependency extends NullDependency { super.serialize(context); } + /** + * @param {ObjectDeserializerContext} context context + */ deserialize(context) { const { read } = context; @@ -106126,7 +109861,7 @@ module.exports = AMDRequireArrayDependency; /***/ }), -/***/ 40198: +/***/ 6199: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -106137,10 +109872,19 @@ module.exports = AMDRequireArrayDependency; -const makeSerializable = __webpack_require__(23827); -const ContextDependency = __webpack_require__(45899); +const makeSerializable = __webpack_require__(83626); +const ContextDependency = __webpack_require__(64946); + +/** @typedef {import("../javascript/JavascriptParser").Range} Range */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */ class AMDRequireContextDependency extends ContextDependency { + /** + * @param {TODO} options options + * @param {Range} range range + * @param {Range} valueRange value range + */ constructor(options, range, valueRange) { super(options); @@ -106156,6 +109900,9 @@ class AMDRequireContextDependency extends ContextDependency { return "amd"; } + /** + * @param {ObjectSerializerContext} context context + */ serialize(context) { const { write } = context; @@ -106165,6 +109912,9 @@ class AMDRequireContextDependency extends ContextDependency { super.serialize(context); } + /** + * @param {ObjectDeserializerContext} context context + */ deserialize(context) { const { read } = context; @@ -106180,14 +109930,14 @@ makeSerializable( "webpack/lib/dependencies/AMDRequireContextDependency" ); -AMDRequireContextDependency.Template = __webpack_require__(19113); +AMDRequireContextDependency.Template = __webpack_require__(82305); module.exports = AMDRequireContextDependency; /***/ }), -/***/ 97032: +/***/ 74287: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -106198,10 +109948,16 @@ module.exports = AMDRequireContextDependency; -const AsyncDependenciesBlock = __webpack_require__(54823); -const makeSerializable = __webpack_require__(23827); +const AsyncDependenciesBlock = __webpack_require__(27973); +const makeSerializable = __webpack_require__(83626); + +/** @typedef {import("../Dependency").DependencyLocation} DependencyLocation */ class AMDRequireDependenciesBlock extends AsyncDependenciesBlock { + /** + * @param {DependencyLocation} loc location info + * @param {string=} request request + */ constructor(loc, request) { super(null, loc, request); } @@ -106217,7 +109973,7 @@ module.exports = AMDRequireDependenciesBlock; /***/ }), -/***/ 91069: +/***/ 47838: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -106228,19 +109984,21 @@ module.exports = AMDRequireDependenciesBlock; -const RuntimeGlobals = __webpack_require__(34623); -const UnsupportedFeatureWarning = __webpack_require__(19290); -const AMDRequireArrayDependency = __webpack_require__(56714); -const AMDRequireContextDependency = __webpack_require__(40198); -const AMDRequireDependenciesBlock = __webpack_require__(97032); -const AMDRequireDependency = __webpack_require__(91281); -const AMDRequireItemDependency = __webpack_require__(35105); -const ConstDependency = __webpack_require__(78284); -const ContextDependencyHelpers = __webpack_require__(84555); -const LocalModuleDependency = __webpack_require__(86333); -const { getLocalModule } = __webpack_require__(96183); -const UnsupportedDependency = __webpack_require__(72557); -const getFunctionExpression = __webpack_require__(38781); +const RuntimeGlobals = __webpack_require__(61539); +const UnsupportedFeatureWarning = __webpack_require__(84099); +const AMDRequireArrayDependency = __webpack_require__(61339); +const AMDRequireContextDependency = __webpack_require__(6199); +const AMDRequireDependenciesBlock = __webpack_require__(74287); +const AMDRequireDependency = __webpack_require__(77178); +const AMDRequireItemDependency = __webpack_require__(99905); +const ConstDependency = __webpack_require__(67538); +const ContextDependencyHelpers = __webpack_require__(61200); +const LocalModuleDependency = __webpack_require__(32637); +const { getLocalModule } = __webpack_require__(62693); +const UnsupportedDependency = __webpack_require__(93761); +const getFunctionExpression = __webpack_require__(27345); + +/** @typedef {import("../javascript/JavascriptParser")} JavascriptParser */ class AMDRequireDependenciesBlockParserPlugin { constructor(options) { @@ -106273,6 +110031,10 @@ class AMDRequireDependenciesBlockParserPlugin { return bindThis; } + /** + * @param {JavascriptParser} parser the parser + * @returns {void} + */ apply(parser) { parser.hooks.call .for("require") @@ -106296,7 +110058,7 @@ class AMDRequireDependenciesBlockParserPlugin { for (const request of param.array) { let dep, localModule; if (request === "require") { - dep = "__webpack_require__"; + dep = RuntimeGlobals.require; } else if (["exports", "module"].includes(request)) { dep = request; } else if ((localModule = getLocalModule(parser.state, request))) { @@ -106331,7 +110093,7 @@ class AMDRequireDependenciesBlockParserPlugin { } else if (param.isString()) { let dep, localModule; if (param.string === "require") { - dep = new ConstDependency("__webpack_require__", param.string, [ + dep = new ConstDependency(RuntimeGlobals.require, param.string, [ RuntimeGlobals.require ]); } else if (param.string === "module") { @@ -106504,7 +110266,7 @@ module.exports = AMDRequireDependenciesBlockParserPlugin; /***/ }), -/***/ 91281: +/***/ 77178: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -106515,16 +110277,25 @@ module.exports = AMDRequireDependenciesBlockParserPlugin; -const RuntimeGlobals = __webpack_require__(34623); -const makeSerializable = __webpack_require__(23827); -const NullDependency = __webpack_require__(74263); +const RuntimeGlobals = __webpack_require__(61539); +const makeSerializable = __webpack_require__(83626); +const NullDependency = __webpack_require__(87568); /** @typedef {import("webpack-sources").ReplaceSource} ReplaceSource */ /** @typedef {import("../AsyncDependenciesBlock")} AsyncDependenciesBlock */ /** @typedef {import("../Dependency")} Dependency */ /** @typedef {import("../DependencyTemplate").DependencyTemplateContext} DependencyTemplateContext */ +/** @typedef {import("../javascript/JavascriptParser").Range} Range */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */ class AMDRequireDependency extends NullDependency { + /** + * @param {Range} outerRange outer range + * @param {Range} arrayRange array range + * @param {Range} functionRange function range + * @param {Range} errorCallbackRange error callback range + */ constructor(outerRange, arrayRange, functionRange, errorCallbackRange) { super(); @@ -106540,6 +110311,9 @@ class AMDRequireDependency extends NullDependency { return "amd"; } + /** + * @param {ObjectSerializerContext} context context + */ serialize(context) { const { write } = context; @@ -106553,6 +110327,9 @@ class AMDRequireDependency extends NullDependency { super.serialize(context); } + /** + * @param {ObjectDeserializerContext} context context + */ deserialize(context) { const { read } = context; @@ -106613,7 +110390,7 @@ AMDRequireDependency.Template = class AMDRequireDependencyTemplate extends ( // has function range but no array range if (dep.functionRange && !dep.arrayRange) { const startBlock = `${promise}.then((`; - const endBlock = `).bind(exports, __webpack_require__, exports, module))['catch'](${RuntimeGlobals.uncaughtErrorHandler})`; + const endBlock = `).bind(exports, ${RuntimeGlobals.require}, exports, module))['catch'](${RuntimeGlobals.uncaughtErrorHandler})`; runtimeRequirements.add(RuntimeGlobals.uncaughtErrorHandler); source.replace(dep.outerRange[0], dep.functionRange[0] - 1, startBlock); @@ -106686,7 +110463,7 @@ module.exports = AMDRequireDependency; /***/ }), -/***/ 35105: +/***/ 99905: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -106697,11 +110474,17 @@ module.exports = AMDRequireDependency; -const makeSerializable = __webpack_require__(23827); -const ModuleDependency = __webpack_require__(22994); -const ModuleDependencyTemplateAsRequireId = __webpack_require__(28144); +const makeSerializable = __webpack_require__(83626); +const ModuleDependency = __webpack_require__(10931); +const ModuleDependencyTemplateAsRequireId = __webpack_require__(9623); + +/** @typedef {import("../javascript/JavascriptParser").Range} Range */ class AMDRequireItemDependency extends ModuleDependency { + /** + * @param {string} request the request string + * @param {Range} range location in source code + */ constructor(request, range) { super(request); @@ -106729,7 +110512,7 @@ module.exports = AMDRequireItemDependency; /***/ }), -/***/ 45897: +/***/ 34792: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; @@ -106739,9 +110522,9 @@ module.exports = AMDRequireItemDependency; -const RuntimeGlobals = __webpack_require__(34623); -const RuntimeModule = __webpack_require__(81196); -const Template = __webpack_require__(88070); +const RuntimeGlobals = __webpack_require__(61539); +const RuntimeModule = __webpack_require__(21296); +const Template = __webpack_require__(88835); class AMDDefineRuntimeModule extends RuntimeModule { constructor() { @@ -106749,7 +110532,7 @@ class AMDDefineRuntimeModule extends RuntimeModule { } /** - * @returns {string} runtime code + * @returns {string | null} runtime code */ generate() { return Template.asString([ @@ -106770,7 +110553,7 @@ class AMDOptionsRuntimeModule extends RuntimeModule { } /** - * @returns {string} runtime code + * @returns {string | null} runtime code */ generate() { return Template.asString([ @@ -106785,7 +110568,7 @@ exports.AMDOptionsRuntimeModule = AMDOptionsRuntimeModule; /***/ }), -/***/ 12389: +/***/ 346: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -106796,10 +110579,10 @@ exports.AMDOptionsRuntimeModule = AMDOptionsRuntimeModule; -const DependencyTemplate = __webpack_require__(26472); -const InitFragment = __webpack_require__(53658); -const makeSerializable = __webpack_require__(23827); -const NullDependency = __webpack_require__(74263); +const DependencyTemplate = __webpack_require__(17043); +const InitFragment = __webpack_require__(44508); +const makeSerializable = __webpack_require__(83626); +const NullDependency = __webpack_require__(87568); /** @typedef {import("webpack-sources").ReplaceSource} ReplaceSource */ /** @typedef {import("../ChunkGraph")} ChunkGraph */ @@ -106809,9 +110592,17 @@ const NullDependency = __webpack_require__(74263); /** @typedef {import("../DependencyTemplates")} DependencyTemplates */ /** @typedef {import("../ModuleGraph")} ModuleGraph */ /** @typedef {import("../RuntimeTemplate")} RuntimeTemplate */ +/** @typedef {import("../javascript/JavascriptParser").Range} Range */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */ /** @typedef {import("../util/Hash")} Hash */ class CachedConstDependency extends NullDependency { + /** + * @param {string} expression expression + * @param {Range} range range + * @param {string} identifier identifier + */ constructor(expression, range, identifier) { super(); @@ -106833,6 +110624,9 @@ class CachedConstDependency extends NullDependency { hash.update(this._hashUpdate); } + /** + * @param {ObjectSerializerContext} context context + */ serialize(context) { const { write } = context; @@ -106843,6 +110637,9 @@ class CachedConstDependency extends NullDependency { super.serialize(context); } + /** + * @param {ObjectDeserializerContext} context context + */ deserialize(context) { const { read } = context; @@ -106899,7 +110696,7 @@ module.exports = CachedConstDependency; /***/ }), -/***/ 97888: +/***/ 42542: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; @@ -106910,8 +110707,17 @@ module.exports = CachedConstDependency; -const RuntimeGlobals = __webpack_require__(34623); +const RuntimeGlobals = __webpack_require__(61539); + +/** @typedef {import("../Module")} Module */ +/** @typedef {"exports" | "module.exports" | "this" | "Object.defineProperty(exports)" | "Object.defineProperty(module.exports)" | "Object.defineProperty(this)"} CommonJSDependencyBaseKeywords */ +/** + * @param {CommonJSDependencyBaseKeywords} depBase commonjs dependency base + * @param {Module} module module + * @param {Set} runtimeRequirements runtime requirements + * @returns {[string, string]} type and base + */ exports.handleDependencyBase = (depBase, module, runtimeRequirements) => { let base = undefined; let type; @@ -106956,7 +110762,7 @@ exports.handleDependencyBase = (depBase, module, runtimeRequirements) => { /***/ }), -/***/ 53204: +/***/ 65475: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -106967,15 +110773,15 @@ exports.handleDependencyBase = (depBase, module, runtimeRequirements) => { -const Dependency = __webpack_require__(68242); -const { UsageState } = __webpack_require__(1723); -const Template = __webpack_require__(88070); -const { equals } = __webpack_require__(91696); -const makeSerializable = __webpack_require__(23827); -const propertyAccess = __webpack_require__(92884); -const { handleDependencyBase } = __webpack_require__(97888); -const ModuleDependency = __webpack_require__(22994); -const processExportInfo = __webpack_require__(6822); +const Dependency = __webpack_require__(504); +const { UsageState } = __webpack_require__(14768); +const Template = __webpack_require__(88835); +const { equals } = __webpack_require__(22150); +const makeSerializable = __webpack_require__(83626); +const propertyAccess = __webpack_require__(60305); +const { handleDependencyBase } = __webpack_require__(42542); +const ModuleDependency = __webpack_require__(10931); +const processExportInfo = __webpack_require__(63152); /** @typedef {import("webpack-sources").ReplaceSource} ReplaceSource */ /** @typedef {import("../Dependency").ExportsSpec} ExportsSpec */ @@ -106984,13 +110790,26 @@ const processExportInfo = __webpack_require__(6822); /** @typedef {import("../DependencyTemplate").DependencyTemplateContext} DependencyTemplateContext */ /** @typedef {import("../Module")} Module */ /** @typedef {import("../ModuleGraph")} ModuleGraph */ +/** @typedef {import("../javascript/JavascriptParser").Range} Range */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */ /** @typedef {import("../util/runtime").RuntimeSpec} RuntimeSpec */ +/** @typedef {import("./CommonJsDependencyHelpers").CommonJSDependencyBaseKeywords} CommonJSDependencyBaseKeywords */ const idsSymbol = Symbol("CommonJsExportRequireDependency.ids"); const EMPTY_OBJECT = {}; class CommonJsExportRequireDependency extends ModuleDependency { + /** + * @param {Range} range range + * @param {Range} valueRange value range + * @param {CommonJSDependencyBaseKeywords} base base + * @param {string[]} names names + * @param {string} request request + * @param {string[]} ids ids + * @param {boolean} resultUsed true, when the result is used + */ constructor(range, valueRange, base, names, request, ids, resultUsed) { super(request); this.range = range; @@ -107232,6 +111051,9 @@ class CommonJsExportRequireDependency extends ModuleDependency { return { exports, checked }; } + /** + * @param {ObjectSerializerContext} context context + */ serialize(context) { const { write } = context; write(this.asiSafe); @@ -107244,6 +111066,9 @@ class CommonJsExportRequireDependency extends ModuleDependency { super.serialize(context); } + /** + * @param {ObjectDeserializerContext} context context + */ deserialize(context) { const { read } = context; this.asiSafe = read(); @@ -107338,7 +111163,7 @@ module.exports = CommonJsExportRequireDependency; /***/ }), -/***/ 50380: +/***/ 74544: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -107349,21 +111174,31 @@ module.exports = CommonJsExportRequireDependency; -const InitFragment = __webpack_require__(53658); -const makeSerializable = __webpack_require__(23827); -const propertyAccess = __webpack_require__(92884); -const { handleDependencyBase } = __webpack_require__(97888); -const NullDependency = __webpack_require__(74263); +const InitFragment = __webpack_require__(44508); +const makeSerializable = __webpack_require__(83626); +const propertyAccess = __webpack_require__(60305); +const { handleDependencyBase } = __webpack_require__(42542); +const NullDependency = __webpack_require__(87568); /** @typedef {import("webpack-sources").ReplaceSource} ReplaceSource */ /** @typedef {import("../Dependency")} Dependency */ /** @typedef {import("../Dependency").ExportsSpec} ExportsSpec */ /** @typedef {import("../DependencyTemplate").DependencyTemplateContext} DependencyTemplateContext */ /** @typedef {import("../ModuleGraph")} ModuleGraph */ +/** @typedef {import("../javascript/JavascriptParser").Range} Range */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */ +/** @typedef {import("./CommonJsDependencyHelpers").CommonJSDependencyBaseKeywords} CommonJSDependencyBaseKeywords */ const EMPTY_OBJECT = {}; class CommonJsExportsDependency extends NullDependency { + /** + * @param {Range} range range + * @param {Range} valueRange value range + * @param {CommonJSDependencyBaseKeywords} base base + * @param {string[]} names names + */ constructor(range, valueRange, base, names) { super(); this.range = range; @@ -107397,6 +111232,9 @@ class CommonJsExportsDependency extends NullDependency { }; } + /** + * @param {ObjectSerializerContext} context context + */ serialize(context) { const { write } = context; write(this.range); @@ -107406,6 +111244,9 @@ class CommonJsExportsDependency extends NullDependency { super.serialize(context); } + /** + * @param {ObjectDeserializerContext} context context + */ deserialize(context) { const { read } = context; this.range = read(); @@ -107506,7 +111347,7 @@ module.exports = CommonJsExportsDependency; /***/ }), -/***/ 93997: +/***/ 7358: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -107517,22 +111358,47 @@ module.exports = CommonJsExportsDependency; -const RuntimeGlobals = __webpack_require__(34623); -const formatLocation = __webpack_require__(49064); -const { evaluateToString } = __webpack_require__(645); -const propertyAccess = __webpack_require__(92884); -const CommonJsExportRequireDependency = __webpack_require__(53204); -const CommonJsExportsDependency = __webpack_require__(50380); -const CommonJsSelfReferenceDependency = __webpack_require__(53853); -const DynamicExports = __webpack_require__(51930); -const HarmonyExports = __webpack_require__(60035); -const ModuleDecoratorDependency = __webpack_require__(15086); +const RuntimeGlobals = __webpack_require__(61539); +const formatLocation = __webpack_require__(60246); +const { evaluateToString } = __webpack_require__(94213); +const propertyAccess = __webpack_require__(60305); +const CommonJsExportRequireDependency = __webpack_require__(65475); +const CommonJsExportsDependency = __webpack_require__(74544); +const CommonJsSelfReferenceDependency = __webpack_require__(86797); +const DynamicExports = __webpack_require__(24974); +const HarmonyExports = __webpack_require__(33080); +const ModuleDecoratorDependency = __webpack_require__(746); -/** @typedef {import("estree").Expression} ExpressionNode */ +/** @typedef {import("estree").AssignmentExpression} AssignmentExpression */ +/** @typedef {import("estree").CallExpression} CallExpression */ +/** @typedef {import("estree").Expression} Expression */ +/** @typedef {import("estree").Super} Super */ + +/** @typedef {import("../ModuleGraph")} ModuleGraph */ /** @typedef {import("../NormalModule")} NormalModule */ /** @typedef {import("../javascript/BasicEvaluatedExpression")} BasicEvaluatedExpression */ /** @typedef {import("../javascript/JavascriptParser")} JavascriptParser */ +/** @typedef {import("./CommonJsDependencyHelpers").CommonJSDependencyBaseKeywords} CommonJSDependencyBaseKeywords */ +/** + * This function takes a generic expression and detects whether it is an ObjectExpression. + * This is used in the context of parsing CommonJS exports to get the value of the property descriptor + * when the `exports` object is assigned to `Object.defineProperty`. + * + * In CommonJS modules, the `exports` object can be assigned to `Object.defineProperty` and therefore + * webpack has to detect this case and get the value key of the property descriptor. See the following example + * for more information: https://astexplorer.net/#/gist/83ce51a4e96e59d777df315a6d111da6/8058ead48a1bb53c097738225db0967ef7f70e57 + * + * This would be an example of a CommonJS module that exports an object with a property descriptor: + * ```js + * Object.defineProperty(exports, "__esModule", { value: true }); + * exports.foo = void 0; + * exports.foo = "bar"; + * ``` + * + * @param {TODO} expr expression + * @returns {Expression | undefined} returns the value of property descriptor + */ const getValueOfPropertyDescription = expr => { if (expr.type !== "ObjectExpression") return; for (const property of expr.properties) { @@ -107543,6 +111409,15 @@ const getValueOfPropertyDescription = expr => { } }; +/** + * The purpose of this function is to check whether an expression is a truthy literal or not. This is + * useful when parsing CommonJS exports, because CommonJS modules can export any value, including falsy + * values like `null` and `false`. However, exports should only be created if the exported value is truthy. + * + * @param {Expression} expr expression being checked + * @returns {boolean} true, when the expression is a truthy literal + * + */ const isTruthyLiteral = expr => { switch (expr.type) { case "Literal": @@ -107553,6 +111428,14 @@ const isTruthyLiteral = expr => { return false; }; +/** + * The purpose of this function is to check whether an expression is a falsy literal or not. This is + * useful when parsing CommonJS exports, because CommonJS modules can export any value, including falsy + * values like `null` and `false`. However, exports should only be created if the exported value is truthy. + * + * @param {Expression} expr expression being checked + * @returns {boolean} true, when the expression is a falsy literal + */ const isFalsyLiteral = expr => { switch (expr.type) { case "Literal": @@ -107565,7 +111448,7 @@ const isFalsyLiteral = expr => { /** * @param {JavascriptParser} parser the parser - * @param {ExpressionNode} expr expression + * @param {Expression} expr expression * @returns {{ argument: BasicEvaluatedExpression, ids: string[] } | undefined} parsed call */ const parseRequireCall = (parser, expr) => { @@ -107598,17 +111481,28 @@ const parseRequireCall = (parser, expr) => { }; class CommonJsExportsParserPlugin { + /** + * @param {ModuleGraph} moduleGraph module graph + */ constructor(moduleGraph) { this.moduleGraph = moduleGraph; } /** * @param {JavascriptParser} parser the parser + * @returns {void} */ apply(parser) { const enableStructuredExports = () => { DynamicExports.enable(parser.state); }; + + /** + * @param {boolean} topLevel true, when the export is on top level + * @param {string[]} members members of the export + * @param {Expression | undefined} valueExpr expression for the value + * @returns {void} + */ const checkNamespace = (topLevel, members, valueExpr) => { if (!DynamicExports.isEnabled(parser.state)) return; if (members.length > 0 && members[0] === "__esModule") { @@ -107619,10 +111513,16 @@ class CommonJsExportsParserPlugin { } } }; + /** + * @param {string=} reason reason + */ const bailout = reason => { DynamicExports.bailout(parser.state); if (reason) bailoutHint(reason); }; + /** + * @param {string} reason reason + */ const bailoutHint = reason => { this.moduleGraph .getOptimizationBailout(parser.state.module) @@ -107638,6 +111538,13 @@ class CommonJsExportsParserPlugin { .tap("CommonJsPlugin", evaluateToString("object")); // exporting // + + /** + * @param {AssignmentExpression} expr expression + * @param {CommonJSDependencyBaseKeywords} base commonjs base keywords + * @param {string[]} members members of the export + * @returns {boolean} true, when the expression was handled + */ const handleAssignExport = (expr, base, members) => { if (HarmonyExports.isEnabled(parser.state)) return; // Handle reexporting @@ -107704,9 +111611,7 @@ class CommonJsExportsParserPlugin { parser.hooks.call .for("Object.defineProperty") .tap("CommonJsExportsParserPlugin", expression => { - const expr = /** @type {import("estree").CallExpression} */ ( - expression - ); + const expr = /** @type {CallExpression} */ (expression); if (!parser.isStatementLevelExpression(expr)) return; if (expr.arguments.length !== 3) return; if (expr.arguments[0].type === "SpreadElement") return; @@ -107745,6 +111650,14 @@ class CommonJsExportsParserPlugin { }); // Self reference // + + /** + * @param {Expression | Super} expr expression + * @param {CommonJSDependencyBaseKeywords} base commonjs base keywords + * @param {string[]} members members of the export + * @param {CallExpression=} call call expression + * @returns {boolean | void} true, when the expression was handled + */ const handleAccessExport = (expr, base, members, call = undefined) => { if (HarmonyExports.isEnabled(parser.state)) return; if (members.length === 0) { @@ -107849,7 +111762,7 @@ module.exports = CommonJsExportsParserPlugin; /***/ }), -/***/ 7715: +/***/ 55515: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -107860,23 +111773,26 @@ module.exports = CommonJsExportsParserPlugin; -const Template = __webpack_require__(88070); -const { equals } = __webpack_require__(91696); -const makeSerializable = __webpack_require__(23827); -const propertyAccess = __webpack_require__(92884); -const ModuleDependency = __webpack_require__(22994); +const Template = __webpack_require__(88835); +const { equals } = __webpack_require__(22150); +const makeSerializable = __webpack_require__(83626); +const propertyAccess = __webpack_require__(60305); +const ModuleDependency = __webpack_require__(10931); /** @typedef {import("webpack-sources").ReplaceSource} ReplaceSource */ /** @typedef {import("../Dependency")} Dependency */ /** @typedef {import("../Dependency").ReferencedExport} ReferencedExport */ /** @typedef {import("../DependencyTemplate").DependencyTemplateContext} DependencyTemplateContext */ /** @typedef {import("../ModuleGraph")} ModuleGraph */ +/** @typedef {import("../javascript/JavascriptParser").Range} Range */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */ /** @typedef {import("../util/runtime").RuntimeSpec} RuntimeSpec */ class CommonJsFullRequireDependency extends ModuleDependency { /** * @param {string} request the request string - * @param {[number, number]} range location in source code + * @param {Range} range location in source code * @param {string[]} names accessed properties on module */ constructor(request, range, names) { @@ -107906,6 +111822,9 @@ class CommonJsFullRequireDependency extends ModuleDependency { return [this.names]; } + /** + * @param {ObjectSerializerContext} context context + */ serialize(context) { const { write } = context; write(this.names); @@ -107914,6 +111833,9 @@ class CommonJsFullRequireDependency extends ModuleDependency { super.serialize(context); } + /** + * @param {ObjectDeserializerContext} context context + */ deserialize(context) { const { read } = context; this.names = read(); @@ -107993,7 +111915,7 @@ module.exports = CommonJsFullRequireDependency; /***/ }), -/***/ 36889: +/***/ 2526: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -108005,31 +111927,37 @@ module.exports = CommonJsFullRequireDependency; const { fileURLToPath } = __webpack_require__(57310); -const CommentCompilationWarning = __webpack_require__(72190); -const RuntimeGlobals = __webpack_require__(34623); -const UnsupportedFeatureWarning = __webpack_require__(19290); -const WebpackError = __webpack_require__(10841); -const BasicEvaluatedExpression = __webpack_require__(88981); +const CommentCompilationWarning = __webpack_require__(38011); +const RuntimeGlobals = __webpack_require__(61539); +const UnsupportedFeatureWarning = __webpack_require__(84099); +const WebpackError = __webpack_require__(49999); +const BasicEvaluatedExpression = __webpack_require__(52493); const { evaluateToIdentifier, evaluateToString, expressionIsUnsupported, toConstantDependency -} = __webpack_require__(645); -const CommonJsFullRequireDependency = __webpack_require__(7715); -const CommonJsRequireContextDependency = __webpack_require__(89449); -const CommonJsRequireDependency = __webpack_require__(76237); -const ConstDependency = __webpack_require__(78284); -const ContextDependencyHelpers = __webpack_require__(84555); -const LocalModuleDependency = __webpack_require__(86333); -const { getLocalModule } = __webpack_require__(96183); -const RequireHeaderDependency = __webpack_require__(46658); -const RequireResolveContextDependency = __webpack_require__(95219); -const RequireResolveDependency = __webpack_require__(53711); -const RequireResolveHeaderDependency = __webpack_require__(95635); - -/** @typedef {import("estree").CallExpression} CallExpressionNode */ +} = __webpack_require__(94213); +const CommonJsFullRequireDependency = __webpack_require__(55515); +const CommonJsRequireContextDependency = __webpack_require__(75074); +const CommonJsRequireDependency = __webpack_require__(65050); +const ConstDependency = __webpack_require__(67538); +const ContextDependencyHelpers = __webpack_require__(61200); +const LocalModuleDependency = __webpack_require__(32637); +const { getLocalModule } = __webpack_require__(62693); +const RequireHeaderDependency = __webpack_require__(91172); +const RequireResolveContextDependency = __webpack_require__(9973); +const RequireResolveDependency = __webpack_require__(14694); +const RequireResolveHeaderDependency = __webpack_require__(58164); + +/** @typedef {import("estree").CallExpression} CallExpression */ +/** @typedef {import("estree").Expression} Expression */ +/** @typedef {import("estree").NewExpression} NewExpression */ /** @typedef {import("../../declarations/WebpackOptions").JavascriptParserOptions} JavascriptParserOptions */ +/** @typedef {import("../Dependency").DependencyLocation} DependencyLocation */ +/** @typedef {import("../javascript/JavascriptParser")} JavascriptParser */ +/** @typedef {import("../javascript/JavascriptParser").ImportSource} ImportSource */ +/** @typedef {import("../javascript/JavascriptParser").Range} Range */ const createRequireSpecifierTag = Symbol("createRequire"); const createdRequireIdentifierTag = Symbol("createRequire()"); @@ -108042,6 +111970,10 @@ class CommonJsImportsParserPlugin { this.options = options; } + /** + * @param {JavascriptParser} parser the parser + * @returns {void} + */ apply(parser) { const options = this.options; @@ -108053,6 +111985,10 @@ class CommonJsImportsParserPlugin { }; //#region metadata + /** + * @param {TODO} expression expression + * @param {() => string[]} getMembers get members + */ const tapRequireExpression = (expression, getMembers) => { parser.hooks.typeof .for(expression) @@ -108070,6 +112006,9 @@ class CommonJsImportsParserPlugin { evaluateToIdentifier(expression, "require", getMembers, true) ); }; + /** + * @param {string | symbol} tag tag + */ const tapRequireExpressionTag = tag => { parser.hooks.typeof .for(tag) @@ -108092,7 +112031,7 @@ class CommonJsImportsParserPlugin { .tap("CommonJsImportsParserPlugin", expr => { // to not leak to global "require", we need to define a local require here. const dep = new ConstDependency("var require;", 0); - dep.loc = expr.loc; + dep.loc = /** @type {DependencyLocation} */ (expr.loc); parser.state.module.addPresentationalDependency(dep); return true; }); @@ -108137,10 +112076,17 @@ class CommonJsImportsParserPlugin { //#endregion //#region Renaming + /** + * @param {Expression} expr expression + * @returns {boolean} true when set undefined + */ const defineUndefined = expr => { // To avoid "not defined" error, replace the value with undefined - const dep = new ConstDependency("undefined", expr.range); - dep.loc = expr.loc; + const dep = new ConstDependency( + "undefined", + /** @type {Range} */ (expr.range) + ); + dep.loc = /** @type {DependencyLocation} */ (expr.loc); parser.state.module.addPresentationalDependency(dep); return false; }; @@ -108169,6 +112115,10 @@ class CommonJsImportsParserPlugin { //#endregion //#region Require as expression + /** + * @param {Expression} expr expression + * @returns {boolean} true when handled + */ const requireAsExpressionHandler = expr => { const dep = new CommonJsRequireContextDependency( { @@ -108177,7 +112127,7 @@ class CommonJsImportsParserPlugin { regExp: options.unknownContextRegExp, mode: "sync" }, - expr.range, + /** @type {Range} */ (expr.range), undefined, parser.scope.inShorthand, getContext() @@ -108185,7 +112135,7 @@ class CommonJsImportsParserPlugin { dep.critical = options.unknownContextCritical && "require function is used in a way in which dependencies cannot be statically extracted"; - dep.loc = expr.loc; + dep.loc = /** @type {DependencyLocation} */ (expr.loc); dep.optional = !!parser.scope.inTry; parser.state.current.addDependency(dep); return true; @@ -108196,23 +112146,33 @@ class CommonJsImportsParserPlugin { //#endregion //#region Require + /** + * @param {CallExpression | NewExpression} expr expression + * @param {BasicEvaluatedExpression} param param + * @returns {boolean | void} true when handled + */ const processRequireItem = (expr, param) => { if (param.isString()) { const dep = new CommonJsRequireDependency( - param.string, - param.range, + /** @type {string} */ (param.string), + /** @type {Range} */ (param.range), getContext() ); - dep.loc = expr.loc; + dep.loc = /** @type {DependencyLocation} */ (expr.loc); dep.optional = !!parser.scope.inTry; parser.state.current.addDependency(dep); return true; } }; + /** + * @param {CallExpression | NewExpression} expr expression + * @param {BasicEvaluatedExpression} param param + * @returns {boolean | void} true when handled + */ const processRequireContext = (expr, param) => { const dep = ContextDependencyHelpers.create( CommonJsRequireContextDependency, - expr.range, + /** @type {Range} */ (expr.range), param, expr, options, @@ -108224,15 +112184,19 @@ class CommonJsImportsParserPlugin { getContext() ); if (!dep) return; - dep.loc = expr.loc; + dep.loc = /** @type {DependencyLocation} */ (expr.loc); dep.optional = !!parser.scope.inTry; parser.state.current.addDependency(dep); return true; }; + /** + * @param {boolean} callNew true, when require is called with new + * @returns {(expr: CallExpression | NewExpression) => (boolean | void)} handler + */ const createRequireHandler = callNew => expr => { if (options.commonjsMagicComments) { const { options: requireOptions, errors: commentErrors } = - parser.parseCommentOptions(expr.range); + parser.parseCommentOptions(/** @type {Range} */ (expr.range)); if (commentErrors) { for (const e of commentErrors) { @@ -108251,7 +112215,7 @@ class CommonJsImportsParserPlugin { parser.state.module.addWarning( new UnsupportedFeatureWarning( `\`webpackIgnore\` expected a boolean, but received: ${requireOptions.webpackIgnore}.`, - expr.loc + /** @type {DependencyLocation} */ (expr.loc) ) ); } else { @@ -108269,26 +112233,37 @@ class CommonJsImportsParserPlugin { const param = parser.evaluateExpression(expr.arguments[0]); if (param.isConditional()) { let isExpression = false; - for (const p of param.options) { + for (const p of /** @type {BasicEvaluatedExpression[]} */ ( + param.options + )) { const result = processRequireItem(expr, p); if (result === undefined) { isExpression = true; } } if (!isExpression) { - const dep = new RequireHeaderDependency(expr.callee.range); - dep.loc = expr.loc; + const dep = new RequireHeaderDependency( + /** @type {Range} */ (expr.callee.range) + ); + dep.loc = /** @type {DependencyLocation} */ (expr.loc); parser.state.module.addPresentationalDependency(dep); return true; } } if ( param.isString() && - (localModule = getLocalModule(parser.state, param.string)) + (localModule = getLocalModule( + parser.state, + /** @type {string} */ (param.string) + )) ) { localModule.flagUsed(); - const dep = new LocalModuleDependency(localModule, expr.range, callNew); - dep.loc = expr.loc; + const dep = new LocalModuleDependency( + localModule, + /** @type {Range} */ (expr.range), + callNew + ); + dep.loc = /** @type {DependencyLocation} */ (expr.loc); parser.state.module.addPresentationalDependency(dep); return true; } else { @@ -108296,8 +112271,10 @@ class CommonJsImportsParserPlugin { if (result === undefined) { processRequireContext(expr, param); } else { - const dep = new RequireHeaderDependency(expr.callee.range); - dep.loc = expr.loc; + const dep = new RequireHeaderDependency( + /** @type {Range} */ (expr.callee.range) + ); + dep.loc = /** @type {DependencyLocation} */ (expr.loc); parser.state.module.addPresentationalDependency(dep); } return true; @@ -108318,35 +112295,59 @@ class CommonJsImportsParserPlugin { //#endregion //#region Require with property access + /** + * @param {Expression} expr expression + * @param {string[]} calleeMembers callee members + * @param {CallExpression} callExpr call expression + * @param {string[]} members members + * @returns {boolean | void} true when handled + */ const chainHandler = (expr, calleeMembers, callExpr, members) => { if (callExpr.arguments.length !== 1) return; const param = parser.evaluateExpression(callExpr.arguments[0]); - if (param.isString() && !getLocalModule(parser.state, param.string)) { + if ( + param.isString() && + !getLocalModule(parser.state, /** @type {string} */ (param.string)) + ) { const dep = new CommonJsFullRequireDependency( - param.string, - expr.range, + /** @type {string} */ (param.string), + /** @type {Range} */ (expr.range), members ); - dep.asiSafe = !parser.isAsiPosition(expr.range[0]); + dep.asiSafe = !parser.isAsiPosition( + /** @type {Range} */ (expr.range)[0] + ); dep.optional = !!parser.scope.inTry; - dep.loc = expr.loc; + dep.loc = /** @type {DependencyLocation} */ (expr.loc); parser.state.current.addDependency(dep); return true; } }; + /** + * @param {CallExpression} expr expression + * @param {string[]} calleeMembers callee members + * @param {CallExpression} callExpr call expression + * @param {string[]} members members + * @returns {boolean | void} true when handled + */ const callChainHandler = (expr, calleeMembers, callExpr, members) => { if (callExpr.arguments.length !== 1) return; const param = parser.evaluateExpression(callExpr.arguments[0]); - if (param.isString() && !getLocalModule(parser.state, param.string)) { + if ( + param.isString() && + !getLocalModule(parser.state, /** @type {string} */ (param.string)) + ) { const dep = new CommonJsFullRequireDependency( - param.string, - expr.callee.range, + /** @type {string} */ (param.string), + /** @type {Range} */ (expr.callee.range), members ); dep.call = true; - dep.asiSafe = !parser.isAsiPosition(expr.range[0]); + dep.asiSafe = !parser.isAsiPosition( + /** @type {Range} */ (expr.range)[0] + ); dep.optional = !!parser.scope.inTry; - dep.loc = expr.callee.loc; + dep.loc = /** @type {DependencyLocation} */ (expr.callee.loc); parser.state.current.addDependency(dep); parser.walkExpressions(expr.arguments); return true; @@ -108367,18 +112368,27 @@ class CommonJsImportsParserPlugin { //#endregion //#region Require.resolve + /** + * @param {CallExpression} expr call expression + * @param {boolean} weak weak + * @returns {boolean | void} true when handled + */ const processResolve = (expr, weak) => { if (expr.arguments.length !== 1) return; const param = parser.evaluateExpression(expr.arguments[0]); if (param.isConditional()) { - for (const option of param.options) { + for (const option of /** @type {BasicEvaluatedExpression[]} */ ( + param.options + )) { const result = processResolveItem(expr, option, weak); if (result === undefined) { processResolveContext(expr, option, weak); } } - const dep = new RequireResolveHeaderDependency(expr.callee.range); - dep.loc = expr.loc; + const dep = new RequireResolveHeaderDependency( + /** @type {Range} */ (expr.callee.range) + ); + dep.loc = /** @type {DependencyLocation} */ (expr.loc); parser.state.module.addPresentationalDependency(dep); return true; } else { @@ -108386,30 +112396,44 @@ class CommonJsImportsParserPlugin { if (result === undefined) { processResolveContext(expr, param, weak); } - const dep = new RequireResolveHeaderDependency(expr.callee.range); - dep.loc = expr.loc; + const dep = new RequireResolveHeaderDependency( + /** @type {Range} */ (expr.callee.range) + ); + dep.loc = /** @type {DependencyLocation} */ (expr.loc); parser.state.module.addPresentationalDependency(dep); return true; } }; + /** + * @param {CallExpression} expr call expression + * @param {BasicEvaluatedExpression} param param + * @param {boolean} weak weak + * @returns {boolean | void} true when handled + */ const processResolveItem = (expr, param, weak) => { if (param.isString()) { const dep = new RequireResolveDependency( - param.string, - param.range, + /** @type {string} */ (param.string), + /** @type {Range} */ (param.range), getContext() ); - dep.loc = expr.loc; + dep.loc = /** @type {DependencyLocation} */ (expr.loc); dep.optional = !!parser.scope.inTry; dep.weak = weak; parser.state.current.addDependency(dep); return true; } }; + /** + * @param {CallExpression} expr call expression + * @param {BasicEvaluatedExpression} param param + * @param {boolean} weak weak + * @returns {boolean | void} true when handled + */ const processResolveContext = (expr, param, weak) => { const dep = ContextDependencyHelpers.create( RequireResolveContextDependency, - param.range, + /** @type {Range} */ (param.range), param, expr, options, @@ -108421,7 +112445,7 @@ class CommonJsImportsParserPlugin { getContext() ); if (!dep) return; - dep.loc = expr.loc; + dep.loc = /** @type {DependencyLocation} */ (expr.loc); dep.optional = !!parser.scope.inTry; parser.state.current.addDependency(dep); return true; @@ -108443,13 +112467,16 @@ class CommonJsImportsParserPlugin { if (!options.createRequire) return; - let moduleName; + /** @type {ImportSource[]} */ + let moduleName = []; + /** @type {string | undefined} */ let specifierName; if (options.createRequire === true) { - moduleName = "module"; + moduleName = ["module", "node:module"]; specifierName = "createRequire"; } else { + let moduleName; const match = /^(.*) from (.*)$/.exec(options.createRequire); if (match) { [, specifierName, moduleName] = match; @@ -108479,9 +112506,13 @@ class CommonJsImportsParserPlugin { next: undefined }); return new BasicEvaluatedExpression() - .setIdentifier(ident, ident, () => []) + .setIdentifier( + /** @type {TODO} */ (ident), + /** @type {TODO} */ (ident), + () => [] + ) .setSideEffects(false) - .setRange(expr.range); + .setRange(/** @type {Range} */ (expr.range)); }); parser.hooks.unhandledExpressionMemberChain .for(createdRequireIdentifierTag) @@ -108507,8 +112538,8 @@ class CommonJsImportsParserPlugin { .for(createdRequireIdentifierTag) .tap("CommonJsImportsParserPlugin", createRequireHandler(false)); /** - * @param {CallExpressionNode} expr call expression - * @returns {string} context + * @param {CallExpression} expr call expression + * @returns {string | void} context */ const parseCreateRequireArguments = expr => { const args = expr.arguments; @@ -108516,7 +112547,7 @@ class CommonJsImportsParserPlugin { const err = new WebpackError( "module.createRequire supports only one argument." ); - err.loc = expr.loc; + err.loc = /** @type {DependencyLocation} */ (expr.loc); parser.state.module.addWarning(err); return; } @@ -108526,13 +112557,13 @@ class CommonJsImportsParserPlugin { const err = new WebpackError( "module.createRequire failed parsing argument." ); - err.loc = arg.loc; + err.loc = /** @type {DependencyLocation} */ (arg.loc); parser.state.module.addWarning(err); return; } - const ctx = evaluated.string.startsWith("file://") - ? fileURLToPath(evaluated.string) - : evaluated.string; + const ctx = /** @type {string} */ (evaluated.string).startsWith("file://") + ? fileURLToPath(/** @type {string} */ (evaluated.string)) + : /** @type {string} */ (evaluated.string); // argument always should be a filename return ctx.slice(0, ctx.lastIndexOf(ctx.startsWith("/") ? "/" : "\\")); }; @@ -108544,7 +112575,7 @@ class CommonJsImportsParserPlugin { }, (statement, source) => { if ( - source !== moduleName || + !moduleName.includes(source) || statement.specifiers.length !== 1 || statement.specifiers[0].type !== "ImportSpecifier" || statement.specifiers[0].imported.type !== "Identifier" || @@ -108554,12 +112585,14 @@ class CommonJsImportsParserPlugin { // clear for 'import { createRequire as x } from "module"' // if any other specifier was used import module const clearDep = new ConstDependency( - parser.isAsiPosition(statement.range[0]) ? ";" : "", - statement.range + parser.isAsiPosition(/** @type {Range} */ (statement.range)[0]) + ? ";" + : "", + /** @type {Range} */ (statement.range) ); - clearDep.loc = statement.loc; + clearDep.loc = /** @type {DependencyLocation} */ (statement.loc); parser.state.module.addPresentationalDependency(clearDep); - parser.unsetAsiPosition(statement.range[1]); + parser.unsetAsiPosition(/** @type {Range} */ (statement.range)[1]); return true; } ); @@ -108569,7 +112602,7 @@ class CommonJsImportsParserPlugin { stage: -10 }, (statement, source, id, name) => { - if (source !== moduleName || id !== specifierName) return; + if (!moduleName.includes(source) || id !== specifierName) return; parser.tagVariable(name, createRequireSpecifierTag); return true; } @@ -108584,9 +112617,9 @@ class CommonJsImportsParserPlugin { declarator.init.callee.type !== "Identifier" ) return; - const variableInfo = parser.getVariableInfo( - declarator.init.callee.name - ); + const variableInfo = + /** @type {TODO} */ + (parser.getVariableInfo(declarator.init.callee.name)); if ( variableInfo && variableInfo.tagInfo && @@ -108656,9 +112689,9 @@ class CommonJsImportsParserPlugin { .tap("CommonJsImportsParserPlugin", expr => { const clearDep = new ConstDependency( "/* createRequire() */ undefined", - expr.range + /** @type {Range} */ (expr.range) ); - clearDep.loc = expr.loc; + clearDep.loc = /** @type {DependencyLocation} */ (expr.loc); parser.state.module.addPresentationalDependency(clearDep); return true; }); @@ -108670,7 +112703,7 @@ module.exports = CommonJsImportsParserPlugin; /***/ }), -/***/ 81907: +/***/ 35892: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -108681,35 +112714,53 @@ module.exports = CommonJsImportsParserPlugin; -const RuntimeGlobals = __webpack_require__(34623); -const RuntimeModule = __webpack_require__(81196); -const SelfModuleFactory = __webpack_require__(56967); -const Template = __webpack_require__(88070); -const CommonJsExportsDependency = __webpack_require__(50380); -const CommonJsFullRequireDependency = __webpack_require__(7715); -const CommonJsRequireContextDependency = __webpack_require__(89449); -const CommonJsRequireDependency = __webpack_require__(76237); -const CommonJsSelfReferenceDependency = __webpack_require__(53853); -const ModuleDecoratorDependency = __webpack_require__(15086); -const RequireHeaderDependency = __webpack_require__(46658); -const RequireResolveContextDependency = __webpack_require__(95219); -const RequireResolveDependency = __webpack_require__(53711); -const RequireResolveHeaderDependency = __webpack_require__(95635); -const RuntimeRequirementsDependency = __webpack_require__(72885); +const RuntimeGlobals = __webpack_require__(61539); +const RuntimeModule = __webpack_require__(21296); +const SelfModuleFactory = __webpack_require__(48588); +const Template = __webpack_require__(88835); +const CommonJsExportsDependency = __webpack_require__(74544); +const CommonJsFullRequireDependency = __webpack_require__(55515); +const CommonJsRequireContextDependency = __webpack_require__(75074); +const CommonJsRequireDependency = __webpack_require__(65050); +const CommonJsSelfReferenceDependency = __webpack_require__(86797); +const ModuleDecoratorDependency = __webpack_require__(746); +const RequireHeaderDependency = __webpack_require__(91172); +const RequireResolveContextDependency = __webpack_require__(9973); +const RequireResolveDependency = __webpack_require__(14694); +const RequireResolveHeaderDependency = __webpack_require__(58164); +const RuntimeRequirementsDependency = __webpack_require__(26068); -const CommonJsExportsParserPlugin = __webpack_require__(93997); -const CommonJsImportsParserPlugin = __webpack_require__(36889); +const CommonJsExportsParserPlugin = __webpack_require__(7358); +const CommonJsImportsParserPlugin = __webpack_require__(2526); +const { + JAVASCRIPT_MODULE_TYPE_AUTO, + JAVASCRIPT_MODULE_TYPE_DYNAMIC +} = __webpack_require__(92891); const { evaluateToIdentifier, toConstantDependency -} = __webpack_require__(645); -const CommonJsExportRequireDependency = __webpack_require__(53204); +} = __webpack_require__(94213); +const CommonJsExportRequireDependency = __webpack_require__(65475); + +/** @typedef {import("../../declarations/WebpackOptions").JavascriptParserOptions} JavascriptParserOptions */ +/** @typedef {import("../Compilation")} Compilation */ +/** @typedef {import("../Compiler")} Compiler */ +/** @typedef {import("../Dependency").DependencyLocation} DependencyLocation */ +/** @typedef {import("../Module").BuildInfo} BuildInfo */ +/** @typedef {import("../javascript/JavascriptParser")} Parser */ + +const PLUGIN_NAME = "CommonJsPlugin"; class CommonJsPlugin { + /** + * Apply the plugin + * @param {Compiler} compiler the compiler instance + * @returns {void} + */ apply(compiler) { compiler.hooks.compilation.tap( - "CommonJsPlugin", + PLUGIN_NAME, (compilation, { contextModuleFactory, normalModuleFactory }) => { compilation.dependencyFactories.set( CommonJsRequireDependency, @@ -108802,21 +112853,21 @@ class CommonJsPlugin { compilation.hooks.runtimeRequirementInModule .for(RuntimeGlobals.harmonyModuleDecorator) - .tap("CommonJsPlugin", (module, set) => { + .tap(PLUGIN_NAME, (module, set) => { set.add(RuntimeGlobals.module); set.add(RuntimeGlobals.requireScope); }); compilation.hooks.runtimeRequirementInModule .for(RuntimeGlobals.nodeModuleDecorator) - .tap("CommonJsPlugin", (module, set) => { + .tap(PLUGIN_NAME, (module, set) => { set.add(RuntimeGlobals.module); set.add(RuntimeGlobals.requireScope); }); compilation.hooks.runtimeRequirementInTree .for(RuntimeGlobals.harmonyModuleDecorator) - .tap("CommonJsPlugin", (chunk, set) => { + .tap(PLUGIN_NAME, (chunk, set) => { compilation.addRuntimeModule( chunk, new HarmonyModuleDecoratorRuntimeModule() @@ -108825,27 +112876,32 @@ class CommonJsPlugin { compilation.hooks.runtimeRequirementInTree .for(RuntimeGlobals.nodeModuleDecorator) - .tap("CommonJsPlugin", (chunk, set) => { + .tap(PLUGIN_NAME, (chunk, set) => { compilation.addRuntimeModule( chunk, new NodeModuleDecoratorRuntimeModule() ); }); + /** + * @param {Parser} parser parser parser + * @param {JavascriptParserOptions} parserOptions parserOptions + * @returns {void} + */ const handler = (parser, parserOptions) => { if (parserOptions.commonjs !== undefined && !parserOptions.commonjs) return; parser.hooks.typeof .for("module") .tap( - "CommonJsPlugin", + PLUGIN_NAME, toConstantDependency(parser, JSON.stringify("object")) ); parser.hooks.expression .for("require.main") .tap( - "CommonJsPlugin", + PLUGIN_NAME, toConstantDependency( parser, `${RuntimeGlobals.moduleCache}[${RuntimeGlobals.entryModuleId}]`, @@ -108853,33 +112909,35 @@ class CommonJsPlugin { ) ); parser.hooks.expression - .for("module.loaded") - .tap("CommonJsPlugin", expr => { - parser.state.module.buildInfo.moduleConcatenationBailout = - "module.loaded"; + .for(RuntimeGlobals.moduleLoaded) + .tap(PLUGIN_NAME, expr => { + /** @type {BuildInfo} */ + (parser.state.module.buildInfo).moduleConcatenationBailout = + RuntimeGlobals.moduleLoaded; const dep = new RuntimeRequirementsDependency([ RuntimeGlobals.moduleLoaded ]); - dep.loc = expr.loc; + dep.loc = /** @type {DependencyLocation} */ (expr.loc); parser.state.module.addPresentationalDependency(dep); return true; }); parser.hooks.expression - .for("module.id") - .tap("CommonJsPlugin", expr => { - parser.state.module.buildInfo.moduleConcatenationBailout = - "module.id"; + .for(RuntimeGlobals.moduleId) + .tap(PLUGIN_NAME, expr => { + /** @type {BuildInfo} */ + (parser.state.module.buildInfo).moduleConcatenationBailout = + RuntimeGlobals.moduleId; const dep = new RuntimeRequirementsDependency([ RuntimeGlobals.moduleId ]); - dep.loc = expr.loc; + dep.loc = /** @type {DependencyLocation} */ (expr.loc); parser.state.module.addPresentationalDependency(dep); return true; }); parser.hooks.evaluateIdentifier.for("module.hot").tap( - "CommonJsPlugin", + PLUGIN_NAME, evaluateToIdentifier("module.hot", "module", () => ["hot"], null) ); @@ -108890,11 +112948,11 @@ class CommonJsPlugin { }; normalModuleFactory.hooks.parser - .for("javascript/auto") - .tap("CommonJsPlugin", handler); + .for(JAVASCRIPT_MODULE_TYPE_AUTO) + .tap(PLUGIN_NAME, handler); normalModuleFactory.hooks.parser - .for("javascript/dynamic") - .tap("CommonJsPlugin", handler); + .for(JAVASCRIPT_MODULE_TYPE_DYNAMIC) + .tap(PLUGIN_NAME, handler); } ); } @@ -108906,10 +112964,10 @@ class HarmonyModuleDecoratorRuntimeModule extends RuntimeModule { } /** - * @returns {string} runtime code + * @returns {string | null} runtime code */ generate() { - const { runtimeTemplate } = this.compilation; + const { runtimeTemplate } = /** @type {Compilation} */ (this.compilation); return Template.asString([ `${ RuntimeGlobals.harmonyModuleDecorator @@ -108936,10 +112994,10 @@ class NodeModuleDecoratorRuntimeModule extends RuntimeModule { } /** - * @returns {string} runtime code + * @returns {string | null} runtime code */ generate() { - const { runtimeTemplate } = this.compilation; + const { runtimeTemplate } = /** @type {Compilation} */ (this.compilation); return Template.asString([ `${RuntimeGlobals.nodeModuleDecorator} = ${runtimeTemplate.basicFunction( "module", @@ -108958,7 +113016,7 @@ module.exports = CommonJsPlugin; /***/ }), -/***/ 89449: +/***/ 75074: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -108969,11 +113027,22 @@ module.exports = CommonJsPlugin; -const makeSerializable = __webpack_require__(23827); -const ContextDependency = __webpack_require__(45899); -const ContextDependencyTemplateAsRequireCall = __webpack_require__(19113); +const makeSerializable = __webpack_require__(83626); +const ContextDependency = __webpack_require__(64946); +const ContextDependencyTemplateAsRequireCall = __webpack_require__(82305); + +/** @typedef {import("../javascript/JavascriptParser").Range} Range */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */ class CommonJsRequireContextDependency extends ContextDependency { + /** + * @param {TODO} options options for the context module + * @param {Range} range location in source code + * @param {Range | undefined} valueRange location of the require call + * @param {boolean | string } inShorthand true or name + * @param {string} context context + */ constructor(options, range, valueRange, inShorthand, context) { super(options, context); @@ -108987,6 +113056,9 @@ class CommonJsRequireContextDependency extends ContextDependency { return "cjs require context"; } + /** + * @param {ObjectSerializerContext} context context + */ serialize(context) { const { write } = context; @@ -108997,6 +113069,9 @@ class CommonJsRequireContextDependency extends ContextDependency { super.serialize(context); } + /** + * @param {ObjectDeserializerContext} context context + */ deserialize(context) { const { read } = context; @@ -109021,7 +113096,7 @@ module.exports = CommonJsRequireContextDependency; /***/ }), -/***/ 76237: +/***/ 65050: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -109032,11 +113107,18 @@ module.exports = CommonJsRequireContextDependency; -const makeSerializable = __webpack_require__(23827); -const ModuleDependency = __webpack_require__(22994); -const ModuleDependencyTemplateAsId = __webpack_require__(32789); +const makeSerializable = __webpack_require__(83626); +const ModuleDependency = __webpack_require__(10931); +const ModuleDependencyTemplateAsId = __webpack_require__(90881); + +/** @typedef {import("../javascript/JavascriptParser").Range} Range */ class CommonJsRequireDependency extends ModuleDependency { + /** + * @param {string} request request + * @param {Range=} range location in source code + * @param {string=} context request context + */ constructor(request, range, context) { super(request); this.range = range; @@ -109064,7 +113146,7 @@ module.exports = CommonJsRequireDependency; /***/ }), -/***/ 53853: +/***/ 86797: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -109075,11 +113157,11 @@ module.exports = CommonJsRequireDependency; -const RuntimeGlobals = __webpack_require__(34623); -const { equals } = __webpack_require__(91696); -const makeSerializable = __webpack_require__(23827); -const propertyAccess = __webpack_require__(92884); -const NullDependency = __webpack_require__(74263); +const RuntimeGlobals = __webpack_require__(61539); +const { equals } = __webpack_require__(22150); +const makeSerializable = __webpack_require__(83626); +const propertyAccess = __webpack_require__(60305); +const NullDependency = __webpack_require__(87568); /** @typedef {import("webpack-sources").ReplaceSource} ReplaceSource */ /** @typedef {import("../Dependency")} Dependency */ @@ -109087,9 +113169,19 @@ const NullDependency = __webpack_require__(74263); /** @typedef {import("../Dependency").ReferencedExport} ReferencedExport */ /** @typedef {import("../DependencyTemplate").DependencyTemplateContext} DependencyTemplateContext */ /** @typedef {import("../ModuleGraph")} ModuleGraph */ +/** @typedef {import("../javascript/JavascriptParser").Range} Range */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */ /** @typedef {import("../util/runtime").RuntimeSpec} RuntimeSpec */ +/** @typedef {import("./CommonJsDependencyHelpers").CommonJSDependencyBaseKeywords} CommonJSDependencyBaseKeywords */ class CommonJsSelfReferenceDependency extends NullDependency { + /** + * @param {Range} range range + * @param {CommonJSDependencyBaseKeywords} base base + * @param {string[]} names names + * @param {boolean} call is a call + */ constructor(range, base, names, call) { super(); this.range = range; @@ -109123,6 +113215,9 @@ class CommonJsSelfReferenceDependency extends NullDependency { return [this.call ? this.names.slice(0, -1) : this.names]; } + /** + * @param {ObjectSerializerContext} context context + */ serialize(context) { const { write } = context; write(this.range); @@ -109132,6 +113227,9 @@ class CommonJsSelfReferenceDependency extends NullDependency { super.serialize(context); } + /** + * @param {ObjectDeserializerContext} context context + */ deserialize(context) { const { read } = context; this.range = read(); @@ -109213,7 +113311,7 @@ module.exports = CommonJsSelfReferenceDependency; /***/ }), -/***/ 78284: +/***/ 67538: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -109224,8 +113322,8 @@ module.exports = CommonJsSelfReferenceDependency; -const makeSerializable = __webpack_require__(23827); -const NullDependency = __webpack_require__(74263); +const makeSerializable = __webpack_require__(83626); +const NullDependency = __webpack_require__(87568); /** @typedef {import("webpack-sources").ReplaceSource} ReplaceSource */ /** @typedef {import("../ChunkGraph")} ChunkGraph */ @@ -109234,13 +113332,16 @@ const NullDependency = __webpack_require__(74263); /** @typedef {import("../DependencyTemplate").DependencyTemplateContext} DependencyTemplateContext */ /** @typedef {import("../ModuleGraph")} ModuleGraph */ /** @typedef {import("../ModuleGraphConnection").ConnectionState} ConnectionState */ +/** @typedef {import("../javascript/JavascriptParser").Range} Range */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */ /** @typedef {import("../util/Hash")} Hash */ class ConstDependency extends NullDependency { /** * @param {string} expression the expression - * @param {number|[number, number]} range the source range - * @param {string[]=} runtimeRequirements runtime requirements + * @param {number | Range} range the source range + * @param {(string[] | null)=} runtimeRequirements runtime requirements */ constructor(expression, range, runtimeRequirements) { super(); @@ -109280,6 +113381,9 @@ class ConstDependency extends NullDependency { return false; } + /** + * @param {ObjectSerializerContext} context context + */ serialize(context) { const { write } = context; write(this.expression); @@ -109288,6 +113392,9 @@ class ConstDependency extends NullDependency { super.serialize(context); } + /** + * @param {ObjectDeserializerContext} context context + */ deserialize(context) { const { read } = context; this.expression = read(); @@ -109329,7 +113436,7 @@ module.exports = ConstDependency; /***/ }), -/***/ 45899: +/***/ 64946: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -109340,22 +113447,28 @@ module.exports = ConstDependency; -const Dependency = __webpack_require__(68242); -const DependencyTemplate = __webpack_require__(26472); -const makeSerializable = __webpack_require__(23827); -const memoize = __webpack_require__(27319); +const Dependency = __webpack_require__(504); +const DependencyTemplate = __webpack_require__(17043); +const makeSerializable = __webpack_require__(83626); +const memoize = __webpack_require__(62377); /** @typedef {import("../ContextModule").ContextOptions} ContextOptions */ /** @typedef {import("../Dependency").TRANSITIVE} TRANSITIVE */ /** @typedef {import("../ModuleGraph")} ModuleGraph */ /** @typedef {import("../WebpackError")} WebpackError */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */ const getCriticalDependencyWarning = memoize(() => - __webpack_require__(90848) + __webpack_require__(7438) ); /** @typedef {ContextOptions & { request: string }} ContextDependencyOptions */ +/** + * @param {RegExp | null | undefined} r regexp + * @returns {string} stringified regexp + */ const regExpToString = r => (r ? r + "" : ""); class ContextDependency extends Dependency { @@ -109368,7 +113481,7 @@ class ContextDependency extends Dependency { this.options = options; this.userRequest = this.options && this.options.request; - /** @type {false | string} */ + /** @type {false | undefined | string} */ this.critical = false; this.hadGlobalOrStickyRegExp = false; @@ -109383,6 +113496,7 @@ class ContextDependency extends Dependency { this.request = undefined; this.range = undefined; this.valueRange = undefined; + /** @type {boolean | string | undefined} */ this.inShorthand = undefined; // TODO refactor this this.replaces = undefined; @@ -109426,7 +113540,7 @@ class ContextDependency extends Dependency { /** * Returns warnings * @param {ModuleGraph} moduleGraph module graph - * @returns {WebpackError[]} warnings + * @returns {WebpackError[] | null | undefined} warnings */ getWarnings(moduleGraph) { let warnings = super.getWarnings(moduleGraph); @@ -109450,6 +113564,9 @@ class ContextDependency extends Dependency { return warnings; } + /** + * @param {ObjectSerializerContext} context context + */ serialize(context) { const { write } = context; @@ -109467,6 +113584,9 @@ class ContextDependency extends Dependency { super.serialize(context); } + /** + * @param {ObjectDeserializerContext} context context + */ deserialize(context) { const { read } = context; @@ -109497,7 +113617,7 @@ module.exports = ContextDependency; /***/ }), -/***/ 84555: +/***/ 61200: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; @@ -109508,7 +113628,7 @@ module.exports = ContextDependency; -const { parseResource } = __webpack_require__(63146); +const { parseResource } = __webpack_require__(97451); /** @typedef {import("estree").Node} EsTreeNode */ /** @typedef {import("../../declarations/WebpackOptions").JavascriptParserOptions} JavascriptParserOptions */ @@ -109541,12 +113661,12 @@ const splitContextFromPrefix = prefix => { }; /** @typedef {Partial>} PartialContextDependencyOptions */ - -/** @typedef {{ new(options: ContextDependencyOptions, range: [number, number], valueRange: [number, number], ...args: any[]): ContextDependency }} ContextDependencyConstructor */ +/** @typedef {import("../javascript/JavascriptParser").Range} Range */ +/** @typedef {{ new(options: ContextDependencyOptions, range: Range, valueRange: [number, number], ...args: any[]): ContextDependency }} ContextDependencyConstructor */ /** * @param {ContextDependencyConstructor} Dep the Dependency class - * @param {[number, number]} range source range + * @param {Range} range source range * @param {BasicEvaluatedExpression} param context param * @param {EsTreeNode} expr expr * @param {Pick} options options for context creation @@ -109750,7 +113870,7 @@ exports.create = ( /***/ }), -/***/ 40562: +/***/ 44264: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -109761,7 +113881,7 @@ exports.create = ( -const ContextDependency = __webpack_require__(45899); +const ContextDependency = __webpack_require__(64946); /** @typedef {import("webpack-sources").ReplaceSource} ReplaceSource */ /** @typedef {import("../Dependency")} Dependency */ @@ -109819,7 +113939,7 @@ module.exports = ContextDependencyTemplateAsId; /***/ }), -/***/ 19113: +/***/ 82305: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -109830,7 +113950,7 @@ module.exports = ContextDependencyTemplateAsId; -const ContextDependency = __webpack_require__(45899); +const ContextDependency = __webpack_require__(64946); /** @typedef {import("webpack-sources").ReplaceSource} ReplaceSource */ /** @typedef {import("../Dependency")} Dependency */ @@ -109886,7 +114006,7 @@ module.exports = ContextDependencyTemplateAsRequireCall; /***/ }), -/***/ 34286: +/***/ 27054: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -109897,12 +114017,14 @@ module.exports = ContextDependencyTemplateAsRequireCall; -const Dependency = __webpack_require__(68242); -const makeSerializable = __webpack_require__(23827); -const ModuleDependency = __webpack_require__(22994); +const Dependency = __webpack_require__(504); +const makeSerializable = __webpack_require__(83626); +const ModuleDependency = __webpack_require__(10931); /** @typedef {import("../Dependency").ReferencedExport} ReferencedExport */ /** @typedef {import("../ModuleGraph")} ModuleGraph */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */ /** @typedef {import("../util/runtime").RuntimeSpec} RuntimeSpec */ class ContextElementDependency extends ModuleDependency { @@ -109960,6 +114082,9 @@ class ContextElementDependency extends ModuleDependency { : Dependency.EXPORTS_OBJECT_REFERENCED; } + /** + * @param {ObjectSerializerContext} context context + */ serialize(context) { const { write } = context; write(this._typePrefix); @@ -109968,6 +114093,9 @@ class ContextElementDependency extends ModuleDependency { super.serialize(context); } + /** + * @param {ObjectDeserializerContext} context context + */ deserialize(context) { const { read } = context; this._typePrefix = read(); @@ -109987,7 +114115,7 @@ module.exports = ContextElementDependency; /***/ }), -/***/ 98626: +/***/ 48723: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -109998,17 +114126,20 @@ module.exports = ContextElementDependency; -const RuntimeGlobals = __webpack_require__(34623); -const makeSerializable = __webpack_require__(23827); -const NullDependency = __webpack_require__(74263); +const RuntimeGlobals = __webpack_require__(61539); +const makeSerializable = __webpack_require__(83626); +const NullDependency = __webpack_require__(87568); /** @typedef {import("webpack-sources").ReplaceSource} ReplaceSource */ /** @typedef {import("../Dependency")} Dependency */ /** @typedef {import("../DependencyTemplate").DependencyTemplateContext} DependencyTemplateContext */ +/** @typedef {import("../javascript/JavascriptParser").Range} Range */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */ class CreateScriptUrlDependency extends NullDependency { /** - * @param {[number, number]} range range + * @param {Range} range range */ constructor(range) { super(); @@ -110019,12 +114150,18 @@ class CreateScriptUrlDependency extends NullDependency { return "create script url"; } + /** + * @param {ObjectSerializerContext} context context + */ serialize(context) { const { write } = context; write(this.range); super.serialize(context); } + /** + * @param {ObjectDeserializerContext} context context + */ deserialize(context) { const { read } = context; this.range = read(); @@ -110061,7 +114198,7 @@ module.exports = CreateScriptUrlDependency; /***/ }), -/***/ 90848: +/***/ 7438: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -110072,10 +114209,13 @@ module.exports = CreateScriptUrlDependency; -const WebpackError = __webpack_require__(10841); -const makeSerializable = __webpack_require__(23827); +const WebpackError = __webpack_require__(49999); +const makeSerializable = __webpack_require__(83626); class CriticalDependencyWarning extends WebpackError { + /** + * @param {string} message message + */ constructor(message) { super(); @@ -110094,7 +114234,7 @@ module.exports = CriticalDependencyWarning; /***/ }), -/***/ 22201: +/***/ 54990: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -110105,14 +114245,16 @@ module.exports = CriticalDependencyWarning; -const makeSerializable = __webpack_require__(23827); -const NullDependency = __webpack_require__(74263); +const makeSerializable = __webpack_require__(83626); +const NullDependency = __webpack_require__(87568); /** @typedef {import("webpack-sources").ReplaceSource} ReplaceSource */ /** @typedef {import("../Dependency")} Dependency */ /** @typedef {import("../Dependency").ExportsSpec} ExportsSpec */ /** @typedef {import("../DependencyTemplate").CssDependencyTemplateContext} DependencyTemplateContext */ /** @typedef {import("../ModuleGraph")} ModuleGraph */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */ class CssExportDependency extends NullDependency { /** @@ -110147,6 +114289,9 @@ class CssExportDependency extends NullDependency { }; } + /** + * @param {ObjectSerializerContext} context context + */ serialize(context) { const { write } = context; write(this.name); @@ -110154,6 +114299,9 @@ class CssExportDependency extends NullDependency { super.serialize(context); } + /** + * @param {ObjectDeserializerContext} context context + */ deserialize(context) { const { read } = context; this.name = read(); @@ -110187,7 +114335,7 @@ module.exports = CssExportDependency; /***/ }), -/***/ 26282: +/***/ 88587: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -110198,8 +114346,8 @@ module.exports = CssExportDependency; -const makeSerializable = __webpack_require__(23827); -const ModuleDependency = __webpack_require__(22994); +const makeSerializable = __webpack_require__(83626); +const ModuleDependency = __webpack_require__(10931); /** @typedef {import("webpack-sources").ReplaceSource} ReplaceSource */ /** @typedef {import("../ChunkGraph")} ChunkGraph */ @@ -110210,19 +114358,28 @@ const ModuleDependency = __webpack_require__(22994); /** @typedef {import("../ModuleGraph")} ModuleGraph */ /** @typedef {import("../ModuleGraphConnection")} ModuleGraphConnection */ /** @typedef {import("../ModuleGraphConnection").ConnectionState} ConnectionState */ +/** @typedef {import("../css/CssParser").Range} Range */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */ /** @typedef {import("../util/Hash")} Hash */ /** @typedef {import("../util/runtime").RuntimeSpec} RuntimeSpec */ class CssImportDependency extends ModuleDependency { /** + * Example of dependency: + * + * \@import url("landscape.css") layer(forms) screen and (orientation: landscape) screen and (orientation: landscape); + * * @param {string} request request - * @param {[number, number]} range range of the argument + * @param {Range} range range of the argument + * @param {string | undefined} layer layer * @param {string | undefined} supports list of supports conditions * @param {string | undefined} media list of media conditions */ - constructor(request, range, supports, media) { + constructor(request, range, layer, supports, media) { super(request); this.range = range; + this.layer = layer; this.supports = supports; this.media = media; } @@ -110235,13 +114392,56 @@ class CssImportDependency extends ModuleDependency { return "css-import"; } + /** + * @returns {string | null} an identifier to merge equal requests + */ + getResourceIdentifier() { + let str = `context${this._context || ""}|module${this.request}`; + + if (this.layer) { + str += `|layer${this.layer}`; + } + + if (this.supports) { + str += `|supports${this.supports}`; + } + + if (this.media) { + str += `|media${this.media}`; + } + + return str; + } + /** * @param {string} context context directory - * @returns {Module} a module + * @returns {Module | null} a module */ createIgnoredModule(context) { return null; } + + /** + * @param {ObjectSerializerContext} context context + */ + serialize(context) { + const { write } = context; + write(this.layer); + write(this.supports); + write(this.media); + super.serialize(context); + } + + /** + * @param {ObjectDeserializerContext} context context + */ + deserialize(context) { + const { read } = context; + this.layer = read(); + this.supports = read(); + this.media = read(); + super.deserialize(context); + } } CssImportDependency.Template = class CssImportDependencyTemplate extends ( @@ -110270,7 +114470,7 @@ module.exports = CssImportDependency; /***/ }), -/***/ 13230: +/***/ 90055: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -110281,19 +114481,22 @@ module.exports = CssImportDependency; -const makeSerializable = __webpack_require__(23827); -const NullDependency = __webpack_require__(74263); +const makeSerializable = __webpack_require__(83626); +const NullDependency = __webpack_require__(87568); /** @typedef {import("webpack-sources").ReplaceSource} ReplaceSource */ /** @typedef {import("../Dependency")} Dependency */ /** @typedef {import("../Dependency").ExportsSpec} ExportsSpec */ /** @typedef {import("../DependencyTemplate").CssDependencyTemplateContext} DependencyTemplateContext */ /** @typedef {import("../ModuleGraph")} ModuleGraph */ +/** @typedef {import("../css/CssParser").Range} Range */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */ class CssLocalIdentifierDependency extends NullDependency { /** * @param {string} name name - * @param {[number, number]} range range + * @param {Range} range range * @param {string=} prefix prefix */ constructor(name, range, prefix = "") { @@ -110325,6 +114528,9 @@ class CssLocalIdentifierDependency extends NullDependency { }; } + /** + * @param {ObjectSerializerContext} context context + */ serialize(context) { const { write } = context; write(this.name); @@ -110333,6 +114539,9 @@ class CssLocalIdentifierDependency extends NullDependency { super.serialize(context); } + /** + * @param {ObjectDeserializerContext} context context + */ deserialize(context) { const { read } = context; this.name = read(); @@ -110342,6 +114551,11 @@ class CssLocalIdentifierDependency extends NullDependency { } } +/** + * @param {string} str string + * @param {string | boolean} omitUnderscore true if you need to omit underscore + * @returns {string} escaped css identifier + */ const escapeCssIdentifier = (str, omitUnderscore) => { const escaped = `${str}`.replace( // cspell:word uffff @@ -110371,6 +114585,9 @@ CssLocalIdentifierDependency.Template = class CssLocalIdentifierDependencyTempla const used = moduleGraph .getExportInfo(module, dep.name) .getUsedName(dep.name, runtime); + + if (!used) return; + const moduleId = chunkGraph.getModuleId(module); const identifier = dep.prefix + @@ -110397,7 +114614,7 @@ module.exports = CssLocalIdentifierDependency; /***/ }), -/***/ 11310: +/***/ 15050: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -110408,21 +114625,24 @@ module.exports = CssLocalIdentifierDependency; -const Dependency = __webpack_require__(68242); -const makeSerializable = __webpack_require__(23827); -const CssLocalIdentifierDependency = __webpack_require__(13230); +const Dependency = __webpack_require__(504); +const makeSerializable = __webpack_require__(83626); +const CssLocalIdentifierDependency = __webpack_require__(90055); /** @typedef {import("webpack-sources").ReplaceSource} ReplaceSource */ /** @typedef {import("../Dependency").ExportsSpec} ExportsSpec */ /** @typedef {import("../Dependency").ReferencedExport} ReferencedExport */ /** @typedef {import("../DependencyTemplate").CssDependencyTemplateContext} DependencyTemplateContext */ /** @typedef {import("../ModuleGraph")} ModuleGraph */ +/** @typedef {import("../css/CssParser").Range} Range */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */ /** @typedef {import("../util/runtime").RuntimeSpec} RuntimeSpec */ class CssSelfLocalIdentifierDependency extends CssLocalIdentifierDependency { /** * @param {string} name name - * @param {[number, number]} range range + * @param {Range} range range * @param {string=} prefix prefix * @param {Set=} declaredSet set of declared names (will only be active when in declared set) */ @@ -110467,12 +114687,18 @@ class CssSelfLocalIdentifierDependency extends CssLocalIdentifierDependency { return [[this.name]]; } + /** + * @param {ObjectSerializerContext} context context + */ serialize(context) { const { write } = context; write(this.declaredSet); super.serialize(context); } + /** + * @param {ObjectDeserializerContext} context context + */ deserialize(context) { const { read } = context; this.declaredSet = read(); @@ -110506,7 +114732,7 @@ module.exports = CssSelfLocalIdentifierDependency; /***/ }), -/***/ 78700: +/***/ 93920: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -110517,9 +114743,9 @@ module.exports = CssSelfLocalIdentifierDependency; -const makeSerializable = __webpack_require__(23827); -const memoize = __webpack_require__(27319); -const ModuleDependency = __webpack_require__(22994); +const makeSerializable = __webpack_require__(83626); +const memoize = __webpack_require__(62377); +const ModuleDependency = __webpack_require__(10931); /** @typedef {import("webpack-sources").ReplaceSource} ReplaceSource */ /** @typedef {import("../ChunkGraph")} ChunkGraph */ @@ -110530,21 +114756,24 @@ const ModuleDependency = __webpack_require__(22994); /** @typedef {import("../ModuleGraph")} ModuleGraph */ /** @typedef {import("../ModuleGraphConnection")} ModuleGraphConnection */ /** @typedef {import("../ModuleGraphConnection").ConnectionState} ConnectionState */ +/** @typedef {import("../javascript/JavascriptParser").Range} Range */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */ /** @typedef {import("../util/Hash")} Hash */ /** @typedef {import("../util/runtime").RuntimeSpec} RuntimeSpec */ -const getRawDataUrlModule = memoize(() => __webpack_require__(90144)); +const getRawDataUrlModule = memoize(() => __webpack_require__(69762)); class CssUrlDependency extends ModuleDependency { /** * @param {string} request request - * @param {[number, number]} range range of the argument - * @param {string} cssFunctionKind kind of css function, e. g. url(), image() + * @param {Range} range range of the argument + * @param {"string" | "url"} urlType dependency type e.g. url() or string */ - constructor(request, range, cssFunctionKind) { + constructor(request, range, urlType) { super(request); this.range = range; - this.cssFunctionKind = cssFunctionKind; + this.urlType = urlType; } get type() { @@ -110557,26 +114786,36 @@ class CssUrlDependency extends ModuleDependency { /** * @param {string} context context directory - * @returns {Module} a module + * @returns {Module | null} a module */ createIgnoredModule(context) { const RawDataUrlModule = getRawDataUrlModule(); return new RawDataUrlModule("data:,", `ignored-asset`, `(ignored asset)`); } + /** + * @param {ObjectSerializerContext} context context + */ serialize(context) { const { write } = context; - write(this.cssFunctionKind); + write(this.urlType); super.serialize(context); } + /** + * @param {ObjectDeserializerContext} context context + */ deserialize(context) { const { read } = context; - this.cssFunctionKind = read(); + this.urlType = read(); super.deserialize(context); } } +/** + * @param {string} str string + * @returns {string} string in quotes if needed + */ const cssEscapeString = str => { let countWhiteOrBracket = 0; let countQuotation = 0; @@ -110620,21 +114859,38 @@ CssUrlDependency.Template = class CssUrlDependencyTemplate extends ( apply( dependency, source, - { runtime, moduleGraph, runtimeTemplate, codeGenerationResults } + { moduleGraph, runtimeTemplate, codeGenerationResults } ) { const dep = /** @type {CssUrlDependency} */ (dependency); + /** @type {string | undefined} */ + let newValue; + + switch (dep.urlType) { + case "string": + newValue = cssEscapeString( + runtimeTemplate.assetUrl({ + publicPath: "", + module: /** @type {Module} */ (moduleGraph.getModule(dep)), + codeGenerationResults + }) + ); + break; + case "url": + newValue = `url(${cssEscapeString( + runtimeTemplate.assetUrl({ + publicPath: "", + module: /** @type {Module} */ (moduleGraph.getModule(dep)), + codeGenerationResults + }) + )})`; + break; + } + source.replace( dep.range[0], dep.range[1] - 1, - `${dep.cssFunctionKind}(${cssEscapeString( - runtimeTemplate.assetUrl({ - publicPath: "", - runtime, - module: moduleGraph.getModule(dep), - codeGenerationResults - }) - )})` + /** @type {string} */ (newValue) ); } }; @@ -110646,7 +114902,7 @@ module.exports = CssUrlDependency; /***/ }), -/***/ 16582: +/***/ 99416: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -110657,10 +114913,13 @@ module.exports = CssUrlDependency; -const makeSerializable = __webpack_require__(23827); -const ModuleDependency = __webpack_require__(22994); +const makeSerializable = __webpack_require__(83626); +const ModuleDependency = __webpack_require__(10931); class DelegatedSourceDependency extends ModuleDependency { + /** + * @param {string} request the request string + */ constructor(request) { super(request); } @@ -110684,7 +114943,7 @@ module.exports = DelegatedSourceDependency; /***/ }), -/***/ 11377: +/***/ 93970: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -110695,10 +114954,18 @@ module.exports = DelegatedSourceDependency; -const Dependency = __webpack_require__(68242); -const makeSerializable = __webpack_require__(23827); +const Dependency = __webpack_require__(504); +const makeSerializable = __webpack_require__(83626); + +/** @typedef {import("../serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */ +/** @typedef {import("./EntryDependency")} EntryDependency */ class DllEntryDependency extends Dependency { + /** + * @param {EntryDependency[]} dependencies dependencies + * @param {string} name name + */ constructor(dependencies, name) { super(); @@ -110710,6 +114977,9 @@ class DllEntryDependency extends Dependency { return "dll entry"; } + /** + * @param {ObjectSerializerContext} context context + */ serialize(context) { const { write } = context; @@ -110719,6 +114989,9 @@ class DllEntryDependency extends Dependency { super.serialize(context); } + /** + * @param {ObjectDeserializerContext} context context + */ deserialize(context) { const { read } = context; @@ -110739,7 +115012,7 @@ module.exports = DllEntryDependency; /***/ }), -/***/ 51930: +/***/ 24974: /***/ (function(__unused_webpack_module, exports) { "use strict"; @@ -110750,6 +115023,7 @@ module.exports = DllEntryDependency; +/** @typedef {import("../Module").BuildMeta} BuildMeta */ /** @typedef {import("../Parser").ParserState} ParserState */ /** @type {WeakMap} */ @@ -110763,8 +115037,9 @@ exports.bailout = parserState => { const value = parserStateExportsState.get(parserState); parserStateExportsState.set(parserState, false); if (value === true) { - parserState.module.buildMeta.exportsType = undefined; - parserState.module.buildMeta.defaultObject = false; + const buildMeta = /** @type {BuildMeta} */ (parserState.module.buildMeta); + buildMeta.exportsType = undefined; + buildMeta.defaultObject = false; } }; @@ -110777,8 +115052,9 @@ exports.enable = parserState => { if (value === false) return; parserStateExportsState.set(parserState, true); if (value !== true) { - parserState.module.buildMeta.exportsType = "default"; - parserState.module.buildMeta.defaultObject = "redirect"; + const buildMeta = /** @type {BuildMeta} */ (parserState.module.buildMeta); + buildMeta.exportsType = "default"; + buildMeta.defaultObject = "redirect"; } }; @@ -110789,7 +115065,7 @@ exports.enable = parserState => { exports.setFlagged = parserState => { const value = parserStateExportsState.get(parserState); if (value !== true) return; - const buildMeta = parserState.module.buildMeta; + const buildMeta = /** @type {BuildMeta} */ (parserState.module.buildMeta); if (buildMeta.exportsType === "dynamic") return; buildMeta.exportsType = "flagged"; }; @@ -110801,7 +115077,8 @@ exports.setFlagged = parserState => { exports.setDynamic = parserState => { const value = parserStateExportsState.get(parserState); if (value !== true) return; - parserState.module.buildMeta.exportsType = "dynamic"; + /** @type {BuildMeta} */ + (parserState.module.buildMeta).exportsType = "dynamic"; }; /** @@ -110816,7 +115093,7 @@ exports.isEnabled = parserState => { /***/ }), -/***/ 54511: +/***/ 49787: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -110827,8 +115104,8 @@ exports.isEnabled = parserState => { -const makeSerializable = __webpack_require__(23827); -const ModuleDependency = __webpack_require__(22994); +const makeSerializable = __webpack_require__(83626); +const ModuleDependency = __webpack_require__(10931); class EntryDependency extends ModuleDependency { /** @@ -110854,7 +115131,7 @@ module.exports = EntryDependency; /***/ }), -/***/ 38914: +/***/ 624: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -110865,9 +115142,9 @@ module.exports = EntryDependency; -const { UsageState } = __webpack_require__(1723); -const makeSerializable = __webpack_require__(23827); -const NullDependency = __webpack_require__(74263); +const { UsageState } = __webpack_require__(14768); +const makeSerializable = __webpack_require__(83626); +const NullDependency = __webpack_require__(87568); /** @typedef {import("webpack-sources").ReplaceSource} ReplaceSource */ /** @typedef {import("../ChunkGraph")} ChunkGraph */ @@ -110876,6 +115153,9 @@ const NullDependency = __webpack_require__(74263); /** @typedef {import("../DependencyTemplate").DependencyTemplateContext} DependencyTemplateContext */ /** @typedef {import("../Module")} Module */ /** @typedef {import("../ModuleGraph")} ModuleGraph */ +/** @typedef {import("../javascript/JavascriptParser").Range} Range */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */ /** @typedef {import("../util/Hash")} Hash */ /** @typedef {import("../util/runtime").RuntimeSpec} RuntimeSpec */ @@ -110908,19 +115188,23 @@ const getProperty = (moduleGraph, module, exportName, property, runtime) => { switch (property) { case "canMangle": { const exportsInfo = moduleGraph.getExportsInfo(module); - const exportInfo = exportsInfo.getExportInfo(exportName); + const exportInfo = exportsInfo.getExportInfo( + /** @type {string} */ (exportName) + ); if (exportInfo) return exportInfo.canMangle; return exportsInfo.otherExportsInfo.canMangle; } case "used": return ( - moduleGraph.getExportsInfo(module).getUsed(exportName, runtime) !== + moduleGraph + .getExportsInfo(module) + .getUsed(/** @type {string} */ (exportName), runtime) !== UsageState.Unused ); case "useInfo": { const state = moduleGraph .getExportsInfo(module) - .getUsed(exportName, runtime); + .getUsed(/** @type {string} */ (exportName), runtime); switch (state) { case UsageState.Used: case UsageState.OnlyPropertiesUsed: @@ -110936,12 +115220,19 @@ const getProperty = (moduleGraph, module, exportName, property, runtime) => { } } case "provideInfo": - return moduleGraph.getExportsInfo(module).isExportProvided(exportName); + return moduleGraph + .getExportsInfo(module) + .isExportProvided(/** @type {string} */ (exportName)); } return undefined; }; class ExportsInfoDependency extends NullDependency { + /** + * @param {Range} range range + * @param {TODO} exportName export name + * @param {string | null} property property + */ constructor(range, exportName, property) { super(); this.range = range; @@ -110949,6 +115240,9 @@ class ExportsInfoDependency extends NullDependency { this.property = property; } + /** + * @param {ObjectSerializerContext} context context + */ serialize(context) { const { write } = context; write(this.range); @@ -110957,6 +115251,10 @@ class ExportsInfoDependency extends NullDependency { super.serialize(context); } + /** + * @param {ObjectDeserializerContext} context context + * @returns {ExportsInfoDependency} ExportsInfoDependency + */ static deserialize(context) { const obj = new ExportsInfoDependency( context.read(), @@ -111005,7 +115303,7 @@ module.exports = ExportsInfoDependency; /***/ }), -/***/ 13071: +/***/ 94610: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -111016,19 +115314,22 @@ module.exports = ExportsInfoDependency; -const Template = __webpack_require__(88070); -const makeSerializable = __webpack_require__(23827); -const HarmonyImportDependency = __webpack_require__(52405); -const NullDependency = __webpack_require__(74263); +const Template = __webpack_require__(88835); +const makeSerializable = __webpack_require__(83626); +const HarmonyImportDependency = __webpack_require__(75650); +const NullDependency = __webpack_require__(87568); /** @typedef {import("webpack-sources").ReplaceSource} ReplaceSource */ /** @typedef {import("../Dependency")} Dependency */ /** @typedef {import("../DependencyTemplate").DependencyTemplateContext} DependencyTemplateContext */ +/** @typedef {import("../javascript/JavascriptParser").Range} Range */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */ /** @typedef {import("./HarmonyAcceptImportDependency")} HarmonyAcceptImportDependency */ class HarmonyAcceptDependency extends NullDependency { /** - * @param {[number, number]} range expression range + * @param {Range} range expression range * @param {HarmonyAcceptImportDependency[]} dependencies import dependencies * @param {boolean} hasCallback true, if the range wraps an existing callback */ @@ -111043,6 +115344,9 @@ class HarmonyAcceptDependency extends NullDependency { return "accepted harmony modules"; } + /** + * @param {ObjectSerializerContext} context context + */ serialize(context) { const { write } = context; write(this.range); @@ -111051,6 +115355,9 @@ class HarmonyAcceptDependency extends NullDependency { super.serialize(context); } + /** + * @param {ObjectDeserializerContext} context context + */ deserialize(context) { const { read } = context; this.range = read(); @@ -111147,7 +115454,7 @@ module.exports = HarmonyAcceptDependency; /***/ }), -/***/ 75315: +/***/ 75402: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -111158,15 +115465,18 @@ module.exports = HarmonyAcceptDependency; -const makeSerializable = __webpack_require__(23827); -const HarmonyImportDependency = __webpack_require__(52405); -const NullDependency = __webpack_require__(74263); +const makeSerializable = __webpack_require__(83626); +const HarmonyImportDependency = __webpack_require__(75650); +const NullDependency = __webpack_require__(87568); /** @typedef {import("webpack-sources").ReplaceSource} ReplaceSource */ /** @typedef {import("../Dependency")} Dependency */ /** @typedef {import("../DependencyTemplate").DependencyTemplateContext} DependencyTemplateContext */ class HarmonyAcceptImportDependency extends HarmonyImportDependency { + /** + * @param {string} request the request string + */ constructor(request) { super(request, NaN); this.weak = true; @@ -111192,7 +115502,7 @@ module.exports = HarmonyAcceptImportDependency; /***/ }), -/***/ 66565: +/***/ 695: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -111203,16 +115513,17 @@ module.exports = HarmonyAcceptImportDependency; -const { UsageState } = __webpack_require__(1723); -const InitFragment = __webpack_require__(53658); -const RuntimeGlobals = __webpack_require__(34623); -const makeSerializable = __webpack_require__(23827); -const NullDependency = __webpack_require__(74263); +const { UsageState } = __webpack_require__(14768); +const InitFragment = __webpack_require__(44508); +const RuntimeGlobals = __webpack_require__(61539); +const makeSerializable = __webpack_require__(83626); +const NullDependency = __webpack_require__(87568); /** @typedef {import("webpack-sources").ReplaceSource} ReplaceSource */ /** @typedef {import("../Dependency")} Dependency */ /** @typedef {import("../DependencyTemplate").DependencyTemplateContext} DependencyTemplateContext */ /** @typedef {import("../Module")} Module */ +/** @typedef {import("../Module").BuildMeta} BuildMeta */ class HarmonyCompatibilityDependency extends NullDependency { get type() { @@ -111278,7 +115589,7 @@ HarmonyCompatibilityDependency.Template = class HarmonyExportDependencyTemplate 0, undefined, `\n__webpack_async_result__();\n} catch(e) { __webpack_async_result__(e); } }${ - module.buildMeta.async ? ", 1" : "" + /** @type {BuildMeta} */ (module.buildMeta).async ? ", 1" : "" });` ) ); @@ -111291,7 +115602,7 @@ module.exports = HarmonyCompatibilityDependency; /***/ }), -/***/ 92810: +/***/ 92083: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -111302,19 +115613,32 @@ module.exports = HarmonyCompatibilityDependency; -const DynamicExports = __webpack_require__(51930); -const HarmonyCompatibilityDependency = __webpack_require__(66565); -const HarmonyExports = __webpack_require__(60035); +const { JAVASCRIPT_MODULE_TYPE_ESM } = __webpack_require__(92891); +const DynamicExports = __webpack_require__(24974); +const HarmonyCompatibilityDependency = __webpack_require__(695); +const HarmonyExports = __webpack_require__(33080); + +/** @typedef {import("../Module").BuildMeta} BuildMeta */ +/** @typedef {import("../javascript/JavascriptParser")} JavascriptParser */ +/** @typedef {import("./HarmonyModulesPlugin").HarmonyModulesPluginOptions} HarmonyModulesPluginOptions */ module.exports = class HarmonyDetectionParserPlugin { + /** + * @param {HarmonyModulesPluginOptions} options options + */ constructor(options) { const { topLevelAwait = false } = options || {}; this.topLevelAwait = topLevelAwait; } + /** + * @param {JavascriptParser} parser the parser + * @returns {void} + */ apply(parser) { parser.hooks.program.tap("HarmonyDetectionParserPlugin", ast => { - const isStrictHarmony = parser.state.module.type === "javascript/esm"; + const isStrictHarmony = + parser.state.module.type === JAVASCRIPT_MODULE_TYPE_ESM; const isHarmony = isStrictHarmony || ast.body.some( @@ -111357,15 +115681,22 @@ module.exports = class HarmonyDetectionParserPlugin { "Top-level-await is only supported in EcmaScript Modules" ); } - module.buildMeta.async = true; + /** @type {BuildMeta} */ + (module.buildMeta).async = true; }); + /** + * @returns {boolean | undefined} true if in harmony + */ const skipInHarmony = () => { if (HarmonyExports.isEnabled(parser.state)) { return true; } }; + /** + * @returns {null | undefined} null if in harmony + */ const nullInHarmony = () => { if (HarmonyExports.isEnabled(parser.state)) { return null; @@ -111396,7 +115727,7 @@ module.exports = class HarmonyDetectionParserPlugin { /***/ }), -/***/ 61911: +/***/ 28962: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -111407,13 +115738,19 @@ module.exports = class HarmonyDetectionParserPlugin { -const makeSerializable = __webpack_require__(23827); -const HarmonyImportSpecifierDependency = __webpack_require__(13474); +const makeSerializable = __webpack_require__(83626); +const HarmonyImportSpecifierDependency = __webpack_require__(72952); /** @typedef {import("webpack-sources").ReplaceSource} ReplaceSource */ /** @typedef {import("../ChunkGraph")} ChunkGraph */ /** @typedef {import("../Dependency")} Dependency */ /** @typedef {import("../DependencyTemplate").DependencyTemplateContext} DependencyTemplateContext */ +/** @typedef {import("../Module").BuildMeta} BuildMeta */ +/** @typedef {import("../ModuleGraphConnection")} ModuleGraphConnection */ +/** @typedef {import("../javascript/JavascriptParser").Assertions} Assertions */ +/** @typedef {import("../javascript/JavascriptParser").Range} Range */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */ /** * Dependency for static evaluating import specifier. e.g. @@ -111423,8 +115760,17 @@ const HarmonyImportSpecifierDependency = __webpack_require__(13474); * a.x !== undefined; // if x value statically analyzable */ class HarmonyEvaluatedImportSpecifierDependency extends HarmonyImportSpecifierDependency { + /** + * @param {string} request the request string + * @param {number} sourceOrder source order + * @param {TODO} ids ids + * @param {TODO} name name + * @param {Range} range location in source code + * @param {Assertions} assertions assertions + * @param {string} operator operator + */ constructor(request, sourceOrder, ids, name, range, assertions, operator) { - super(request, sourceOrder, ids, name, range, false, assertions); + super(request, sourceOrder, ids, name, range, false, assertions, []); this.operator = operator; } @@ -111432,12 +115778,18 @@ class HarmonyEvaluatedImportSpecifierDependency extends HarmonyImportSpecifierDe return `evaluated X ${this.operator} harmony import specifier`; } + /** + * @param {ObjectSerializerContext} context context + */ serialize(context) { super.serialize(context); const { write } = context; write(this.operator); } + /** + * @param {ObjectDeserializerContext} context context + */ deserialize(context) { super.deserialize(context); const { read } = context; @@ -111468,15 +115820,20 @@ HarmonyEvaluatedImportSpecifierDependency.Template = class HarmonyEvaluatedImpor // Skip rendering depending when dependency is conditional if (connection && !connection.isTargetActive(runtime)) return; - const exportsInfo = moduleGraph.getExportsInfo(connection.module); + const exportsInfo = moduleGraph.getExportsInfo( + /** @type {ModuleGraphConnection} */ (connection).module + ); const ids = dep.getIds(moduleGraph); let value; - const exportsType = connection.module.getExportsType( - moduleGraph, - module.buildMeta.strictHarmonyModule - ); + const exportsType = + /** @type {ModuleGraphConnection} */ + (connection).module.getExportsType( + moduleGraph, + /** @type {BuildMeta} */ + (module.buildMeta).strictHarmonyModule + ); switch (exportsType) { case "default-with-named": { if (ids[0] === "default") { @@ -111531,7 +115888,7 @@ module.exports = HarmonyEvaluatedImportSpecifierDependency; /***/ }), -/***/ 78576: +/***/ 59522: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -111542,22 +115899,27 @@ module.exports = HarmonyEvaluatedImportSpecifierDependency; -const InnerGraph = __webpack_require__(91424); -const ConstDependency = __webpack_require__(78284); -const HarmonyExportExpressionDependency = __webpack_require__(16387); -const HarmonyExportHeaderDependency = __webpack_require__(90756); -const HarmonyExportImportedSpecifierDependency = __webpack_require__(49933); -const HarmonyExportSpecifierDependency = __webpack_require__(88613); -const { ExportPresenceModes } = __webpack_require__(52405); +const InnerGraph = __webpack_require__(53310); +const ConstDependency = __webpack_require__(67538); +const HarmonyExportExpressionDependency = __webpack_require__(93126); +const HarmonyExportHeaderDependency = __webpack_require__(57220); +const HarmonyExportImportedSpecifierDependency = __webpack_require__(75624); +const HarmonyExportSpecifierDependency = __webpack_require__(59542); +const { ExportPresenceModes } = __webpack_require__(75650); const { harmonySpecifierTag, getAssertions -} = __webpack_require__(90102); -const HarmonyImportSideEffectDependency = __webpack_require__(75307); +} = __webpack_require__(72893); +const HarmonyImportSideEffectDependency = __webpack_require__(73187); + +/** @typedef {import("../javascript/JavascriptParser")} JavascriptParser */ const { HarmonyStarExportsList } = HarmonyExportImportedSpecifierDependency; module.exports = class HarmonyExportDependencyParserPlugin { + /** + * @param {import("../../declarations/WebpackOptions").JavascriptParserOptions} options options + */ constructor(options) { this.exportPresenceMode = options.reexportExportsPresence !== undefined @@ -111724,7 +116086,7 @@ module.exports = class HarmonyExportDependencyParserPlugin { /***/ }), -/***/ 16387: +/***/ 93126: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -111735,11 +116097,12 @@ module.exports = class HarmonyExportDependencyParserPlugin { -const ConcatenationScope = __webpack_require__(68645); -const RuntimeGlobals = __webpack_require__(34623); -const makeSerializable = __webpack_require__(23827); -const HarmonyExportInitFragment = __webpack_require__(82439); -const NullDependency = __webpack_require__(74263); +const ConcatenationScope = __webpack_require__(92811); +const RuntimeGlobals = __webpack_require__(61539); +const makeSerializable = __webpack_require__(83626); +const propertyAccess = __webpack_require__(60305); +const HarmonyExportInitFragment = __webpack_require__(55289); +const NullDependency = __webpack_require__(87568); /** @typedef {import("webpack-sources").ReplaceSource} ReplaceSource */ /** @typedef {import("../Dependency")} Dependency */ @@ -111747,8 +116110,17 @@ const NullDependency = __webpack_require__(74263); /** @typedef {import("../DependencyTemplate").DependencyTemplateContext} DependencyTemplateContext */ /** @typedef {import("../ModuleGraph")} ModuleGraph */ /** @typedef {import("../ModuleGraphConnection").ConnectionState} ConnectionState */ +/** @typedef {import("../javascript/JavascriptParser").Range} Range */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */ class HarmonyExportExpressionDependency extends NullDependency { + /** + * @param {Range} range range + * @param {Range} rangeStatement range statement + * @param {string} prefix prefix + * @param {string | { range: Range, prefix: string, suffix: string }} [declarationId] declaration id + */ constructor(range, rangeStatement, prefix, declarationId) { super(); this.range = range; @@ -111784,6 +116156,9 @@ class HarmonyExportExpressionDependency extends NullDependency { return false; } + /** + * @param {ObjectSerializerContext} context context + */ serialize(context) { const { write } = context; write(this.range); @@ -111793,6 +116168,9 @@ class HarmonyExportExpressionDependency extends NullDependency { super.serialize(context); } + /** + * @param {ObjectDeserializerContext} context context + */ deserialize(context) { const { read } = context; this.range = read(); @@ -111865,6 +116243,7 @@ HarmonyExportExpressionDependency.Template = class HarmonyExportDependencyTempla `/* harmony default export */ ${dep.prefix}` ); } else { + /** @type {string} */ let content; const name = ConcatenationScope.DEFAULT_EXPORT; if (runtimeTemplate.supportsConst()) { @@ -111894,9 +116273,9 @@ HarmonyExportExpressionDependency.Template = class HarmonyExportDependencyTempla if (used) { runtimeRequirements.add(RuntimeGlobals.exports); // This is a little bit incorrect as TDZ is not correct, but we can't use const. - content = `/* harmony default export */ ${exportsName}[${JSON.stringify( - used - )}] = `; + content = `/* harmony default export */ ${exportsName}${propertyAccess( + typeof used === "string" ? [used] : used + )} = `; } else { content = `/* unused harmony default export */ var ${name} = `; } @@ -111922,7 +116301,7 @@ module.exports = HarmonyExportExpressionDependency; /***/ }), -/***/ 90756: +/***/ 57220: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -111933,14 +116312,21 @@ module.exports = HarmonyExportExpressionDependency; -const makeSerializable = __webpack_require__(23827); -const NullDependency = __webpack_require__(74263); +const makeSerializable = __webpack_require__(83626); +const NullDependency = __webpack_require__(87568); /** @typedef {import("webpack-sources").ReplaceSource} ReplaceSource */ /** @typedef {import("../Dependency")} Dependency */ /** @typedef {import("../DependencyTemplate").DependencyTemplateContext} DependencyTemplateContext */ +/** @typedef {import("../javascript/JavascriptParser").Range} Range */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */ class HarmonyExportHeaderDependency extends NullDependency { + /** + * @param {Range} range range + * @param {Range} rangeStatement range statement + */ constructor(range, rangeStatement) { super(); this.range = range; @@ -111951,6 +116337,9 @@ class HarmonyExportHeaderDependency extends NullDependency { return "harmony export header"; } + /** + * @param {ObjectSerializerContext} context context + */ serialize(context) { const { write } = context; write(this.range); @@ -111958,6 +116347,9 @@ class HarmonyExportHeaderDependency extends NullDependency { super.serialize(context); } + /** + * @param {ObjectDeserializerContext} context context + */ deserialize(context) { const { read } = context; this.range = read(); @@ -111995,7 +116387,7 @@ module.exports = HarmonyExportHeaderDependency; /***/ }), -/***/ 49933: +/***/ 75624: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -112006,20 +116398,21 @@ module.exports = HarmonyExportHeaderDependency; -const Dependency = __webpack_require__(68242); -const { UsageState } = __webpack_require__(1723); -const HarmonyLinkingError = __webpack_require__(71905); -const InitFragment = __webpack_require__(53658); -const RuntimeGlobals = __webpack_require__(34623); -const Template = __webpack_require__(88070); -const { countIterable } = __webpack_require__(99958); -const { first, combine } = __webpack_require__(97045); -const makeSerializable = __webpack_require__(23827); -const propertyAccess = __webpack_require__(92884); -const { getRuntimeKey, keyToRuntime } = __webpack_require__(55693); -const HarmonyExportInitFragment = __webpack_require__(82439); -const HarmonyImportDependency = __webpack_require__(52405); -const processExportInfo = __webpack_require__(6822); +const Dependency = __webpack_require__(504); +const { UsageState } = __webpack_require__(14768); +const HarmonyLinkingError = __webpack_require__(63325); +const InitFragment = __webpack_require__(44508); +const RuntimeGlobals = __webpack_require__(61539); +const Template = __webpack_require__(88835); +const { countIterable } = __webpack_require__(12281); +const { first, combine } = __webpack_require__(24352); +const makeSerializable = __webpack_require__(83626); +const propertyAccess = __webpack_require__(60305); +const { propertyName } = __webpack_require__(40234); +const { getRuntimeKey, keyToRuntime } = __webpack_require__(69965); +const HarmonyExportInitFragment = __webpack_require__(55289); +const HarmonyImportDependency = __webpack_require__(75650); +const processExportInfo = __webpack_require__(63152); /** @typedef {import("webpack-sources").ReplaceSource} ReplaceSource */ /** @typedef {import("../ChunkGraph")} ChunkGraph */ @@ -112036,6 +116429,9 @@ const processExportInfo = __webpack_require__(6822); /** @typedef {import("../ModuleGraphConnection").ConnectionState} ConnectionState */ /** @typedef {import("../RuntimeTemplate")} RuntimeTemplate */ /** @typedef {import("../WebpackError")} WebpackError */ +/** @typedef {import("../javascript/JavascriptParser").Assertions} Assertions */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */ /** @typedef {import("../util/Hash")} Hash */ /** @typedef {import("../util/runtime").RuntimeSpec} RuntimeSpec */ @@ -112327,10 +116723,10 @@ class HarmonyExportImportedSpecifierDependency extends HarmonyImportDependency { * @param {string[]} ids the requested export name of the imported module * @param {string | null} name the export name of for this module * @param {Set} activeExports other named exports in the module - * @param {ReadonlyArray | Iterable} otherStarExports other star exports in the module before this import + * @param {ReadonlyArray | Iterable | null} otherStarExports other star exports in the module before this import * @param {number} exportPresenceMode mode of checking export names - * @param {HarmonyStarExportsList} allStarExports all star exports in the module - * @param {Record=} assertions import assertions + * @param {HarmonyStarExportsList | null} allStarExports all star exports in the module + * @param {Assertions=} assertions import assertions */ constructor( request, @@ -112753,7 +117149,7 @@ class HarmonyExportImportedSpecifierDependency extends HarmonyImportDependency { /** * Returns warnings * @param {ModuleGraph} moduleGraph module graph - * @returns {WebpackError[]} warnings + * @returns {WebpackError[] | null | undefined} warnings */ getWarnings(moduleGraph) { const exportsPresence = this._getEffectiveExportPresenceLevel(moduleGraph); @@ -112766,7 +117162,7 @@ class HarmonyExportImportedSpecifierDependency extends HarmonyImportDependency { /** * Returns errors * @param {ModuleGraph} moduleGraph module graph - * @returns {WebpackError[]} errors + * @returns {WebpackError[] | null | undefined} errors */ getErrors(moduleGraph) { const exportsPresence = this._getEffectiveExportPresenceLevel(moduleGraph); @@ -112857,6 +117253,9 @@ class HarmonyExportImportedSpecifierDependency extends HarmonyImportDependency { return errors; } + /** + * @param {ObjectSerializerContext} context context + */ serialize(context) { const { write, setCircularReference } = context; @@ -112871,6 +117270,9 @@ class HarmonyExportImportedSpecifierDependency extends HarmonyImportDependency { super.serialize(context); } + /** + * @param {ObjectDeserializerContext} context context + */ deserialize(context) { const { read, setCircularReference } = context; @@ -113212,7 +117614,7 @@ HarmonyExportImportedSpecifierDependency.Template = class HarmonyExportImportedS valueKey[0] )})) ${ RuntimeGlobals.definePropertyGetters - }(${exportsName}, { ${JSON.stringify( + }(${exportsName}, { ${propertyName( key )}: function() { return ${returnValue}; } });\n`; } @@ -113252,11 +117654,17 @@ class HarmonyStarExportsList { return this.dependencies.slice(); } + /** + * @param {ObjectSerializerContext} context context + */ serialize({ write, setCircularReference }) { setCircularReference(this); write(this.dependencies); } + /** + * @param {ObjectDeserializerContext} context context + */ deserialize({ read, setCircularReference }) { setCircularReference(this); this.dependencies = read(); @@ -113274,7 +117682,7 @@ module.exports.HarmonyStarExportsList = HarmonyStarExportsList; /***/ }), -/***/ 82439: +/***/ 55289: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -113285,9 +117693,10 @@ module.exports.HarmonyStarExportsList = HarmonyStarExportsList; -const InitFragment = __webpack_require__(53658); -const RuntimeGlobals = __webpack_require__(34623); -const { first } = __webpack_require__(97045); +const InitFragment = __webpack_require__(44508); +const RuntimeGlobals = __webpack_require__(61539); +const { first } = __webpack_require__(24352); +const { propertyName } = __webpack_require__(40234); /** @typedef {import("webpack-sources").Source} Source */ /** @typedef {import("../Generator").GenerateContext} GenerateContext */ @@ -113430,7 +117839,7 @@ class HarmonyExportInitFragment extends InitFragment { ); for (const [key, value] of orderedExportMap) { definitions.push( - `\n/* harmony export */ ${JSON.stringify( + `\n/* harmony export */ ${propertyName( key )}: ${runtimeTemplate.returningFunction(value)}` ); @@ -113450,7 +117859,7 @@ module.exports = HarmonyExportInitFragment; /***/ }), -/***/ 88613: +/***/ 59542: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -113461,9 +117870,9 @@ module.exports = HarmonyExportInitFragment; -const makeSerializable = __webpack_require__(23827); -const HarmonyExportInitFragment = __webpack_require__(82439); -const NullDependency = __webpack_require__(74263); +const makeSerializable = __webpack_require__(83626); +const HarmonyExportInitFragment = __webpack_require__(55289); +const NullDependency = __webpack_require__(87568); /** @typedef {import("webpack-sources").ReplaceSource} ReplaceSource */ /** @typedef {import("../Dependency")} Dependency */ @@ -113471,8 +117880,14 @@ const NullDependency = __webpack_require__(74263); /** @typedef {import("../DependencyTemplate").DependencyTemplateContext} DependencyTemplateContext */ /** @typedef {import("../ModuleGraph")} ModuleGraph */ /** @typedef {import("../ModuleGraphConnection").ConnectionState} ConnectionState */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */ class HarmonyExportSpecifierDependency extends NullDependency { + /** + * @param {TODO} id id + * @param {TODO} name name + */ constructor(id, name) { super(); this.id = id; @@ -113505,6 +117920,9 @@ class HarmonyExportSpecifierDependency extends NullDependency { return false; } + /** + * @param {ObjectSerializerContext} context context + */ serialize(context) { const { write } = context; write(this.id); @@ -113512,6 +117930,9 @@ class HarmonyExportSpecifierDependency extends NullDependency { super.serialize(context); } + /** + * @param {ObjectDeserializerContext} context context + */ deserialize(context) { const { read } = context; this.id = read(); @@ -113569,8 +117990,8 @@ module.exports = HarmonyExportSpecifierDependency; /***/ }), -/***/ 60035: -/***/ (function(__unused_webpack_module, exports) { +/***/ 33080: +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; /* @@ -113580,6 +118001,10 @@ module.exports = HarmonyExportSpecifierDependency; +const RuntimeGlobals = __webpack_require__(61539); + +/** @typedef {import("../Module").BuildInfo} BuildInfo */ +/** @typedef {import("../Module").BuildMeta} BuildMeta */ /** @typedef {import("../Parser").ParserState} ParserState */ /** @type {WeakMap} */ @@ -113595,12 +118020,14 @@ exports.enable = (parserState, isStrictHarmony) => { if (value === false) return; parserStateExportsState.set(parserState, true); if (value !== true) { - parserState.module.buildMeta.exportsType = "namespace"; - parserState.module.buildInfo.strict = true; - parserState.module.buildInfo.exportsArgument = "__webpack_exports__"; + const buildMeta = /** @type {BuildMeta} */ (parserState.module.buildMeta); + buildMeta.exportsType = "namespace"; + const buildInfo = /** @type {BuildInfo} */ (parserState.module.buildInfo); + buildInfo.strict = true; + buildInfo.exportsArgument = RuntimeGlobals.exports; if (isStrictHarmony) { - parserState.module.buildMeta.strictHarmonyModule = true; - parserState.module.buildInfo.moduleArgument = "__webpack_module__"; + buildMeta.strictHarmonyModule = true; + buildInfo.moduleArgument = "__webpack_module__"; } } }; @@ -113617,7 +118044,7 @@ exports.isEnabled = parserState => { /***/ }), -/***/ 52405: +/***/ 75650: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -113628,14 +118055,14 @@ exports.isEnabled = parserState => { -const ConditionalInitFragment = __webpack_require__(63723); -const Dependency = __webpack_require__(68242); -const HarmonyLinkingError = __webpack_require__(71905); -const InitFragment = __webpack_require__(53658); -const Template = __webpack_require__(88070); -const AwaitDependenciesInitFragment = __webpack_require__(76425); -const { filterRuntime, mergeRuntime } = __webpack_require__(55693); -const ModuleDependency = __webpack_require__(22994); +const ConditionalInitFragment = __webpack_require__(1617); +const Dependency = __webpack_require__(504); +const HarmonyLinkingError = __webpack_require__(63325); +const InitFragment = __webpack_require__(44508); +const Template = __webpack_require__(88835); +const AwaitDependenciesInitFragment = __webpack_require__(37153); +const { filterRuntime, mergeRuntime } = __webpack_require__(69965); +const ModuleDependency = __webpack_require__(10931); /** @typedef {import("webpack-sources").ReplaceSource} ReplaceSource */ /** @typedef {import("webpack-sources").Source} Source */ @@ -113647,6 +118074,9 @@ const ModuleDependency = __webpack_require__(22994); /** @typedef {import("../ModuleGraph")} ModuleGraph */ /** @typedef {import("../RuntimeTemplate")} RuntimeTemplate */ /** @typedef {import("../WebpackError")} WebpackError */ +/** @typedef {import("../javascript/JavascriptParser").Assertions} Assertions */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */ /** @typedef {import("../util/Hash")} Hash */ /** @typedef {import("../util/runtime").RuntimeSpec} RuntimeSpec */ @@ -113676,7 +118106,7 @@ class HarmonyImportDependency extends ModuleDependency { * * @param {string} request request string * @param {number} sourceOrder source order - * @param {Record=} assertions import assertions + * @param {Assertions=} assertions import assertions */ constructor(request, sourceOrder, assertions) { super(request); @@ -113844,6 +118274,9 @@ class HarmonyImportDependency extends ModuleDependency { } } + /** + * @param {ObjectSerializerContext} context context + */ serialize(context) { const { write } = context; write(this.sourceOrder); @@ -113851,6 +118284,9 @@ class HarmonyImportDependency extends ModuleDependency { super.serialize(context); } + /** + * @param {ObjectDeserializerContext} context context + */ deserialize(context) { const { read } = context; this.sourceOrder = read(); @@ -113984,7 +118420,7 @@ module.exports.ExportPresenceModes = ExportPresenceModes; /***/ }), -/***/ 90102: +/***/ 72893: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -113995,24 +118431,28 @@ module.exports.ExportPresenceModes = ExportPresenceModes; -const HotModuleReplacementPlugin = __webpack_require__(92837); -const InnerGraph = __webpack_require__(91424); -const ConstDependency = __webpack_require__(78284); -const HarmonyAcceptDependency = __webpack_require__(13071); -const HarmonyAcceptImportDependency = __webpack_require__(75315); -const HarmonyEvaluatedImportSpecifierDependency = __webpack_require__(61911); -const HarmonyExports = __webpack_require__(60035); -const { ExportPresenceModes } = __webpack_require__(52405); -const HarmonyImportSideEffectDependency = __webpack_require__(75307); -const HarmonyImportSpecifierDependency = __webpack_require__(13474); +const HotModuleReplacementPlugin = __webpack_require__(41490); +const InnerGraph = __webpack_require__(53310); +const ConstDependency = __webpack_require__(67538); +const HarmonyAcceptDependency = __webpack_require__(94610); +const HarmonyAcceptImportDependency = __webpack_require__(75402); +const HarmonyEvaluatedImportSpecifierDependency = __webpack_require__(28962); +const HarmonyExports = __webpack_require__(33080); +const { ExportPresenceModes } = __webpack_require__(75650); +const HarmonyImportSideEffectDependency = __webpack_require__(73187); +const HarmonyImportSpecifierDependency = __webpack_require__(72952); /** @typedef {import("estree").ExportAllDeclaration} ExportAllDeclaration */ /** @typedef {import("estree").ExportNamedDeclaration} ExportNamedDeclaration */ /** @typedef {import("estree").Identifier} Identifier */ /** @typedef {import("estree").ImportDeclaration} ImportDeclaration */ /** @typedef {import("estree").ImportExpression} ImportExpression */ +/** @typedef {import("estree").MemberExpression} MemberExpression */ /** @typedef {import("../../declarations/WebpackOptions").JavascriptParserOptions} JavascriptParserOptions */ +/** @typedef {import("../Dependency").DependencyLocation} DependencyLocation */ +/** @typedef {import("../javascript/BasicEvaluatedExpression")} BasicEvaluatedExpression */ /** @typedef {import("../javascript/JavascriptParser")} JavascriptParser */ +/** @typedef {import("../javascript/JavascriptParser").Range} Range */ /** @typedef {import("../optimize/InnerGraph").InnerGraph} InnerGraph */ /** @typedef {import("../optimize/InnerGraph").TopLevelSymbol} TopLevelSymbol */ /** @typedef {import("./HarmonyImportDependency")} HarmonyImportDependency */ @@ -114103,19 +118543,21 @@ module.exports = class HarmonyImportDependencyParserPlugin { parser.state.lastHarmonyImportOrder = (parser.state.lastHarmonyImportOrder || 0) + 1; const clearDep = new ConstDependency( - parser.isAsiPosition(statement.range[0]) ? ";" : "", - statement.range + parser.isAsiPosition(/** @type {Range} */ (statement.range)[0]) + ? ";" + : "", + /** @type {Range} */ (statement.range) ); - clearDep.loc = statement.loc; + clearDep.loc = /** @type {DependencyLocation} */ (statement.loc); parser.state.module.addPresentationalDependency(clearDep); - parser.unsetAsiPosition(statement.range[1]); + parser.unsetAsiPosition(/** @type {Range} */ (statement.range)[1]); const assertions = getAssertions(statement); const sideEffectDep = new HarmonyImportSideEffectDependency( source, parser.state.lastHarmonyImportOrder, assertions ); - sideEffectDep.loc = statement.loc; + sideEffectDep.loc = /** @type {DependencyLocation} */ (statement.loc); parser.state.module.addDependency(sideEffectDep); return true; } @@ -114149,6 +118591,7 @@ module.exports = class HarmonyImportDependencyParserPlugin { const rootInfo = rightPart.rootInfo; if ( + typeof rootInfo === "string" || !rootInfo || !rootInfo.tagInfo || rootInfo.tagInfo.tag !== harmonySpecifierTag @@ -114161,13 +118604,15 @@ module.exports = class HarmonyImportDependencyParserPlugin { settings.sourceOrder, settings.ids.concat(members).concat([leftPart]), settings.name, - expression.range, + /** @type {Range} */ (expression.range), settings.assertions, "in" ); dep.directImport = members.length === 0; - dep.asiSafe = !parser.isAsiPosition(expression.range[0]); - dep.loc = expression.loc; + dep.asiSafe = !parser.isAsiPosition( + /** @type {Range} */ (expression.range)[0] + ); + dep.loc = /** @type {DependencyLocation} */ (expression.loc); parser.state.module.addDependency(dep); InnerGraph.onUsage(parser.state, e => (dep.usedByExports = e)); return true; @@ -114182,14 +118627,20 @@ module.exports = class HarmonyImportDependencyParserPlugin { settings.sourceOrder, settings.ids, settings.name, - expr.range, + /** @type {Range} */ (expr.range), exportPresenceMode, - settings.assertions + settings.assertions, + [] ); + dep.referencedPropertiesInDestructuring = + parser.destructuringAssignmentPropertiesFor(expr); dep.shorthand = parser.scope.inShorthand; dep.directImport = true; - dep.asiSafe = !parser.isAsiPosition(expr.range[0]); - dep.loc = expr.loc; + dep.asiSafe = !parser.isAsiPosition( + /** @type {Range} */ (expr.range)[0] + ); + dep.loc = /** @type {DependencyLocation} */ (expr.loc); + dep.call = parser.scope.inTaggedTemplateTag; parser.state.module.addDependency(dep); InnerGraph.onUsage(parser.state, e => (dep.usedByExports = e)); return true; @@ -114198,7 +118649,7 @@ module.exports = class HarmonyImportDependencyParserPlugin { .for(harmonySpecifierTag) .tap( "HarmonyImportDependencyParserPlugin", - (expression, members, membersOptionals) => { + (expression, members, membersOptionals, memberRanges) => { const settings = /** @type {HarmonySettings} */ ( parser.currentTagData ); @@ -114206,6 +118657,10 @@ module.exports = class HarmonyImportDependencyParserPlugin { members, membersOptionals ); + const ranges = memberRanges.slice( + 0, + memberRanges.length - (members.length - nonOptionalMembers.length) + ); const expr = nonOptionalMembers !== members ? getNonOptionalMemberChain( @@ -114219,12 +118674,17 @@ module.exports = class HarmonyImportDependencyParserPlugin { settings.sourceOrder, ids, settings.name, - expr.range, + /** @type {Range} */ (expr.range), exportPresenceMode, - settings.assertions + settings.assertions, + ranges ); - dep.asiSafe = !parser.isAsiPosition(expr.range[0]); - dep.loc = expr.loc; + dep.referencedPropertiesInDestructuring = + parser.destructuringAssignmentPropertiesFor(expr); + dep.asiSafe = !parser.isAsiPosition( + /** @type {Range} */ (expr.range)[0] + ); + dep.loc = /** @type {DependencyLocation} */ (expr.loc); parser.state.module.addDependency(dep); InnerGraph.onUsage(parser.state, e => (dep.usedByExports = e)); return true; @@ -114234,7 +118694,7 @@ module.exports = class HarmonyImportDependencyParserPlugin { .for(harmonySpecifierTag) .tap( "HarmonyImportDependencyParserPlugin", - (expression, members, membersOptionals) => { + (expression, members, membersOptionals, memberRanges) => { const { arguments: args, callee } = expression; const settings = /** @type {HarmonySettings} */ ( parser.currentTagData @@ -114243,6 +118703,10 @@ module.exports = class HarmonyImportDependencyParserPlugin { members, membersOptionals ); + const ranges = memberRanges.slice( + 0, + memberRanges.length - (members.length - nonOptionalMembers.length) + ); const expr = nonOptionalMembers !== members ? getNonOptionalMemberChain( @@ -114256,17 +118720,20 @@ module.exports = class HarmonyImportDependencyParserPlugin { settings.sourceOrder, ids, settings.name, - expr.range, + /** @type {Range} */ (expr.range), exportPresenceMode, - settings.assertions + settings.assertions, + ranges ); dep.directImport = members.length === 0; dep.call = true; - dep.asiSafe = !parser.isAsiPosition(expr.range[0]); + dep.asiSafe = !parser.isAsiPosition( + /** @type {Range} */ (expr.range)[0] + ); // only in case when we strictly follow the spec we need a special case here dep.namespaceObjectAsContext = members.length > 0 && this.strictThisContextOnImports; - dep.loc = expr.loc; + dep.loc = /** @type {DependencyLocation} */ (expr.loc); parser.state.module.addDependency(dep); if (args) parser.walkExpressions(args); InnerGraph.onUsage(parser.state, e => (dep.usedByExports = e)); @@ -114332,7 +118799,7 @@ module.exports.getAssertions = getAssertions; /***/ }), -/***/ 75307: +/***/ 73187: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -114343,21 +118810,26 @@ module.exports.getAssertions = getAssertions; -const makeSerializable = __webpack_require__(23827); -const HarmonyImportDependency = __webpack_require__(52405); +const makeSerializable = __webpack_require__(83626); +const HarmonyImportDependency = __webpack_require__(75650); /** @typedef {import("webpack-sources").ReplaceSource} ReplaceSource */ /** @typedef {import("../Dependency")} Dependency */ /** @typedef {import("../DependencyTemplate").DependencyTemplateContext} DependencyTemplateContext */ -/** @typedef {import("../InitFragment")} InitFragment */ /** @typedef {import("../Module")} Module */ /** @typedef {import("../ModuleGraph")} ModuleGraph */ /** @typedef {import("../ModuleGraphConnection")} ModuleGraphConnection */ /** @typedef {import("../ModuleGraphConnection").ConnectionState} ConnectionState */ +/** @typedef {import("../javascript/JavascriptParser").Assertions} Assertions */ /** @typedef {import("../util/Hash")} Hash */ /** @typedef {import("../util/runtime").RuntimeSpec} RuntimeSpec */ class HarmonyImportSideEffectDependency extends HarmonyImportDependency { + /** + * @param {TODO} request the request string + * @param {number} sourceOrder source order + * @param {Assertions=} assertions assertions + */ constructor(request, sourceOrder, assertions) { super(request, sourceOrder, assertions); } @@ -114406,7 +118878,7 @@ HarmonyImportSideEffectDependency.Template = class HarmonyImportSideEffectDepend apply(dependency, source, templateContext) { const { moduleGraph, concatenationScope } = templateContext; if (concatenationScope) { - const module = moduleGraph.getModule(dependency); + const module = /** @type {Module} */ (moduleGraph.getModule(dependency)); if (concatenationScope.isModuleInScope(module)) { return; } @@ -114420,7 +118892,7 @@ module.exports = HarmonyImportSideEffectDependency; /***/ }), -/***/ 13474: +/***/ 72952: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -114431,13 +118903,13 @@ module.exports = HarmonyImportSideEffectDependency; -const Dependency = __webpack_require__(68242); +const Dependency = __webpack_require__(504); const { getDependencyUsedByExportsCondition -} = __webpack_require__(91424); -const makeSerializable = __webpack_require__(23827); -const propertyAccess = __webpack_require__(92884); -const HarmonyImportDependency = __webpack_require__(52405); +} = __webpack_require__(53310); +const makeSerializable = __webpack_require__(83626); +const propertyAccess = __webpack_require__(60305); +const HarmonyImportDependency = __webpack_require__(75650); /** @typedef {import("webpack-sources").ReplaceSource} ReplaceSource */ /** @typedef {import("../ChunkGraph")} ChunkGraph */ @@ -114445,10 +118917,16 @@ const HarmonyImportDependency = __webpack_require__(52405); /** @typedef {import("../Dependency").ReferencedExport} ReferencedExport */ /** @typedef {import("../Dependency").UpdateHashContext} UpdateHashContext */ /** @typedef {import("../DependencyTemplate").DependencyTemplateContext} DependencyTemplateContext */ +/** @typedef {import("../Module")} Module */ +/** @typedef {import("../Module").BuildMeta} BuildMeta */ /** @typedef {import("../ModuleGraph")} ModuleGraph */ /** @typedef {import("../ModuleGraphConnection")} ModuleGraphConnection */ /** @typedef {import("../ModuleGraphConnection").ConnectionState} ConnectionState */ /** @typedef {import("../WebpackError")} WebpackError */ +/** @typedef {import("../javascript/JavascriptParser").Assertions} Assertions */ +/** @typedef {import("../javascript/JavascriptParser").Range} Range */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */ /** @typedef {import("../util/Hash")} Hash */ /** @typedef {import("../util/runtime").RuntimeSpec} RuntimeSpec */ @@ -114457,6 +118935,16 @@ const idsSymbol = Symbol("HarmonyImportSpecifierDependency.ids"); const { ExportPresenceModes } = HarmonyImportDependency; class HarmonyImportSpecifierDependency extends HarmonyImportDependency { + /** + * @param {TODO} request request + * @param {number} sourceOrder source order + * @param {string[]} ids ids + * @param {string} name name + * @param {Range} range range + * @param {TODO} exportPresenceMode export presence mode + * @param {Assertions=} assertions assertions + * @param {Range[]=} idRanges ranges for members of ids; the two arrays are right-aligned + */ constructor( request, sourceOrder, @@ -114464,20 +118952,25 @@ class HarmonyImportSpecifierDependency extends HarmonyImportDependency { name, range, exportPresenceMode, - assertions + assertions, + idRanges // TODO webpack 6 make this non-optional. It must always be set to properly trim ids. ) { super(request, sourceOrder, assertions); this.ids = ids; this.name = name; this.range = range; + this.idRanges = idRanges; this.exportPresenceMode = exportPresenceMode; + /** @type {boolean | undefined} */ this.namespaceObjectAsContext = false; this.call = undefined; this.directImport = undefined; this.shorthand = undefined; this.asiSafe = undefined; - /** @type {Set | boolean} */ + /** @type {Set | boolean | undefined} */ this.usedByExports = undefined; + /** @type {Set | undefined} */ + this.referencedPropertiesInDestructuring = undefined; } // TODO webpack 6 remove @@ -114547,20 +119040,24 @@ class HarmonyImportSpecifierDependency extends HarmonyImportDependency { */ getReferencedExports(moduleGraph, runtime) { let ids = this.getIds(moduleGraph); - if (ids.length === 0) return Dependency.EXPORTS_OBJECT_REFERENCED; + if (ids.length === 0) return this._getReferencedExportsInDestructuring(); let namespaceObjectAsContext = this.namespaceObjectAsContext; if (ids[0] === "default") { const selfModule = moduleGraph.getParentModule(this); - const importedModule = moduleGraph.getModule(this); + const importedModule = + /** @type {Module} */ + (moduleGraph.getModule(this)); switch ( importedModule.getExportsType( moduleGraph, - selfModule.buildMeta.strictHarmonyModule + /** @type {BuildMeta} */ + (selfModule.buildMeta).strictHarmonyModule ) ) { case "default-only": case "default-with-named": - if (ids.length === 1) return Dependency.EXPORTS_OBJECT_REFERENCED; + if (ids.length === 1) + return this._getReferencedExportsInDestructuring(); ids = ids.slice(1); namespaceObjectAsContext = true; break; @@ -114578,7 +119075,27 @@ class HarmonyImportSpecifierDependency extends HarmonyImportDependency { ids = ids.slice(0, -1); } - return [ids]; + return this._getReferencedExportsInDestructuring(ids); + } + + /** + * @param {string[]=} ids ids + * @returns {(string[] | ReferencedExport)[]} referenced exports + */ + _getReferencedExportsInDestructuring(ids) { + if (this.referencedPropertiesInDestructuring) { + /** @type {ReferencedExport[]} */ + const refs = []; + for (const key of this.referencedPropertiesInDestructuring) { + refs.push({ + name: ids ? ids.concat([key]) : [key], + canMangle: false + }); + } + return refs; + } else { + return ids ? [ids] : Dependency.EXPORTS_OBJECT_REFERENCED; + } } /** @@ -114588,7 +119105,10 @@ class HarmonyImportSpecifierDependency extends HarmonyImportDependency { _getEffectiveExportPresenceLevel(moduleGraph) { if (this.exportPresenceMode !== ExportPresenceModes.AUTO) return this.exportPresenceMode; - return moduleGraph.getParentModule(this).buildMeta.strictHarmonyModule + const buildMeta = /** @type {BuildMeta} */ ( + moduleGraph.getParentModule(this).buildMeta + ); + return buildMeta.strictHarmonyModule ? ExportPresenceModes.ERROR : ExportPresenceModes.WARN; } @@ -114596,7 +119116,7 @@ class HarmonyImportSpecifierDependency extends HarmonyImportDependency { /** * Returns warnings * @param {ModuleGraph} moduleGraph module graph - * @returns {WebpackError[]} warnings + * @returns {WebpackError[] | null | undefined} warnings */ getWarnings(moduleGraph) { const exportsPresence = this._getEffectiveExportPresenceLevel(moduleGraph); @@ -114609,7 +119129,7 @@ class HarmonyImportSpecifierDependency extends HarmonyImportDependency { /** * Returns errors * @param {ModuleGraph} moduleGraph module graph - * @returns {WebpackError[]} errors + * @returns {WebpackError[] | null | undefined} errors */ getErrors(moduleGraph) { const exportsPresence = this._getEffectiveExportPresenceLevel(moduleGraph); @@ -114640,11 +119160,15 @@ class HarmonyImportSpecifierDependency extends HarmonyImportDependency { return 0; } + /** + * @param {ObjectSerializerContext} context context + */ serialize(context) { const { write } = context; write(this.ids); write(this.name); write(this.range); + write(this.idRanges); write(this.exportPresenceMode); write(this.namespaceObjectAsContext); write(this.call); @@ -114652,14 +119176,19 @@ class HarmonyImportSpecifierDependency extends HarmonyImportDependency { write(this.shorthand); write(this.asiSafe); write(this.usedByExports); + write(this.referencedPropertiesInDestructuring); super.serialize(context); } + /** + * @param {ObjectDeserializerContext} context context + */ deserialize(context) { const { read } = context; this.ids = read(); this.name = read(); this.range = read(); + this.idRanges = read(); this.exportPresenceMode = read(); this.namespaceObjectAsContext = read(); this.call = read(); @@ -114667,6 +119196,7 @@ class HarmonyImportSpecifierDependency extends HarmonyImportDependency { this.shorthand = read(); this.asiSafe = read(); this.usedByExports = read(); + this.referencedPropertiesInDestructuring = read(); super.deserialize(context); } } @@ -114692,14 +119222,79 @@ HarmonyImportSpecifierDependency.Template = class HarmonyImportSpecifierDependen // Skip rendering depending when dependency is conditional if (connection && !connection.isTargetActive(runtime)) return; - const ids = dep.getIds(moduleGraph); - const exportExpr = this._getCodeForIds(dep, source, templateContext, ids); - const range = dep.range; + const ids = dep.getIds(moduleGraph); // determine minimal set of IDs. + let trimmedIds = this._trimIdsToThoseImported(ids, moduleGraph, dep); + + let [rangeStart, rangeEnd] = dep.range; + if (trimmedIds.length !== ids.length) { + // The array returned from dep.idRanges is right-aligned with the array returned from dep.getIds. + // Meaning, the two arrays may not always have the same number of elements, but the last element of + // dep.idRanges corresponds to [the expression fragment to the left of] the last element of dep.getIds. + // Use this to find the correct replacement range based on the number of ids that were trimmed. + const idx = + dep.idRanges === undefined + ? -1 /* trigger failure case below */ + : dep.idRanges.length + (trimmedIds.length - ids.length); + if (idx < 0 || idx >= dep.idRanges.length) { + // cspell:ignore minifiers + // Should not happen but we can't throw an error here because of backward compatibility with + // external plugins in wp5. Instead, we just disable trimming for now. This may break some minifiers. + trimmedIds = ids; + // TODO webpack 6 remove the "trimmedIds = ids" above and uncomment the following line instead. + // throw new Error("Missing range starts data for id replacement trimming."); + } else { + [rangeStart, rangeEnd] = dep.idRanges[idx]; + } + } + + const exportExpr = this._getCodeForIds( + dep, + source, + templateContext, + trimmedIds + ); if (dep.shorthand) { - source.insert(range[1], `: ${exportExpr}`); + source.insert(rangeEnd, `: ${exportExpr}`); } else { - source.replace(range[0], range[1] - 1, exportExpr); + source.replace(rangeStart, rangeEnd - 1, exportExpr); + } + } + + /** + * @summary Determine which IDs in the id chain are actually referring to namespaces or imports, + * and which are deeper member accessors on the imported object. Only the former should be re-rendered. + * @param {string[]} ids ids + * @param {ModuleGraph} moduleGraph moduleGraph + * @param {HarmonyImportSpecifierDependency} dependency dependency + * @returns {string[]} generated code + */ + _trimIdsToThoseImported(ids, moduleGraph, dependency) { + /** @type {string[]} */ + let trimmedIds = []; + const exportsInfo = moduleGraph.getExportsInfo( + /** @type {Module} */ (moduleGraph.getModule(dependency)) + ); + let currentExportsInfo = /** @type {ExportsInfo=} */ exportsInfo; + for (let i = 0; i < ids.length; i++) { + if (i === 0 && ids[i] === "default") { + continue; // ExportInfo for the next level under default is still at the root ExportsInfo, so don't advance currentExportsInfo + } + const exportInfo = currentExportsInfo.getExportInfo(ids[i]); + if (exportInfo.provided === false) { + // json imports have nested ExportInfo for elements that things that are not actually exported, so check .provided + trimmedIds = ids.slice(0, i); + break; + } + const nestedInfo = exportInfo.getNestedExportsInfo(); + if (!nestedInfo) { + // once all nested exports are traversed, the next item is the actual import so stop there + trimmedIds = ids.slice(0, i + 1); + break; + } + currentExportsInfo = nestedInfo; } + // Never trim to nothing. This can happen for invalid imports (e.g. import { notThere } from "./module", or import { anything } from "./missingModule") + return trimmedIds.length ? trimmedIds : ids; } /** @@ -114750,7 +119345,7 @@ HarmonyImportSpecifierDependency.Template = class HarmonyImportSpecifierDependen exportExpr = runtimeTemplate.exportFromImport({ moduleGraph, - module: moduleGraph.getModule(dep), + module: /** @type {Module} */ (moduleGraph.getModule(dep)), request: dep.request, exportName: ids, originModule: module, @@ -114773,7 +119368,7 @@ module.exports = HarmonyImportSpecifierDependency; /***/ }), -/***/ 1055: +/***/ 17775: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -114784,25 +119379,38 @@ module.exports = HarmonyImportSpecifierDependency; -const HarmonyAcceptDependency = __webpack_require__(13071); -const HarmonyAcceptImportDependency = __webpack_require__(75315); -const HarmonyCompatibilityDependency = __webpack_require__(66565); -const HarmonyEvaluatedImportSpecifierDependency = __webpack_require__(61911); -const HarmonyExportExpressionDependency = __webpack_require__(16387); -const HarmonyExportHeaderDependency = __webpack_require__(90756); -const HarmonyExportImportedSpecifierDependency = __webpack_require__(49933); -const HarmonyExportSpecifierDependency = __webpack_require__(88613); -const HarmonyImportSideEffectDependency = __webpack_require__(75307); -const HarmonyImportSpecifierDependency = __webpack_require__(13474); +const HarmonyAcceptDependency = __webpack_require__(94610); +const HarmonyAcceptImportDependency = __webpack_require__(75402); +const HarmonyCompatibilityDependency = __webpack_require__(695); +const HarmonyEvaluatedImportSpecifierDependency = __webpack_require__(28962); +const HarmonyExportExpressionDependency = __webpack_require__(93126); +const HarmonyExportHeaderDependency = __webpack_require__(57220); +const HarmonyExportImportedSpecifierDependency = __webpack_require__(75624); +const HarmonyExportSpecifierDependency = __webpack_require__(59542); +const HarmonyImportSideEffectDependency = __webpack_require__(73187); +const HarmonyImportSpecifierDependency = __webpack_require__(72952); -const HarmonyDetectionParserPlugin = __webpack_require__(92810); -const HarmonyExportDependencyParserPlugin = __webpack_require__(78576); -const HarmonyImportDependencyParserPlugin = __webpack_require__(90102); -const HarmonyTopLevelThisParserPlugin = __webpack_require__(68350); +const { + JAVASCRIPT_MODULE_TYPE_AUTO, + JAVASCRIPT_MODULE_TYPE_ESM +} = __webpack_require__(92891); +const HarmonyDetectionParserPlugin = __webpack_require__(92083); +const HarmonyExportDependencyParserPlugin = __webpack_require__(59522); +const HarmonyImportDependencyParserPlugin = __webpack_require__(72893); +const HarmonyTopLevelThisParserPlugin = __webpack_require__(55981); +/** @typedef {import("../../declarations/WebpackOptions").JavascriptParserOptions} JavascriptParserOptions */ /** @typedef {import("../Compiler")} Compiler */ +/** @typedef {import("../javascript/JavascriptParser")} Parser */ + +const PLUGIN_NAME = "HarmonyModulesPlugin"; + +/** @typedef {{ topLevelAwait?: boolean }} HarmonyModulesPluginOptions */ class HarmonyModulesPlugin { + /** + * @param {HarmonyModulesPluginOptions} options options + */ constructor(options) { this.options = options; } @@ -114814,7 +119422,7 @@ class HarmonyModulesPlugin { */ apply(compiler) { compiler.hooks.compilation.tap( - "HarmonyModulesPlugin", + PLUGIN_NAME, (compilation, { normalModuleFactory }) => { compilation.dependencyTemplates.set( HarmonyCompatibilityDependency, @@ -114886,6 +119494,11 @@ class HarmonyModulesPlugin { new HarmonyAcceptImportDependency.Template() ); + /** + * @param {Parser} parser parser parser + * @param {JavascriptParserOptions} parserOptions parserOptions + * @returns {void} + */ const handler = (parser, parserOptions) => { // TODO webpack 6: rename harmony to esm or module if (parserOptions.harmony !== undefined && !parserOptions.harmony) @@ -114898,11 +119511,11 @@ class HarmonyModulesPlugin { }; normalModuleFactory.hooks.parser - .for("javascript/auto") - .tap("HarmonyModulesPlugin", handler); + .for(JAVASCRIPT_MODULE_TYPE_AUTO) + .tap(PLUGIN_NAME, handler); normalModuleFactory.hooks.parser - .for("javascript/esm") - .tap("HarmonyModulesPlugin", handler); + .for(JAVASCRIPT_MODULE_TYPE_ESM) + .tap(PLUGIN_NAME, handler); } ); } @@ -114912,7 +119525,7 @@ module.exports = HarmonyModulesPlugin; /***/ }), -/***/ 68350: +/***/ 55981: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -114923,20 +119536,32 @@ module.exports = HarmonyModulesPlugin; -const ConstDependency = __webpack_require__(78284); -const HarmonyExports = __webpack_require__(60035); +const ConstDependency = __webpack_require__(67538); +const HarmonyExports = __webpack_require__(33080); + +/** @typedef {import("../Dependency").DependencyLocation} DependencyLocation */ +/** @typedef {import("../javascript/JavascriptParser")} JavascriptParser */ +/** @typedef {import("../javascript/JavascriptParser").Range} Range */ class HarmonyTopLevelThisParserPlugin { + /** + * @param {JavascriptParser} parser the parser + * @returns {void} + */ apply(parser) { parser.hooks.expression .for("this") .tap("HarmonyTopLevelThisParserPlugin", node => { if (!parser.scope.topLevelScope) return; if (HarmonyExports.isEnabled(parser.state)) { - const dep = new ConstDependency("undefined", node.range, null); - dep.loc = node.loc; + const dep = new ConstDependency( + "undefined", + /** @type {Range} */ (node.range), + null + ); + dep.loc = /** @type {DependencyLocation} */ (node.loc); parser.state.module.addPresentationalDependency(dep); - return this; + return true; } }); } @@ -114947,7 +119572,7 @@ module.exports = HarmonyTopLevelThisParserPlugin; /***/ }), -/***/ 81819: +/***/ 93330: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -114958,11 +119583,20 @@ module.exports = HarmonyTopLevelThisParserPlugin; -const makeSerializable = __webpack_require__(23827); -const ContextDependency = __webpack_require__(45899); -const ContextDependencyTemplateAsRequireCall = __webpack_require__(19113); +const makeSerializable = __webpack_require__(83626); +const ContextDependency = __webpack_require__(64946); +const ContextDependencyTemplateAsRequireCall = __webpack_require__(82305); + +/** @typedef {import("../javascript/JavascriptParser").Range} Range */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */ class ImportContextDependency extends ContextDependency { + /** + * @param {TODO} options options + * @param {Range} range range + * @param {Range} valueRange value range + */ constructor(options, range, valueRange) { super(options); @@ -114978,6 +119612,9 @@ class ImportContextDependency extends ContextDependency { return "esm"; } + /** + * @param {ObjectSerializerContext} context context + */ serialize(context) { const { write } = context; @@ -114986,6 +119623,9 @@ class ImportContextDependency extends ContextDependency { super.serialize(context); } + /** + * @param {ObjectDeserializerContext} context context + */ deserialize(context) { const { read } = context; @@ -115007,7 +119647,7 @@ module.exports = ImportContextDependency; /***/ }), -/***/ 3605: +/***/ 62378: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -115018,22 +119658,27 @@ module.exports = ImportContextDependency; -const Dependency = __webpack_require__(68242); -const makeSerializable = __webpack_require__(23827); -const ModuleDependency = __webpack_require__(22994); +const Dependency = __webpack_require__(504); +const makeSerializable = __webpack_require__(83626); +const ModuleDependency = __webpack_require__(10931); /** @typedef {import("webpack-sources").ReplaceSource} ReplaceSource */ /** @typedef {import("../AsyncDependenciesBlock")} AsyncDependenciesBlock */ /** @typedef {import("../Dependency").ReferencedExport} ReferencedExport */ /** @typedef {import("../DependencyTemplate").DependencyTemplateContext} DependencyTemplateContext */ +/** @typedef {import("../Module")} Module */ +/** @typedef {import("../Module").BuildMeta} BuildMeta */ /** @typedef {import("../ModuleGraph")} ModuleGraph */ +/** @typedef {import("../javascript/JavascriptParser").Range} Range */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */ /** @typedef {import("../util/runtime").RuntimeSpec} RuntimeSpec */ class ImportDependency extends ModuleDependency { /** * @param {string} request the request - * @param {[number, number]} range expression range - * @param {string[][]=} referencedExports list of referenced exports + * @param {Range} range expression range + * @param {(string[][] | null)=} referencedExports list of referenced exports */ constructor(request, range, referencedExports) { super(request); @@ -115064,12 +119709,18 @@ class ImportDependency extends ModuleDependency { : Dependency.EXPORTS_OBJECT_REFERENCED; } + /** + * @param {ObjectSerializerContext} context context + */ serialize(context) { context.write(this.range); context.write(this.referencedExports); super.serialize(context); } + /** + * @param {ObjectDeserializerContext} context context + */ deserialize(context) { this.range = context.read(); this.referencedExports = context.read(); @@ -115100,9 +119751,9 @@ ImportDependency.Template = class ImportDependencyTemplate extends ( const content = runtimeTemplate.moduleNamespacePromise({ chunkGraph, block: block, - module: moduleGraph.getModule(dep), + module: /** @type {Module} */ (moduleGraph.getModule(dep)), request: dep.request, - strict: module.buildMeta.strictHarmonyModule, + strict: /** @type {BuildMeta} */ (module.buildMeta).strictHarmonyModule, message: "import()", runtimeRequirements }); @@ -115116,7 +119767,7 @@ module.exports = ImportDependency; /***/ }), -/***/ 89830: +/***/ 45716: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -115127,20 +119778,23 @@ module.exports = ImportDependency; -const makeSerializable = __webpack_require__(23827); -const ImportDependency = __webpack_require__(3605); +const makeSerializable = __webpack_require__(83626); +const ImportDependency = __webpack_require__(62378); /** @typedef {import("webpack-sources").ReplaceSource} ReplaceSource */ /** @typedef {import("../Dependency")} Dependency */ /** @typedef {import("../Dependency").ReferencedExport} ReferencedExport */ /** @typedef {import("../DependencyTemplate").DependencyTemplateContext} DependencyTemplateContext */ +/** @typedef {import("../Module")} Module */ +/** @typedef {import("../Module").BuildMeta} BuildMeta */ /** @typedef {import("../ModuleGraph")} ModuleGraph */ +/** @typedef {import("../javascript/JavascriptParser").Range} Range */ class ImportEagerDependency extends ImportDependency { /** * @param {string} request the request - * @param {[number, number]} range expression range - * @param {string[][]=} referencedExports list of referenced exports + * @param {Range} range expression range + * @param {(string[][] | null)=} referencedExports list of referenced exports */ constructor(request, range, referencedExports) { super(request, range, referencedExports); @@ -115177,9 +119831,9 @@ ImportEagerDependency.Template = class ImportEagerDependencyTemplate extends ( const dep = /** @type {ImportEagerDependency} */ (dependency); const content = runtimeTemplate.moduleNamespacePromise({ chunkGraph, - module: moduleGraph.getModule(dep), + module: /** @type {Module} */ (moduleGraph.getModule(dep)), request: dep.request, - strict: module.buildMeta.strictHarmonyModule, + strict: /** @type {BuildMeta} */ (module.buildMeta).strictHarmonyModule, message: "import() eager", runtimeRequirements }); @@ -115193,7 +119847,7 @@ module.exports = ImportEagerDependency; /***/ }), -/***/ 79945: +/***/ 95760: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -115204,9 +119858,9 @@ module.exports = ImportEagerDependency; -const makeSerializable = __webpack_require__(23827); -const ContextDependency = __webpack_require__(45899); -const ModuleDependencyTemplateAsRequireId = __webpack_require__(28144); +const makeSerializable = __webpack_require__(83626); +const ContextDependency = __webpack_require__(64946); +const ModuleDependencyTemplateAsRequireId = __webpack_require__(9623); class ImportMetaContextDependency extends ContextDependency { constructor(options, range) { @@ -115236,7 +119890,7 @@ module.exports = ImportMetaContextDependency; /***/ }), -/***/ 38590: +/***/ 66404: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -115247,19 +119901,26 @@ module.exports = ImportMetaContextDependency; -const WebpackError = __webpack_require__(10841); +const WebpackError = __webpack_require__(49999); const { evaluateToIdentifier -} = __webpack_require__(645); -const ImportMetaContextDependency = __webpack_require__(79945); +} = __webpack_require__(94213); +const ImportMetaContextDependency = __webpack_require__(95760); -/** @typedef {import("estree").Expression} ExpressionNode */ -/** @typedef {import("estree").ObjectExpression} ObjectExpressionNode */ +/** @typedef {import("estree").Expression} Expression */ +/** @typedef {import("estree").ObjectExpression} ObjectExpression */ +/** @typedef {import("estree").Property} Property */ +/** @typedef {import("estree").SourceLocation} SourceLocation */ /** @typedef {import("../javascript/JavascriptParser")} JavascriptParser */ /** @typedef {import("../ContextModule").ContextModuleOptions} ContextModuleOptions */ /** @typedef {import("../ChunkGroup").RawChunkGroupOptions} RawChunkGroupOptions */ /** @typedef {Pick&{groupOptions: RawChunkGroupOptions, exports?: ContextModuleOptions["referencedExports"]}} ImportMetaContextOptions */ +/** + * @param {TODO} prop property + * @param {string} expect except message + * @returns {WebpackError} error + */ function createPropertyParseError(prop, expect) { return createError( `Parsing import.meta.webpackContext options failed. Unknown value for property ${JSON.stringify( @@ -115269,6 +119930,11 @@ function createPropertyParseError(prop, expect) { ); } +/** + * @param {string} msg message + * @param {SourceLocation} loc location + * @returns {WebpackError} error + */ function createError(msg, loc) { const error = new WebpackError(msg); error.name = "ImportMetaContextError"; @@ -115277,6 +119943,10 @@ function createError(msg, loc) { } module.exports = class ImportMetaContextDependencyParserPlugin { + /** + * @param {JavascriptParser} parser the parser + * @returns {void} + */ apply(parser) { parser.hooks.evaluateIdentifier .for("import.meta.webpackContext") @@ -115294,7 +119964,9 @@ module.exports = class ImportMetaContextDependencyParserPlugin { if (expr.arguments.length < 1 || expr.arguments.length > 2) return; const [directoryNode, optionsNode] = expr.arguments; if (optionsNode && optionsNode.type !== "ObjectExpression") return; - const requestExpr = parser.evaluateExpression(directoryNode); + const requestExpr = parser.evaluateExpression( + /** @type {Expression} */ (directoryNode) + ); if (!requestExpr.isString()) return; const request = requestExpr.string; const errors = []; @@ -115313,7 +119985,8 @@ module.exports = class ImportMetaContextDependencyParserPlugin { /** @type {ContextModuleOptions["referencedExports"]} */ let exports; if (optionsNode) { - for (const prop of optionsNode.properties) { + for (const prop of /** @type {ObjectExpression} */ (optionsNode) + .properties) { if (prop.type !== "Property" || prop.key.type !== "Identifier") { errors.push( createError( @@ -115326,7 +119999,7 @@ module.exports = class ImportMetaContextDependencyParserPlugin { switch (prop.key.name) { case "regExp": { const regExpExpr = parser.evaluateExpression( - /** @type {ExpressionNode} */ (prop.value) + /** @type {Expression} */ (prop.value) ); if (!regExpExpr.isRegExp()) { errors.push(createPropertyParseError(prop, "RegExp")); @@ -115337,7 +120010,7 @@ module.exports = class ImportMetaContextDependencyParserPlugin { } case "include": { const regExpExpr = parser.evaluateExpression( - /** @type {ExpressionNode} */ (prop.value) + /** @type {Expression} */ (prop.value) ); if (!regExpExpr.isRegExp()) { errors.push(createPropertyParseError(prop, "RegExp")); @@ -115348,7 +120021,7 @@ module.exports = class ImportMetaContextDependencyParserPlugin { } case "exclude": { const regExpExpr = parser.evaluateExpression( - /** @type {ExpressionNode} */ (prop.value) + /** @type {Expression} */ (prop.value) ); if (!regExpExpr.isRegExp()) { errors.push(createPropertyParseError(prop, "RegExp")); @@ -115359,7 +120032,7 @@ module.exports = class ImportMetaContextDependencyParserPlugin { } case "mode": { const modeExpr = parser.evaluateExpression( - /** @type {ExpressionNode} */ (prop.value) + /** @type {Expression} */ (prop.value) ); if (!modeExpr.isString()) { errors.push(createPropertyParseError(prop, "string")); @@ -115372,7 +120045,7 @@ module.exports = class ImportMetaContextDependencyParserPlugin { } case "chunkName": { const expr = parser.evaluateExpression( - /** @type {ExpressionNode} */ (prop.value) + /** @type {Expression} */ (prop.value) ); if (!expr.isString()) { errors.push(createPropertyParseError(prop, "string")); @@ -115383,7 +120056,7 @@ module.exports = class ImportMetaContextDependencyParserPlugin { } case "exports": { const expr = parser.evaluateExpression( - /** @type {ExpressionNode} */ (prop.value) + /** @type {Expression} */ (prop.value) ); if (expr.isString()) { exports = [[expr.string]]; @@ -115418,7 +120091,7 @@ module.exports = class ImportMetaContextDependencyParserPlugin { } case "prefetch": { const expr = parser.evaluateExpression( - /** @type {ExpressionNode} */ (prop.value) + /** @type {Expression} */ (prop.value) ); if (expr.isBoolean()) { groupOptions.prefetchOrder = 0; @@ -115431,7 +120104,7 @@ module.exports = class ImportMetaContextDependencyParserPlugin { } case "preload": { const expr = parser.evaluateExpression( - /** @type {ExpressionNode} */ (prop.value) + /** @type {Expression} */ (prop.value) ); if (expr.isBoolean()) { groupOptions.preloadOrder = 0; @@ -115442,9 +120115,28 @@ module.exports = class ImportMetaContextDependencyParserPlugin { } break; } + case "fetchPriority": { + const expr = parser.evaluateExpression( + /** @type {Expression} */ (prop.value) + ); + if ( + expr.isString() && + ["high", "low", "auto"].includes(expr.string) + ) { + groupOptions.fetchPriority = + /** @type {RawChunkGroupOptions["fetchPriority"]} */ ( + expr.string + ); + } else { + errors.push( + createPropertyParseError(prop, '"high"|"low"|"auto"') + ); + } + break; + } case "recursive": { const recursiveExpr = parser.evaluateExpression( - /** @type {ExpressionNode} */ (prop.value) + /** @type {Expression} */ (prop.value) ); if (!recursiveExpr.isBoolean()) { errors.push(createPropertyParseError(prop, "boolean")); @@ -115496,7 +120188,7 @@ module.exports = class ImportMetaContextDependencyParserPlugin { /***/ }), -/***/ 38437: +/***/ 61860: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -115507,12 +120199,20 @@ module.exports = class ImportMetaContextDependencyParserPlugin { -const ContextElementDependency = __webpack_require__(34286); -const ImportMetaContextDependency = __webpack_require__(79945); -const ImportMetaContextDependencyParserPlugin = __webpack_require__(38590); +const { + JAVASCRIPT_MODULE_TYPE_AUTO, + JAVASCRIPT_MODULE_TYPE_ESM +} = __webpack_require__(92891); +const ContextElementDependency = __webpack_require__(27054); +const ImportMetaContextDependency = __webpack_require__(95760); +const ImportMetaContextDependencyParserPlugin = __webpack_require__(66404); +/** @typedef {import("../../declarations/WebpackOptions").JavascriptParserOptions} JavascriptParserOptions */ /** @typedef {import("../../declarations/WebpackOptions").ResolveOptions} ResolveOptions */ /** @typedef {import("../Compiler")} Compiler */ +/** @typedef {import("../javascript/JavascriptParser")} Parser */ + +const PLUGIN_NAME = "ImportMetaContextPlugin"; class ImportMetaContextPlugin { /** @@ -115522,7 +120222,7 @@ class ImportMetaContextPlugin { */ apply(compiler) { compiler.hooks.compilation.tap( - "RequireContextPlugin", + PLUGIN_NAME, (compilation, { contextModuleFactory, normalModuleFactory }) => { compilation.dependencyFactories.set( ImportMetaContextDependency, @@ -115537,6 +120237,11 @@ class ImportMetaContextPlugin { normalModuleFactory ); + /** + * @param {Parser} parser parser parser + * @param {JavascriptParserOptions} parserOptions parserOptions + * @returns {void} + */ const handler = (parser, parserOptions) => { if ( parserOptions.importMetaContext !== undefined && @@ -115548,11 +120253,11 @@ class ImportMetaContextPlugin { }; normalModuleFactory.hooks.parser - .for("javascript/auto") - .tap("ImportMetaContextPlugin", handler); + .for(JAVASCRIPT_MODULE_TYPE_AUTO) + .tap(PLUGIN_NAME, handler); normalModuleFactory.hooks.parser - .for("javascript/esm") - .tap("ImportMetaContextPlugin", handler); + .for(JAVASCRIPT_MODULE_TYPE_ESM) + .tap(PLUGIN_NAME, handler); } ); } @@ -115563,7 +120268,7 @@ module.exports = ImportMetaContextPlugin; /***/ }), -/***/ 46209: +/***/ 95698: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -115574,11 +120279,17 @@ module.exports = ImportMetaContextPlugin; -const makeSerializable = __webpack_require__(23827); -const ModuleDependency = __webpack_require__(22994); -const ModuleDependencyTemplateAsId = __webpack_require__(32789); +const makeSerializable = __webpack_require__(83626); +const ModuleDependency = __webpack_require__(10931); +const ModuleDependencyTemplateAsId = __webpack_require__(90881); + +/** @typedef {import("../javascript/JavascriptParser").Range} Range */ class ImportMetaHotAcceptDependency extends ModuleDependency { + /** + * @param {string} request the request string + * @param {Range} range location in source code + */ constructor(request, range) { super(request); this.range = range; @@ -115606,7 +120317,7 @@ module.exports = ImportMetaHotAcceptDependency; /***/ }), -/***/ 47713: +/***/ 99022: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -115617,11 +120328,17 @@ module.exports = ImportMetaHotAcceptDependency; -const makeSerializable = __webpack_require__(23827); -const ModuleDependency = __webpack_require__(22994); -const ModuleDependencyTemplateAsId = __webpack_require__(32789); +const makeSerializable = __webpack_require__(83626); +const ModuleDependency = __webpack_require__(10931); +const ModuleDependencyTemplateAsId = __webpack_require__(90881); + +/** @typedef {import("../javascript/JavascriptParser").Range} Range */ class ImportMetaHotDeclineDependency extends ModuleDependency { + /** + * @param {string} request the request string + * @param {Range} range location in source code + */ constructor(request, range) { super(request); @@ -115650,7 +120367,7 @@ module.exports = ImportMetaHotDeclineDependency; /***/ }), -/***/ 34004: +/***/ 27987: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -115662,36 +120379,44 @@ module.exports = ImportMetaHotDeclineDependency; const { pathToFileURL } = __webpack_require__(57310); -const ModuleDependencyWarning = __webpack_require__(93492); -const Template = __webpack_require__(88070); -const BasicEvaluatedExpression = __webpack_require__(88981); +const ModuleDependencyWarning = __webpack_require__(99391); +const { + JAVASCRIPT_MODULE_TYPE_AUTO, + JAVASCRIPT_MODULE_TYPE_ESM +} = __webpack_require__(92891); +const Template = __webpack_require__(88835); +const BasicEvaluatedExpression = __webpack_require__(52493); const { evaluateToIdentifier, toConstantDependency, evaluateToString, evaluateToNumber -} = __webpack_require__(645); -const memoize = __webpack_require__(27319); -const propertyAccess = __webpack_require__(92884); -const ConstDependency = __webpack_require__(78284); +} = __webpack_require__(94213); +const memoize = __webpack_require__(62377); +const propertyAccess = __webpack_require__(60305); +const ConstDependency = __webpack_require__(67538); /** @typedef {import("estree").MemberExpression} MemberExpression */ /** @typedef {import("../../declarations/WebpackOptions").JavascriptParserOptions} JavascriptParserOptions */ /** @typedef {import("../Compiler")} Compiler */ +/** @typedef {import("../Dependency").DependencyLocation} DependencyLocation */ /** @typedef {import("../NormalModule")} NormalModule */ /** @typedef {import("../javascript/JavascriptParser")} Parser */ +/** @typedef {import("../javascript/JavascriptParser").Range} Range */ const getCriticalDependencyWarning = memoize(() => - __webpack_require__(90848) + __webpack_require__(7438) ); +const PLUGIN_NAME = "ImportMetaPlugin"; + class ImportMetaPlugin { /** * @param {Compiler} compiler compiler */ apply(compiler) { compiler.hooks.compilation.tap( - "ImportMetaPlugin", + PLUGIN_NAME, (compilation, { normalModuleFactory }) => { /** * @param {NormalModule} module module @@ -115712,12 +120437,12 @@ class ImportMetaPlugin { parser.hooks.expression .for("import.meta") - .tap("ImportMetaPlugin", metaProperty => { + .tap(PLUGIN_NAME, metaProperty => { const dep = new ConstDependency( - importMetaName, - metaProperty.range + /** @type {string} */ (importMetaName), + /** @type {Range} */ (metaProperty.range) ); - dep.loc = metaProperty.loc; + dep.loc = /** @type {DependencyLocation} */ (metaProperty.loc); parser.state.module.addPresentationalDependency(dep); return true; }); @@ -115725,38 +120450,88 @@ class ImportMetaPlugin { } /// import.meta direct /// + const webpackVersion = parseInt( + (__webpack_require__(73284)/* .version */ .i8), + 10 + ); + const importMetaUrl = () => + JSON.stringify(getUrl(parser.state.module)); + const importMetaWebpackVersion = () => JSON.stringify(webpackVersion); + /** + * @param {string[]} members members + * @returns {string} error message + */ + const importMetaUnknownProperty = members => + `${Template.toNormalComment( + "unsupported import.meta." + members.join(".") + )} undefined${propertyAccess(members, 1)}`; parser.hooks.typeof .for("import.meta") .tap( - "ImportMetaPlugin", + PLUGIN_NAME, toConstantDependency(parser, JSON.stringify("object")) ); parser.hooks.expression .for("import.meta") - .tap("ImportMetaPlugin", metaProperty => { - const CriticalDependencyWarning = getCriticalDependencyWarning(); - parser.state.module.addWarning( - new ModuleDependencyWarning( - parser.state.module, - new CriticalDependencyWarning( - "Accessing import.meta directly is unsupported (only property access is supported)" - ), - metaProperty.loc - ) - ); + .tap(PLUGIN_NAME, metaProperty => { + const referencedPropertiesInDestructuring = + parser.destructuringAssignmentPropertiesFor(metaProperty); + if (!referencedPropertiesInDestructuring) { + const CriticalDependencyWarning = + getCriticalDependencyWarning(); + parser.state.module.addWarning( + new ModuleDependencyWarning( + parser.state.module, + new CriticalDependencyWarning( + "Accessing import.meta directly is unsupported (only property access or destructuring is supported)" + ), + /** @type {DependencyLocation} */ (metaProperty.loc) + ) + ); + const dep = new ConstDependency( + `${ + parser.isAsiPosition( + /** @type {Range} */ (metaProperty.range)[0] + ) + ? ";" + : "" + }({})`, + /** @type {Range} */ (metaProperty.range) + ); + dep.loc = /** @type {DependencyLocation} */ (metaProperty.loc); + parser.state.module.addPresentationalDependency(dep); + return true; + } + + let str = ""; + for (const prop of referencedPropertiesInDestructuring) { + switch (prop) { + case "url": + str += `url: ${importMetaUrl()},`; + break; + case "webpack": + str += `webpack: ${importMetaWebpackVersion()},`; + break; + default: + str += `[${JSON.stringify( + prop + )}]: ${importMetaUnknownProperty([prop])},`; + break; + } + } const dep = new ConstDependency( - `${parser.isAsiPosition(metaProperty.range[0]) ? ";" : ""}({})`, - metaProperty.range + `({${str}})`, + /** @type {Range} */ (metaProperty.range) ); - dep.loc = metaProperty.loc; + dep.loc = /** @type {DependencyLocation} */ (metaProperty.loc); parser.state.module.addPresentationalDependency(dep); return true; }); parser.hooks.evaluateTypeof .for("import.meta") - .tap("ImportMetaPlugin", evaluateToString("object")); + .tap(PLUGIN_NAME, evaluateToString("object")); parser.hooks.evaluateIdentifier.for("import.meta").tap( - "ImportMetaPlugin", + PLUGIN_NAME, evaluateToIdentifier("import.meta", "import.meta", () => [], true) ); @@ -115764,72 +120539,66 @@ class ImportMetaPlugin { parser.hooks.typeof .for("import.meta.url") .tap( - "ImportMetaPlugin", + PLUGIN_NAME, toConstantDependency(parser, JSON.stringify("string")) ); parser.hooks.expression .for("import.meta.url") - .tap("ImportMetaPlugin", expr => { + .tap(PLUGIN_NAME, expr => { const dep = new ConstDependency( - JSON.stringify(getUrl(parser.state.module)), - expr.range + importMetaUrl(), + /** @type {Range} */ (expr.range) ); - dep.loc = expr.loc; + dep.loc = /** @type {DependencyLocation} */ (expr.loc); parser.state.module.addPresentationalDependency(dep); return true; }); parser.hooks.evaluateTypeof .for("import.meta.url") - .tap("ImportMetaPlugin", evaluateToString("string")); + .tap(PLUGIN_NAME, evaluateToString("string")); parser.hooks.evaluateIdentifier .for("import.meta.url") - .tap("ImportMetaPlugin", expr => { + .tap(PLUGIN_NAME, expr => { return new BasicEvaluatedExpression() .setString(getUrl(parser.state.module)) - .setRange(expr.range); + .setRange(/** @type {Range} */ (expr.range)); }); /// import.meta.webpack /// - const webpackVersion = parseInt( - (__webpack_require__(3104)/* .version */ .i8), - 10 - ); parser.hooks.typeof .for("import.meta.webpack") .tap( - "ImportMetaPlugin", + PLUGIN_NAME, toConstantDependency(parser, JSON.stringify("number")) ); parser.hooks.expression .for("import.meta.webpack") .tap( - "ImportMetaPlugin", - toConstantDependency(parser, JSON.stringify(webpackVersion)) + PLUGIN_NAME, + toConstantDependency(parser, importMetaWebpackVersion()) ); parser.hooks.evaluateTypeof .for("import.meta.webpack") - .tap("ImportMetaPlugin", evaluateToString("number")); + .tap(PLUGIN_NAME, evaluateToString("number")); parser.hooks.evaluateIdentifier .for("import.meta.webpack") - .tap("ImportMetaPlugin", evaluateToNumber(webpackVersion)); + .tap(PLUGIN_NAME, evaluateToNumber(webpackVersion)); /// Unknown properties /// parser.hooks.unhandledExpressionMemberChain .for("import.meta") - .tap("ImportMetaPlugin", (expr, members) => { + .tap(PLUGIN_NAME, (expr, members) => { const dep = new ConstDependency( - `${Template.toNormalComment( - "unsupported import.meta." + members.join(".") - )} undefined${propertyAccess(members, 1)}`, - expr.range + importMetaUnknownProperty(members), + /** @type {Range} */ (expr.range) ); - dep.loc = expr.loc; + dep.loc = /** @type {DependencyLocation} */ (expr.loc); parser.state.module.addPresentationalDependency(dep); return true; }); parser.hooks.evaluate .for("MemberExpression") - .tap("ImportMetaPlugin", expression => { + .tap(PLUGIN_NAME, expression => { const expr = /** @type {MemberExpression} */ (expression); if ( expr.object.type === "MetaProperty" && @@ -115840,17 +120609,17 @@ class ImportMetaPlugin { ) { return new BasicEvaluatedExpression() .setUndefined() - .setRange(expr.range); + .setRange(/** @type {Range} */ (expr.range)); } }); }; normalModuleFactory.hooks.parser - .for("javascript/auto") - .tap("ImportMetaPlugin", parserHandler); + .for(JAVASCRIPT_MODULE_TYPE_AUTO) + .tap(PLUGIN_NAME, parserHandler); normalModuleFactory.hooks.parser - .for("javascript/esm") - .tap("ImportMetaPlugin", parserHandler); + .for(JAVASCRIPT_MODULE_TYPE_ESM) + .tap(PLUGIN_NAME, parserHandler); } ); } @@ -115861,7 +120630,7 @@ module.exports = ImportMetaPlugin; /***/ }), -/***/ 59139: +/***/ 7260: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -115872,18 +120641,22 @@ module.exports = ImportMetaPlugin; -const AsyncDependenciesBlock = __webpack_require__(54823); -const CommentCompilationWarning = __webpack_require__(72190); -const UnsupportedFeatureWarning = __webpack_require__(19290); -const ContextDependencyHelpers = __webpack_require__(84555); -const ImportContextDependency = __webpack_require__(81819); -const ImportDependency = __webpack_require__(3605); -const ImportEagerDependency = __webpack_require__(89830); -const ImportWeakDependency = __webpack_require__(27008); +const AsyncDependenciesBlock = __webpack_require__(27973); +const CommentCompilationWarning = __webpack_require__(38011); +const UnsupportedFeatureWarning = __webpack_require__(84099); +const ContextDependencyHelpers = __webpack_require__(61200); +const ImportContextDependency = __webpack_require__(93330); +const ImportDependency = __webpack_require__(62378); +const ImportEagerDependency = __webpack_require__(45716); +const ImportWeakDependency = __webpack_require__(79576); /** @typedef {import("../../declarations/WebpackOptions").JavascriptParserOptions} JavascriptParserOptions */ /** @typedef {import("../ChunkGroup").RawChunkGroupOptions} RawChunkGroupOptions */ /** @typedef {import("../ContextModule").ContextMode} ContextMode */ +/** @typedef {import("../Dependency").DependencyLocation} DependencyLocation */ +/** @typedef {import("../Module").BuildMeta} BuildMeta */ +/** @typedef {import("../javascript/JavascriptParser")} JavascriptParser */ +/** @typedef {import("../javascript/JavascriptParser").Range} Range */ class ImportParserPlugin { /** @@ -115893,13 +120666,23 @@ class ImportParserPlugin { this.options = options; } + /** + * @param {JavascriptParser} parser the parser + * @returns {void} + */ apply(parser) { + /** + * @template T + * @param {Iterable} enumerable enumerable + * @returns {T[][]} array of array + */ + const exportsFromEnumerable = enumerable => + Array.from(enumerable, e => [e]); parser.hooks.importCall.tap("ImportParserPlugin", expr => { const param = parser.evaluateExpression(expr.source); let chunkName = null; - /** @type {ContextMode} */ - let mode = this.options.dynamicImportMode; + let mode = /** @type {ContextMode} */ (this.options.dynamicImportMode); let include = null; let exclude = null; /** @type {string[][] | null} */ @@ -115907,7 +120690,11 @@ class ImportParserPlugin { /** @type {RawChunkGroupOptions} */ const groupOptions = {}; - const { dynamicImportPreload, dynamicImportPrefetch } = this.options; + const { + dynamicImportPreload, + dynamicImportPrefetch, + dynamicImportFetchPriority + } = this.options; if (dynamicImportPreload !== undefined && dynamicImportPreload !== false) groupOptions.preloadOrder = dynamicImportPreload === true ? 0 : dynamicImportPreload; @@ -115917,9 +120704,14 @@ class ImportParserPlugin { ) groupOptions.prefetchOrder = dynamicImportPrefetch === true ? 0 : dynamicImportPrefetch; + if ( + dynamicImportFetchPriority !== undefined && + dynamicImportFetchPriority !== false + ) + groupOptions.fetchPriority = dynamicImportFetchPriority; const { options: importOptions, errors: commentErrors } = - parser.parseCommentOptions(expr.range); + parser.parseCommentOptions(/** @type {Range} */ (expr.range)); if (commentErrors) { for (const e of commentErrors) { @@ -115939,7 +120731,7 @@ class ImportParserPlugin { parser.state.module.addWarning( new UnsupportedFeatureWarning( `\`webpackIgnore\` expected a boolean, but received: ${importOptions.webpackIgnore}.`, - expr.loc + /** @type {DependencyLocation} */ (expr.loc) ) ); } else { @@ -115954,7 +120746,7 @@ class ImportParserPlugin { parser.state.module.addWarning( new UnsupportedFeatureWarning( `\`webpackChunkName\` expected a string, but received: ${importOptions.webpackChunkName}.`, - expr.loc + /** @type {DependencyLocation} */ (expr.loc) ) ); } else { @@ -115966,7 +120758,7 @@ class ImportParserPlugin { parser.state.module.addWarning( new UnsupportedFeatureWarning( `\`webpackMode\` expected a string, but received: ${importOptions.webpackMode}.`, - expr.loc + /** @type {DependencyLocation} */ (expr.loc) ) ); } else { @@ -115982,7 +120774,7 @@ class ImportParserPlugin { parser.state.module.addWarning( new UnsupportedFeatureWarning( `\`webpackPrefetch\` expected true or a number, but received: ${importOptions.webpackPrefetch}.`, - expr.loc + /** @type {DependencyLocation} */ (expr.loc) ) ); } @@ -115996,7 +120788,22 @@ class ImportParserPlugin { parser.state.module.addWarning( new UnsupportedFeatureWarning( `\`webpackPreload\` expected true or a number, but received: ${importOptions.webpackPreload}.`, - expr.loc + /** @type {DependencyLocation} */ (expr.loc) + ) + ); + } + } + if (importOptions.webpackFetchPriority !== undefined) { + if ( + typeof importOptions.webpackFetchPriority === "string" && + ["high", "low", "auto"].includes(importOptions.webpackFetchPriority) + ) { + groupOptions.fetchPriority = importOptions.webpackFetchPriority; + } else { + parser.state.module.addWarning( + new UnsupportedFeatureWarning( + `\`webpackFetchPriority\` expected true or "low", "high" or "auto", but received: ${importOptions.webpackFetchPriority}.`, + /** @type {DependencyLocation} */ (expr.loc) ) ); } @@ -116009,7 +120816,7 @@ class ImportParserPlugin { parser.state.module.addWarning( new UnsupportedFeatureWarning( `\`webpackInclude\` expected a regular expression, but received: ${importOptions.webpackInclude}.`, - expr.loc + /** @type {DependencyLocation} */ (expr.loc) ) ); } else { @@ -116024,7 +120831,7 @@ class ImportParserPlugin { parser.state.module.addWarning( new UnsupportedFeatureWarning( `\`webpackExclude\` expected a regular expression, but received: ${importOptions.webpackExclude}.`, - expr.loc + /** @type {DependencyLocation} */ (expr.loc) ) ); } else { @@ -116036,7 +120843,7 @@ class ImportParserPlugin { !( typeof importOptions.webpackExports === "string" || (Array.isArray(importOptions.webpackExports) && - importOptions.webpackExports.every( + /** @type {string[]} */ (importOptions.webpackExports).every( item => typeof item === "string" )) ) @@ -116044,14 +120851,14 @@ class ImportParserPlugin { parser.state.module.addWarning( new UnsupportedFeatureWarning( `\`webpackExports\` expected a string or an array of strings, but received: ${importOptions.webpackExports}.`, - expr.loc + /** @type {DependencyLocation} */ (expr.loc) ) ); } else { if (typeof importOptions.webpackExports === "string") { exports = [[importOptions.webpackExports]]; } else { - exports = Array.from(importOptions.webpackExports, e => [e]); + exports = exportsFromEnumerable(importOptions.webpackExports); } } } @@ -116066,24 +120873,38 @@ class ImportParserPlugin { parser.state.module.addWarning( new UnsupportedFeatureWarning( `\`webpackMode\` expected 'lazy', 'lazy-once', 'eager' or 'weak', but received: ${mode}.`, - expr.loc + /** @type {DependencyLocation} */ (expr.loc) ) ); mode = "lazy"; } + const referencedPropertiesInDestructuring = + parser.destructuringAssignmentPropertiesFor(expr); + if (referencedPropertiesInDestructuring) { + if (exports) { + parser.state.module.addWarning( + new UnsupportedFeatureWarning( + `\`webpackExports\` could not be used with destructuring assignment.`, + /** @type {DependencyLocation} */ (expr.loc) + ) + ); + } + exports = exportsFromEnumerable(referencedPropertiesInDestructuring); + } + if (param.isString()) { if (mode === "eager") { const dep = new ImportEagerDependency( - param.string, - expr.range, + /** @type {string} */ (param.string), + /** @type {Range} */ (expr.range), exports ); parser.state.current.addDependency(dep); } else if (mode === "weak") { const dep = new ImportWeakDependency( - param.string, - expr.range, + /** @type {string} */ (param.string), + /** @type {Range} */ (expr.range), exports ); parser.state.current.addDependency(dep); @@ -116093,11 +120914,15 @@ class ImportParserPlugin { ...groupOptions, name: chunkName }, - expr.loc, + /** @type {DependencyLocation} */ (expr.loc), param.string ); - const dep = new ImportDependency(param.string, expr.range, exports); - dep.loc = expr.loc; + const dep = new ImportDependency( + /** @type {string} */ (param.string), + /** @type {Range} */ (expr.range), + exports + ); + dep.loc = /** @type {DependencyLocation} */ (expr.loc); depBlock.addDependency(dep); parser.state.current.addBlock(depBlock); } @@ -116108,7 +120933,7 @@ class ImportParserPlugin { } const dep = ContextDependencyHelpers.create( ImportContextDependency, - expr.range, + /** @type {Range} */ (expr.range), param, expr, this.options, @@ -116118,7 +120943,9 @@ class ImportParserPlugin { include, exclude, mode, - namespaceObject: parser.state.module.buildMeta.strictHarmonyModule + namespaceObject: /** @type {BuildMeta} */ ( + parser.state.module.buildMeta + ).strictHarmonyModule ? "strict" : true, typePrefix: "import()", @@ -116128,7 +120955,7 @@ class ImportParserPlugin { parser ); if (!dep) return; - dep.loc = expr.loc; + dep.loc = /** @type {DependencyLocation} */ (expr.loc); dep.optional = !!parser.scope.inTry; parser.state.current.addDependency(dep); return true; @@ -116142,7 +120969,7 @@ module.exports = ImportParserPlugin; /***/ }), -/***/ 9265: +/***/ 47673: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -116153,13 +120980,22 @@ module.exports = ImportParserPlugin; -const ImportContextDependency = __webpack_require__(81819); -const ImportDependency = __webpack_require__(3605); -const ImportEagerDependency = __webpack_require__(89830); -const ImportParserPlugin = __webpack_require__(59139); -const ImportWeakDependency = __webpack_require__(27008); +const { + JAVASCRIPT_MODULE_TYPE_AUTO, + JAVASCRIPT_MODULE_TYPE_DYNAMIC, + JAVASCRIPT_MODULE_TYPE_ESM +} = __webpack_require__(92891); +const ImportContextDependency = __webpack_require__(93330); +const ImportDependency = __webpack_require__(62378); +const ImportEagerDependency = __webpack_require__(45716); +const ImportParserPlugin = __webpack_require__(7260); +const ImportWeakDependency = __webpack_require__(79576); +/** @typedef {import("../../declarations/WebpackOptions").JavascriptParserOptions} JavascriptParserOptions */ /** @typedef {import("../Compiler")} Compiler */ +/** @typedef {import("../javascript/JavascriptParser")} Parser */ + +const PLUGIN_NAME = "ImportPlugin"; class ImportPlugin { /** @@ -116169,7 +121005,7 @@ class ImportPlugin { */ apply(compiler) { compiler.hooks.compilation.tap( - "ImportPlugin", + PLUGIN_NAME, (compilation, { contextModuleFactory, normalModuleFactory }) => { compilation.dependencyFactories.set( ImportDependency, @@ -116207,6 +121043,11 @@ class ImportPlugin { new ImportContextDependency.Template() ); + /** + * @param {Parser} parser parser parser + * @param {JavascriptParserOptions} parserOptions parserOptions + * @returns {void} + */ const handler = (parser, parserOptions) => { if (parserOptions.import !== undefined && !parserOptions.import) return; @@ -116215,14 +121056,14 @@ class ImportPlugin { }; normalModuleFactory.hooks.parser - .for("javascript/auto") - .tap("ImportPlugin", handler); + .for(JAVASCRIPT_MODULE_TYPE_AUTO) + .tap(PLUGIN_NAME, handler); normalModuleFactory.hooks.parser - .for("javascript/dynamic") - .tap("ImportPlugin", handler); + .for(JAVASCRIPT_MODULE_TYPE_DYNAMIC) + .tap(PLUGIN_NAME, handler); normalModuleFactory.hooks.parser - .for("javascript/esm") - .tap("ImportPlugin", handler); + .for(JAVASCRIPT_MODULE_TYPE_ESM) + .tap(PLUGIN_NAME, handler); } ); } @@ -116232,7 +121073,7 @@ module.exports = ImportPlugin; /***/ }), -/***/ 27008: +/***/ 79576: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -116243,20 +121084,23 @@ module.exports = ImportPlugin; -const makeSerializable = __webpack_require__(23827); -const ImportDependency = __webpack_require__(3605); +const makeSerializable = __webpack_require__(83626); +const ImportDependency = __webpack_require__(62378); /** @typedef {import("webpack-sources").ReplaceSource} ReplaceSource */ /** @typedef {import("../Dependency")} Dependency */ /** @typedef {import("../Dependency").ReferencedExport} ReferencedExport */ /** @typedef {import("../DependencyTemplate").DependencyTemplateContext} DependencyTemplateContext */ +/** @typedef {import("../Module")} Module */ +/** @typedef {import("../Module").BuildMeta} BuildMeta */ /** @typedef {import("../ModuleGraph")} ModuleGraph */ +/** @typedef {import("../javascript/JavascriptParser").Range} Range */ class ImportWeakDependency extends ImportDependency { /** * @param {string} request the request - * @param {[number, number]} range expression range - * @param {string[][]=} referencedExports list of referenced exports + * @param {Range} range expression range + * @param {(string[][] | null)=} referencedExports list of referenced exports */ constructor(request, range, referencedExports) { super(request, range, referencedExports); @@ -116290,9 +121134,9 @@ ImportWeakDependency.Template = class ImportDependencyTemplate extends ( const dep = /** @type {ImportWeakDependency} */ (dependency); const content = runtimeTemplate.moduleNamespacePromise({ chunkGraph, - module: moduleGraph.getModule(dep), + module: /** @type {Module} */ (moduleGraph.getModule(dep)), request: dep.request, - strict: module.buildMeta.strictHarmonyModule, + strict: /** @type {BuildMeta} */ (module.buildMeta).strictHarmonyModule, message: "import() weak", weak: true, runtimeRequirements @@ -116307,7 +121151,7 @@ module.exports = ImportWeakDependency; /***/ }), -/***/ 72610: +/***/ 71528: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -116318,8 +121162,8 @@ module.exports = ImportWeakDependency; -const makeSerializable = __webpack_require__(23827); -const NullDependency = __webpack_require__(74263); +const makeSerializable = __webpack_require__(83626); +const NullDependency = __webpack_require__(87568); /** @typedef {import("../ChunkGraph")} ChunkGraph */ /** @typedef {import("../Dependency").ExportSpec} ExportSpec */ @@ -116327,6 +121171,8 @@ const NullDependency = __webpack_require__(74263); /** @typedef {import("../Dependency").UpdateHashContext} UpdateHashContext */ /** @typedef {import("../ModuleGraph")} ModuleGraph */ /** @typedef {import("../json/JsonData")} JsonData */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */ /** @typedef {import("../util/Hash")} Hash */ const getExportsFromData = data => { @@ -116358,7 +121204,7 @@ const getExportsFromData = data => { class JsonExportsDependency extends NullDependency { /** - * @param {JsonData=} data json data + * @param {JsonData} data json data */ constructor(data) { super(); @@ -116391,12 +121237,18 @@ class JsonExportsDependency extends NullDependency { this.data.updateHash(hash); } + /** + * @param {ObjectSerializerContext} context context + */ serialize(context) { const { write } = context; write(this.data); super.serialize(context); } + /** + * @param {ObjectDeserializerContext} context context + */ deserialize(context) { const { read } = context; this.data = read(); @@ -116414,7 +121266,7 @@ module.exports = JsonExportsDependency; /***/ }), -/***/ 60113: +/***/ 46210: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -116425,7 +121277,7 @@ module.exports = JsonExportsDependency; -const ModuleDependency = __webpack_require__(22994); +const ModuleDependency = __webpack_require__(10931); /** @typedef {import("../ModuleGraph")} ModuleGraph */ /** @typedef {import("../ModuleGraphConnection")} ModuleGraphConnection */ @@ -116462,7 +121314,7 @@ module.exports = LoaderDependency; /***/ }), -/***/ 73535: +/***/ 11300: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -116473,7 +121325,7 @@ module.exports = LoaderDependency; -const ModuleDependency = __webpack_require__(22994); +const ModuleDependency = __webpack_require__(10931); /** @typedef {import("../ModuleGraph")} ModuleGraph */ /** @typedef {import("../ModuleGraphConnection")} ModuleGraphConnection */ @@ -116511,7 +121363,7 @@ module.exports = LoaderImportDependency; /***/ }), -/***/ 80402: +/***/ 13585: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -116522,10 +121374,10 @@ module.exports = LoaderImportDependency; -const NormalModule = __webpack_require__(55443); -const LazySet = __webpack_require__(66205); -const LoaderDependency = __webpack_require__(60113); -const LoaderImportDependency = __webpack_require__(73535); +const NormalModule = __webpack_require__(17318); +const LazySet = __webpack_require__(57876); +const LoaderDependency = __webpack_require__(46210); +const LoaderImportDependency = __webpack_require__(11300); /** @typedef {import("../Compilation").DepConstructor} DepConstructor */ /** @typedef {import("../Compiler")} Compiler */ @@ -116780,7 +121632,7 @@ module.exports = LoaderPlugin; /***/ }), -/***/ 12786: +/***/ 51571: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -116791,9 +121643,16 @@ module.exports = LoaderPlugin; -const makeSerializable = __webpack_require__(23827); +const makeSerializable = __webpack_require__(83626); + +/** @typedef {import("../serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */ class LocalModule { + /** + * @param {string} name name + * @param {number} idx index + */ constructor(name, idx) { this.name = name; this.idx = idx; @@ -116804,10 +121663,16 @@ class LocalModule { this.used = true; } + /** + * @returns {string} variable name + */ variableName() { return "__WEBPACK_LOCAL_MODULE_" + this.idx + "__"; } + /** + * @param {ObjectSerializerContext} context context + */ serialize(context) { const { write } = context; @@ -116816,6 +121681,9 @@ class LocalModule { write(this.used); } + /** + * @param {ObjectDeserializerContext} context context + */ deserialize(context) { const { read } = context; @@ -116832,7 +121700,7 @@ module.exports = LocalModule; /***/ }), -/***/ 86333: +/***/ 32637: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -116843,14 +121711,23 @@ module.exports = LocalModule; -const makeSerializable = __webpack_require__(23827); -const NullDependency = __webpack_require__(74263); +const makeSerializable = __webpack_require__(83626); +const NullDependency = __webpack_require__(87568); /** @typedef {import("webpack-sources").ReplaceSource} ReplaceSource */ /** @typedef {import("../Dependency")} Dependency */ /** @typedef {import("../DependencyTemplate").DependencyTemplateContext} DependencyTemplateContext */ +/** @typedef {import("../javascript/JavascriptParser").Range} Range */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */ +/** @typedef {import("./LocalModule")} LocalModule */ class LocalModuleDependency extends NullDependency { + /** + * @param {LocalModule} localModule local module + * @param {Range} range range + * @param {boolean} callNew true, when the local module should be called with new + */ constructor(localModule, range, callNew) { super(); @@ -116859,6 +121736,9 @@ class LocalModuleDependency extends NullDependency { this.callNew = callNew; } + /** + * @param {ObjectSerializerContext} context context + */ serialize(context) { const { write } = context; @@ -116869,6 +121749,9 @@ class LocalModuleDependency extends NullDependency { super.serialize(context); } + /** + * @param {ObjectDeserializerContext} context context + */ deserialize(context) { const { read } = context; @@ -116909,7 +121792,7 @@ module.exports = LocalModuleDependency; /***/ }), -/***/ 96183: +/***/ 62693: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; @@ -116920,8 +121803,15 @@ module.exports = LocalModuleDependency; -const LocalModule = __webpack_require__(12786); +const LocalModule = __webpack_require__(51571); + +/** @typedef {import("../javascript/JavascriptParser").ParserState} ParserState */ +/** + * @param {string} parent parent module + * @param {string} mod module to resolve + * @returns {string} resolved module + */ const lookup = (parent, mod) => { if (mod.charAt(0) !== ".") return mod; @@ -116941,6 +121831,11 @@ const lookup = (parent, mod) => { return path.join("/"); }; +/** + * @param {ParserState} state parser state + * @param {string} name name + * @returns {LocalModule} local module + */ exports.addLocalModule = (state, name) => { if (!state.localModules) { state.localModules = []; @@ -116950,6 +121845,12 @@ exports.addLocalModule = (state, name) => { return m; }; +/** + * @param {ParserState} state parser state + * @param {string} name name + * @param {string} [namedModule] named module + * @returns {LocalModule | null} local module or null + */ exports.getLocalModule = (state, name, namedModule) => { if (!state.localModules) return null; if (namedModule) { @@ -116967,7 +121868,7 @@ exports.getLocalModule = (state, name, namedModule) => { /***/ }), -/***/ 15086: +/***/ 746: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -116978,11 +121879,11 @@ exports.getLocalModule = (state, name, namedModule) => { -const Dependency = __webpack_require__(68242); -const InitFragment = __webpack_require__(53658); -const RuntimeGlobals = __webpack_require__(34623); -const makeSerializable = __webpack_require__(23827); -const NullDependency = __webpack_require__(74263); +const Dependency = __webpack_require__(504); +const InitFragment = __webpack_require__(44508); +const RuntimeGlobals = __webpack_require__(61539); +const makeSerializable = __webpack_require__(83626); +const NullDependency = __webpack_require__(87568); /** @typedef {import("webpack-sources").ReplaceSource} ReplaceSource */ /** @typedef {import("../ChunkGraph")} ChunkGraph */ @@ -116991,6 +121892,8 @@ const NullDependency = __webpack_require__(74263); /** @typedef {import("../DependencyTemplate").DependencyTemplateContext} DependencyTemplateContext */ /** @typedef {import("../DependencyTemplates")} DependencyTemplates */ /** @typedef {import("../ModuleGraph")} ModuleGraph */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */ /** @typedef {import("../util/Hash")} Hash */ /** @typedef {import("../util/runtime").RuntimeSpec} RuntimeSpec */ @@ -117049,6 +121952,9 @@ class ModuleDecoratorDependency extends NullDependency { hash.update(this._hashUpdate); } + /** + * @param {ObjectSerializerContext} context context + */ serialize(context) { const { write } = context; write(this.decorator); @@ -117056,6 +121962,9 @@ class ModuleDecoratorDependency extends NullDependency { super.serialize(context); } + /** + * @param {ObjectDeserializerContext} context context + */ deserialize(context) { const { read } = context; this.decorator = read(); @@ -117104,7 +122013,7 @@ module.exports = ModuleDecoratorDependency; /***/ }), -/***/ 22994: +/***/ 10931: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -117115,14 +122024,16 @@ module.exports = ModuleDecoratorDependency; -const Dependency = __webpack_require__(68242); -const DependencyTemplate = __webpack_require__(26472); -const memoize = __webpack_require__(27319); +const Dependency = __webpack_require__(504); +const DependencyTemplate = __webpack_require__(17043); +const memoize = __webpack_require__(62377); /** @typedef {import("../Dependency").TRANSITIVE} TRANSITIVE */ /** @typedef {import("../Module")} Module */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */ -const getRawModule = memoize(() => __webpack_require__(11794)); +const getRawModule = memoize(() => __webpack_require__(74360)); class ModuleDependency extends Dependency { /** @@ -117166,7 +122077,7 @@ class ModuleDependency extends Dependency { /** * @param {string} context context directory - * @returns {Module} a module + * @returns {Module | null} a module */ createIgnoredModule(context) { const RawModule = getRawModule(); @@ -117177,6 +122088,9 @@ class ModuleDependency extends Dependency { ); } + /** + * @param {ObjectSerializerContext} context context + */ serialize(context) { const { write } = context; write(this.request); @@ -117186,6 +122100,9 @@ class ModuleDependency extends Dependency { super.serialize(context); } + /** + * @param {ObjectDeserializerContext} context context + */ deserialize(context) { const { read } = context; this.request = read(); @@ -117203,7 +122120,7 @@ module.exports = ModuleDependency; /***/ }), -/***/ 32789: +/***/ 90881: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -117214,11 +122131,12 @@ module.exports = ModuleDependency; -const ModuleDependency = __webpack_require__(22994); +const ModuleDependency = __webpack_require__(10931); /** @typedef {import("webpack-sources").ReplaceSource} ReplaceSource */ /** @typedef {import("../Dependency")} Dependency */ /** @typedef {import("../DependencyTemplate").DependencyTemplateContext} DependencyTemplateContext */ +/** @typedef {import("../Module")} Module */ class ModuleDependencyTemplateAsId extends ModuleDependency.Template { /** @@ -117231,7 +122149,7 @@ class ModuleDependencyTemplateAsId extends ModuleDependency.Template { const dep = /** @type {ModuleDependency} */ (dependency); if (!dep.range) return; const content = runtimeTemplate.moduleId({ - module: moduleGraph.getModule(dep), + module: /** @type {Module} */ (moduleGraph.getModule(dep)), chunkGraph, request: dep.request, weak: dep.weak @@ -117245,7 +122163,7 @@ module.exports = ModuleDependencyTemplateAsId; /***/ }), -/***/ 28144: +/***/ 9623: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -117256,7 +122174,7 @@ module.exports = ModuleDependencyTemplateAsId; -const ModuleDependency = __webpack_require__(22994); +const ModuleDependency = __webpack_require__(10931); /** @typedef {import("webpack-sources").ReplaceSource} ReplaceSource */ /** @typedef {import("../Dependency")} Dependency */ @@ -117291,7 +122209,7 @@ module.exports = ModuleDependencyTemplateAsRequireId; /***/ }), -/***/ 92807: +/***/ 19647: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -117302,11 +122220,17 @@ module.exports = ModuleDependencyTemplateAsRequireId; -const makeSerializable = __webpack_require__(23827); -const ModuleDependency = __webpack_require__(22994); -const ModuleDependencyTemplateAsId = __webpack_require__(32789); +const makeSerializable = __webpack_require__(83626); +const ModuleDependency = __webpack_require__(10931); +const ModuleDependencyTemplateAsId = __webpack_require__(90881); + +/** @typedef {import("../javascript/JavascriptParser").Range} Range */ class ModuleHotAcceptDependency extends ModuleDependency { + /** + * @param {string} request the request string + * @param {Range} range location in source code + */ constructor(request, range) { super(request); this.range = range; @@ -117334,7 +122258,7 @@ module.exports = ModuleHotAcceptDependency; /***/ }), -/***/ 74213: +/***/ 5341: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -117345,11 +122269,17 @@ module.exports = ModuleHotAcceptDependency; -const makeSerializable = __webpack_require__(23827); -const ModuleDependency = __webpack_require__(22994); -const ModuleDependencyTemplateAsId = __webpack_require__(32789); +const makeSerializable = __webpack_require__(83626); +const ModuleDependency = __webpack_require__(10931); +const ModuleDependencyTemplateAsId = __webpack_require__(90881); + +/** @typedef {import("../javascript/JavascriptParser").Range} Range */ class ModuleHotDeclineDependency extends ModuleDependency { + /** + * @param {string} request the request string + * @param {Range} range location in source code + */ constructor(request, range) { super(request); @@ -117378,7 +122308,7 @@ module.exports = ModuleHotDeclineDependency; /***/ }), -/***/ 74263: +/***/ 87568: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -117389,8 +122319,8 @@ module.exports = ModuleHotDeclineDependency; -const Dependency = __webpack_require__(68242); -const DependencyTemplate = __webpack_require__(26472); +const Dependency = __webpack_require__(504); +const DependencyTemplate = __webpack_require__(17043); /** @typedef {import("webpack-sources").ReplaceSource} ReplaceSource */ /** @typedef {import("../Dependency").TRANSITIVE} TRANSITIVE */ @@ -117426,7 +122356,7 @@ module.exports = NullDependency; /***/ }), -/***/ 51351: +/***/ 98786: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -117437,9 +122367,12 @@ module.exports = NullDependency; -const ModuleDependency = __webpack_require__(22994); +const ModuleDependency = __webpack_require__(10931); class PrefetchDependency extends ModuleDependency { + /** + * @param {string} request the request string + */ constructor(request) { super(request); } @@ -117458,7 +122391,7 @@ module.exports = PrefetchDependency; /***/ }), -/***/ 30927: +/***/ 47468: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -117469,10 +122402,10 @@ module.exports = PrefetchDependency; -const Dependency = __webpack_require__(68242); -const InitFragment = __webpack_require__(53658); -const makeSerializable = __webpack_require__(23827); -const ModuleDependency = __webpack_require__(22994); +const Dependency = __webpack_require__(504); +const InitFragment = __webpack_require__(44508); +const makeSerializable = __webpack_require__(83626); +const ModuleDependency = __webpack_require__(10931); /** @typedef {import("webpack-sources").ReplaceSource} ReplaceSource */ /** @typedef {import("../ChunkGraph")} ChunkGraph */ @@ -117481,7 +122414,11 @@ const ModuleDependency = __webpack_require__(22994); /** @typedef {import("../DependencyTemplate").DependencyTemplateContext} DependencyTemplateContext */ /** @typedef {import("../DependencyTemplates")} DependencyTemplates */ /** @typedef {import("../ModuleGraph")} ModuleGraph */ +/** @typedef {import("../ModuleGraphConnection")} ModuleGraphConnection */ /** @typedef {import("../RuntimeTemplate")} RuntimeTemplate */ +/** @typedef {import("../javascript/JavascriptParser").Range} Range */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */ /** @typedef {import("../util/Hash")} Hash */ /** @typedef {import("../util/runtime").RuntimeSpec} RuntimeSpec */ @@ -117499,7 +122436,7 @@ class ProvidedDependency extends ModuleDependency { * @param {string} request request * @param {string} identifier identifier * @param {string[]} ids ids - * @param {[number, number]} range range + * @param {Range} range range */ constructor(request, identifier, ids, range) { super(request); @@ -117542,6 +122479,9 @@ class ProvidedDependency extends ModuleDependency { hash.update(this._hashUpdate); } + /** + * @param {ObjectSerializerContext} context context + */ serialize(context) { const { write } = context; write(this.identifier); @@ -117549,6 +122489,9 @@ class ProvidedDependency extends ModuleDependency { super.serialize(context); } + /** + * @param {ObjectDeserializerContext} context context + */ deserialize(context) { const { read } = context; this.identifier = read(); @@ -117582,7 +122525,9 @@ class ProvidedDependencyTemplate extends ModuleDependency.Template { } ) { const dep = /** @type {ProvidedDependency} */ (dependency); - const connection = moduleGraph.getConnection(dep); + const connection = + /** @type {ModuleGraphConnection} */ + (moduleGraph.getConnection(dep)); const exportsInfo = moduleGraph.getExportsInfo(connection.module); const usedName = exportsInfo.getUsedName(dep.ids, runtime); initFragments.push( @@ -117611,7 +122556,7 @@ module.exports = ProvidedDependency; /***/ }), -/***/ 94535: +/***/ 80510: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -117622,10 +122567,10 @@ module.exports = ProvidedDependency; -const { UsageState } = __webpack_require__(1723); -const makeSerializable = __webpack_require__(23827); -const { filterRuntime } = __webpack_require__(55693); -const NullDependency = __webpack_require__(74263); +const { UsageState } = __webpack_require__(14768); +const makeSerializable = __webpack_require__(83626); +const { filterRuntime } = __webpack_require__(69965); +const NullDependency = __webpack_require__(87568); /** @typedef {import("webpack-sources").ReplaceSource} ReplaceSource */ /** @typedef {import("../ChunkGraph")} ChunkGraph */ @@ -117634,11 +122579,14 @@ const NullDependency = __webpack_require__(74263); /** @typedef {import("../DependencyTemplate").DependencyTemplateContext} DependencyTemplateContext */ /** @typedef {import("../ModuleGraph")} ModuleGraph */ /** @typedef {import("../ModuleGraphConnection").ConnectionState} ConnectionState */ +/** @typedef {import("../javascript/JavascriptParser").Range} Range */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */ /** @typedef {import("../util/Hash")} Hash */ class PureExpressionDependency extends NullDependency { /** - * @param {[number, number]} range the source range + * @param {Range} range the source range */ constructor(range) { super(); @@ -117669,6 +122617,9 @@ class PureExpressionDependency extends NullDependency { return false; } + /** + * @param {ObjectSerializerContext} context context + */ serialize(context) { const { write } = context; write(this.range); @@ -117676,6 +122627,9 @@ class PureExpressionDependency extends NullDependency { super.serialize(context); } + /** + * @param {ObjectDeserializerContext} context context + */ deserialize(context) { const { read } = context; this.range = read(); @@ -117747,7 +122701,7 @@ module.exports = PureExpressionDependency; /***/ }), -/***/ 54213: +/***/ 70802: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -117758,11 +122712,17 @@ module.exports = PureExpressionDependency; -const makeSerializable = __webpack_require__(23827); -const ContextDependency = __webpack_require__(45899); -const ModuleDependencyTemplateAsRequireId = __webpack_require__(28144); +const makeSerializable = __webpack_require__(83626); +const ContextDependency = __webpack_require__(64946); +const ModuleDependencyTemplateAsRequireId = __webpack_require__(9623); + +/** @typedef {import("../javascript/JavascriptParser").Range} Range */ class RequireContextDependency extends ContextDependency { + /** + * @param {TODO} options options + * @param {Range} range range + */ constructor(options, range) { super(options); @@ -117786,7 +122746,7 @@ module.exports = RequireContextDependency; /***/ }), -/***/ 37846: +/***/ 90295: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -117797,9 +122757,17 @@ module.exports = RequireContextDependency; -const RequireContextDependency = __webpack_require__(54213); +const RequireContextDependency = __webpack_require__(70802); + +/** @typedef {import("../Dependency").DependencyLocation} DependencyLocation */ +/** @typedef {import("../javascript/JavascriptParser")} JavascriptParser */ +/** @typedef {import("../javascript/JavascriptParser").Range} Range */ module.exports = class RequireContextDependencyParserPlugin { + /** + * @param {JavascriptParser} parser the parser + * @returns {void} + */ apply(parser) { parser.hooks.call .for("require.context") @@ -117811,19 +122779,19 @@ module.exports = class RequireContextDependencyParserPlugin { case 4: { const modeExpr = parser.evaluateExpression(expr.arguments[3]); if (!modeExpr.isString()) return; - mode = modeExpr.string; + mode = /** @type {string} */ (modeExpr.string); } // falls through case 3: { const regExpExpr = parser.evaluateExpression(expr.arguments[2]); if (!regExpExpr.isRegExp()) return; - regExp = regExpExpr.regExp; + regExp = /** @type {RegExp} */ (regExpExpr.regExp); } // falls through case 2: { const recursiveExpr = parser.evaluateExpression(expr.arguments[1]); if (!recursiveExpr.isBoolean()) return; - recursive = recursiveExpr.bool; + recursive = /** @type {boolean} */ (recursiveExpr.bool); } // falls through case 1: { @@ -117837,9 +122805,9 @@ module.exports = class RequireContextDependencyParserPlugin { mode, category: "commonjs" }, - expr.range + /** @type {Range} */ (expr.range) ); - dep.loc = expr.loc; + dep.loc = /** @type {DependencyLocation} */ (expr.loc); dep.optional = !!parser.scope.inTry; parser.state.current.addDependency(dep); return true; @@ -117852,7 +122820,7 @@ module.exports = class RequireContextDependencyParserPlugin { /***/ }), -/***/ 84209: +/***/ 99322: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -117863,17 +122831,25 @@ module.exports = class RequireContextDependencyParserPlugin { -const { cachedSetProperty } = __webpack_require__(31074); -const ContextElementDependency = __webpack_require__(34286); -const RequireContextDependency = __webpack_require__(54213); -const RequireContextDependencyParserPlugin = __webpack_require__(37846); +const { + JAVASCRIPT_MODULE_TYPE_AUTO, + JAVASCRIPT_MODULE_TYPE_DYNAMIC +} = __webpack_require__(92891); +const { cachedSetProperty } = __webpack_require__(44639); +const ContextElementDependency = __webpack_require__(27054); +const RequireContextDependency = __webpack_require__(70802); +const RequireContextDependencyParserPlugin = __webpack_require__(90295); +/** @typedef {import("../../declarations/WebpackOptions").JavascriptParserOptions} JavascriptParserOptions */ /** @typedef {import("../../declarations/WebpackOptions").ResolveOptions} ResolveOptions */ /** @typedef {import("../Compiler")} Compiler */ +/** @typedef {import("../javascript/JavascriptParser")} Parser */ /** @type {ResolveOptions} */ const EMPTY_RESOLVE_OPTIONS = {}; +const PLUGIN_NAME = "RequireContextPlugin"; + class RequireContextPlugin { /** * Apply the plugin @@ -117882,7 +122858,7 @@ class RequireContextPlugin { */ apply(compiler) { compiler.hooks.compilation.tap( - "RequireContextPlugin", + PLUGIN_NAME, (compilation, { contextModuleFactory, normalModuleFactory }) => { compilation.dependencyFactories.set( RequireContextDependency, @@ -117898,6 +122874,11 @@ class RequireContextPlugin { normalModuleFactory ); + /** + * @param {Parser} parser parser parser + * @param {JavascriptParserOptions} parserOptions parserOptions + * @returns {void} + */ const handler = (parser, parserOptions) => { if ( parserOptions.requireContext !== undefined && @@ -117909,14 +122890,14 @@ class RequireContextPlugin { }; normalModuleFactory.hooks.parser - .for("javascript/auto") - .tap("RequireContextPlugin", handler); + .for(JAVASCRIPT_MODULE_TYPE_AUTO) + .tap(PLUGIN_NAME, handler); normalModuleFactory.hooks.parser - .for("javascript/dynamic") - .tap("RequireContextPlugin", handler); + .for(JAVASCRIPT_MODULE_TYPE_DYNAMIC) + .tap(PLUGIN_NAME, handler); contextModuleFactory.hooks.alternativeRequests.tap( - "RequireContextPlugin", + PLUGIN_NAME, (items, options) => { if (items.length === 0) return items; @@ -118010,7 +122991,7 @@ module.exports = RequireContextPlugin; /***/ }), -/***/ 21888: +/***/ 69653: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -118021,10 +123002,17 @@ module.exports = RequireContextPlugin; -const AsyncDependenciesBlock = __webpack_require__(54823); -const makeSerializable = __webpack_require__(23827); +const AsyncDependenciesBlock = __webpack_require__(27973); +const makeSerializable = __webpack_require__(83626); + +/** @typedef {import("../ChunkGroup").ChunkGroupOptions} ChunkGroupOptions */ +/** @typedef {import("../Dependency").DependencyLocation} DependencyLocation */ class RequireEnsureDependenciesBlock extends AsyncDependenciesBlock { + /** + * @param {ChunkGroupOptions & { entryOptions?: TODO }} chunkName chunk name + * @param {DependencyLocation} loc location info + */ constructor(chunkName, loc) { super(chunkName, loc, null); } @@ -118040,7 +123028,7 @@ module.exports = RequireEnsureDependenciesBlock; /***/ }), -/***/ 18896: +/***/ 54009: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -118051,10 +123039,13 @@ module.exports = RequireEnsureDependenciesBlock; -const RequireEnsureDependenciesBlock = __webpack_require__(21888); -const RequireEnsureDependency = __webpack_require__(66813); -const RequireEnsureItemDependency = __webpack_require__(15406); -const getFunctionExpression = __webpack_require__(38781); +const RequireEnsureDependenciesBlock = __webpack_require__(69653); +const RequireEnsureDependency = __webpack_require__(61639); +const RequireEnsureItemDependency = __webpack_require__(11798); +const getFunctionExpression = __webpack_require__(27345); + +/** @typedef {import("../ChunkGroup").ChunkGroupOptions} ChunkGroupOptions */ +/** @typedef {import("../javascript/JavascriptParser")} JavascriptParser */ module.exports = class RequireEnsureDependenciesBlockParserPlugin { apply(parser) { @@ -118103,7 +123094,9 @@ module.exports = class RequireEnsureDependenciesBlockParserPlugin { } const depBlock = new RequireEnsureDependenciesBlock( - chunkName, + /** @type {ChunkGroupOptions & { entryOptions?: TODO }} */ ( + chunkName + ), expr.loc ); const errorCallbackExists = @@ -118169,7 +123162,7 @@ module.exports = class RequireEnsureDependenciesBlockParserPlugin { /***/ }), -/***/ 66813: +/***/ 61639: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -118180,16 +123173,24 @@ module.exports = class RequireEnsureDependenciesBlockParserPlugin { -const RuntimeGlobals = __webpack_require__(34623); -const makeSerializable = __webpack_require__(23827); -const NullDependency = __webpack_require__(74263); +const RuntimeGlobals = __webpack_require__(61539); +const makeSerializable = __webpack_require__(83626); +const NullDependency = __webpack_require__(87568); /** @typedef {import("webpack-sources").ReplaceSource} ReplaceSource */ /** @typedef {import("../AsyncDependenciesBlock")} AsyncDependenciesBlock */ /** @typedef {import("../Dependency")} Dependency */ /** @typedef {import("../DependencyTemplate").DependencyTemplateContext} DependencyTemplateContext */ +/** @typedef {import("../javascript/JavascriptParser").Range} Range */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */ class RequireEnsureDependency extends NullDependency { + /** + * @param {Range} range range + * @param {Range} contentRange content range + * @param {Range} errorHandlerRange error handler range + */ constructor(range, contentRange, errorHandlerRange) { super(); @@ -118202,6 +123203,9 @@ class RequireEnsureDependency extends NullDependency { return "require.ensure"; } + /** + * @param {ObjectSerializerContext} context context + */ serialize(context) { const { write } = context; @@ -118212,6 +123216,9 @@ class RequireEnsureDependency extends NullDependency { super.serialize(context); } + /** + * @param {ObjectDeserializerContext} context context + */ deserialize(context) { const { read } = context; @@ -118260,14 +123267,14 @@ RequireEnsureDependency.Template = class RequireEnsureDependencyTemplate extends source.replace( contentRange[1], errorHandlerRange[0] - 1, - ").bind(null, __webpack_require__))['catch'](" + `).bind(null, ${RuntimeGlobals.require}))['catch'](` ); source.replace(errorHandlerRange[1], range[1] - 1, ")"); } else { source.replace( contentRange[1], range[1] - 1, - `).bind(null, __webpack_require__))['catch'](${RuntimeGlobals.uncaughtErrorHandler})` + `).bind(null, ${RuntimeGlobals.require}))['catch'](${RuntimeGlobals.uncaughtErrorHandler})` ); } } @@ -118278,7 +123285,7 @@ module.exports = RequireEnsureDependency; /***/ }), -/***/ 15406: +/***/ 11798: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -118289,11 +123296,14 @@ module.exports = RequireEnsureDependency; -const makeSerializable = __webpack_require__(23827); -const ModuleDependency = __webpack_require__(22994); -const NullDependency = __webpack_require__(74263); +const makeSerializable = __webpack_require__(83626); +const ModuleDependency = __webpack_require__(10931); +const NullDependency = __webpack_require__(87568); class RequireEnsureItemDependency extends ModuleDependency { + /** + * @param {string} request the request string + */ constructor(request) { super(request); } @@ -118319,7 +123329,7 @@ module.exports = RequireEnsureItemDependency; /***/ }), -/***/ 54560: +/***/ 47276: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -118330,20 +123340,35 @@ module.exports = RequireEnsureItemDependency; -const RequireEnsureDependency = __webpack_require__(66813); -const RequireEnsureItemDependency = __webpack_require__(15406); +const RequireEnsureDependency = __webpack_require__(61639); +const RequireEnsureItemDependency = __webpack_require__(11798); -const RequireEnsureDependenciesBlockParserPlugin = __webpack_require__(18896); +const RequireEnsureDependenciesBlockParserPlugin = __webpack_require__(54009); +const { + JAVASCRIPT_MODULE_TYPE_AUTO, + JAVASCRIPT_MODULE_TYPE_DYNAMIC +} = __webpack_require__(92891); const { evaluateToString, toConstantDependency -} = __webpack_require__(645); +} = __webpack_require__(94213); + +/** @typedef {import("../../declarations/WebpackOptions").JavascriptParserOptions} JavascriptParserOptions */ +/** @typedef {import("../Compiler")} Compiler */ +/** @typedef {import("../javascript/JavascriptParser")} Parser */ + +const PLUGIN_NAME = "RequireEnsurePlugin"; class RequireEnsurePlugin { + /** + * Apply the plugin + * @param {Compiler} compiler the compiler instance + * @returns {void} + */ apply(compiler) { compiler.hooks.compilation.tap( - "RequireEnsurePlugin", + PLUGIN_NAME, (compilation, { normalModuleFactory }) => { compilation.dependencyFactories.set( RequireEnsureItemDependency, @@ -118359,6 +123384,11 @@ class RequireEnsurePlugin { new RequireEnsureDependency.Template() ); + /** + * @param {Parser} parser parser parser + * @param {JavascriptParserOptions} parserOptions parserOptions + * @returns {void} + */ const handler = (parser, parserOptions) => { if ( parserOptions.requireEnsure !== undefined && @@ -118369,21 +123399,21 @@ class RequireEnsurePlugin { new RequireEnsureDependenciesBlockParserPlugin().apply(parser); parser.hooks.evaluateTypeof .for("require.ensure") - .tap("RequireEnsurePlugin", evaluateToString("function")); + .tap(PLUGIN_NAME, evaluateToString("function")); parser.hooks.typeof .for("require.ensure") .tap( - "RequireEnsurePlugin", + PLUGIN_NAME, toConstantDependency(parser, JSON.stringify("function")) ); }; normalModuleFactory.hooks.parser - .for("javascript/auto") - .tap("RequireEnsurePlugin", handler); + .for(JAVASCRIPT_MODULE_TYPE_AUTO) + .tap(PLUGIN_NAME, handler); normalModuleFactory.hooks.parser - .for("javascript/dynamic") - .tap("RequireEnsurePlugin", handler); + .for(JAVASCRIPT_MODULE_TYPE_DYNAMIC) + .tap(PLUGIN_NAME, handler); } ); } @@ -118393,7 +123423,7 @@ module.exports = RequireEnsurePlugin; /***/ }), -/***/ 46658: +/***/ 91172: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -118404,27 +123434,40 @@ module.exports = RequireEnsurePlugin; -const RuntimeGlobals = __webpack_require__(34623); -const makeSerializable = __webpack_require__(23827); -const NullDependency = __webpack_require__(74263); +const RuntimeGlobals = __webpack_require__(61539); +const makeSerializable = __webpack_require__(83626); +const NullDependency = __webpack_require__(87568); /** @typedef {import("webpack-sources").ReplaceSource} ReplaceSource */ /** @typedef {import("../Dependency")} Dependency */ /** @typedef {import("../DependencyTemplate").DependencyTemplateContext} DependencyTemplateContext */ +/** @typedef {import("../javascript/JavascriptParser").Range} Range */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */ class RequireHeaderDependency extends NullDependency { + /** + * @param {Range} range range + */ constructor(range) { super(); if (!Array.isArray(range)) throw new Error("range must be valid"); this.range = range; } + /** + * @param {ObjectSerializerContext} context context + */ serialize(context) { const { write } = context; write(this.range); super.serialize(context); } + /** + * @param {ObjectDeserializerContext} context context + * @returns {RequireHeaderDependency} RequireHeaderDependency + */ static deserialize(context) { const obj = new RequireHeaderDependency(context.read()); obj.deserialize(context); @@ -118449,7 +123492,7 @@ RequireHeaderDependency.Template = class RequireHeaderDependencyTemplate extends apply(dependency, source, { runtimeRequirements }) { const dep = /** @type {RequireHeaderDependency} */ (dependency); runtimeRequirements.add(RuntimeGlobals.require); - source.replace(dep.range[0], dep.range[1] - 1, "__webpack_require__"); + source.replace(dep.range[0], dep.range[1] - 1, RuntimeGlobals.require); } }; @@ -118458,7 +123501,7 @@ module.exports = RequireHeaderDependency; /***/ }), -/***/ 94313: +/***/ 27998: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -118469,18 +123512,23 @@ module.exports = RequireHeaderDependency; -const Dependency = __webpack_require__(68242); -const Template = __webpack_require__(88070); -const makeSerializable = __webpack_require__(23827); -const ModuleDependency = __webpack_require__(22994); +const Dependency = __webpack_require__(504); +const Template = __webpack_require__(88835); +const makeSerializable = __webpack_require__(83626); +const ModuleDependency = __webpack_require__(10931); /** @typedef {import("webpack-sources").ReplaceSource} ReplaceSource */ /** @typedef {import("../Dependency").ReferencedExport} ReferencedExport */ /** @typedef {import("../DependencyTemplate").DependencyTemplateContext} DependencyTemplateContext */ /** @typedef {import("../ModuleGraph")} ModuleGraph */ +/** @typedef {import("../javascript/JavascriptParser").Range} Range */ /** @typedef {import("../util/runtime").RuntimeSpec} RuntimeSpec */ class RequireIncludeDependency extends ModuleDependency { + /** + * @param {string} request the request string + * @param {Range} range location in source code + */ constructor(request, range) { super(request); @@ -118540,7 +123588,7 @@ module.exports = RequireIncludeDependency; /***/ }), -/***/ 42589: +/***/ 50181: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -118551,18 +123599,30 @@ module.exports = RequireIncludeDependency; -const WebpackError = __webpack_require__(10841); +const WebpackError = __webpack_require__(49999); const { evaluateToString, toConstantDependency -} = __webpack_require__(645); -const makeSerializable = __webpack_require__(23827); -const RequireIncludeDependency = __webpack_require__(94313); +} = __webpack_require__(94213); +const makeSerializable = __webpack_require__(83626); +const RequireIncludeDependency = __webpack_require__(27998); + +/** @typedef {import("../Dependency").DependencyLocation} DependencyLocation */ +/** @typedef {import("../javascript/JavascriptParser")} JavascriptParser */ +/** @typedef {import("../javascript/JavascriptParser").Range} Range */ module.exports = class RequireIncludeDependencyParserPlugin { + /** + * @param {boolean} warn true: warn about deprecation, false: don't warn + */ constructor(warn) { this.warn = warn; } + + /** + * @param {JavascriptParser} parser the parser + * @returns {void} + */ apply(parser) { const { warn } = this; parser.hooks.call @@ -118574,12 +123634,17 @@ module.exports = class RequireIncludeDependencyParserPlugin { if (warn) { parser.state.module.addWarning( - new RequireIncludeDeprecationWarning(expr.loc) + new RequireIncludeDeprecationWarning( + /** @type {DependencyLocation} */ (expr.loc) + ) ); } - const dep = new RequireIncludeDependency(param.string, expr.range); - dep.loc = expr.loc; + const dep = new RequireIncludeDependency( + /** @type {string} */ (param.string), + /** @type {Range} */ (expr.range) + ); + dep.loc = /** @type {DependencyLocation} */ (expr.loc); parser.state.current.addDependency(dep); return true; }); @@ -118588,7 +123653,9 @@ module.exports = class RequireIncludeDependencyParserPlugin { .tap("RequireIncludePlugin", expr => { if (warn) { parser.state.module.addWarning( - new RequireIncludeDeprecationWarning(expr.loc) + new RequireIncludeDeprecationWarning( + /** @type {DependencyLocation} */ (expr.loc) + ) ); } return evaluateToString("function")(expr); @@ -118598,7 +123665,9 @@ module.exports = class RequireIncludeDependencyParserPlugin { .tap("RequireIncludePlugin", expr => { if (warn) { parser.state.module.addWarning( - new RequireIncludeDeprecationWarning(expr.loc) + new RequireIncludeDeprecationWarning( + /** @type {DependencyLocation} */ (expr.loc) + ) ); } return toConstantDependency(parser, JSON.stringify("function"))(expr); @@ -118607,6 +123676,9 @@ module.exports = class RequireIncludeDependencyParserPlugin { }; class RequireIncludeDeprecationWarning extends WebpackError { + /** + * @param {DependencyLocation} loc location + */ constructor(loc) { super("require.include() is deprecated and will be removed soon."); @@ -118625,7 +123697,7 @@ makeSerializable( /***/ }), -/***/ 77209: +/***/ 71912: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -118636,13 +123708,28 @@ makeSerializable( -const RequireIncludeDependency = __webpack_require__(94313); -const RequireIncludeDependencyParserPlugin = __webpack_require__(42589); +const { + JAVASCRIPT_MODULE_TYPE_AUTO, + JAVASCRIPT_MODULE_TYPE_DYNAMIC +} = __webpack_require__(92891); +const RequireIncludeDependency = __webpack_require__(27998); +const RequireIncludeDependencyParserPlugin = __webpack_require__(50181); + +/** @typedef {import("../../declarations/WebpackOptions").JavascriptParserOptions} JavascriptParserOptions */ +/** @typedef {import("../Compiler")} Compiler */ +/** @typedef {import("../javascript/JavascriptParser")} Parser */ + +const PLUGIN_NAME = "RequireIncludePlugin"; class RequireIncludePlugin { + /** + * Apply the plugin + * @param {Compiler} compiler the compiler instance + * @returns {void} + */ apply(compiler) { compiler.hooks.compilation.tap( - "RequireIncludePlugin", + PLUGIN_NAME, (compilation, { normalModuleFactory }) => { compilation.dependencyFactories.set( RequireIncludeDependency, @@ -118653,6 +123740,11 @@ class RequireIncludePlugin { new RequireIncludeDependency.Template() ); + /** + * @param {Parser} parser parser parser + * @param {JavascriptParserOptions} parserOptions parserOptions + * @returns {void} + */ const handler = (parser, parserOptions) => { if (parserOptions.requireInclude === false) return; const warn = parserOptions.requireInclude === undefined; @@ -118661,11 +123753,11 @@ class RequireIncludePlugin { }; normalModuleFactory.hooks.parser - .for("javascript/auto") - .tap("RequireIncludePlugin", handler); + .for(JAVASCRIPT_MODULE_TYPE_AUTO) + .tap(PLUGIN_NAME, handler); normalModuleFactory.hooks.parser - .for("javascript/dynamic") - .tap("RequireIncludePlugin", handler); + .for(JAVASCRIPT_MODULE_TYPE_DYNAMIC) + .tap(PLUGIN_NAME, handler); } ); } @@ -118675,7 +123767,7 @@ module.exports = RequireIncludePlugin; /***/ }), -/***/ 95219: +/***/ 9973: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -118686,11 +123778,22 @@ module.exports = RequireIncludePlugin; -const makeSerializable = __webpack_require__(23827); -const ContextDependency = __webpack_require__(45899); -const ContextDependencyTemplateAsId = __webpack_require__(40562); +const makeSerializable = __webpack_require__(83626); +const ContextDependency = __webpack_require__(64946); +const ContextDependencyTemplateAsId = __webpack_require__(44264); + +/** @typedef {import("../javascript/JavascriptParser").Range} Range */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */ +/** @typedef {import("./ContextDependency").ContextDependencyOptions} ContextDependencyOptions */ class RequireResolveContextDependency extends ContextDependency { + /** + * @param {ContextDependencyOptions} options options + * @param {Range} range range + * @param {Range} valueRange value range + * @param {TODO} context context + */ constructor(options, range, valueRange, context) { super(options, context); @@ -118702,6 +123805,9 @@ class RequireResolveContextDependency extends ContextDependency { return "amd require context"; } + /** + * @param {ObjectSerializerContext} context context + */ serialize(context) { const { write } = context; @@ -118711,6 +123817,9 @@ class RequireResolveContextDependency extends ContextDependency { super.serialize(context); } + /** + * @param {ObjectDeserializerContext} context context + */ deserialize(context) { const { read } = context; @@ -118733,7 +123842,7 @@ module.exports = RequireResolveContextDependency; /***/ }), -/***/ 53711: +/***/ 14694: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -118744,16 +123853,22 @@ module.exports = RequireResolveContextDependency; -const Dependency = __webpack_require__(68242); -const makeSerializable = __webpack_require__(23827); -const ModuleDependency = __webpack_require__(22994); -const ModuleDependencyAsId = __webpack_require__(32789); +const Dependency = __webpack_require__(504); +const makeSerializable = __webpack_require__(83626); +const ModuleDependency = __webpack_require__(10931); +const ModuleDependencyAsId = __webpack_require__(90881); /** @typedef {import("../Dependency").ReferencedExport} ReferencedExport */ /** @typedef {import("../ModuleGraph")} ModuleGraph */ +/** @typedef {import("../javascript/JavascriptParser").Range} Range */ /** @typedef {import("../util/runtime").RuntimeSpec} RuntimeSpec */ class RequireResolveDependency extends ModuleDependency { + /** + * @param {string} request the request string + * @param {Range} range location in source code + * @param {string} [context] context + */ constructor(request, range, context) { super(request); @@ -118793,7 +123908,7 @@ module.exports = RequireResolveDependency; /***/ }), -/***/ 95635: +/***/ 58164: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -118804,14 +123919,20 @@ module.exports = RequireResolveDependency; -const makeSerializable = __webpack_require__(23827); -const NullDependency = __webpack_require__(74263); +const makeSerializable = __webpack_require__(83626); +const NullDependency = __webpack_require__(87568); /** @typedef {import("webpack-sources").ReplaceSource} ReplaceSource */ /** @typedef {import("../Dependency")} Dependency */ /** @typedef {import("../DependencyTemplate").DependencyTemplateContext} DependencyTemplateContext */ +/** @typedef {import("../javascript/JavascriptParser").Range} Range */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */ class RequireResolveHeaderDependency extends NullDependency { + /** + * @param {Range} range range + */ constructor(range) { super(); @@ -118820,6 +123941,9 @@ class RequireResolveHeaderDependency extends NullDependency { this.range = range; } + /** + * @param {ObjectSerializerContext} context context + */ serialize(context) { const { write } = context; @@ -118828,6 +123952,10 @@ class RequireResolveHeaderDependency extends NullDependency { super.serialize(context); } + /** + * @param {ObjectDeserializerContext} context context + * @returns {RequireResolveHeaderDependency} RequireResolveHeaderDependency + */ static deserialize(context) { const obj = new RequireResolveHeaderDependency(context.read()); obj.deserialize(context); @@ -118854,6 +123982,11 @@ RequireResolveHeaderDependency.Template = class RequireResolveHeaderDependencyTe source.replace(dep.range[0], dep.range[1] - 1, "/*require.resolve*/"); } + /** + * @param {string} name name + * @param {RequireResolveHeaderDependency} dep dependency + * @param {ReplaceSource} source source + */ applyAsTemplateArgument(name, dep, source) { source.replace(dep.range[0], dep.range[1] - 1, "/*require.resolve*/"); } @@ -118864,7 +123997,7 @@ module.exports = RequireResolveHeaderDependency; /***/ }), -/***/ 72885: +/***/ 26068: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -118875,8 +124008,8 @@ module.exports = RequireResolveHeaderDependency; -const makeSerializable = __webpack_require__(23827); -const NullDependency = __webpack_require__(74263); +const makeSerializable = __webpack_require__(83626); +const NullDependency = __webpack_require__(87568); /** @typedef {import("webpack-sources").ReplaceSource} ReplaceSource */ /** @typedef {import("../ChunkGraph")} ChunkGraph */ @@ -118884,6 +124017,8 @@ const NullDependency = __webpack_require__(74263); /** @typedef {import("../Dependency").UpdateHashContext} UpdateHashContext */ /** @typedef {import("../DependencyTemplate").DependencyTemplateContext} DependencyTemplateContext */ /** @typedef {import("../ModuleGraph")} ModuleGraph */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */ /** @typedef {import("../util/Hash")} Hash */ class RuntimeRequirementsDependency extends NullDependency { @@ -118909,12 +124044,18 @@ class RuntimeRequirementsDependency extends NullDependency { hash.update(this._hashUpdate); } + /** + * @param {ObjectSerializerContext} context context + */ serialize(context) { const { write } = context; write(this.runtimeRequirements); super.serialize(context); } + /** + * @param {ObjectDeserializerContext} context context + */ deserialize(context) { const { read } = context; this.runtimeRequirements = read(); @@ -118949,7 +124090,7 @@ module.exports = RuntimeRequirementsDependency; /***/ }), -/***/ 64422: +/***/ 71444: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -118960,14 +124101,16 @@ module.exports = RuntimeRequirementsDependency; -const makeSerializable = __webpack_require__(23827); -const NullDependency = __webpack_require__(74263); +const makeSerializable = __webpack_require__(83626); +const NullDependency = __webpack_require__(87568); /** @typedef {import("../ChunkGraph")} ChunkGraph */ /** @typedef {import("../Dependency").ExportSpec} ExportSpec */ /** @typedef {import("../Dependency").ExportsSpec} ExportsSpec */ /** @typedef {import("../Dependency").UpdateHashContext} UpdateHashContext */ /** @typedef {import("../ModuleGraph")} ModuleGraph */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */ /** @typedef {import("../util/Hash")} Hash */ class StaticExportsDependency extends NullDependency { @@ -118998,6 +124141,9 @@ class StaticExportsDependency extends NullDependency { }; } + /** + * @param {ObjectSerializerContext} context context + */ serialize(context) { const { write } = context; write(this.exports); @@ -119005,6 +124151,9 @@ class StaticExportsDependency extends NullDependency { super.serialize(context); } + /** + * @param {ObjectDeserializerContext} context context + */ deserialize(context) { const { read } = context; this.exports = read(); @@ -119023,7 +124172,7 @@ module.exports = StaticExportsDependency; /***/ }), -/***/ 21835: +/***/ 89277: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -119034,18 +124183,28 @@ module.exports = StaticExportsDependency; -const RuntimeGlobals = __webpack_require__(34623); -const WebpackError = __webpack_require__(10841); +const { + JAVASCRIPT_MODULE_TYPE_AUTO, + JAVASCRIPT_MODULE_TYPE_DYNAMIC +} = __webpack_require__(92891); +const RuntimeGlobals = __webpack_require__(61539); +const WebpackError = __webpack_require__(49999); const { evaluateToString, expressionIsUnsupported, toConstantDependency -} = __webpack_require__(645); -const makeSerializable = __webpack_require__(23827); -const ConstDependency = __webpack_require__(78284); -const SystemRuntimeModule = __webpack_require__(49167); +} = __webpack_require__(94213); +const makeSerializable = __webpack_require__(83626); +const ConstDependency = __webpack_require__(67538); +const SystemRuntimeModule = __webpack_require__(83235); +/** @typedef {import("../../declarations/WebpackOptions").JavascriptParserOptions} JavascriptParserOptions */ /** @typedef {import("../Compiler")} Compiler */ +/** @typedef {import("../Dependency").DependencyLocation} DependencyLocation */ +/** @typedef {import("../javascript/JavascriptParser")} Parser */ +/** @typedef {import("../javascript/JavascriptParser").Range} Range */ + +const PLUGIN_NAME = "SystemPlugin"; class SystemPlugin { /** @@ -119055,33 +124214,41 @@ class SystemPlugin { */ apply(compiler) { compiler.hooks.compilation.tap( - "SystemPlugin", + PLUGIN_NAME, (compilation, { normalModuleFactory }) => { compilation.hooks.runtimeRequirementInModule .for(RuntimeGlobals.system) - .tap("SystemPlugin", (module, set) => { + .tap(PLUGIN_NAME, (module, set) => { set.add(RuntimeGlobals.requireScope); }); compilation.hooks.runtimeRequirementInTree .for(RuntimeGlobals.system) - .tap("SystemPlugin", (chunk, set) => { + .tap(PLUGIN_NAME, (chunk, set) => { compilation.addRuntimeModule(chunk, new SystemRuntimeModule()); }); + /** + * @param {Parser} parser parser parser + * @param {JavascriptParserOptions} parserOptions parserOptions + * @returns {void} + */ const handler = (parser, parserOptions) => { if (parserOptions.system === undefined || !parserOptions.system) { return; } + /** + * @param {string} name name + */ const setNotSupported = name => { parser.hooks.evaluateTypeof .for(name) - .tap("SystemPlugin", evaluateToString("undefined")); + .tap(PLUGIN_NAME, evaluateToString("undefined")); parser.hooks.expression .for(name) .tap( - "SystemPlugin", + PLUGIN_NAME, expressionIsUnsupported( parser, name + " is not supported by webpack." @@ -119092,43 +124259,49 @@ class SystemPlugin { parser.hooks.typeof .for("System.import") .tap( - "SystemPlugin", + PLUGIN_NAME, toConstantDependency(parser, JSON.stringify("function")) ); parser.hooks.evaluateTypeof .for("System.import") - .tap("SystemPlugin", evaluateToString("function")); + .tap(PLUGIN_NAME, evaluateToString("function")); parser.hooks.typeof .for("System") .tap( - "SystemPlugin", + PLUGIN_NAME, toConstantDependency(parser, JSON.stringify("object")) ); parser.hooks.evaluateTypeof .for("System") - .tap("SystemPlugin", evaluateToString("object")); + .tap(PLUGIN_NAME, evaluateToString("object")); setNotSupported("System.set"); setNotSupported("System.get"); setNotSupported("System.register"); - parser.hooks.expression.for("System").tap("SystemPlugin", expr => { - const dep = new ConstDependency(RuntimeGlobals.system, expr.range, [ - RuntimeGlobals.system - ]); - dep.loc = expr.loc; + parser.hooks.expression.for("System").tap(PLUGIN_NAME, expr => { + const dep = new ConstDependency( + RuntimeGlobals.system, + /** @type {Range} */ (expr.range), + [RuntimeGlobals.system] + ); + dep.loc = /** @type {DependencyLocation} */ (expr.loc); parser.state.module.addPresentationalDependency(dep); return true; }); - parser.hooks.call.for("System.import").tap("SystemPlugin", expr => { + parser.hooks.call.for("System.import").tap(PLUGIN_NAME, expr => { parser.state.module.addWarning( - new SystemImportDeprecationWarning(expr.loc) + new SystemImportDeprecationWarning( + /** @type {DependencyLocation} */ (expr.loc) + ) ); return parser.hooks.importCall.call({ type: "ImportExpression", - source: expr.arguments[0], + source: + /** @type {import("estree").Literal} */ + (expr.arguments[0]), loc: expr.loc, range: expr.range }); @@ -119136,17 +124309,20 @@ class SystemPlugin { }; normalModuleFactory.hooks.parser - .for("javascript/auto") - .tap("SystemPlugin", handler); + .for(JAVASCRIPT_MODULE_TYPE_AUTO) + .tap(PLUGIN_NAME, handler); normalModuleFactory.hooks.parser - .for("javascript/dynamic") - .tap("SystemPlugin", handler); + .for(JAVASCRIPT_MODULE_TYPE_DYNAMIC) + .tap(PLUGIN_NAME, handler); } ); } } class SystemImportDeprecationWarning extends WebpackError { + /** + * @param {DependencyLocation} loc location + */ constructor(loc) { super( "System.import() is deprecated and will be removed soon. Use import() instead.\n" + @@ -119171,7 +124347,7 @@ module.exports.SystemImportDeprecationWarning = SystemImportDeprecationWarning; /***/ }), -/***/ 49167: +/***/ 83235: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -119182,9 +124358,9 @@ module.exports.SystemImportDeprecationWarning = SystemImportDeprecationWarning; -const RuntimeGlobals = __webpack_require__(34623); -const RuntimeModule = __webpack_require__(81196); -const Template = __webpack_require__(88070); +const RuntimeGlobals = __webpack_require__(61539); +const RuntimeModule = __webpack_require__(21296); +const Template = __webpack_require__(88835); class SystemRuntimeModule extends RuntimeModule { constructor() { @@ -119192,7 +124368,7 @@ class SystemRuntimeModule extends RuntimeModule { } /** - * @returns {string} runtime code + * @returns {string | null} runtime code */ generate() { return Template.asString([ @@ -119214,7 +124390,7 @@ module.exports = SystemRuntimeModule; /***/ }), -/***/ 76440: +/***/ 24756: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -119225,13 +124401,13 @@ module.exports = SystemRuntimeModule; -const RuntimeGlobals = __webpack_require__(34623); +const RuntimeGlobals = __webpack_require__(61539); const { getDependencyUsedByExportsCondition -} = __webpack_require__(91424); -const makeSerializable = __webpack_require__(23827); -const memoize = __webpack_require__(27319); -const ModuleDependency = __webpack_require__(22994); +} = __webpack_require__(53310); +const makeSerializable = __webpack_require__(83626); +const memoize = __webpack_require__(62377); +const ModuleDependency = __webpack_require__(10931); /** @typedef {import("webpack-sources").ReplaceSource} ReplaceSource */ /** @typedef {import("../ChunkGraph")} ChunkGraph */ @@ -119242,16 +124418,19 @@ const ModuleDependency = __webpack_require__(22994); /** @typedef {import("../ModuleGraph")} ModuleGraph */ /** @typedef {import("../ModuleGraphConnection")} ModuleGraphConnection */ /** @typedef {import("../ModuleGraphConnection").ConnectionState} ConnectionState */ +/** @typedef {import("../javascript/JavascriptParser").Range} Range */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */ /** @typedef {import("../util/Hash")} Hash */ /** @typedef {import("../util/runtime").RuntimeSpec} RuntimeSpec */ -const getRawDataUrlModule = memoize(() => __webpack_require__(90144)); +const getRawDataUrlModule = memoize(() => __webpack_require__(69762)); class URLDependency extends ModuleDependency { /** * @param {string} request request - * @param {[number, number]} range range of the arguments of new URL( |> ... <| ) - * @param {[number, number]} outerRange range of the full |> new URL(...) <| + * @param {Range} range range of the arguments of new URL( |> ... <| ) + * @param {Range} outerRange range of the full |> new URL(...) <| * @param {boolean=} relative use relative urls instead of absolute with base uri */ constructor(request, range, outerRange, relative) { @@ -119259,7 +124438,7 @@ class URLDependency extends ModuleDependency { this.range = range; this.outerRange = outerRange; this.relative = relative || false; - /** @type {Set | boolean} */ + /** @type {Set | boolean | undefined} */ this.usedByExports = undefined; } @@ -119285,13 +124464,16 @@ class URLDependency extends ModuleDependency { /** * @param {string} context context directory - * @returns {Module} a module + * @returns {Module | null} a module */ createIgnoredModule(context) { const RawDataUrlModule = getRawDataUrlModule(); return new RawDataUrlModule("data:,", `ignored-asset`, `(ignored asset)`); } + /** + * @param {ObjectSerializerContext} context context + */ serialize(context) { const { write } = context; write(this.outerRange); @@ -119300,6 +124482,9 @@ class URLDependency extends ModuleDependency { super.serialize(context); } + /** + * @param {ObjectDeserializerContext} context context + */ deserialize(context) { const { read } = context; this.outerRange = read(); @@ -119380,7 +124565,7 @@ module.exports = URLDependency; /***/ }), -/***/ 55437: +/***/ 10937: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -119392,15 +124577,25 @@ module.exports = URLDependency; const { pathToFileURL } = __webpack_require__(57310); -const BasicEvaluatedExpression = __webpack_require__(88981); -const { approve } = __webpack_require__(645); -const InnerGraph = __webpack_require__(91424); -const URLDependency = __webpack_require__(76440); +const { + JAVASCRIPT_MODULE_TYPE_AUTO, + JAVASCRIPT_MODULE_TYPE_ESM +} = __webpack_require__(92891); +const BasicEvaluatedExpression = __webpack_require__(52493); +const { approve } = __webpack_require__(94213); +const InnerGraph = __webpack_require__(53310); +const URLDependency = __webpack_require__(24756); /** @typedef {import("estree").NewExpression} NewExpressionNode */ +/** @typedef {import("../../declarations/WebpackOptions").JavascriptParserOptions} JavascriptParserOptions */ /** @typedef {import("../Compiler")} Compiler */ +/** @typedef {import("../Dependency").DependencyLocation} DependencyLocation */ /** @typedef {import("../NormalModule")} NormalModule */ /** @typedef {import("../javascript/JavascriptParser")} JavascriptParser */ +/** @typedef {import("../javascript/JavascriptParser")} Parser */ +/** @typedef {import("../javascript/JavascriptParser").Range} Range */ + +const PLUGIN_NAME = "URLPlugin"; class URLPlugin { /** @@ -119408,7 +124603,7 @@ class URLPlugin { */ apply(compiler) { compiler.hooks.compilation.tap( - "URLPlugin", + PLUGIN_NAME, (compilation, { normalModuleFactory }) => { compilation.dependencyFactories.set(URLDependency, normalModuleFactory); compilation.dependencyTemplates.set( @@ -119423,9 +124618,11 @@ class URLPlugin { const getUrl = module => { return pathToFileURL(module.resource); }; + /** - * @param {JavascriptParser} parser parser - * @param {object} parserOptions options + * @param {Parser} parser parser parser + * @param {JavascriptParserOptions} parserOptions parserOptions + * @returns {void} */ const parserCallback = (parser, parserOptions) => { if (parserOptions.url === false) return; @@ -119457,24 +124654,22 @@ class URLPlugin { ) return; - const request = parser.evaluateExpression(arg1).asString(); - - return request; + return parser.evaluateExpression(arg1).asString(); }; - parser.hooks.canRename.for("URL").tap("URLPlugin", approve); + parser.hooks.canRename.for("URL").tap(PLUGIN_NAME, approve); parser.hooks.evaluateNewExpression .for("URL") - .tap("URLPlugin", expr => { + .tap(PLUGIN_NAME, expr => { const request = getUrlRequest(expr); if (!request) return; const url = new URL(request, getUrl(parser.state.module)); return new BasicEvaluatedExpression() .setString(url.toString()) - .setRange(expr.range); + .setRange(/** @type {Range} */ (expr.range)); }); - parser.hooks.new.for("URL").tap("URLPlugin", _expr => { + parser.hooks.new.for("URL").tap(PLUGIN_NAME, _expr => { const expr = /** @type {NewExpressionNode} */ (_expr); const request = getUrlRequest(expr); @@ -119484,16 +124679,19 @@ class URLPlugin { const [arg1, arg2] = expr.arguments; const dep = new URLDependency( request, - [arg1.range[0], arg2.range[1]], - expr.range, + [ + /** @type {Range} */ (arg1.range)[0], + /** @type {Range} */ (arg2.range)[1] + ], + /** @type {Range} */ (expr.range), relative ); - dep.loc = expr.loc; + dep.loc = /** @type {DependencyLocation} */ (expr.loc); parser.state.current.addDependency(dep); InnerGraph.onUsage(parser.state, e => (dep.usedByExports = e)); return true; }); - parser.hooks.isPure.for("NewExpression").tap("URLPlugin", _expr => { + parser.hooks.isPure.for("NewExpression").tap(PLUGIN_NAME, _expr => { const expr = /** @type {NewExpressionNode} */ (_expr); const { callee } = expr; if (callee.type !== "Identifier") return; @@ -119507,12 +124705,12 @@ class URLPlugin { }; normalModuleFactory.hooks.parser - .for("javascript/auto") - .tap("URLPlugin", parserCallback); + .for(JAVASCRIPT_MODULE_TYPE_AUTO) + .tap(PLUGIN_NAME, parserCallback); normalModuleFactory.hooks.parser - .for("javascript/esm") - .tap("URLPlugin", parserCallback); + .for(JAVASCRIPT_MODULE_TYPE_ESM) + .tap(PLUGIN_NAME, parserCallback); } ); } @@ -119523,7 +124721,7 @@ module.exports = URLPlugin; /***/ }), -/***/ 72557: +/***/ 93761: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -119534,14 +124732,21 @@ module.exports = URLPlugin; -const makeSerializable = __webpack_require__(23827); -const NullDependency = __webpack_require__(74263); +const makeSerializable = __webpack_require__(83626); +const NullDependency = __webpack_require__(87568); /** @typedef {import("webpack-sources").ReplaceSource} ReplaceSource */ /** @typedef {import("../Dependency")} Dependency */ /** @typedef {import("../DependencyTemplate").DependencyTemplateContext} DependencyTemplateContext */ +/** @typedef {import("../javascript/JavascriptParser").Range} Range */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */ class UnsupportedDependency extends NullDependency { + /** + * @param {string} request the request string + * @param {Range} range location in source code + */ constructor(request, range) { super(); @@ -119549,6 +124754,9 @@ class UnsupportedDependency extends NullDependency { this.range = range; } + /** + * @param {ObjectSerializerContext} context context + */ serialize(context) { const { write } = context; @@ -119558,6 +124766,9 @@ class UnsupportedDependency extends NullDependency { super.serialize(context); } + /** + * @param {ObjectDeserializerContext} context context + */ deserialize(context) { const { read } = context; @@ -119600,7 +124811,7 @@ module.exports = UnsupportedDependency; /***/ }), -/***/ 29931: +/***/ 79604: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -119611,16 +124822,24 @@ module.exports = UnsupportedDependency; -const Dependency = __webpack_require__(68242); -const makeSerializable = __webpack_require__(23827); -const ModuleDependency = __webpack_require__(22994); +const Dependency = __webpack_require__(504); +const makeSerializable = __webpack_require__(83626); +const ModuleDependency = __webpack_require__(10931); /** @typedef {import("../Dependency").ReferencedExport} ReferencedExport */ /** @typedef {import("../Dependency").TRANSITIVE} TRANSITIVE */ /** @typedef {import("../ModuleGraph")} ModuleGraph */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */ /** @typedef {import("../util/runtime").RuntimeSpec} RuntimeSpec */ class WebAssemblyExportImportedDependency extends ModuleDependency { + /** + * @param {string} exportName export name + * @param {string} request request + * @param {string} name name + * @param {TODO} valueType value type + */ constructor(exportName, request, name, valueType) { super(request); /** @type {string} */ @@ -119656,6 +124875,9 @@ class WebAssemblyExportImportedDependency extends ModuleDependency { return "wasm"; } + /** + * @param {ObjectSerializerContext} context context + */ serialize(context) { const { write } = context; @@ -119666,6 +124888,9 @@ class WebAssemblyExportImportedDependency extends ModuleDependency { super.serialize(context); } + /** + * @param {ObjectDeserializerContext} context context + */ deserialize(context) { const { read } = context; @@ -119687,7 +124912,7 @@ module.exports = WebAssemblyExportImportedDependency; /***/ }), -/***/ 55884: +/***/ 50992: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -119698,14 +124923,16 @@ module.exports = WebAssemblyExportImportedDependency; -const makeSerializable = __webpack_require__(23827); -const UnsupportedWebAssemblyFeatureError = __webpack_require__(6275); -const ModuleDependency = __webpack_require__(22994); +const makeSerializable = __webpack_require__(83626); +const UnsupportedWebAssemblyFeatureError = __webpack_require__(16399); +const ModuleDependency = __webpack_require__(10931); /** @typedef {import("@webassemblyjs/ast").ModuleImportDescription} ModuleImportDescription */ /** @typedef {import("../Dependency").ReferencedExport} ReferencedExport */ /** @typedef {import("../ModuleGraph")} ModuleGraph */ /** @typedef {import("../WebpackError")} WebpackError */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */ /** @typedef {import("../util/runtime").RuntimeSpec} RuntimeSpec */ class WebAssemblyImportDependency extends ModuleDependency { @@ -119746,7 +124973,7 @@ class WebAssemblyImportDependency extends ModuleDependency { /** * Returns errors * @param {ModuleGraph} moduleGraph module graph - * @returns {WebpackError[]} errors + * @returns {WebpackError[] | null | undefined} errors */ getErrors(moduleGraph) { const module = moduleGraph.getModule(this); @@ -119764,6 +124991,9 @@ class WebAssemblyImportDependency extends ModuleDependency { } } + /** + * @param {ObjectSerializerContext} context context + */ serialize(context) { const { write } = context; @@ -119774,6 +125004,9 @@ class WebAssemblyImportDependency extends ModuleDependency { super.serialize(context); } + /** + * @param {ObjectDeserializerContext} context context + */ deserialize(context) { const { read } = context; @@ -119795,7 +125028,7 @@ module.exports = WebAssemblyImportDependency; /***/ }), -/***/ 13470: +/***/ 98343: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -119806,19 +125039,24 @@ module.exports = WebAssemblyImportDependency; -const Dependency = __webpack_require__(68242); -const Template = __webpack_require__(88070); -const makeSerializable = __webpack_require__(23827); -const ModuleDependency = __webpack_require__(22994); +const Dependency = __webpack_require__(504); +const Template = __webpack_require__(88835); +const makeSerializable = __webpack_require__(83626); +const ModuleDependency = __webpack_require__(10931); /** @typedef {import("webpack-sources").ReplaceSource} ReplaceSource */ /** @typedef {import("../Compilation")} Compilation */ /** @typedef {import("../Dependency").ReferencedExport} ReferencedExport */ /** @typedef {import("../DependencyTemplate").DependencyTemplateContext} DependencyTemplateContext */ /** @typedef {import("../ModuleGraph")} ModuleGraph */ +/** @typedef {import("../javascript/JavascriptParser").Range} Range */ /** @typedef {import("../util/runtime").RuntimeSpec} RuntimeSpec */ class WebpackIsIncludedDependency extends ModuleDependency { + /** + * @param {string} request the request string + * @param {Range} range location in source code + */ constructor(request, range) { super(request); @@ -119883,7 +125121,7 @@ module.exports = WebpackIsIncludedDependency; /***/ }), -/***/ 51899: +/***/ 18523: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -119894,10 +125132,10 @@ module.exports = WebpackIsIncludedDependency; -const Dependency = __webpack_require__(68242); -const RuntimeGlobals = __webpack_require__(34623); -const makeSerializable = __webpack_require__(23827); -const ModuleDependency = __webpack_require__(22994); +const Dependency = __webpack_require__(504); +const RuntimeGlobals = __webpack_require__(61539); +const makeSerializable = __webpack_require__(83626); +const ModuleDependency = __webpack_require__(10931); /** @typedef {import("webpack-sources").ReplaceSource} ReplaceSource */ /** @typedef {import("../AsyncDependenciesBlock")} AsyncDependenciesBlock */ @@ -119907,17 +125145,26 @@ const ModuleDependency = __webpack_require__(22994); /** @typedef {import("../DependencyTemplate").DependencyTemplateContext} DependencyTemplateContext */ /** @typedef {import("../Entrypoint")} Entrypoint */ /** @typedef {import("../ModuleGraph")} ModuleGraph */ +/** @typedef {import("../javascript/JavascriptParser").Range} Range */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */ /** @typedef {import("../util/Hash")} Hash */ /** @typedef {import("../util/runtime").RuntimeSpec} RuntimeSpec */ class WorkerDependency extends ModuleDependency { /** * @param {string} request request - * @param {[number, number]} range range + * @param {Range} range range + * @param {Object} workerDependencyOptions options + * @param {string} workerDependencyOptions.publicPath public path for the worker */ - constructor(request, range) { + constructor(request, range, workerDependencyOptions) { super(request); this.range = range; + // If options are updated, don't forget to update the hash and serialization functions + this.options = workerDependencyOptions; + /** Cache the hash */ + this._hashUpdate = undefined; } /** @@ -119937,6 +125184,37 @@ class WorkerDependency extends ModuleDependency { get category() { return "worker"; } + + /** + * Update the hash + * @param {Hash} hash hash to be updated + * @param {UpdateHashContext} context context + * @returns {void} + */ + updateHash(hash, context) { + if (this._hashUpdate === undefined) { + this._hashUpdate = JSON.stringify(this.options); + } + hash.update(this._hashUpdate); + } + + /** + * @param {ObjectSerializerContext} context context + */ + serialize(context) { + const { write } = context; + write(this.options); + super.serialize(context); + } + + /** + * @param {ObjectDeserializerContext} context context + */ + deserialize(context) { + const { read } = context; + this.options = read(); + super.deserialize(context); + } } WorkerDependency.Template = class WorkerDependencyTemplate extends ( @@ -119958,6 +125236,10 @@ WorkerDependency.Template = class WorkerDependencyTemplate extends ( chunkGraph.getBlockChunkGroup(block) ); const chunk = entrypoint.getEntrypointChunk(); + // We use the workerPublicPath option if provided, else we fallback to the RuntimeGlobal publicPath + const workerImportBaseUrl = dep.options.publicPath + ? `"${dep.options.publicPath}"` + : RuntimeGlobals.publicPath; runtimeRequirements.add(RuntimeGlobals.publicPath); runtimeRequirements.add(RuntimeGlobals.baseURI); @@ -119966,7 +125248,7 @@ WorkerDependency.Template = class WorkerDependencyTemplate extends ( source.replace( dep.range[0], dep.range[1] - 1, - `/* worker import */ ${RuntimeGlobals.publicPath} + ${ + `/* worker import */ ${workerImportBaseUrl} + ${ RuntimeGlobals.getChunkScriptFilename }(${JSON.stringify(chunk.id)}), ${RuntimeGlobals.baseURI}` ); @@ -119980,7 +125262,7 @@ module.exports = WorkerDependency; /***/ }), -/***/ 2447: +/***/ 3065: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -119992,37 +125274,57 @@ module.exports = WorkerDependency; const { pathToFileURL } = __webpack_require__(57310); -const AsyncDependenciesBlock = __webpack_require__(54823); -const CommentCompilationWarning = __webpack_require__(72190); -const UnsupportedFeatureWarning = __webpack_require__(19290); -const EnableChunkLoadingPlugin = __webpack_require__(14622); -const { equals } = __webpack_require__(91696); -const createHash = __webpack_require__(94624); -const { contextify } = __webpack_require__(63146); -const EnableWasmLoadingPlugin = __webpack_require__(15102); -const ConstDependency = __webpack_require__(78284); -const CreateScriptUrlDependency = __webpack_require__(98626); +const AsyncDependenciesBlock = __webpack_require__(27973); +const CommentCompilationWarning = __webpack_require__(38011); +const { + JAVASCRIPT_MODULE_TYPE_AUTO, + JAVASCRIPT_MODULE_TYPE_ESM +} = __webpack_require__(92891); +const UnsupportedFeatureWarning = __webpack_require__(84099); +const EnableChunkLoadingPlugin = __webpack_require__(51050); +const { equals } = __webpack_require__(22150); +const createHash = __webpack_require__(31147); +const { contextify } = __webpack_require__(97451); +const EnableWasmLoadingPlugin = __webpack_require__(25240); +const ConstDependency = __webpack_require__(67538); +const CreateScriptUrlDependency = __webpack_require__(48723); const { harmonySpecifierTag -} = __webpack_require__(90102); -const WorkerDependency = __webpack_require__(51899); +} = __webpack_require__(72893); +const WorkerDependency = __webpack_require__(18523); +/** @typedef {import("estree").CallExpression} CallExpression */ /** @typedef {import("estree").Expression} Expression */ /** @typedef {import("estree").ObjectExpression} ObjectExpression */ /** @typedef {import("estree").Pattern} Pattern */ /** @typedef {import("estree").Property} Property */ /** @typedef {import("estree").SpreadElement} SpreadElement */ +/** @typedef {import("../../declarations/WebpackOptions").ChunkLoading} ChunkLoading */ +/** @typedef {import("../../declarations/WebpackOptions").JavascriptParserOptions} JavascriptParserOptions */ +/** @typedef {import("../../declarations/WebpackOptions").OutputModule} OutputModule */ +/** @typedef {import("../../declarations/WebpackOptions").WasmLoading} WasmLoading */ +/** @typedef {import("../../declarations/WebpackOptions").WorkerPublicPath} WorkerPublicPath */ /** @typedef {import("../Compiler")} Compiler */ +/** @typedef {import("../Dependency").DependencyLocation} DependencyLocation */ /** @typedef {import("../Entrypoint").EntryOptions} EntryOptions */ +/** @typedef {import("../NormalModule")} NormalModule */ /** @typedef {import("../Parser").ParserState} ParserState */ /** @typedef {import("../javascript/BasicEvaluatedExpression")} BasicEvaluatedExpression */ /** @typedef {import("../javascript/JavascriptParser")} JavascriptParser */ +/** @typedef {import("../javascript/JavascriptParser")} Parser */ +/** @typedef {import("../javascript/JavascriptParser").Range} Range */ /** @typedef {import("./HarmonyImportDependencyParserPlugin").HarmonySettings} HarmonySettings */ +/** + * @param {NormalModule} module module + * @returns {string} url + */ const getUrl = module => { return pathToFileURL(module.resource).toString(); }; +const WorkerSpecifierTag = Symbol("worker specifier tag"); + const DEFAULT_SYNTAX = [ "Worker", "SharedWorker", @@ -120033,11 +125335,20 @@ const DEFAULT_SYNTAX = [ /** @type {WeakMap} */ const workerIndexMap = new WeakMap(); +const PLUGIN_NAME = "WorkerPlugin"; + class WorkerPlugin { - constructor(chunkLoading, wasmLoading, module) { + /** + * @param {ChunkLoading} chunkLoading chunk loading + * @param {WasmLoading} wasmLoading wasm loading + * @param {OutputModule} module output module + * @param {WorkerPublicPath} workerPublicPath worker public path + */ + constructor(chunkLoading, wasmLoading, module, workerPublicPath) { this._chunkLoading = chunkLoading; this._wasmLoading = wasmLoading; this._module = module; + this._workerPublicPath = workerPublicPath; } /** * Apply the plugin @@ -120056,7 +125367,7 @@ class WorkerPlugin { compiler.root ); compiler.hooks.thisCompilation.tap( - "WorkerPlugin", + PLUGIN_NAME, (compilation, { normalModuleFactory }) => { compilation.dependencyFactories.set( WorkerDependency, @@ -120074,7 +125385,7 @@ class WorkerPlugin { /** * @param {JavascriptParser} parser the parser * @param {Expression} expr expression - * @returns {[BasicEvaluatedExpression, [number, number]]} parsed + * @returns {[BasicEvaluatedExpression, [number, number]] | void} parsed */ const parseModuleUrl = (parser, expr) => { if ( @@ -120091,13 +125402,19 @@ class WorkerPlugin { const arg2Value = parser.evaluateExpression(arg2); if ( !arg2Value.isString() || - !arg2Value.string.startsWith("file://") || + !(/** @type {string} */ (arg2Value.string).startsWith("file://")) || arg2Value.string !== getUrl(parser.state.module) ) { return; } const arg1Value = parser.evaluateExpression(arg1); - return [arg1Value, [arg1.range[0], arg2.range[1]]]; + return [ + arg1Value, + [ + /** @type {Range} */ (arg1.range)[0], + /** @type {Range} */ (arg2.range)[1] + ] + ]; }; /** @@ -120148,14 +125465,19 @@ class WorkerPlugin { }; /** - * @param {JavascriptParser} parser the parser - * @param {object} parserOptions options + * @param {Parser} parser parser parser + * @param {JavascriptParserOptions} parserOptions parserOptions + * @returns {void} */ const parserPlugin = (parser, parserOptions) => { if (parserOptions.worker === false) return; const options = !Array.isArray(parserOptions.worker) ? ["..."] : parserOptions.worker; + /** + * @param {CallExpression} expr expression + * @returns {boolean | void} true when handled + */ const handleNewWorker = expr => { if (expr.arguments.length === 0 || expr.arguments.length > 2) return; @@ -120183,10 +125505,12 @@ class WorkerPlugin { values: {}, spread: false, insertType: arg2 ? "spread" : "argument", - insertLocation: arg2 ? arg2.range : arg1.range[1] + insertLocation: arg2 + ? /** @type {Range} */ (arg2.range) + : /** @type {Range} */ (arg1.range)[1] }; const { options: importOptions, errors: commentErrors } = - parser.parseCommentOptions(expr.range); + parser.parseCommentOptions(/** @type {Range} */ (expr.range)); if (commentErrors) { for (const e of commentErrors) { @@ -120209,7 +125533,7 @@ class WorkerPlugin { parser.state.module.addWarning( new UnsupportedFeatureWarning( `\`webpackIgnore\` expected a boolean, but received: ${importOptions.webpackIgnore}.`, - expr.loc + /** @type {DependencyLocation} */ (expr.loc) ) ); } else { @@ -120226,7 +125550,7 @@ class WorkerPlugin { parser.state.module.addWarning( new UnsupportedFeatureWarning( `\`webpackEntryOptions\` expected a object, but received: ${importOptions.webpackEntryOptions}.`, - expr.loc + /** @type {DependencyLocation} */ (expr.loc) ) ); } else { @@ -120241,7 +125565,7 @@ class WorkerPlugin { parser.state.module.addWarning( new UnsupportedFeatureWarning( `\`webpackChunkName\` expected a string, but received: ${importOptions.webpackChunkName}.`, - expr.loc + /** @type {DependencyLocation} */ (expr.loc) ) ); } else { @@ -120284,16 +125608,22 @@ class WorkerPlugin { } }); block.loc = expr.loc; - const dep = new WorkerDependency(url.string, range); - dep.loc = expr.loc; + const dep = new WorkerDependency( + /** @type {string} */ (url.string), + range, + { + publicPath: this._workerPublicPath + } + ); + dep.loc = /** @type {DependencyLocation} */ (expr.loc); block.addDependency(dep); parser.state.module.addBlock(block); if (compilation.outputOptions.trustedTypes) { const dep = new CreateScriptUrlDependency( - expr.arguments[0].range + /** @type {Range} */ (expr.arguments[0].range) ); - dep.loc = expr.loc; + dep.loc = /** @type {DependencyLocation} */ (expr.loc); parser.state.module.addDependency(dep); } @@ -120302,9 +125632,9 @@ class WorkerPlugin { if (options.type !== false) { const dep = new ConstDependency( this._module ? '"module"' : "undefined", - expr.range + /** @type {Range} */ (expr.range) ); - dep.loc = expr.loc; + dep.loc = /** @type {DependencyLocation} */ (expr.loc); parser.state.module.addPresentationalDependency(dep); expressions.type = undefined; } @@ -120314,20 +125644,20 @@ class WorkerPlugin { `, type: ${this._module ? '"module"' : "undefined"}`, insertLocation ); - dep.loc = expr.loc; + dep.loc = /** @type {DependencyLocation} */ (expr.loc); parser.state.module.addPresentationalDependency(dep); } } else if (insertType === "spread") { const dep1 = new ConstDependency( "Object.assign({}, ", - insertLocation[0] + /** @type {Range} */ (insertLocation)[0] ); const dep2 = new ConstDependency( `, { type: ${this._module ? '"module"' : "undefined"} })`, - insertLocation[1] + /** @type {Range} */ (insertLocation)[1] ); - dep1.loc = expr.loc; - dep2.loc = expr.loc; + dep1.loc = /** @type {DependencyLocation} */ (expr.loc); + dep2.loc = /** @type {DependencyLocation} */ (expr.loc); parser.state.module.addPresentationalDependency(dep1); parser.state.module.addPresentationalDependency(dep2); } else if (insertType === "argument") { @@ -120336,7 +125666,7 @@ class WorkerPlugin { ', { type: "module" }', insertLocation ); - dep.loc = expr.loc; + dep.loc = /** @type {DependencyLocation} */ (expr.loc); parser.state.module.addPresentationalDependency(dep); } } @@ -120354,11 +125684,36 @@ class WorkerPlugin { return true; }; + /** + * @param {string} item item + */ const processItem = item => { - if (item.endsWith("()")) { + if ( + item.startsWith("*") && + item.includes(".") && + item.endsWith("()") + ) { + const firstDot = item.indexOf("."); + const pattern = item.slice(1, firstDot); + const itemMembers = item.slice(firstDot + 1, -2); + + parser.hooks.pattern.for(pattern).tap(PLUGIN_NAME, pattern => { + parser.tagVariable(pattern.name, WorkerSpecifierTag); + return true; + }); + parser.hooks.callMemberChain + .for(WorkerSpecifierTag) + .tap(PLUGIN_NAME, (expression, members) => { + if (itemMembers !== members.join(".")) { + return; + } + + return handleNewWorker(expression); + }); + } else if (item.endsWith("()")) { parser.hooks.call .for(item.slice(0, -2)) - .tap("WorkerPlugin", handleNewWorker); + .tap(PLUGIN_NAME, handleNewWorker); } else { const match = /^(.+?)(\(\))?\s+from\s+(.+)$/.exec(item); if (match) { @@ -120367,7 +125722,7 @@ class WorkerPlugin { const source = match[3]; (call ? parser.hooks.call : parser.hooks.new) .for(harmonySpecifierTag) - .tap("WorkerPlugin", expr => { + .tap(PLUGIN_NAME, expr => { const settings = /** @type {HarmonySettings} */ ( parser.currentTagData ); @@ -120381,7 +125736,7 @@ class WorkerPlugin { return handleNewWorker(expr); }); } else { - parser.hooks.new.for(item).tap("WorkerPlugin", handleNewWorker); + parser.hooks.new.for(item).tap(PLUGIN_NAME, handleNewWorker); } } }; @@ -120392,11 +125747,11 @@ class WorkerPlugin { } }; normalModuleFactory.hooks.parser - .for("javascript/auto") - .tap("WorkerPlugin", parserPlugin); + .for(JAVASCRIPT_MODULE_TYPE_AUTO) + .tap(PLUGIN_NAME, parserPlugin); normalModuleFactory.hooks.parser - .for("javascript/esm") - .tap("WorkerPlugin", parserPlugin); + .for(JAVASCRIPT_MODULE_TYPE_ESM) + .tap(PLUGIN_NAME, parserPlugin); } ); } @@ -120406,7 +125761,7 @@ module.exports = WorkerPlugin; /***/ }), -/***/ 38781: +/***/ 27345: /***/ (function(module) { "use strict"; @@ -120417,6 +125772,13 @@ module.exports = WorkerPlugin; +/** @typedef {import("estree").Expression} Expression */ +/** @typedef {import("estree").SpreadElement} SpreadElement */ + +/** + * @param {Expression} expr expressions + * @returns {{fn: TODO, expressions: (Expression | SpreadElement)[], needThis: boolean | undefined }} function expression with additional information + */ module.exports = expr => { // if ( @@ -120469,7 +125831,7 @@ module.exports = expr => { /***/ }), -/***/ 6822: +/***/ 63152: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -120480,7 +125842,7 @@ module.exports = expr => { -const { UsageState } = __webpack_require__(1723); +const { UsageState } = __webpack_require__(14768); /** @typedef {import("../ExportsInfo").ExportInfo} ExportInfo */ /** @typedef {import("../util/runtime").RuntimeSpec} RuntimeSpec */ @@ -120542,7 +125904,7 @@ module.exports = processExportInfo; /***/ }), -/***/ 71888: +/***/ 20205: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -120553,7 +125915,7 @@ module.exports = processExportInfo; -const ExternalsPlugin = __webpack_require__(3021); +const ExternalsPlugin = __webpack_require__(42605); /** @typedef {import("../Compiler")} Compiler */ @@ -120618,7 +125980,7 @@ module.exports = ElectronTargetPlugin; /***/ }), -/***/ 46006: +/***/ 83989: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -120629,7 +125991,7 @@ module.exports = ElectronTargetPlugin; -const WebpackError = __webpack_require__(10841); +const WebpackError = __webpack_require__(49999); /** @typedef {import("../Module")} Module */ @@ -120653,7 +126015,7 @@ module.exports = BuildCycleError; /***/ }), -/***/ 29819: +/***/ 23137: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -120663,7 +126025,8 @@ module.exports = BuildCycleError; -const RuntimeModule = __webpack_require__(81196); +const RuntimeGlobals = __webpack_require__(61539); +const RuntimeModule = __webpack_require__(21296); class ExportWebpackRequireRuntimeModule extends RuntimeModule { constructor() { @@ -120678,10 +126041,10 @@ class ExportWebpackRequireRuntimeModule extends RuntimeModule { } /** - * @returns {string} runtime code + * @returns {string | null} runtime code */ generate() { - return "export default __webpack_require__;"; + return `export default ${RuntimeGlobals.require};`; } } @@ -120690,7 +126053,7 @@ module.exports = ExportWebpackRequireRuntimeModule; /***/ }), -/***/ 9416: +/***/ 73918: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -120702,17 +126065,20 @@ module.exports = ExportWebpackRequireRuntimeModule; const { ConcatSource } = __webpack_require__(59728); -const { RuntimeGlobals } = __webpack_require__(3516); -const HotUpdateChunk = __webpack_require__(72873); -const Template = __webpack_require__(88070); -const { getAllChunks } = __webpack_require__(99561); +const { RuntimeGlobals } = __webpack_require__(7265); +const HotUpdateChunk = __webpack_require__(80065); +const Template = __webpack_require__(88835); +const { getAllChunks } = __webpack_require__(70428); const { + chunkHasJs, getCompilationHooks, getChunkFilenameTemplate -} = __webpack_require__(96230); -const { updateHashForEntryStartup } = __webpack_require__(67164); +} = __webpack_require__(70061); +const { updateHashForEntryStartup } = __webpack_require__(61554); +/** @typedef {import("../Chunk")} Chunk */ /** @typedef {import("../Compiler")} Compiler */ +/** @typedef {import("../Entrypoint")} Entrypoint */ class ModuleChunkFormatPlugin { /** @@ -120768,7 +126134,9 @@ class ModuleChunkFormatPlugin { chunkGraph.getChunkEntryModulesWithChunkGroupIterable(chunk) ); if (entries.length > 0) { - const runtimeChunk = entries[0][1].getRuntimeChunk(); + const runtimeChunk = + /** @type {Entrypoint[][]} */ + (entries)[0][1].getRuntimeChunk(); const currentOutputName = compilation .getPath( getChunkFilenameTemplate(chunk, compilation.outputOptions), @@ -120782,6 +126150,10 @@ class ModuleChunkFormatPlugin { // remove filename, we only need the directory currentOutputName.pop(); + /** + * @param {Chunk} chunk the chunk + * @returns {string} the relative path + */ const getRelativePath = chunk => { const baseOutputName = currentOutputName.slice(); const chunkOutputName = compilation @@ -120818,15 +126190,15 @@ class ModuleChunkFormatPlugin { entrySource.add(source); entrySource.add(";\n\n// load runtime\n"); entrySource.add( - `import __webpack_require__ from ${JSON.stringify( - getRelativePath(runtimeChunk) + `import ${RuntimeGlobals.require} from ${JSON.stringify( + getRelativePath(/** @type {Chunk} */ (runtimeChunk)) )};\n` ); const startupSource = new ConcatSource(); startupSource.add( `var __webpack_exec__ = ${runtimeTemplate.returningFunction( - `__webpack_require__(${RuntimeGlobals.entryModuleId} = moduleId)`, + `${RuntimeGlobals.require}(${RuntimeGlobals.entryModuleId} = moduleId)`, "moduleId" )}\n` ); @@ -120838,12 +126210,16 @@ class ModuleChunkFormatPlugin { const final = i + 1 === entries.length; const moduleId = chunkGraph.getModuleId(module); const chunks = getAllChunks( - entrypoint, - runtimeChunk, + /** @type {Entrypoint} */ (entrypoint), + /** @type {Chunk} */ (runtimeChunk), undefined ); for (const chunk of chunks) { - if (loadedChunks.has(chunk)) continue; + if ( + loadedChunks.has(chunk) || + !chunkHasJs(chunk, chunkGraph) + ) + continue; loadedChunks.add(chunk); startupSource.add( `import * as __webpack_chunk_${index}__ from ${JSON.stringify( @@ -120857,7 +126233,7 @@ class ModuleChunkFormatPlugin { } startupSource.add( `${ - final ? "var __webpack_exports__ = " : "" + final ? `var ${RuntimeGlobals.exports} = ` : "" }__webpack_exec__(${JSON.stringify(moduleId)});\n` ); } @@ -120900,7 +126276,7 @@ module.exports = ModuleChunkFormatPlugin; /***/ }), -/***/ 11214: +/***/ 22498: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -120911,10 +126287,11 @@ module.exports = ModuleChunkFormatPlugin; -const RuntimeGlobals = __webpack_require__(34623); -const ExportWebpackRequireRuntimeModule = __webpack_require__(29819); -const ModuleChunkLoadingRuntimeModule = __webpack_require__(67149); +const RuntimeGlobals = __webpack_require__(61539); +const ExportWebpackRequireRuntimeModule = __webpack_require__(23137); +const ModuleChunkLoadingRuntimeModule = __webpack_require__(70067); +/** @typedef {import("../Chunk")} Chunk */ /** @typedef {import("../Compiler")} Compiler */ class ModuleChunkLoadingPlugin { @@ -120928,6 +126305,10 @@ class ModuleChunkLoadingPlugin { "ModuleChunkLoadingPlugin", compilation => { const globalChunkLoading = compilation.outputOptions.chunkLoading; + /** + * @param {Chunk} chunk chunk to check + * @returns {boolean} true, when the plugin is enabled for the chunk + */ const isEnabledForChunk = chunk => { const options = chunk.getEntryOptions(); const chunkLoading = @@ -120937,6 +126318,10 @@ class ModuleChunkLoadingPlugin { return chunkLoading === "import"; }; const onceForChunkSet = new WeakSet(); + /** + * @param {Chunk} chunk chunk to check + * @param {Set} set runtime requirements + */ const handler = (chunk, set) => { if (onceForChunkSet.has(chunk)) return; onceForChunkSet.add(chunk); @@ -120986,7 +126371,7 @@ module.exports = ModuleChunkLoadingPlugin; /***/ }), -/***/ 67149: +/***/ 70067: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -120997,19 +126382,20 @@ module.exports = ModuleChunkLoadingPlugin; const { SyncWaterfallHook } = __webpack_require__(70793); -const Compilation = __webpack_require__(38292); -const RuntimeGlobals = __webpack_require__(34623); -const RuntimeModule = __webpack_require__(81196); -const Template = __webpack_require__(88070); +const Compilation = __webpack_require__(20417); +const RuntimeGlobals = __webpack_require__(61539); +const RuntimeModule = __webpack_require__(21296); +const Template = __webpack_require__(88835); const { getChunkFilenameTemplate, chunkHasJs -} = __webpack_require__(96230); -const { getInitialChunkIds } = __webpack_require__(67164); -const compileBooleanMatcher = __webpack_require__(25526); -const { getUndoPath } = __webpack_require__(63146); +} = __webpack_require__(70061); +const { getInitialChunkIds } = __webpack_require__(61554); +const compileBooleanMatcher = __webpack_require__(1258); +const { getUndoPath } = __webpack_require__(97451); /** @typedef {import("../Chunk")} Chunk */ +/** @typedef {import("../ChunkGraph")} ChunkGraph */ /** * @typedef {Object} JsonpCompilationPluginHooks @@ -121042,6 +126428,9 @@ class ModuleChunkLoadingRuntimeModule extends RuntimeModule { return hooks; } + /** + * @param {ReadonlySet} runtimeRequirements runtime requirements + */ constructor(runtimeRequirements) { super("import chunk loading", RuntimeModule.STAGE_ATTACH); this._runtimeRequirements = runtimeRequirements; @@ -121058,21 +126447,22 @@ class ModuleChunkLoadingRuntimeModule extends RuntimeModule { if (options && options.baseUri) { return `${RuntimeGlobals.baseURI} = ${JSON.stringify(options.baseUri)};`; } + const compilation = /** @type {Compilation} */ (this.compilation); const { - compilation: { - outputOptions: { importMetaName } - } - } = this; + outputOptions: { importMetaName } + } = compilation; return `${RuntimeGlobals.baseURI} = new URL(${JSON.stringify( rootOutputDir )}, ${importMetaName}.url);`; } /** - * @returns {string} runtime code + * @returns {string | null} runtime code */ generate() { - const { compilation, chunk, chunkGraph } = this; + const compilation = /** @type {Compilation} */ (this.compilation); + const chunkGraph = /** @type {ChunkGraph} */ (this.chunkGraph); + const chunk = /** @type {Chunk} */ (this.chunk); const { runtimeTemplate, outputOptions: { importFunctionName } @@ -121095,8 +126485,8 @@ class ModuleChunkLoadingRuntimeModule extends RuntimeModule { const hasJsMatcher = compileBooleanMatcher(conditionMap); const initialChunkIds = getInitialChunkIds(chunk, chunkGraph, chunkHasJs); - const outputName = this.compilation.getPath( - getChunkFilenameTemplate(chunk, this.compilation.outputOptions), + const outputName = compilation.getPath( + getChunkFilenameTemplate(chunk, compilation.outputOptions), { chunk, contentHashType: "javascript" @@ -121104,7 +126494,7 @@ class ModuleChunkLoadingRuntimeModule extends RuntimeModule { ); const rootOutputDir = getUndoPath( outputName, - this.compilation.outputOptions.path, + /** @type {string} */ (compilation.outputOptions.path), true ); @@ -121119,7 +126509,7 @@ class ModuleChunkLoadingRuntimeModule extends RuntimeModule { "", "// object to store loaded and loading chunks", "// undefined = chunk not loaded, null = chunk preloaded/prefetched", - "// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded", + "// [resolve, Promise] = chunk loading, 0 = chunk loaded", `var installedChunks = ${ stateExpression ? `${stateExpression} = ${stateExpression} || ` : "" }{`, @@ -121148,7 +126538,7 @@ class ModuleChunkLoadingRuntimeModule extends RuntimeModule { "}" ]), "}", - "if(runtime) runtime(__webpack_require__);", + `if(runtime) runtime(${RuntimeGlobals.require});`, "for(;i < ids.length; i++) {", Template.indent([ "chunkId = ids[i];", @@ -121202,7 +126592,9 @@ class ModuleChunkLoadingRuntimeModule extends RuntimeModule { )})])`, `promises.push(installedChunkData[1] = promise);` ]), - "} else installedChunks[chunkId] = 0;" + hasJsMatcher === true + ? "}" + : "} else installedChunks[chunkId] = 0;" ]), "}" ]), @@ -121236,7 +126628,7 @@ module.exports = ModuleChunkLoadingRuntimeModule; /***/ }), -/***/ 49064: +/***/ 60246: /***/ (function(module) { "use strict"; @@ -121312,7 +126704,7 @@ module.exports = formatLocation; /***/ }), -/***/ 78630: +/***/ 38839: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -121323,16 +126715,16 @@ module.exports = formatLocation; -const RuntimeGlobals = __webpack_require__(34623); -const RuntimeModule = __webpack_require__(81196); -const Template = __webpack_require__(88070); +const RuntimeGlobals = __webpack_require__(61539); +const RuntimeModule = __webpack_require__(21296); +const Template = __webpack_require__(88835); class HotModuleReplacementRuntimeModule extends RuntimeModule { constructor() { super("hot module replacement", RuntimeModule.STAGE_BASIC); } /** - * @returns {string} runtime code + * @returns {string | null} runtime code */ generate() { return Template.getFunctionContent( @@ -121362,7 +126754,7 @@ module.exports = HotModuleReplacementRuntimeModule; /***/ }), -/***/ 51094: +/***/ 5696: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -121374,14 +126766,17 @@ module.exports = HotModuleReplacementRuntimeModule; const { RawSource } = __webpack_require__(59728); -const AsyncDependenciesBlock = __webpack_require__(54823); -const Dependency = __webpack_require__(68242); -const Module = __webpack_require__(96040); -const ModuleFactory = __webpack_require__(10149); -const RuntimeGlobals = __webpack_require__(34623); -const Template = __webpack_require__(88070); -const CommonJsRequireDependency = __webpack_require__(76237); -const { registerNotSerializable } = __webpack_require__(94965); +const AsyncDependenciesBlock = __webpack_require__(27973); +const Dependency = __webpack_require__(504); +const Module = __webpack_require__(6309); +const ModuleFactory = __webpack_require__(60667); +const { + WEBPACK_MODULE_TYPE_LAZY_COMPILATION_PROXY +} = __webpack_require__(92891); +const RuntimeGlobals = __webpack_require__(61539); +const Template = __webpack_require__(88835); +const CommonJsRequireDependency = __webpack_require__(65050); +const { registerNotSerializable } = __webpack_require__(93141); /** @typedef {import("../../declarations/WebpackOptions")} WebpackOptions */ /** @typedef {import("../Compilation")} Compilation */ @@ -121463,7 +126858,11 @@ registerNotSerializable(LazyCompilationDependency); class LazyCompilationProxyModule extends Module { constructor(context, originalModule, request, client, data, active) { - super("lazy-compilation-proxy", context, originalModule.layer); + super( + WEBPACK_MODULE_TYPE_LAZY_COMPILATION_PROXY, + context, + originalModule.layer + ); this.originalModule = originalModule; this.request = request; this.client = client; @@ -121475,7 +126874,7 @@ class LazyCompilationProxyModule extends Module { * @returns {string} a unique identifier of the module */ identifier() { - return `lazy-compilation-proxy|${this.originalModule.identifier()}`; + return `${WEBPACK_MODULE_TYPE_LAZY_COMPILATION_PROXY}|${this.originalModule.identifier()}`; } /** @@ -121483,7 +126882,7 @@ class LazyCompilationProxyModule extends Module { * @returns {string} a user readable identifier of the module */ readableIdentifier(requestShortener) { - return `lazy-compilation-proxy ${this.originalModule.readableIdentifier( + return `${WEBPACK_MODULE_TYPE_LAZY_COMPILATION_PROXY} ${this.originalModule.readableIdentifier( requestShortener )}`; } @@ -121510,7 +126909,9 @@ class LazyCompilationProxyModule extends Module { * @returns {string | null} an identifier for library inclusion */ libIdent(options) { - return `${this.originalModule.libIdent(options)}!lazy-compilation-proxy`; + return `${this.originalModule.libIdent( + options + )}!${WEBPACK_MODULE_TYPE_LAZY_COMPILATION_PROXY}`; } /** @@ -121662,7 +127063,7 @@ class LazyCompilationDependencyFactory extends ModuleFactory { /** * @param {ModuleFactoryCreateData} data data object - * @param {function(Error=, ModuleFactoryResult=): void} callback callback + * @param {function((Error | null)=, ModuleFactoryResult=): void} callback callback * @returns {void} */ create(data, callback) { @@ -121788,7 +127189,7 @@ module.exports = LazyCompilationPlugin; /***/ }), -/***/ 43888: +/***/ 80924: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -121939,7 +127340,7 @@ module.exports = options => (compiler, callback) => { /***/ }), -/***/ 88434: +/***/ 74412: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -121950,15 +127351,26 @@ module.exports = options => (compiler, callback) => { -const { find } = __webpack_require__(97045); +const { find } = __webpack_require__(24352); const { compareModulesByPreOrderIndexOrIdentifier, compareModulesByPostOrderIndexOrIdentifier -} = __webpack_require__(29355); +} = __webpack_require__(95978); /** @typedef {import("../Compiler")} Compiler */ +/** + * @typedef {Object} ChunkModuleIdRangePluginOptions + * @property {string} name the chunk name + * @property {("index" | "index2" | "preOrderIndex" | "postOrderIndex")=} order order + * @property {number=} start start id + * @property {number=} end end id + */ + class ChunkModuleIdRangePlugin { + /** + * @param {ChunkModuleIdRangePluginOptions} options options object + */ constructor(options) { this.options = options; } @@ -122027,7 +127439,7 @@ module.exports = ChunkModuleIdRangePlugin; /***/ }), -/***/ 17209: +/***/ 59501: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -122038,19 +127450,28 @@ module.exports = ChunkModuleIdRangePlugin; -const { compareChunksNatural } = __webpack_require__(29355); +const { compareChunksNatural } = __webpack_require__(95978); const { getFullChunkName, getUsedChunkIds, assignDeterministicIds -} = __webpack_require__(15869); +} = __webpack_require__(2970); /** @typedef {import("../Compiler")} Compiler */ /** @typedef {import("../Module")} Module */ +/** + * @typedef {Object} DeterministicChunkIdsPluginOptions + * @property {string=} context context for ids + * @property {number=} maxLength maximum length of ids + */ + class DeterministicChunkIdsPlugin { - constructor(options) { - this.options = options || {}; + /** + * @param {DeterministicChunkIdsPluginOptions} [options] options + */ + constructor(options = {}) { + this.options = options; } /** @@ -122105,7 +127526,7 @@ module.exports = DeterministicChunkIdsPlugin; /***/ }), -/***/ 72488: +/***/ 11018: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -122118,25 +127539,29 @@ module.exports = DeterministicChunkIdsPlugin; const { compareModulesByPreOrderIndexOrIdentifier -} = __webpack_require__(29355); +} = __webpack_require__(95978); const { getUsedModuleIdsAndModules, getFullModuleName, assignDeterministicIds -} = __webpack_require__(15869); +} = __webpack_require__(2970); /** @typedef {import("../Compiler")} Compiler */ /** @typedef {import("../Module")} Module */ +/** + * @typedef {Object} DeterministicModuleIdsPluginOptions + * @property {string=} context context relative to which module identifiers are computed + * @property {function(Module): boolean=} test selector function for modules + * @property {number=} maxLength maximum id length in digits (used as starting point) + * @property {number=} salt hash salt for ids + * @property {boolean=} fixedLength do not increase the maxLength to find an optimal id space size + * @property {boolean=} failOnConflict throw an error when id conflicts occur (instead of rehashing) + */ + class DeterministicModuleIdsPlugin { /** - * @param {Object} options options - * @param {string=} options.context context relative to which module identifiers are computed - * @param {function(Module): boolean=} options.test selector function for modules - * @param {number=} options.maxLength maximum id length in digits (used as starting point) - * @param {number=} options.salt hash salt for ids - * @param {boolean=} options.fixedLength do not increase the maxLength to find an optimal id space size - * @param {boolean=} options.failOnConflict throw an error when id conflicts occur (instead of rehashing) + * @param {DeterministicModuleIdsPluginOptions} [options] options */ constructor(options = {}) { this.options = options; @@ -122206,7 +127631,7 @@ module.exports = DeterministicModuleIdsPlugin; /***/ }), -/***/ 55513: +/***/ 12793: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -122219,19 +127644,20 @@ module.exports = DeterministicModuleIdsPlugin; const { compareModulesByPreOrderIndexOrIdentifier -} = __webpack_require__(29355); -const createSchemaValidation = __webpack_require__(94091); -const createHash = __webpack_require__(94624); +} = __webpack_require__(95978); +const createSchemaValidation = __webpack_require__(45488); +const createHash = __webpack_require__(31147); const { getUsedModuleIdsAndModules, getFullModuleName -} = __webpack_require__(15869); +} = __webpack_require__(2970); /** @typedef {import("../../declarations/plugins/HashedModuleIdsPlugin").HashedModuleIdsPluginOptions} HashedModuleIdsPluginOptions */ +/** @typedef {import("../Compiler")} Compiler */ const validate = createSchemaValidation( - __webpack_require__(19411), - () => __webpack_require__(87764), + __webpack_require__(92150), + () => __webpack_require__(25908), { name: "Hashed Module Ids Plugin", baseDataPath: "options" @@ -122247,7 +127673,7 @@ class HashedModuleIdsPlugin { /** @type {HashedModuleIdsPluginOptions} */ this.options = { - context: null, + context: undefined, hashFunction: "md4", hashDigest: "base64", hashDigestLength: 4, @@ -122255,6 +127681,11 @@ class HashedModuleIdsPlugin { }; } + /** + * Apply the plugin + * @param {Compiler} compiler the compiler instance + * @returns {void} + */ apply(compiler) { const options = this.options; compiler.hooks.compilation.tap("HashedModuleIdsPlugin", compilation => { @@ -122276,7 +127707,8 @@ class HashedModuleIdsPlugin { hash.digest(options.hashDigest) ); let len = options.hashDigestLength; - while (usedIds.has(hashId.slice(0, len))) len++; + while (usedIds.has(hashId.slice(0, len))) + /** @type {number} */ (len)++; const moduleId = hashId.slice(0, len); chunkGraph.setModuleId(module, moduleId); usedIds.add(moduleId); @@ -122291,7 +127723,7 @@ module.exports = HashedModuleIdsPlugin; /***/ }), -/***/ 15869: +/***/ 2970: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; @@ -122302,9 +127734,9 @@ module.exports = HashedModuleIdsPlugin; -const createHash = __webpack_require__(94624); -const { makePathsRelative } = __webpack_require__(63146); -const numberHash = __webpack_require__(6097); +const createHash = __webpack_require__(31147); +const { makePathsRelative } = __webpack_require__(97451); +const numberHash = __webpack_require__(74313); /** @typedef {import("../Chunk")} Chunk */ /** @typedef {import("../ChunkGraph")} ChunkGraph */ @@ -122724,6 +128156,9 @@ const assignAscendingModuleIds = (usedIds, modules, compilation) => { let nextId = 0; let assignId; if (usedIds.size > 0) { + /** + * @param {Module} module the module + */ assignId = module => { if (chunkGraph.getModuleId(module) === null) { while (usedIds.has(nextId + "")) nextId++; @@ -122731,6 +128166,9 @@ const assignAscendingModuleIds = (usedIds, modules, compilation) => { } }; } else { + /** + * @param {Module} module the module + */ assignId = module => { if (chunkGraph.getModuleId(module) === null) { chunkGraph.setModuleId(module, nextId++); @@ -122776,7 +128214,7 @@ exports.assignAscendingChunkIds = assignAscendingChunkIds; /***/ }), -/***/ 39116: +/***/ 44246: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -122787,20 +128225,30 @@ exports.assignAscendingChunkIds = assignAscendingChunkIds; -const { compareChunksNatural } = __webpack_require__(29355); +const { compareChunksNatural } = __webpack_require__(95978); const { getShortChunkName, getLongChunkName, assignNames, getUsedChunkIds, assignAscendingChunkIds -} = __webpack_require__(15869); +} = __webpack_require__(2970); +/** @typedef {import("../../declarations/WebpackOptions").OutputNormalized} Output */ /** @typedef {import("../Chunk")} Chunk */ /** @typedef {import("../Compiler")} Compiler */ /** @typedef {import("../Module")} Module */ +/** + * @typedef {Object} NamedChunkIdsPluginOptions + * @property {string} [context] context + * @property {string} [delimiter] delimiter + */ + class NamedChunkIdsPlugin { + /** + * @param {NamedChunkIdsPluginOptions=} options options + */ constructor(options) { this.delimiter = (options && options.delimiter) || "-"; this.context = options && options.context; @@ -122813,7 +128261,9 @@ class NamedChunkIdsPlugin { */ apply(compiler) { compiler.hooks.compilation.tap("NamedChunkIdsPlugin", compilation => { - const { hashFunction } = compilation.outputOptions; + const hashFunction = + /** @type {NonNullable} */ + (compilation.outputOptions.hashFunction); compilation.hooks.chunkIds.tap("NamedChunkIdsPlugin", chunks => { const chunkGraph = compilation.chunkGraph; const context = this.context ? this.context : compiler.context; @@ -122865,7 +128315,7 @@ module.exports = NamedChunkIdsPlugin; /***/ }), -/***/ 10006: +/***/ 1089: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -122876,21 +128326,30 @@ module.exports = NamedChunkIdsPlugin; -const { compareModulesByIdentifier } = __webpack_require__(29355); +const { compareModulesByIdentifier } = __webpack_require__(95978); const { getShortModuleName, getLongModuleName, assignNames, getUsedModuleIdsAndModules, assignAscendingModuleIds -} = __webpack_require__(15869); +} = __webpack_require__(2970); +/** @typedef {import("../../declarations/WebpackOptions").OutputNormalized} Output */ /** @typedef {import("../Compiler")} Compiler */ /** @typedef {import("../Module")} Module */ +/** + * @typedef {Object} NamedModuleIdsPluginOptions + * @property {string} [context] context + */ + class NamedModuleIdsPlugin { - constructor(options) { - this.options = options || {}; + /** + * @param {NamedModuleIdsPluginOptions} [options] options + */ + constructor(options = {}) { + this.options = options; } /** @@ -122901,7 +128360,9 @@ class NamedModuleIdsPlugin { apply(compiler) { const { root } = compiler; compiler.hooks.compilation.tap("NamedModuleIdsPlugin", compilation => { - const { hashFunction } = compilation.outputOptions; + const hashFunction = + /** @type {NonNullable} */ + (compilation.outputOptions.hashFunction); compilation.hooks.moduleIds.tap("NamedModuleIdsPlugin", () => { const chunkGraph = compilation.chunkGraph; const context = this.options.context @@ -122931,7 +128392,7 @@ module.exports = NamedModuleIdsPlugin; /***/ }), -/***/ 7274: +/***/ 44185: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -122942,8 +128403,8 @@ module.exports = NamedModuleIdsPlugin; -const { compareChunksNatural } = __webpack_require__(29355); -const { assignAscendingChunkIds } = __webpack_require__(15869); +const { compareChunksNatural } = __webpack_require__(95978); +const { assignAscendingChunkIds } = __webpack_require__(2970); /** @typedef {import("../Chunk")} Chunk */ /** @typedef {import("../Compiler")} Compiler */ @@ -122972,7 +128433,7 @@ module.exports = NaturalChunkIdsPlugin; /***/ }), -/***/ 77636: +/***/ 63136: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -122985,11 +128446,11 @@ module.exports = NaturalChunkIdsPlugin; const { compareModulesByPreOrderIndexOrIdentifier -} = __webpack_require__(29355); +} = __webpack_require__(95978); const { assignAscendingModuleIds, getUsedModuleIdsAndModules -} = __webpack_require__(15869); +} = __webpack_require__(2970); /** @typedef {import("../Compiler")} Compiler */ /** @typedef {import("../Module")} Module */ @@ -123019,7 +128480,7 @@ module.exports = NaturalModuleIdsPlugin; /***/ }), -/***/ 80031: +/***/ 32789: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -123030,9 +128491,9 @@ module.exports = NaturalModuleIdsPlugin; -const { compareChunksNatural } = __webpack_require__(29355); -const createSchemaValidation = __webpack_require__(94091); -const { assignAscendingChunkIds } = __webpack_require__(15869); +const { compareChunksNatural } = __webpack_require__(95978); +const createSchemaValidation = __webpack_require__(45488); +const { assignAscendingChunkIds } = __webpack_require__(2970); /** @typedef {import("../../declarations/plugins/ids/OccurrenceChunkIdsPlugin").OccurrenceChunkIdsPluginOptions} OccurrenceChunkIdsPluginOptions */ /** @typedef {import("../Chunk")} Chunk */ @@ -123040,8 +128501,8 @@ const { assignAscendingChunkIds } = __webpack_require__(15869); /** @typedef {import("../Module")} Module */ const validate = createSchemaValidation( - __webpack_require__(2900), - () => __webpack_require__(7510), + __webpack_require__(62110), + () => __webpack_require__(91376), { name: "Occurrence Order Chunk Ids Plugin", baseDataPath: "options" @@ -123085,8 +128546,12 @@ class OccurrenceChunkIdsPlugin { const chunksInOccurrenceOrder = Array.from(chunks).sort((a, b) => { if (prioritiseInitial) { - const aEntryOccurs = occursInInitialChunksMap.get(a); - const bEntryOccurs = occursInInitialChunksMap.get(b); + const aEntryOccurs = + /** @type {number} */ + (occursInInitialChunksMap.get(a)); + const bEntryOccurs = + /** @type {number} */ + (occursInInitialChunksMap.get(b)); if (aEntryOccurs > bEntryOccurs) return -1; if (aEntryOccurs < bEntryOccurs) return 1; } @@ -123107,7 +128572,7 @@ module.exports = OccurrenceChunkIdsPlugin; /***/ }), -/***/ 54475: +/***/ 25909: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -123120,12 +128585,12 @@ module.exports = OccurrenceChunkIdsPlugin; const { compareModulesByPreOrderIndexOrIdentifier -} = __webpack_require__(29355); -const createSchemaValidation = __webpack_require__(94091); +} = __webpack_require__(95978); +const createSchemaValidation = __webpack_require__(45488); const { assignAscendingModuleIds, getUsedModuleIdsAndModules -} = __webpack_require__(15869); +} = __webpack_require__(2970); /** @typedef {import("../../declarations/plugins/ids/OccurrenceModuleIdsPlugin").OccurrenceModuleIdsPluginOptions} OccurrenceModuleIdsPluginOptions */ /** @typedef {import("../Compiler")} Compiler */ @@ -123133,8 +128598,8 @@ const { /** @typedef {import("../ModuleGraphConnection")} ModuleGraphConnection */ const validate = createSchemaValidation( - __webpack_require__(21769), - () => __webpack_require__(45699), + __webpack_require__(26648), + () => __webpack_require__(54257), { name: "Occurrence Order Module Ids Plugin", baseDataPath: "options" @@ -123194,7 +128659,7 @@ class OccurrenceModuleIdsPlugin { ] of moduleGraph.getIncomingConnectionsByOriginModule(module)) { if (!originModule) continue; if (!connections.some(c => c.isTargetActive(undefined))) continue; - sum += initialChunkChunkMap.get(originModule); + sum += initialChunkChunkMap.get(originModule) || 0; } return sum; }; @@ -123274,7 +128739,7 @@ module.exports = OccurrenceModuleIdsPlugin; /***/ }), -/***/ 1354: +/***/ 52016: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -123285,8 +128750,8 @@ module.exports = OccurrenceModuleIdsPlugin; -const { WebpackError } = __webpack_require__(3516); -const { getUsedModuleIdsAndModules } = __webpack_require__(15869); +const { WebpackError } = __webpack_require__(7265); +const { getUsedModuleIdsAndModules } = __webpack_require__(2970); /** @typedef {import("../Compiler")} Compiler */ /** @typedef {import("../Module")} Module */ @@ -123330,7 +128795,7 @@ class SyncModuleIdsPlugin { } return callback(); } - const json = JSON.parse(buffer.toString()); + const json = JSON.parse(/** @type {Buffer} */ (buffer).toString()); data = new Map(); for (const key of Object.keys(json)) { data.set(key, json[key]); @@ -123343,6 +128808,7 @@ class SyncModuleIdsPlugin { if (this._write) { compiler.hooks.emitRecords.tapAsync(plugin, callback => { if (!data || !dataChanged) return callback(); + /** @type {Object} */ const json = {}; const sorted = Array.from(data).sort(([a], [b]) => (a < b ? -1 : 1)); for (const [key, value] of sorted) { @@ -123378,7 +128844,7 @@ class SyncModuleIdsPlugin { err.module = module; compilation.errors.push(err); } - chunkGraph.setModuleId(module, id); + chunkGraph.setModuleId(module, /** @type {string | number} */ (id)); usedIds.add(idAsString); } }); @@ -123422,7 +128888,7 @@ module.exports = SyncModuleIdsPlugin; /***/ }), -/***/ 3516: +/***/ 7265: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -123434,13 +128900,19 @@ module.exports = SyncModuleIdsPlugin; const util = __webpack_require__(73837); -const memoize = __webpack_require__(27319); +const memoize = __webpack_require__(62377); /** @typedef {import("../declarations/WebpackOptions").Entry} Entry */ /** @typedef {import("../declarations/WebpackOptions").EntryNormalized} EntryNormalized */ /** @typedef {import("../declarations/WebpackOptions").EntryObject} EntryObject */ +/** @typedef {import("../declarations/WebpackOptions").ExternalItemFunctionData} ExternalItemFunctionData */ +/** @typedef {import("../declarations/WebpackOptions").ExternalItemObjectKnown} ExternalItemObjectKnown */ +/** @typedef {import("../declarations/WebpackOptions").ExternalItemObjectUnknown} ExternalItemObjectUnknown */ +/** @typedef {import("../declarations/WebpackOptions").ExternalItemValue} ExternalItemValue */ +/** @typedef {import("../declarations/WebpackOptions").Externals} Externals */ /** @typedef {import("../declarations/WebpackOptions").FileCacheOptions} FileCacheOptions */ /** @typedef {import("../declarations/WebpackOptions").LibraryOptions} LibraryOptions */ +/** @typedef {import("../declarations/WebpackOptions").MemoryCacheOptions} MemoryCacheOptions */ /** @typedef {import("../declarations/WebpackOptions").ModuleOptions} ModuleOptions */ /** @typedef {import("../declarations/WebpackOptions").ResolveOptions} ResolveOptions */ /** @typedef {import("../declarations/WebpackOptions").RuleSetCondition} RuleSetCondition */ @@ -123453,12 +128925,14 @@ const memoize = __webpack_require__(27319); /** @typedef {import("../declarations/WebpackOptions").WebpackOptionsNormalized} WebpackOptionsNormalized */ /** @typedef {import("../declarations/WebpackOptions").WebpackPluginFunction} WebpackPluginFunction */ /** @typedef {import("../declarations/WebpackOptions").WebpackPluginInstance} WebpackPluginInstance */ +/** @typedef {import("./ChunkGroup")} ChunkGroup */ /** @typedef {import("./Compilation").Asset} Asset */ /** @typedef {import("./Compilation").AssetInfo} AssetInfo */ /** @typedef {import("./Compilation").EntryOptions} EntryOptions */ /** @typedef {import("./Compilation").PathData} PathData */ /** @typedef {import("./Compiler").AssetEmittedInfo} AssetEmittedInfo */ /** @typedef {import("./MultiStats")} MultiStats */ +/** @typedef {import("./NormalModuleFactory").ResolveData} ResolveData */ /** @typedef {import("./Parser").ParserState} ParserState */ /** @typedef {import("./ResolverFactory").ResolvePluginInstance} ResolvePluginInstance */ /** @typedef {import("./ResolverFactory").Resolver} Resolver */ @@ -123529,16 +129003,16 @@ const mergeExports = (obj, exports) => { return /** @type {A & B} */ (Object.freeze(obj)); }; -const fn = lazyFunction(() => __webpack_require__(20133)); +const fn = lazyFunction(() => __webpack_require__(44728)); module.exports = mergeExports(fn, { get webpack() { - return __webpack_require__(20133); + return __webpack_require__(44728); }, get validate() { - const webpackOptionsSchemaCheck = __webpack_require__(14509); + const webpackOptionsSchemaCheck = __webpack_require__(19366); const getRealValidate = memoize(() => { - const validateSchema = __webpack_require__(60395); - const webpackOptionsSchema = __webpack_require__(9183); + const validateSchema = __webpack_require__(97848); + const webpackOptionsSchema = __webpack_require__(40138); return options => validateSchema(webpackOptionsSchema, options); }); return options => { @@ -123546,452 +129020,452 @@ module.exports = mergeExports(fn, { }; }, get validateSchema() { - const validateSchema = __webpack_require__(60395); + const validateSchema = __webpack_require__(97848); return validateSchema; }, get version() { - return /** @type {string} */ ((__webpack_require__(3104)/* .version */ .i8)); + return /** @type {string} */ ((__webpack_require__(73284)/* .version */ .i8)); }, get cli() { - return __webpack_require__(6676); + return __webpack_require__(33698); }, get AutomaticPrefetchPlugin() { - return __webpack_require__(76411); + return __webpack_require__(88895); }, get AsyncDependenciesBlock() { - return __webpack_require__(54823); + return __webpack_require__(27973); }, get BannerPlugin() { - return __webpack_require__(20357); + return __webpack_require__(82533); }, get Cache() { - return __webpack_require__(20130); + return __webpack_require__(11948); }, get Chunk() { - return __webpack_require__(67732); + return __webpack_require__(93399); }, get ChunkGraph() { - return __webpack_require__(64438); + return __webpack_require__(84275); }, get CleanPlugin() { - return __webpack_require__(25358); + return __webpack_require__(9110); }, get Compilation() { - return __webpack_require__(38292); + return __webpack_require__(20417); }, get Compiler() { - return __webpack_require__(27551); + return __webpack_require__(18771); }, get ConcatenationScope() { - return __webpack_require__(68645); + return __webpack_require__(92811); }, get ContextExclusionPlugin() { - return __webpack_require__(14030); + return __webpack_require__(41509); }, get ContextReplacementPlugin() { - return __webpack_require__(33399); + return __webpack_require__(18610); }, get DefinePlugin() { - return __webpack_require__(84036); + return __webpack_require__(7628); }, get DelegatedPlugin() { - return __webpack_require__(58702); + return __webpack_require__(14728); }, get Dependency() { - return __webpack_require__(68242); + return __webpack_require__(504); }, get DllPlugin() { - return __webpack_require__(42512); + return __webpack_require__(59318); }, get DllReferencePlugin() { - return __webpack_require__(57699); + return __webpack_require__(50673); }, get DynamicEntryPlugin() { - return __webpack_require__(90956); + return __webpack_require__(58677); }, get EntryOptionPlugin() { - return __webpack_require__(87685); + return __webpack_require__(98397); }, get EntryPlugin() { - return __webpack_require__(42102); + return __webpack_require__(95113); }, get EnvironmentPlugin() { - return __webpack_require__(63460); + return __webpack_require__(17652); }, get EvalDevToolModulePlugin() { - return __webpack_require__(11929); + return __webpack_require__(83204); }, get EvalSourceMapDevToolPlugin() { - return __webpack_require__(99849); + return __webpack_require__(35920); }, get ExternalModule() { - return __webpack_require__(43308); + return __webpack_require__(90790); }, get ExternalsPlugin() { - return __webpack_require__(3021); + return __webpack_require__(42605); }, get Generator() { - return __webpack_require__(8635); + return __webpack_require__(58387); }, get HotUpdateChunk() { - return __webpack_require__(72873); + return __webpack_require__(80065); }, get HotModuleReplacementPlugin() { - return __webpack_require__(92837); + return __webpack_require__(41490); }, get IgnorePlugin() { - return __webpack_require__(5563); + return __webpack_require__(42441); }, get JavascriptModulesPlugin() { return util.deprecate( - () => __webpack_require__(96230), + () => __webpack_require__(70061), "webpack.JavascriptModulesPlugin has moved to webpack.javascript.JavascriptModulesPlugin", "DEP_WEBPACK_JAVASCRIPT_MODULES_PLUGIN" )(); }, get LibManifestPlugin() { - return __webpack_require__(96138); + return __webpack_require__(96577); }, get LibraryTemplatePlugin() { return util.deprecate( - () => __webpack_require__(9398), + () => __webpack_require__(72309), "webpack.LibraryTemplatePlugin is deprecated and has been replaced by compilation.outputOptions.library or compilation.addEntry + passing a library option", "DEP_WEBPACK_LIBRARY_TEMPLATE_PLUGIN" )(); }, get LoaderOptionsPlugin() { - return __webpack_require__(26794); + return __webpack_require__(48423); }, get LoaderTargetPlugin() { - return __webpack_require__(87343); + return __webpack_require__(26056); }, get Module() { - return __webpack_require__(96040); + return __webpack_require__(6309); }, get ModuleFilenameHelpers() { - return __webpack_require__(38738); + return __webpack_require__(82444); }, get ModuleGraph() { - return __webpack_require__(85215); + return __webpack_require__(43714); }, get ModuleGraphConnection() { - return __webpack_require__(17977); + return __webpack_require__(7976); }, get NoEmitOnErrorsPlugin() { - return __webpack_require__(80388); + return __webpack_require__(90229); }, get NormalModule() { - return __webpack_require__(55443); + return __webpack_require__(17318); }, get NormalModuleReplacementPlugin() { - return __webpack_require__(83327); + return __webpack_require__(68787); }, get MultiCompiler() { - return __webpack_require__(25939); + return __webpack_require__(85694); }, get Parser() { - return __webpack_require__(66425); + return __webpack_require__(76690); }, get PrefetchPlugin() { - return __webpack_require__(80471); + return __webpack_require__(12630); }, get ProgressPlugin() { - return __webpack_require__(25334); + return __webpack_require__(25483); }, get ProvidePlugin() { - return __webpack_require__(41017); + return __webpack_require__(54404); }, get RuntimeGlobals() { - return __webpack_require__(34623); + return __webpack_require__(61539); }, get RuntimeModule() { - return __webpack_require__(81196); + return __webpack_require__(21296); }, get SingleEntryPlugin() { return util.deprecate( - () => __webpack_require__(42102), + () => __webpack_require__(95113), "SingleEntryPlugin was renamed to EntryPlugin", "DEP_WEBPACK_SINGLE_ENTRY_PLUGIN" )(); }, get SourceMapDevToolPlugin() { - return __webpack_require__(92732); + return __webpack_require__(44937); }, get Stats() { - return __webpack_require__(62218); + return __webpack_require__(92646); }, get Template() { - return __webpack_require__(88070); + return __webpack_require__(88835); }, get UsageState() { - return (__webpack_require__(1723).UsageState); + return (__webpack_require__(14768).UsageState); }, get WatchIgnorePlugin() { - return __webpack_require__(47231); + return __webpack_require__(27349); }, get WebpackError() { - return __webpack_require__(10841); + return __webpack_require__(49999); }, get WebpackOptionsApply() { - return __webpack_require__(77815); + return __webpack_require__(62721); }, get WebpackOptionsDefaulter() { return util.deprecate( - () => __webpack_require__(7123), + () => __webpack_require__(46389), "webpack.WebpackOptionsDefaulter is deprecated and has been replaced by webpack.config.getNormalizedWebpackOptions and webpack.config.applyWebpackOptionsDefaults", "DEP_WEBPACK_OPTIONS_DEFAULTER" )(); }, // TODO webpack 6 deprecate get WebpackOptionsValidationError() { - return (__webpack_require__(1489).ValidationError); + return (__webpack_require__(16633).ValidationError); }, get ValidationError() { - return (__webpack_require__(1489).ValidationError); + return (__webpack_require__(16633).ValidationError); }, cache: { get MemoryCachePlugin() { - return __webpack_require__(45864); + return __webpack_require__(21429); } }, config: { get getNormalizedWebpackOptions() { - return (__webpack_require__(22941).getNormalizedWebpackOptions); + return (__webpack_require__(69645).getNormalizedWebpackOptions); }, get applyWebpackOptionsDefaults() { - return (__webpack_require__(62484).applyWebpackOptionsDefaults); + return (__webpack_require__(36569).applyWebpackOptionsDefaults); } }, dependencies: { get ModuleDependency() { - return __webpack_require__(22994); + return __webpack_require__(10931); }, get HarmonyImportDependency() { - return __webpack_require__(52405); + return __webpack_require__(75650); }, get ConstDependency() { - return __webpack_require__(78284); + return __webpack_require__(67538); }, get NullDependency() { - return __webpack_require__(74263); + return __webpack_require__(87568); } }, ids: { get ChunkModuleIdRangePlugin() { - return __webpack_require__(88434); + return __webpack_require__(74412); }, get NaturalModuleIdsPlugin() { - return __webpack_require__(77636); + return __webpack_require__(63136); }, get OccurrenceModuleIdsPlugin() { - return __webpack_require__(54475); + return __webpack_require__(25909); }, get NamedModuleIdsPlugin() { - return __webpack_require__(10006); + return __webpack_require__(1089); }, get DeterministicChunkIdsPlugin() { - return __webpack_require__(17209); + return __webpack_require__(59501); }, get DeterministicModuleIdsPlugin() { - return __webpack_require__(72488); + return __webpack_require__(11018); }, get NamedChunkIdsPlugin() { - return __webpack_require__(39116); + return __webpack_require__(44246); }, get OccurrenceChunkIdsPlugin() { - return __webpack_require__(80031); + return __webpack_require__(32789); }, get HashedModuleIdsPlugin() { - return __webpack_require__(55513); + return __webpack_require__(12793); } }, javascript: { get EnableChunkLoadingPlugin() { - return __webpack_require__(14622); + return __webpack_require__(51050); }, get JavascriptModulesPlugin() { - return __webpack_require__(96230); + return __webpack_require__(70061); }, get JavascriptParser() { - return __webpack_require__(23628); + return __webpack_require__(27865); } }, optimize: { get AggressiveMergingPlugin() { - return __webpack_require__(70188); + return __webpack_require__(74280); }, get AggressiveSplittingPlugin() { return util.deprecate( - () => __webpack_require__(51361), + () => __webpack_require__(58561), "AggressiveSplittingPlugin is deprecated in favor of SplitChunksPlugin", "DEP_WEBPACK_AGGRESSIVE_SPLITTING_PLUGIN" )(); }, get InnerGraph() { - return __webpack_require__(91424); + return __webpack_require__(53310); }, get LimitChunkCountPlugin() { - return __webpack_require__(57823); + return __webpack_require__(96296); }, get MinChunkSizePlugin() { - return __webpack_require__(38827); + return __webpack_require__(89331); }, get ModuleConcatenationPlugin() { - return __webpack_require__(2410); + return __webpack_require__(11837); }, get RealContentHashPlugin() { - return __webpack_require__(30471); + return __webpack_require__(79512); }, get RuntimeChunkPlugin() { - return __webpack_require__(32015); + return __webpack_require__(70522); }, get SideEffectsFlagPlugin() { - return __webpack_require__(35762); + return __webpack_require__(29848); }, get SplitChunksPlugin() { - return __webpack_require__(53443); + return __webpack_require__(39834); } }, runtime: { get GetChunkFilenameRuntimeModule() { - return __webpack_require__(77994); + return __webpack_require__(12664); }, get LoadScriptRuntimeModule() { - return __webpack_require__(13139); + return __webpack_require__(94304); } }, prefetch: { get ChunkPrefetchPreloadPlugin() { - return __webpack_require__(66294); + return __webpack_require__(527); } }, web: { get FetchCompileAsyncWasmPlugin() { - return __webpack_require__(40968); + return __webpack_require__(28862); }, get FetchCompileWasmPlugin() { - return __webpack_require__(23056); + return __webpack_require__(24728); }, get JsonpChunkLoadingRuntimeModule() { - return __webpack_require__(93611); + return __webpack_require__(13229); }, get JsonpTemplatePlugin() { - return __webpack_require__(93225); + return __webpack_require__(21185); } }, webworker: { get WebWorkerTemplatePlugin() { - return __webpack_require__(71270); + return __webpack_require__(75919); } }, node: { get NodeEnvironmentPlugin() { - return __webpack_require__(49896); + return __webpack_require__(98084); }, get NodeSourcePlugin() { - return __webpack_require__(24378); + return __webpack_require__(47789); }, get NodeTargetPlugin() { - return __webpack_require__(6640); + return __webpack_require__(63887); }, get NodeTemplatePlugin() { - return __webpack_require__(66235); + return __webpack_require__(16842); }, get ReadFileCompileWasmPlugin() { - return __webpack_require__(67792); + return __webpack_require__(13843); } }, electron: { get ElectronTargetPlugin() { - return __webpack_require__(71888); + return __webpack_require__(20205); } }, wasm: { get AsyncWebAssemblyModulesPlugin() { - return __webpack_require__(1768); + return __webpack_require__(37390); }, get EnableWasmLoadingPlugin() { - return __webpack_require__(15102); + return __webpack_require__(25240); } }, library: { get AbstractLibraryPlugin() { - return __webpack_require__(44073); + return __webpack_require__(2303); }, get EnableLibraryPlugin() { - return __webpack_require__(3580); + return __webpack_require__(90487); } }, container: { get ContainerPlugin() { - return __webpack_require__(61706); + return __webpack_require__(18010); }, get ContainerReferencePlugin() { - return __webpack_require__(41496); + return __webpack_require__(76141); }, get ModuleFederationPlugin() { - return __webpack_require__(37596); + return __webpack_require__(10561); }, get scope() { - return (__webpack_require__(14846).scope); + return (__webpack_require__(4584).scope); } }, sharing: { get ConsumeSharedPlugin() { - return __webpack_require__(81179); + return __webpack_require__(50556); }, get ProvideSharedPlugin() { - return __webpack_require__(71070); + return __webpack_require__(76953); }, get SharePlugin() { - return __webpack_require__(7833); + return __webpack_require__(80584); }, get scope() { - return (__webpack_require__(14846).scope); + return (__webpack_require__(4584).scope); } }, debug: { get ProfilingPlugin() { - return __webpack_require__(93359); + return __webpack_require__(46731); } }, util: { get createHash() { - return __webpack_require__(94624); + return __webpack_require__(31147); }, get comparators() { - return __webpack_require__(29355); + return __webpack_require__(95978); }, get runtime() { - return __webpack_require__(55693); + return __webpack_require__(69965); }, get serialization() { - return __webpack_require__(94965); + return __webpack_require__(93141); }, get cleverMerge() { - return (__webpack_require__(31074).cachedCleverMerge); + return (__webpack_require__(44639).cachedCleverMerge); }, get LazySet() { - return __webpack_require__(66205); + return __webpack_require__(57876); } }, @@ -124002,12 +129476,12 @@ module.exports = mergeExports(fn, { experiments: { schemes: { get HttpUriPlugin() { - return __webpack_require__(15660); + return __webpack_require__(5662); } }, ids: { get SyncModuleIdsPlugin() { - return __webpack_require__(1354); + return __webpack_require__(52016); } } } @@ -124016,7 +129490,7 @@ module.exports = mergeExports(fn, { /***/ }), -/***/ 15006: +/***/ 44717: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -124028,14 +129502,14 @@ module.exports = mergeExports(fn, { const { ConcatSource, PrefixSource, RawSource } = __webpack_require__(59728); -const { RuntimeGlobals } = __webpack_require__(3516); -const HotUpdateChunk = __webpack_require__(72873); -const Template = __webpack_require__(88070); -const { getCompilationHooks } = __webpack_require__(96230); +const { RuntimeGlobals } = __webpack_require__(7265); +const HotUpdateChunk = __webpack_require__(80065); +const Template = __webpack_require__(88835); +const { getCompilationHooks } = __webpack_require__(70061); const { generateEntryStartup, updateHashForEntryStartup -} = __webpack_require__(67164); +} = __webpack_require__(61554); /** @typedef {import("../Compiler")} Compiler */ @@ -124106,8 +129580,8 @@ class ArrayPushCallbackChunkFormatPlugin { if (runtimeModules.length > 0 || entries.length > 0) { const runtime = new ConcatSource( (runtimeTemplate.supportsArrowFunction() - ? "__webpack_require__ =>" - : "function(__webpack_require__)") + + ? `${RuntimeGlobals.require} =>` + : `function(${RuntimeGlobals.require})`) + " { // webpackRuntimeModules\n" ); if (runtimeModules.length > 0) { @@ -124143,7 +129617,7 @@ class ArrayPushCallbackChunkFormatPlugin { .getChunkRuntimeRequirements(chunk) .has(RuntimeGlobals.returnExportsFromRuntime) ) { - runtime.add("return __webpack_exports__;\n"); + runtime.add(`return ${RuntimeGlobals.exports};\n`); } } runtime.add("}\n"); @@ -124178,7 +129652,7 @@ module.exports = ArrayPushCallbackChunkFormatPlugin; /***/ }), -/***/ 88981: +/***/ 52493: /***/ (function(module) { "use strict"; @@ -124189,7 +129663,8 @@ module.exports = ArrayPushCallbackChunkFormatPlugin; -/** @typedef {import("estree").Node} EsTreeNode */ +/** @typedef {import("estree").Node} Node */ +/** @typedef {import("./JavascriptParser").Range} Range */ /** @typedef {import("./JavascriptParser").VariableInfoInterface} VariableInfoInterface */ const TypeUnknown = 0; @@ -124210,7 +129685,7 @@ const TypeBigInt = 13; class BasicEvaluatedExpression { constructor() { this.type = TypeUnknown; - /** @type {[number, number]} */ + /** @type {[number, number] | undefined} */ this.range = undefined; /** @type {boolean} */ this.falsy = false; @@ -124240,20 +129715,23 @@ class BasicEvaluatedExpression { this.items = undefined; /** @type {BasicEvaluatedExpression[] | undefined} */ this.options = undefined; - /** @type {BasicEvaluatedExpression | undefined} */ + /** @type {BasicEvaluatedExpression | undefined | null} */ this.prefix = undefined; - /** @type {BasicEvaluatedExpression | undefined} */ + /** @type {BasicEvaluatedExpression | undefined | null} */ this.postfix = undefined; + /** @type {BasicEvaluatedExpression[] | undefined} */ this.wrappedInnerExpressions = undefined; /** @type {string | VariableInfoInterface | undefined} */ this.identifier = undefined; - /** @type {VariableInfoInterface} */ + /** @type {string | VariableInfoInterface | undefined} */ this.rootInfo = undefined; - /** @type {() => string[]} */ + /** @type {(() => string[]) | undefined} */ this.getMembers = undefined; - /** @type {() => boolean[]} */ + /** @type {(() => boolean[]) | undefined} */ this.getMembersOptionals = undefined; - /** @type {EsTreeNode} */ + /** @type {(() => Range[]) | undefined} */ + this.getMemberRanges = undefined; + /** @type {Node | undefined} */ this.expression = undefined; } @@ -124406,6 +129884,10 @@ class BasicEvaluatedExpression { return this.sideEffects; } + /** + * Creates a boolean representation of this evaluated expression. + * @returns {boolean | undefined} true: truthy, false: falsy, undefined: unknown + */ asBool() { if (this.truthy) return true; if (this.falsy || this.nullish) return false; @@ -124431,6 +129913,10 @@ class BasicEvaluatedExpression { return undefined; } + /** + * Creates a nullish coalescing representation of this evaluated expression. + * @returns {boolean | undefined} true: nullish, false: not nullish, undefined: unknown + */ asNullish() { const nullish = this.isNullish(); @@ -124451,6 +129937,10 @@ class BasicEvaluatedExpression { return undefined; } + /** + * Creates a string representation of this evaluated expression. + * @returns {string | undefined} the string representation or undefined if not possible + */ asString() { if (this.isBoolean()) return `${this.bool}`; if (this.isNull()) return "null"; @@ -124461,7 +129951,9 @@ class BasicEvaluatedExpression { if (this.isRegExp()) return `${this.regExp}`; if (this.isArray()) { let array = []; - for (const item of this.items) { + for (const item of /** @type {BasicEvaluatedExpression[]} */ ( + this.items + )) { const itemStr = item.asString(); if (itemStr === undefined) return undefined; array.push(itemStr); @@ -124471,7 +129963,9 @@ class BasicEvaluatedExpression { if (this.isConstArray()) return `${this.array}`; if (this.isTemplateString()) { let str = ""; - for (const part of this.parts) { + for (const part of /** @type {BasicEvaluatedExpression[]} */ ( + this.parts + )) { const partStr = part.asString(); if (partStr === undefined) return undefined; str += partStr; @@ -124481,6 +129975,10 @@ class BasicEvaluatedExpression { return undefined; } + /** + * @param {string} string value + * @returns {BasicEvaluatedExpression} basic evaluated expression + */ setString(string) { this.type = TypeString; this.string = string; @@ -124500,6 +129998,11 @@ class BasicEvaluatedExpression { return this; } + /** + * Set's the value of this expression to a number + * @param {number} number number to set + * @returns {this} this + */ setNumber(number) { this.type = TypeNumber; this.number = number; @@ -124507,6 +130010,11 @@ class BasicEvaluatedExpression { return this; } + /** + * Set's the value of this expression to a BigInt + * @param {bigint} bigint bigint to set + * @returns {this} this + */ setBigInt(bigint) { this.type = TypeBigInt; this.bigint = bigint; @@ -124514,6 +130022,11 @@ class BasicEvaluatedExpression { return this; } + /** + * Set's the value of this expression to a boolean + * @param {boolean} bool boolean to set + * @returns {this} this + */ setBoolean(bool) { this.type = TypeBoolean; this.bool = bool; @@ -124521,6 +130034,11 @@ class BasicEvaluatedExpression { return this; } + /** + * Set's the value of this expression to a regular expression + * @param {RegExp} regExp regular expression to set + * @returns {this} this + */ setRegExp(regExp) { this.type = TypeRegExp; this.regExp = regExp; @@ -124528,16 +130046,41 @@ class BasicEvaluatedExpression { return this; } - setIdentifier(identifier, rootInfo, getMembers, getMembersOptionals) { + /** + * Set's the value of this expression to a particular identifier and its members. + * + * @param {string | VariableInfoInterface} identifier identifier to set + * @param {string | VariableInfoInterface} rootInfo root info + * @param {() => string[]} getMembers members + * @param {() => boolean[]=} getMembersOptionals optional members + * @param {() => Range[]=} getMemberRanges ranges of progressively increasing sub-expressions + * @returns {this} this + */ + setIdentifier( + identifier, + rootInfo, + getMembers, + getMembersOptionals, + getMemberRanges + ) { this.type = TypeIdentifier; this.identifier = identifier; this.rootInfo = rootInfo; this.getMembers = getMembers; this.getMembersOptionals = getMembersOptionals; + this.getMemberRanges = getMemberRanges; this.sideEffects = true; return this; } + /** + * Wraps an array of expressions with a prefix and postfix expression. + * + * @param {BasicEvaluatedExpression | null | undefined} prefix Expression to be added before the innerExpressions + * @param {BasicEvaluatedExpression | null | undefined} postfix Expression to be added after the innerExpressions + * @param {BasicEvaluatedExpression[]} innerExpressions Expressions to be wrapped + * @returns {this} this + */ setWrapped(prefix, postfix, innerExpressions) { this.type = TypeWrapped; this.prefix = prefix; @@ -124547,6 +130090,12 @@ class BasicEvaluatedExpression { return this; } + /** + * Stores the options of a conditional expression. + * + * @param {BasicEvaluatedExpression[]} options optional (consequent/alternate) expressions to be set + * @returns {this} this + */ setOptions(options) { this.type = TypeConditional; this.options = options; @@ -124554,6 +130103,12 @@ class BasicEvaluatedExpression { return this; } + /** + * Adds options to a conditional expression. + * + * @param {BasicEvaluatedExpression[]} options optional (consequent/alternate) expressions to be added + * @returns {this} this + */ addOptions(options) { if (!this.options) { this.type = TypeConditional; @@ -124566,6 +130121,12 @@ class BasicEvaluatedExpression { return this; } + /** + * Set's the value of this expression to an array of expressions. + * + * @param {BasicEvaluatedExpression[]} items expressions to set + * @returns {this} this + */ setItems(items) { this.type = TypeArray; this.items = items; @@ -124573,6 +130134,12 @@ class BasicEvaluatedExpression { return this; } + /** + * Set's the value of this expression to an array of strings. + * + * @param {string[]} array array to set + * @returns {this} this + */ setArray(array) { this.type = TypeConstArray; this.array = array; @@ -124580,6 +130147,15 @@ class BasicEvaluatedExpression { return this; } + /** + * Set's the value of this expression to a processed/unprocessed template string. Used + * for evaluating TemplateLiteral expressions in the JavaScript Parser. + * + * @param {BasicEvaluatedExpression[]} quasis template string quasis + * @param {BasicEvaluatedExpression[]} parts template string parts + * @param {"cooked" | "raw"} kind template string kind + * @returns {this} this + */ setTemplateString(quasis, parts, kind) { this.type = TypeTemplateString; this.quasis = quasis; @@ -124602,6 +130178,12 @@ class BasicEvaluatedExpression { return this; } + /** + * Set's the value of the expression to nullish. + * + * @param {boolean} value true, if the expression is nullish + * @returns {this} this + */ setNullish(value) { this.nullish = value; @@ -124610,16 +130192,34 @@ class BasicEvaluatedExpression { return this; } + /** + * Set's the range for the expression. + * + * @param {[number, number]} range range to set + * @returns {this} this + */ setRange(range) { this.range = range; return this; } + /** + * Set whether or not the expression has side effects. + * + * @param {boolean} sideEffects true, if the expression has side effects + * @returns {this} this + */ setSideEffects(sideEffects = true) { this.sideEffects = sideEffects; return this; } + /** + * Set the expression node for the expression. + * + * @param {Node | undefined} expression expression + * @returns {this} this + */ setExpression(expression) { this.expression = expression; return this; @@ -124669,7 +130269,7 @@ module.exports = BasicEvaluatedExpression; /***/ }), -/***/ 99561: +/***/ 70428: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; @@ -124680,14 +130280,14 @@ module.exports = BasicEvaluatedExpression; -const Entrypoint = __webpack_require__(3457); +const Entrypoint = __webpack_require__(25661); /** @typedef {import("../Chunk")} Chunk */ /** * @param {Entrypoint} entrypoint a chunk group - * @param {Chunk} excludedChunk1 current chunk which is excluded - * @param {Chunk} excludedChunk2 runtime chunk which is excluded + * @param {Chunk=} excludedChunk1 current chunk which is excluded + * @param {Chunk=} excludedChunk2 runtime chunk which is excluded * @returns {Set} chunks */ const getAllChunks = (entrypoint, excludedChunk1, excludedChunk2) => { @@ -124710,7 +130310,7 @@ exports.getAllChunks = getAllChunks; /***/ }), -/***/ 19398: +/***/ 77422: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -124722,18 +130322,20 @@ exports.getAllChunks = getAllChunks; const { ConcatSource, RawSource } = __webpack_require__(59728); -const RuntimeGlobals = __webpack_require__(34623); -const Template = __webpack_require__(88070); +const RuntimeGlobals = __webpack_require__(61539); +const Template = __webpack_require__(88835); const { getChunkFilenameTemplate, getCompilationHooks -} = __webpack_require__(96230); +} = __webpack_require__(70061); const { generateEntryStartup, updateHashForEntryStartup -} = __webpack_require__(67164); +} = __webpack_require__(61554); +/** @typedef {import("../Chunk")} Chunk */ /** @typedef {import("../Compiler")} Compiler */ +/** @typedef {import("../Entrypoint")} Entrypoint */ class CommonJsChunkFormatPlugin { /** @@ -124782,7 +130384,9 @@ class CommonJsChunkFormatPlugin { chunkGraph.getChunkEntryModulesWithChunkGroupIterable(chunk) ); if (entries.length > 0) { - const runtimeChunk = entries[0][1].getRuntimeChunk(); + const runtimeChunk = + /** @type {Entrypoint} */ + (entries[0][1]).getRuntimeChunk(); const currentOutputName = compilation .getPath( getChunkFilenameTemplate(chunk, compilation.outputOptions), @@ -124799,7 +130403,7 @@ class CommonJsChunkFormatPlugin { compilation.outputOptions ), { - chunk: runtimeChunk, + chunk: /** @type {Chunk} */ (runtimeChunk), contentHashType: "javascript" } ) @@ -124836,7 +130440,7 @@ class CommonJsChunkFormatPlugin { entrySource.add(source); entrySource.add(";\n\n// load runtime\n"); entrySource.add( - `var __webpack_require__ = require(${JSON.stringify( + `var ${RuntimeGlobals.require} = require(${JSON.stringify( runtimePath )});\n` ); @@ -124890,7 +130494,7 @@ module.exports = CommonJsChunkFormatPlugin; /***/ }), -/***/ 14622: +/***/ 51050: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -124907,6 +130511,10 @@ module.exports = CommonJsChunkFormatPlugin; /** @type {WeakMap>} */ const enabledTypes = new WeakMap(); +/** + * @param {Compiler} compiler compiler + * @returns {Set} enabled types + */ const getEnabledTypes = compiler => { let set = enabledTypes.get(compiler); if (set === undefined) { @@ -124967,18 +130575,18 @@ class EnableChunkLoadingPlugin { if (typeof type === "string") { switch (type) { case "jsonp": { - const JsonpChunkLoadingPlugin = __webpack_require__(34633); + const JsonpChunkLoadingPlugin = __webpack_require__(51916); new JsonpChunkLoadingPlugin().apply(compiler); break; } case "import-scripts": { - const ImportScriptsChunkLoadingPlugin = __webpack_require__(97970); + const ImportScriptsChunkLoadingPlugin = __webpack_require__(32405); new ImportScriptsChunkLoadingPlugin().apply(compiler); break; } case "require": { //@ts-expect-error https://github.com/microsoft/TypeScript/issues/41697 - const CommonJsChunkLoadingPlugin = __webpack_require__(39263); + const CommonJsChunkLoadingPlugin = __webpack_require__(48473); new CommonJsChunkLoadingPlugin({ asyncChunkLoading: false }).apply(compiler); @@ -124986,14 +130594,14 @@ class EnableChunkLoadingPlugin { } case "async-node": { //@ts-expect-error https://github.com/microsoft/TypeScript/issues/41697 - const CommonJsChunkLoadingPlugin = __webpack_require__(39263); + const CommonJsChunkLoadingPlugin = __webpack_require__(48473); new CommonJsChunkLoadingPlugin({ asyncChunkLoading: true }).apply(compiler); break; } case "import": { - const ModuleChunkLoadingPlugin = __webpack_require__(11214); + const ModuleChunkLoadingPlugin = __webpack_require__(22498); new ModuleChunkLoadingPlugin().apply(compiler); break; } @@ -125016,7 +130624,7 @@ module.exports = EnableChunkLoadingPlugin; /***/ }), -/***/ 76241: +/***/ 19649: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -125029,9 +130637,9 @@ module.exports = EnableChunkLoadingPlugin; const util = __webpack_require__(73837); const { RawSource, ReplaceSource } = __webpack_require__(59728); -const Generator = __webpack_require__(8635); -const InitFragment = __webpack_require__(53658); -const HarmonyCompatibilityDependency = __webpack_require__(66565); +const Generator = __webpack_require__(58387); +const InitFragment = __webpack_require__(44508); +const HarmonyCompatibilityDependency = __webpack_require__(695); /** @typedef {import("webpack-sources").Source} Source */ /** @typedef {import("../DependenciesBlock")} DependenciesBlock */ @@ -125249,7 +130857,7 @@ module.exports = JavascriptGenerator; /***/ }), -/***/ 96230: +/***/ 70061: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -125269,20 +130877,26 @@ const { RawSource, CachedSource } = __webpack_require__(59728); -const Compilation = __webpack_require__(38292); -const { tryRunOrWebpackError } = __webpack_require__(88608); -const HotUpdateChunk = __webpack_require__(72873); -const InitFragment = __webpack_require__(53658); -const RuntimeGlobals = __webpack_require__(34623); -const Template = __webpack_require__(88070); -const { last, someInIterable } = __webpack_require__(99958); -const StringXor = __webpack_require__(78565); -const { compareModulesByIdentifier } = __webpack_require__(29355); -const createHash = __webpack_require__(94624); -const nonNumericOnlyHash = __webpack_require__(12993); -const { intersectRuntime } = __webpack_require__(55693); -const JavascriptGenerator = __webpack_require__(76241); -const JavascriptParser = __webpack_require__(23628); +const Compilation = __webpack_require__(20417); +const { tryRunOrWebpackError } = __webpack_require__(39319); +const HotUpdateChunk = __webpack_require__(80065); +const InitFragment = __webpack_require__(44508); +const { + JAVASCRIPT_MODULE_TYPE_AUTO, + JAVASCRIPT_MODULE_TYPE_DYNAMIC, + JAVASCRIPT_MODULE_TYPE_ESM, + WEBPACK_MODULE_TYPE_RUNTIME +} = __webpack_require__(92891); +const RuntimeGlobals = __webpack_require__(61539); +const Template = __webpack_require__(88835); +const { last, someInIterable } = __webpack_require__(12281); +const StringXor = __webpack_require__(81650); +const { compareModulesByIdentifier } = __webpack_require__(95978); +const createHash = __webpack_require__(31147); +const nonNumericOnlyHash = __webpack_require__(95162); +const { intersectRuntime } = __webpack_require__(69965); +const JavascriptGenerator = __webpack_require__(19649); +const JavascriptParser = __webpack_require__(27865); /** @typedef {import("webpack-sources").Source} Source */ /** @typedef {import("../Chunk")} Chunk */ @@ -125309,14 +130923,27 @@ const chunkHasJs = (chunk, chunkGraph) => { : false; }; +/** + * @param {Module} module a module + * @param {string} code the code + * @returns {string} generated code for the stack + */ const printGeneratedCodeForStack = (module, code) => { const lines = code.split("\n"); const n = `${lines.length}`.length; return `\n\nGenerated code for ${module.identifier()}\n${lines - .map((line, i, lines) => { - const iStr = `${i + 1}`; - return `${" ".repeat(n - iStr.length)}${iStr} | ${line}`; - }) + .map( + /** + * @param {string} line the line + * @param {number} i the index + * @param {string[]} lines the lines + * @returns {string} the line with line number + */ + (line, i, lines) => { + const iStr = `${i + 1}`; + return `${" ".repeat(n - iStr.length)}${iStr} | ${line}`; + } + ) .join("\n")}`; }; @@ -125379,8 +131006,8 @@ const printGeneratedCodeForStack = (module, code) => { * @property {SyncWaterfallHook<[Source, Module, StartupRenderContext]>} renderStartup * @property {SyncWaterfallHook<[string, RenderBootstrapContext]>} renderRequire * @property {SyncBailHook<[Module, RenderBootstrapContext], string>} inlineInRuntimeBailout - * @property {SyncBailHook<[Module, RenderContext], string>} embedInRuntimeBailout - * @property {SyncBailHook<[RenderContext], string>} strictRuntimeBailout + * @property {SyncBailHook<[Module, RenderContext], string | void>} embedInRuntimeBailout + * @property {SyncBailHook<[RenderContext], string | void>} strictRuntimeBailout * @property {SyncHook<[Chunk, Hash, ChunkHashContext]>} chunkHash * @property {SyncBailHook<[Chunk, RenderContext], boolean>} useSourceMap */ @@ -125388,6 +131015,8 @@ const printGeneratedCodeForStack = (module, code) => { /** @type {WeakMap} */ const compilationHooksMap = new WeakMap(); +const PLUGIN_NAME = "JavascriptModulesPlugin"; + class JavascriptModulesPlugin { /** * @param {Compilation} compilation the compilation @@ -125451,154 +131080,147 @@ class JavascriptModulesPlugin { */ apply(compiler) { compiler.hooks.compilation.tap( - "JavascriptModulesPlugin", + PLUGIN_NAME, (compilation, { normalModuleFactory }) => { const hooks = JavascriptModulesPlugin.getCompilationHooks(compilation); normalModuleFactory.hooks.createParser - .for("javascript/auto") - .tap("JavascriptModulesPlugin", options => { + .for(JAVASCRIPT_MODULE_TYPE_AUTO) + .tap(PLUGIN_NAME, options => { return new JavascriptParser("auto"); }); normalModuleFactory.hooks.createParser - .for("javascript/dynamic") - .tap("JavascriptModulesPlugin", options => { + .for(JAVASCRIPT_MODULE_TYPE_DYNAMIC) + .tap(PLUGIN_NAME, options => { return new JavascriptParser("script"); }); normalModuleFactory.hooks.createParser - .for("javascript/esm") - .tap("JavascriptModulesPlugin", options => { + .for(JAVASCRIPT_MODULE_TYPE_ESM) + .tap(PLUGIN_NAME, options => { return new JavascriptParser("module"); }); normalModuleFactory.hooks.createGenerator - .for("javascript/auto") - .tap("JavascriptModulesPlugin", () => { + .for(JAVASCRIPT_MODULE_TYPE_AUTO) + .tap(PLUGIN_NAME, () => { return new JavascriptGenerator(); }); normalModuleFactory.hooks.createGenerator - .for("javascript/dynamic") - .tap("JavascriptModulesPlugin", () => { + .for(JAVASCRIPT_MODULE_TYPE_DYNAMIC) + .tap(PLUGIN_NAME, () => { return new JavascriptGenerator(); }); normalModuleFactory.hooks.createGenerator - .for("javascript/esm") - .tap("JavascriptModulesPlugin", () => { + .for(JAVASCRIPT_MODULE_TYPE_ESM) + .tap(PLUGIN_NAME, () => { return new JavascriptGenerator(); }); - compilation.hooks.renderManifest.tap( - "JavascriptModulesPlugin", - (result, options) => { - const { - hash, - chunk, - chunkGraph, - moduleGraph, - runtimeTemplate, - dependencyTemplates, - outputOptions, - codeGenerationResults - } = options; + compilation.hooks.renderManifest.tap(PLUGIN_NAME, (result, options) => { + const { + hash, + chunk, + chunkGraph, + moduleGraph, + runtimeTemplate, + dependencyTemplates, + outputOptions, + codeGenerationResults + } = options; - const hotUpdateChunk = - chunk instanceof HotUpdateChunk ? chunk : null; + const hotUpdateChunk = chunk instanceof HotUpdateChunk ? chunk : null; - let render; - const filenameTemplate = - JavascriptModulesPlugin.getChunkFilenameTemplate( - chunk, - outputOptions + let render; + const filenameTemplate = + JavascriptModulesPlugin.getChunkFilenameTemplate( + chunk, + outputOptions + ); + if (hotUpdateChunk) { + render = () => + this.renderChunk( + { + chunk, + dependencyTemplates, + runtimeTemplate, + moduleGraph, + chunkGraph, + codeGenerationResults, + strictMode: runtimeTemplate.isModule() + }, + hooks ); - if (hotUpdateChunk) { - render = () => - this.renderChunk( - { - chunk, - dependencyTemplates, - runtimeTemplate, - moduleGraph, - chunkGraph, - codeGenerationResults, - strictMode: runtimeTemplate.isModule() - }, - hooks - ); - } else if (chunk.hasRuntime()) { - render = () => - this.renderMain( - { - hash, - chunk, - dependencyTemplates, - runtimeTemplate, - moduleGraph, - chunkGraph, - codeGenerationResults, - strictMode: runtimeTemplate.isModule() - }, - hooks, - compilation - ); - } else { - if (!chunkHasJs(chunk, chunkGraph)) { - return result; - } - - render = () => - this.renderChunk( - { - chunk, - dependencyTemplates, - runtimeTemplate, - moduleGraph, - chunkGraph, - codeGenerationResults, - strictMode: runtimeTemplate.isModule() - }, - hooks - ); + } else if (chunk.hasRuntime()) { + render = () => + this.renderMain( + { + hash, + chunk, + dependencyTemplates, + runtimeTemplate, + moduleGraph, + chunkGraph, + codeGenerationResults, + strictMode: runtimeTemplate.isModule() + }, + hooks, + compilation + ); + } else { + if (!chunkHasJs(chunk, chunkGraph)) { + return result; } - result.push({ - render, - filenameTemplate, - pathOptions: { - hash, - runtime: chunk.runtime, - chunk, - contentHashType: "javascript" - }, - info: { - javascriptModule: compilation.runtimeTemplate.isModule() - }, - identifier: hotUpdateChunk - ? `hotupdatechunk${chunk.id}` - : `chunk${chunk.id}`, - hash: chunk.contentHash.javascript - }); - - return result; - } - ); - compilation.hooks.chunkHash.tap( - "JavascriptModulesPlugin", - (chunk, hash, context) => { - hooks.chunkHash.call(chunk, hash, context); - if (chunk.hasRuntime()) { - this.updateHashWithBootstrap( - hash, + render = () => + this.renderChunk( { - hash: "0000", chunk, - codeGenerationResults: context.codeGenerationResults, - chunkGraph: context.chunkGraph, - moduleGraph: context.moduleGraph, - runtimeTemplate: context.runtimeTemplate + dependencyTemplates, + runtimeTemplate, + moduleGraph, + chunkGraph, + codeGenerationResults, + strictMode: runtimeTemplate.isModule() }, hooks ); - } } - ); - compilation.hooks.contentHash.tap("JavascriptModulesPlugin", chunk => { + + result.push({ + render, + filenameTemplate, + pathOptions: { + hash, + runtime: chunk.runtime, + chunk, + contentHashType: "javascript" + }, + info: { + javascriptModule: compilation.runtimeTemplate.isModule() + }, + identifier: hotUpdateChunk + ? `hotupdatechunk${chunk.id}` + : `chunk${chunk.id}`, + hash: chunk.contentHash.javascript + }); + + return result; + }); + compilation.hooks.chunkHash.tap(PLUGIN_NAME, (chunk, hash, context) => { + hooks.chunkHash.call(chunk, hash, context); + if (chunk.hasRuntime()) { + this.updateHashWithBootstrap( + hash, + { + hash: "0000", + chunk, + codeGenerationResults: context.codeGenerationResults, + chunkGraph: context.chunkGraph, + moduleGraph: context.moduleGraph, + runtimeTemplate: context.runtimeTemplate + }, + hooks + ); + } + }); + compilation.hooks.contentHash.tap(PLUGIN_NAME, chunk => { const { chunkGraph, codeGenerationResults, @@ -125649,7 +131271,7 @@ class JavascriptModulesPlugin { } const runtimeModules = chunkGraph.getChunkModulesIterableBySourceType( chunk, - "runtime" + WEBPACK_MODULE_TYPE_RUNTIME ); if (runtimeModules) { const xor = new StringXor(); @@ -125665,7 +131287,7 @@ class JavascriptModulesPlugin { ); }); compilation.hooks.additionalTreeRuntimeRequirements.tap( - "JavascriptModulesPlugin", + PLUGIN_NAME, (chunk, set, { chunkGraph }) => { if ( !set.has(RuntimeGlobals.startupNoDefault) && @@ -125676,58 +131298,54 @@ class JavascriptModulesPlugin { } } ); - compilation.hooks.executeModule.tap( - "JavascriptModulesPlugin", - (options, context) => { - const source = - options.codeGenerationResult.sources.get("javascript"); - if (source === undefined) return; - const { module, moduleObject } = options; - const code = source.source(); - - const fn = vm.runInThisContext( - `(function(${module.moduleArgument}, ${module.exportsArgument}, __webpack_require__) {\n${code}\n/**/})`, - { - filename: module.identifier(), - lineOffset: -1 - } - ); - try { - fn.call( - moduleObject.exports, - moduleObject, - moduleObject.exports, - context.__webpack_require__ - ); - } catch (e) { - e.stack += printGeneratedCodeForStack(options.module, code); - throw e; + compilation.hooks.executeModule.tap(PLUGIN_NAME, (options, context) => { + const source = options.codeGenerationResult.sources.get("javascript"); + if (source === undefined) return; + const { module, moduleObject } = options; + const code = source.source(); + + const fn = vm.runInThisContext( + `(function(${module.moduleArgument}, ${module.exportsArgument}, ${RuntimeGlobals.require}) {\n${code}\n/**/})`, + { + filename: module.identifier(), + lineOffset: -1 } - } - ); - compilation.hooks.executeModule.tap( - "JavascriptModulesPlugin", - (options, context) => { - const source = options.codeGenerationResult.sources.get("runtime"); - if (source === undefined) return; - let code = source.source(); - if (typeof code !== "string") code = code.toString(); - - const fn = vm.runInThisContext( - `(function(__webpack_require__) {\n${code}\n/**/})`, - { - filename: options.module.identifier(), - lineOffset: -1 - } + ); + try { + fn.call( + moduleObject.exports, + moduleObject, + moduleObject.exports, + context.__webpack_require__ ); - try { - fn.call(null, context.__webpack_require__); - } catch (e) { - e.stack += printGeneratedCodeForStack(options.module, code); - throw e; + } catch (e) { + e.stack += printGeneratedCodeForStack( + options.module, + /** @type {string} */ (code) + ); + throw e; + } + }); + compilation.hooks.executeModule.tap(PLUGIN_NAME, (options, context) => { + const source = options.codeGenerationResult.sources.get("runtime"); + if (source === undefined) return; + let code = source.source(); + if (typeof code !== "string") code = code.toString(); + + const fn = vm.runInThisContext( + `(function(${RuntimeGlobals.require}) {\n${code}\n/**/})`, + { + filename: options.module.identifier(), + lineOffset: -1 } + ); + try { + fn.call(null, context.__webpack_require__); + } catch (e) { + e.stack += printGeneratedCodeForStack(options.module, code); + throw e; } - ); + }); } ); } @@ -125818,7 +131436,7 @@ class JavascriptModulesPlugin { ? module.exportsArgument : "__unused_webpack_" + module.exportsArgument ); - if (needRequire) args.push("__webpack_require__"); + if (needRequire) args.push(RuntimeGlobals.require); if (!needThisAsExports && runtimeTemplate.supportsArrowFunction()) { factorySource.add("/***/ ((" + args.join(", ") + ") => {\n\n"); } else { @@ -125952,6 +131570,7 @@ class JavascriptModulesPlugin { ); const hasEntryModules = chunkGraph.getNumberOfEntryModules(chunk) > 0; + /** @type {Set | undefined} */ let inlinedModules; if (bootstrap.allowInlineStartup && hasEntryModules) { inlinedModules = new Set(chunkGraph.getChunkEntryModulesIterable(chunk)); @@ -125993,7 +131612,9 @@ class JavascriptModulesPlugin { const chunkModules = Template.renderChunkModules( chunkRenderContext, inlinedModules - ? allModules.filter(m => !inlinedModules.has(m)) + ? allModules.filter( + m => !(/** @type {Set} */ (inlinedModules).has(m)) + ) : allModules, module => this.renderModule(module, chunkRenderContext, hooks, true), prefix @@ -126059,7 +131680,7 @@ class JavascriptModulesPlugin { } const lastInlinedModule = last(inlinedModules); const startupSource = new ConcatSource(); - startupSource.add(`var __webpack_exports__ = {};\n`); + startupSource.add(`var ${RuntimeGlobals.exports} = {};\n`); for (const m of inlinedModules) { const renderedModule = this.renderModule( m, @@ -126075,7 +131696,7 @@ class JavascriptModulesPlugin { ); const exports = runtimeRequirements.has(RuntimeGlobals.exports); const webpackExports = - exports && m.exportsArgument === "__webpack_exports__"; + exports && m.exportsArgument === RuntimeGlobals.exports; let iife = innerStrict ? "it need to be in strict mode." : inlinedModules.size > 1 @@ -126107,9 +131728,9 @@ class JavascriptModulesPlugin { if (exports) { if (m !== lastInlinedModule) startupSource.add(`var ${m.exportsArgument} = {};\n`); - else if (m.exportsArgument !== "__webpack_exports__") + else if (m.exportsArgument !== RuntimeGlobals.exports) startupSource.add( - `var ${m.exportsArgument} = __webpack_exports__;\n` + `var ${m.exportsArgument} = ${RuntimeGlobals.exports};\n` ); } startupSource.add(renderedModule); @@ -126118,7 +131739,7 @@ class JavascriptModulesPlugin { } if (runtimeRequirements.has(RuntimeGlobals.onChunksLoaded)) { startupSource.add( - `__webpack_exports__ = ${RuntimeGlobals.onChunksLoaded}(__webpack_exports__);\n` + `${RuntimeGlobals.exports} = ${RuntimeGlobals.onChunksLoaded}(${RuntimeGlobals.exports});\n` ); } source.add( @@ -126170,7 +131791,7 @@ class JavascriptModulesPlugin { hasEntryModules && runtimeRequirements.has(RuntimeGlobals.returnExportsFromRuntime) ) { - source.add(`${prefix}return __webpack_exports__;\n`); + source.add(`${prefix}return ${RuntimeGlobals.exports};\n`); } if (iife) { source.add("/******/ })()\n"); @@ -126195,6 +131816,7 @@ class JavascriptModulesPlugin { "JavascriptModulesPlugin error: JavascriptModulesPlugin.getCompilationHooks().renderContent plugins should return something" ); } + finalSource = InitFragment.addToSource( finalSource, chunkRenderContext.chunkInitFragments, @@ -126264,6 +131886,9 @@ class JavascriptModulesPlugin { const useRequire = requireFunction || interceptModuleExecution || moduleUsed; + /** + * @type {{startup: string[], beforeStartup: string[], header: string[], afterStartup: string[], allowInlineStartup: boolean}} + */ const result = { header: [], beforeStartup: [], @@ -126299,13 +131924,13 @@ class JavascriptModulesPlugin { if (useRequire) { buf.push("// The require function"); - buf.push(`function __webpack_require__(moduleId) {`); + buf.push(`function ${RuntimeGlobals.require}(moduleId) {`); buf.push(Template.indent(this.renderRequire(renderContext, hooks))); buf.push("}"); buf.push(""); } else if (runtimeRequirements.has(RuntimeGlobals.requireScope)) { buf.push("// The require scope"); - buf.push("var __webpack_require__ = {};"); + buf.push(`var ${RuntimeGlobals.require} = {};`); buf.push(""); } @@ -126419,32 +132044,32 @@ class JavascriptModulesPlugin { } if (chunks.length > 0) { buf2.push( - `${i === 0 ? "var __webpack_exports__ = " : ""}${ + `${i === 0 ? `var ${RuntimeGlobals.exports} = ` : ""}${ RuntimeGlobals.onChunksLoaded }(undefined, ${JSON.stringify( chunks.map(c => c.id) )}, ${runtimeTemplate.returningFunction( - `__webpack_require__(${moduleIdExpr})` + `${RuntimeGlobals.require}(${moduleIdExpr})` )})` ); } else if (useRequire) { buf2.push( - `${ - i === 0 ? "var __webpack_exports__ = " : "" - }__webpack_require__(${moduleIdExpr});` + `${i === 0 ? `var ${RuntimeGlobals.exports} = ` : ""}${ + RuntimeGlobals.require + }(${moduleIdExpr});` ); } else { - if (i === 0) buf2.push("var __webpack_exports__ = {};"); + if (i === 0) buf2.push(`var ${RuntimeGlobals.exports} = {};`); if (requireScopeUsed) { buf2.push( `__webpack_modules__[${moduleIdExpr}](0, ${ - i === 0 ? "__webpack_exports__" : "{}" - }, __webpack_require__);` + i === 0 ? RuntimeGlobals.exports : "{}" + }, ${RuntimeGlobals.require});` ); } else if (entryRuntimeRequirements.has(RuntimeGlobals.exports)) { buf2.push( `__webpack_modules__[${moduleIdExpr}](0, ${ - i === 0 ? "__webpack_exports__" : "{}" + i === 0 ? RuntimeGlobals.exports : "{}" });` ); } else { @@ -126454,7 +132079,7 @@ class JavascriptModulesPlugin { } if (runtimeRequirements.has(RuntimeGlobals.onChunksLoaded)) { buf2.push( - `__webpack_exports__ = ${RuntimeGlobals.onChunksLoaded}(__webpack_exports__);` + `${RuntimeGlobals.exports} = ${RuntimeGlobals.onChunksLoaded}(${RuntimeGlobals.exports});` ); } if ( @@ -126467,13 +132092,13 @@ class JavascriptModulesPlugin { buf.push( `${RuntimeGlobals.startup} = ${runtimeTemplate.basicFunction("", [ ...buf2, - "return __webpack_exports__;" + `return ${RuntimeGlobals.exports};` ])};` ); buf.push(""); startup.push("// run startup"); startup.push( - `var __webpack_exports__ = ${RuntimeGlobals.startup}();` + `var ${RuntimeGlobals.exports} = ${RuntimeGlobals.startup}();` ); } else if (runtimeRequirements.has(RuntimeGlobals.startupOnlyBefore)) { buf.push("// the startup function"); @@ -126521,7 +132146,9 @@ class JavascriptModulesPlugin { `${RuntimeGlobals.startup} = ${runtimeTemplate.emptyFunction()};` ); startup.push("// run startup"); - startup.push(`var __webpack_exports__ = ${RuntimeGlobals.startup}();`); + startup.push( + `var ${RuntimeGlobals.exports} = ${RuntimeGlobals.startup}();` + ); } return result; } @@ -126542,17 +132169,17 @@ class JavascriptModulesPlugin { RuntimeGlobals.interceptModuleExecution ) ? Template.asString([ - "var execOptions = { id: moduleId, module: module, factory: __webpack_modules__[moduleId], require: __webpack_require__ };", + `var execOptions = { id: moduleId, module: module, factory: __webpack_modules__[moduleId], require: ${RuntimeGlobals.require} };`, `${RuntimeGlobals.interceptModuleExecution}.forEach(function(handler) { handler(execOptions); });`, "module = execOptions.module;", "execOptions.factory.call(module.exports, module, module.exports, execOptions.require);" ]) : runtimeRequirements.has(RuntimeGlobals.thisAsExports) ? Template.asString([ - "__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);" + `__webpack_modules__[moduleId].call(module.exports, module, module.exports, ${RuntimeGlobals.require});` ]) : Template.asString([ - "__webpack_modules__[moduleId](module, module.exports, __webpack_require__);" + `__webpack_modules__[moduleId](module, module.exports, ${RuntimeGlobals.require});` ]); const needModuleId = runtimeRequirements.has(RuntimeGlobals.moduleId); const needModuleLoaded = runtimeRequirements.has( @@ -126607,7 +132234,7 @@ class JavascriptModulesPlugin { ? Template.asString([ "", "// Flag the module as loaded", - "module.loaded = true;", + `${RuntimeGlobals.moduleLoaded} = true;`, "" ]) : "", @@ -126627,7 +132254,7 @@ module.exports.chunkHasJs = chunkHasJs; /***/ }), -/***/ 23628: +/***/ 27865: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -126639,58 +132266,93 @@ module.exports.chunkHasJs = chunkHasJs; const { Parser: AcornParser } = __webpack_require__(11460); -const { importAssertions } = __webpack_require__(77); +const { importAssertions } = __webpack_require__(42991); const { SyncBailHook, HookMap } = __webpack_require__(70793); const vm = __webpack_require__(26144); -const Parser = __webpack_require__(66425); -const StackedMap = __webpack_require__(61463); -const binarySearchBounds = __webpack_require__(59718); -const memoize = __webpack_require__(27319); -const BasicEvaluatedExpression = __webpack_require__(88981); +const Parser = __webpack_require__(76690); +const StackedMap = __webpack_require__(88781); +const binarySearchBounds = __webpack_require__(6871); +const memoize = __webpack_require__(62377); +const BasicEvaluatedExpression = __webpack_require__(52493); /** @typedef {import("acorn").Options} AcornOptions */ -/** @typedef {import("estree").ArrayExpression} ArrayExpressionNode */ -/** @typedef {import("estree").BinaryExpression} BinaryExpressionNode */ -/** @typedef {import("estree").BlockStatement} BlockStatementNode */ -/** @typedef {import("estree").SequenceExpression} SequenceExpressionNode */ -/** @typedef {import("estree").CallExpression} CallExpressionNode */ -/** @typedef {import("estree").ClassDeclaration} ClassDeclarationNode */ -/** @typedef {import("estree").ClassExpression} ClassExpressionNode */ -/** @typedef {import("estree").Comment} CommentNode */ -/** @typedef {import("estree").ConditionalExpression} ConditionalExpressionNode */ -/** @typedef {import("estree").Declaration} DeclarationNode */ -/** @typedef {import("estree").PrivateIdentifier} PrivateIdentifierNode */ -/** @typedef {import("estree").PropertyDefinition} PropertyDefinitionNode */ -/** @typedef {import("estree").Expression} ExpressionNode */ -/** @typedef {import("estree").Identifier} IdentifierNode */ -/** @typedef {import("estree").IfStatement} IfStatementNode */ -/** @typedef {import("estree").LabeledStatement} LabeledStatementNode */ -/** @typedef {import("estree").Literal} LiteralNode */ -/** @typedef {import("estree").LogicalExpression} LogicalExpressionNode */ -/** @typedef {import("estree").ChainExpression} ChainExpressionNode */ -/** @typedef {import("estree").MemberExpression} MemberExpressionNode */ -/** @typedef {import("estree").MetaProperty} MetaPropertyNode */ -/** @typedef {import("estree").MethodDefinition} MethodDefinitionNode */ -/** @typedef {import("estree").ModuleDeclaration} ModuleDeclarationNode */ -/** @typedef {import("estree").NewExpression} NewExpressionNode */ +/** @typedef {import("estree").AssignmentExpression} AssignmentExpression */ +/** @typedef {import("estree").BinaryExpression} BinaryExpression */ +/** @typedef {import("estree").BlockStatement} BlockStatement */ +/** @typedef {import("estree").SequenceExpression} SequenceExpression */ +/** @typedef {import("estree").CallExpression} CallExpression */ +/** @typedef {import("estree").BaseCallExpression} BaseCallExpression */ +/** @typedef {import("estree").StaticBlock} StaticBlock */ +/** @typedef {import("estree").ImportExpression} ImportExpression */ +/** @typedef {import("estree").ClassDeclaration} ClassDeclaration */ +/** @typedef {import("estree").ForStatement} ForStatement */ +/** @typedef {import("estree").SwitchStatement} SwitchStatement */ +/** @typedef {import("estree").ExportNamedDeclaration} ExportNamedDeclaration */ +/** @typedef {import("estree").ClassExpression} ClassExpression */ +/** @typedef {import("estree").Comment} Comment */ +/** @typedef {import("estree").ConditionalExpression} ConditionalExpression */ +/** @typedef {import("estree").Declaration} Declaration */ +/** @typedef {import("estree").PrivateIdentifier} PrivateIdentifier */ +/** @typedef {import("estree").PropertyDefinition} PropertyDefinition */ +/** @typedef {import("estree").Expression} Expression */ +/** @typedef {import("estree").Identifier} Identifier */ +/** @typedef {import("estree").VariableDeclaration} VariableDeclaration */ +/** @typedef {import("estree").IfStatement} IfStatement */ +/** @typedef {import("estree").LabeledStatement} LabeledStatement */ +/** @typedef {import("estree").Literal} Literal */ +/** @typedef {import("estree").LogicalExpression} LogicalExpression */ +/** @typedef {import("estree").ChainExpression} ChainExpression */ +/** @typedef {import("estree").MemberExpression} MemberExpression */ +/** @typedef {import("estree").YieldExpression} YieldExpression */ +/** @typedef {import("estree").MetaProperty} MetaProperty */ +/** @typedef {import("estree").Property} Property */ +/** @typedef {import("estree").AssignmentPattern} AssignmentPattern */ +/** @typedef {import("estree").ChainElement} ChainElement */ +/** @typedef {import("estree").Pattern} Pattern */ +/** @typedef {import("estree").UpdateExpression} UpdateExpression */ +/** @typedef {import("estree").ObjectExpression} ObjectExpression */ +/** @typedef {import("estree").UnaryExpression} UnaryExpression */ +/** @typedef {import("estree").ArrayExpression} ArrayExpression */ +/** @typedef {import("estree").ArrayPattern} ArrayPattern */ +/** @typedef {import("estree").AwaitExpression} AwaitExpression */ +/** @typedef {import("estree").ThisExpression} ThisExpression */ +/** @typedef {import("estree").RestElement} RestElement */ +/** @typedef {import("estree").ObjectPattern} ObjectPattern */ +/** @typedef {import("estree").SwitchCase} SwitchCase */ +/** @typedef {import("estree").CatchClause} CatchClause */ +/** @typedef {import("estree").VariableDeclarator} VariableDeclarator */ +/** @typedef {import("estree").ForInStatement} ForInStatement */ +/** @typedef {import("estree").ForOfStatement} ForOfStatement */ +/** @typedef {import("estree").ReturnStatement} ReturnStatement */ +/** @typedef {import("estree").WithStatement} WithStatement */ +/** @typedef {import("estree").ThrowStatement} ThrowStatement */ +/** @typedef {import("estree").MethodDefinition} MethodDefinition */ +/** @typedef {import("estree").ModuleDeclaration} ModuleDeclaration */ +/** @typedef {import("estree").NewExpression} NewExpression */ +/** @typedef {import("estree").SpreadElement} SpreadElement */ +/** @typedef {import("estree").FunctionExpression} FunctionExpression */ +/** @typedef {import("estree").WhileStatement} WhileStatement */ +/** @typedef {import("estree").ArrowFunctionExpression} ArrowFunctionExpression */ +/** @typedef {import("estree").ExpressionStatement} ExpressionStatement */ +/** @typedef {import("estree").FunctionDeclaration} FunctionDeclaration */ +/** @typedef {import("estree").DoWhileStatement} DoWhileStatement */ +/** @typedef {import("estree").TryStatement} TryStatement */ /** @typedef {import("estree").Node} AnyNode */ -/** @typedef {import("estree").Program} ProgramNode */ -/** @typedef {import("estree").Statement} StatementNode */ -/** @typedef {import("estree").ImportDeclaration} ImportDeclarationNode */ -/** @typedef {import("estree").ExportNamedDeclaration} ExportNamedDeclarationNode */ -/** @typedef {import("estree").ExportDefaultDeclaration} ExportDefaultDeclarationNode */ -/** @typedef {import("estree").ExportAllDeclaration} ExportAllDeclarationNode */ -/** @typedef {import("estree").Super} SuperNode */ -/** @typedef {import("estree").TaggedTemplateExpression} TaggedTemplateExpressionNode */ -/** @typedef {import("estree").TemplateLiteral} TemplateLiteralNode */ -/** @typedef {import("estree").ThisExpression} ThisExpressionNode */ -/** @typedef {import("estree").UnaryExpression} UnaryExpressionNode */ -/** @typedef {import("estree").VariableDeclarator} VariableDeclaratorNode */ +/** @typedef {import("estree").Program} Program */ +/** @typedef {import("estree").Directive} Directive */ +/** @typedef {import("estree").Statement} Statement */ +/** @typedef {import("estree").ImportDeclaration} ImportDeclaration */ +/** @typedef {import("estree").ExportDefaultDeclaration} ExportDefaultDeclaration */ +/** @typedef {import("estree").ExportAllDeclaration} ExportAllDeclaration */ +/** @typedef {import("estree").Super} Super */ +/** @typedef {import("estree").TaggedTemplateExpression} TaggedTemplateExpression */ +/** @typedef {import("estree").TemplateLiteral} TemplateLiteral */ +/** @typedef {Record} Assertions */ /** @template T @typedef {import("tapable").AsArray} AsArray */ /** @typedef {import("../Parser").ParserState} ParserState */ /** @typedef {import("../Parser").PreparsedAst} PreparsedAst */ /** @typedef {{declaredScope: ScopeInfo, freeName: string | true, tagInfo: TagInfo | undefined}} VariableInfoInterface */ -/** @typedef {{ name: string | VariableInfo, rootInfo: string | VariableInfo, getMembers: () => string[], getMembersOptionals: () => boolean[] }} GetInfoResult */ +/** @typedef {{ name: string | VariableInfo, rootInfo: string | VariableInfo, getMembers: () => string[], getMembersOptionals: () => boolean[], getMemberRanges: () => Range[] }} GetInfoResult */ const EMPTY_ARRAY = []; const ALLOWED_MEMBER_TYPES_CALL_EXPRESSION = 0b01; @@ -126704,7 +132366,7 @@ const parser = AcornParser.extend(importAssertions); class VariableInfo { /** * @param {ScopeInfo} declaredScope scope in which the variable is declared - * @param {string | true} freeName which free name the variable aliases, or true when none + * @param {string | true | undefined} freeName which free name the variable aliases, or true when none * @param {TagInfo | undefined} tagInfo info about tags */ constructor(declaredScope, freeName, tagInfo) { @@ -126715,7 +132377,7 @@ class VariableInfo { } /** @typedef {string | ScopeInfo | VariableInfo} ExportedVariableInfo */ -/** @typedef {LiteralNode | string | null | undefined} ImportSource */ +/** @typedef {Literal | string | null | undefined} ImportSource */ /** @typedef {Omit & { sourceType: "module" | "script" | "auto", ecmaVersion?: AcornOptions["ecmaVersion"] }} ParseOptions */ /** @@ -126729,18 +132391,55 @@ class VariableInfo { * @typedef {Object} ScopeInfo * @property {StackedMap} definitions * @property {boolean | "arrow"} topLevelScope - * @property {boolean} inShorthand + * @property {boolean | string} inShorthand + * @property {boolean} inTaggedTemplateTag + * @property {boolean} inTry * @property {boolean} isStrict * @property {boolean} isAsmJs - * @property {boolean} inTry */ +/** @typedef {[number, number]} Range */ + +/** + * Helper function for joining two ranges into a single range. This is useful + * when working with AST nodes, as it allows you to combine the ranges of child nodes + * to create the range of the _parent node_. + * + * @param {[number, number]} startRange start range to join + * @param {[number, number]} endRange end range to join + * @returns {[number, number]} joined range + * + * @example + * ```js + * const startRange = [0, 5]; + * const endRange = [10, 15]; + * const joinedRange = joinRanges(startRange, endRange); + * console.log(joinedRange); // [0, 15] + * ``` + * + */ const joinRanges = (startRange, endRange) => { if (!endRange) return startRange; if (!startRange) return endRange; return [startRange[0], endRange[1]]; }; +/** + * Helper function used to generate a string representation of a + * [member expression](https://github.com/estree/estree/blob/master/es5.md#memberexpression). + * + * @param {string} object object to name + * @param {string[]} membersReversed reversed list of members + * @returns {string} member expression as a string + * @example + * ```js + * const membersReversed = ["property1", "property2", "property3"]; // Members parsed from the AST + * const name = objectAndMembersToName("myObject", membersReversed); + * + * console.log(name); // "myObject.property1.property2.property3" + * ``` + * + */ const objectAndMembersToName = (object, membersReversed) => { let name = object; for (let i = membersReversed.length - 1; i >= 0; i--) { @@ -126749,6 +132448,16 @@ const objectAndMembersToName = (object, membersReversed) => { return name; }; +/** + * Grabs the name of a given expression and returns it as a string or undefined. Has particular + * handling for [Identifiers](https://github.com/estree/estree/blob/master/es5.md#identifier), + * [ThisExpressions](https://github.com/estree/estree/blob/master/es5.md#identifier), and + * [MetaProperties](https://github.com/estree/estree/blob/master/es2015.md#metaproperty) which is + * specifically for handling the `new.target` meta property. + * + * @param {Expression | Super} expression expression + * @returns {string | "this" | undefined} name or variable info + */ const getRootName = expression => { switch (expression.type) { case "Identifier": @@ -126788,81 +132497,81 @@ class JavascriptParser extends Parser { constructor(sourceType = "auto") { super(); this.hooks = Object.freeze({ - /** @type {HookMap>} */ + /** @type {HookMap>} */ evaluateTypeof: new HookMap(() => new SyncBailHook(["expression"])), - /** @type {HookMap>} */ + /** @type {HookMap>} */ evaluate: new HookMap(() => new SyncBailHook(["expression"])), - /** @type {HookMap>} */ + /** @type {HookMap>} */ evaluateIdentifier: new HookMap(() => new SyncBailHook(["expression"])), - /** @type {HookMap>} */ + /** @type {HookMap>} */ evaluateDefinedIdentifier: new HookMap( () => new SyncBailHook(["expression"]) ), - /** @type {HookMap>} */ + /** @type {HookMap>} */ evaluateNewExpression: new HookMap( () => new SyncBailHook(["expression"]) ), - /** @type {HookMap>} */ + /** @type {HookMap>} */ evaluateCallExpression: new HookMap( () => new SyncBailHook(["expression"]) ), - /** @type {HookMap>} */ + /** @type {HookMap>} */ evaluateCallExpressionMember: new HookMap( () => new SyncBailHook(["expression", "param"]) ), - /** @type {HookMap>} */ + /** @type {HookMap>} */ isPure: new HookMap( () => new SyncBailHook(["expression", "commentsStartPosition"]) ), - /** @type {SyncBailHook<[StatementNode | ModuleDeclarationNode], boolean | void>} */ + /** @type {SyncBailHook<[Statement | ModuleDeclaration], boolean | void>} */ preStatement: new SyncBailHook(["statement"]), - /** @type {SyncBailHook<[StatementNode | ModuleDeclarationNode], boolean | void>} */ + /** @type {SyncBailHook<[Statement | ModuleDeclaration], boolean | void>} */ blockPreStatement: new SyncBailHook(["declaration"]), - /** @type {SyncBailHook<[StatementNode | ModuleDeclarationNode], boolean | void>} */ + /** @type {SyncBailHook<[Statement | ModuleDeclaration], boolean | void>} */ statement: new SyncBailHook(["statement"]), - /** @type {SyncBailHook<[IfStatementNode], boolean | void>} */ + /** @type {SyncBailHook<[IfStatement], boolean | void>} */ statementIf: new SyncBailHook(["statement"]), - /** @type {SyncBailHook<[ExpressionNode, ClassExpressionNode | ClassDeclarationNode], boolean | void>} */ + /** @type {SyncBailHook<[Expression, ClassExpression | ClassDeclaration], boolean | void>} */ classExtendsExpression: new SyncBailHook([ "expression", "classDefinition" ]), - /** @type {SyncBailHook<[MethodDefinitionNode | PropertyDefinitionNode, ClassExpressionNode | ClassDeclarationNode], boolean | void>} */ + /** @type {SyncBailHook<[MethodDefinition | PropertyDefinition | StaticBlock, ClassExpression | ClassDeclaration], boolean | void>} */ classBodyElement: new SyncBailHook(["element", "classDefinition"]), - /** @type {SyncBailHook<[ExpressionNode, MethodDefinitionNode | PropertyDefinitionNode, ClassExpressionNode | ClassDeclarationNode], boolean | void>} */ + /** @type {SyncBailHook<[Expression, MethodDefinition | PropertyDefinition, ClassExpression | ClassDeclaration], boolean | void>} */ classBodyValue: new SyncBailHook([ "expression", "element", "classDefinition" ]), - /** @type {HookMap>} */ + /** @type {HookMap>} */ label: new HookMap(() => new SyncBailHook(["statement"])), - /** @type {SyncBailHook<[ImportDeclarationNode, ImportSource], boolean | void>} */ + /** @type {SyncBailHook<[ImportDeclaration, ImportSource], boolean | void>} */ import: new SyncBailHook(["statement", "source"]), - /** @type {SyncBailHook<[ImportDeclarationNode, ImportSource, string, string], boolean | void>} */ + /** @type {SyncBailHook<[ImportDeclaration, ImportSource, string, string], boolean | void>} */ importSpecifier: new SyncBailHook([ "statement", "source", "exportName", "identifierName" ]), - /** @type {SyncBailHook<[ExportNamedDeclarationNode | ExportAllDeclarationNode], boolean | void>} */ + /** @type {SyncBailHook<[ExportNamedDeclaration | ExportAllDeclaration], boolean | void>} */ export: new SyncBailHook(["statement"]), - /** @type {SyncBailHook<[ExportNamedDeclarationNode | ExportAllDeclarationNode, ImportSource], boolean | void>} */ + /** @type {SyncBailHook<[ExportNamedDeclaration | ExportAllDeclaration, ImportSource], boolean | void>} */ exportImport: new SyncBailHook(["statement", "source"]), - /** @type {SyncBailHook<[ExportNamedDeclarationNode | ExportAllDeclarationNode, DeclarationNode], boolean | void>} */ + /** @type {SyncBailHook<[ExportNamedDeclaration | ExportAllDeclaration, Declaration], boolean | void>} */ exportDeclaration: new SyncBailHook(["statement", "declaration"]), - /** @type {SyncBailHook<[ExportDefaultDeclarationNode, DeclarationNode], boolean | void>} */ + /** @type {SyncBailHook<[ExportDefaultDeclaration, Declaration], boolean | void>} */ exportExpression: new SyncBailHook(["statement", "declaration"]), - /** @type {SyncBailHook<[ExportNamedDeclarationNode | ExportAllDeclarationNode, string, string, number | undefined], boolean | void>} */ + /** @type {SyncBailHook<[ExportNamedDeclaration | ExportAllDeclaration, string, string, number | undefined], boolean | void>} */ exportSpecifier: new SyncBailHook([ "statement", "identifierName", "exportName", "index" ]), - /** @type {SyncBailHook<[ExportNamedDeclarationNode | ExportAllDeclarationNode, ImportSource, string, string, number | undefined], boolean | void>} */ + /** @type {SyncBailHook<[ExportNamedDeclaration | ExportAllDeclaration, ImportSource, string, string, number | undefined], boolean | void>} */ exportImportSpecifier: new SyncBailHook([ "statement", "source", @@ -126870,45 +132579,51 @@ class JavascriptParser extends Parser { "exportName", "index" ]), - /** @type {SyncBailHook<[VariableDeclaratorNode, StatementNode], boolean | void>} */ + /** @type {SyncBailHook<[VariableDeclarator, Statement], boolean | void>} */ preDeclarator: new SyncBailHook(["declarator", "statement"]), - /** @type {SyncBailHook<[VariableDeclaratorNode, StatementNode], boolean | void>} */ + /** @type {SyncBailHook<[VariableDeclarator, Statement], boolean | void>} */ declarator: new SyncBailHook(["declarator", "statement"]), - /** @type {HookMap>} */ + /** @type {HookMap>} */ varDeclaration: new HookMap(() => new SyncBailHook(["declaration"])), - /** @type {HookMap>} */ + /** @type {HookMap>} */ varDeclarationLet: new HookMap(() => new SyncBailHook(["declaration"])), - /** @type {HookMap>} */ + /** @type {HookMap>} */ varDeclarationConst: new HookMap(() => new SyncBailHook(["declaration"])), - /** @type {HookMap>} */ + /** @type {HookMap>} */ varDeclarationVar: new HookMap(() => new SyncBailHook(["declaration"])), - /** @type {HookMap>} */ + /** @type {HookMap>} */ pattern: new HookMap(() => new SyncBailHook(["pattern"])), - /** @type {HookMap>} */ + /** @type {HookMap>} */ canRename: new HookMap(() => new SyncBailHook(["initExpression"])), - /** @type {HookMap>} */ + /** @type {HookMap>} */ rename: new HookMap(() => new SyncBailHook(["initExpression"])), - /** @type {HookMap>} */ + /** @type {HookMap>} */ assign: new HookMap(() => new SyncBailHook(["expression"])), - /** @type {HookMap>} */ + /** @type {HookMap>} */ assignMemberChain: new HookMap( () => new SyncBailHook(["expression", "members"]) ), - /** @type {HookMap>} */ + /** @type {HookMap>} */ typeof: new HookMap(() => new SyncBailHook(["expression"])), - /** @type {SyncBailHook<[ExpressionNode], boolean | void>} */ + /** @type {SyncBailHook<[ImportExpression], boolean | void>} */ importCall: new SyncBailHook(["expression"]), - /** @type {SyncBailHook<[ExpressionNode], boolean | void>} */ + /** @type {SyncBailHook<[Expression], boolean | void>} */ topLevelAwait: new SyncBailHook(["expression"]), - /** @type {HookMap>} */ + /** @type {HookMap>} */ call: new HookMap(() => new SyncBailHook(["expression"])), /** Something like "a.b()" */ - /** @type {HookMap>} */ + /** @type {HookMap>} */ callMemberChain: new HookMap( - () => new SyncBailHook(["expression", "members", "membersOptionals"]) + () => + new SyncBailHook([ + "expression", + "members", + "membersOptionals", + "memberRanges" + ]) ), /** Something like "a.b().c.d" */ - /** @type {HookMap>} */ + /** @type {HookMap>} */ memberChainOfCallMemberChain: new HookMap( () => new SyncBailHook([ @@ -126919,7 +132634,7 @@ class JavascriptParser extends Parser { ]) ), /** Something like "a.b().c.d()"" */ - /** @type {HookMap>} */ + /** @type {HookMap>} */ callMemberChainOfCallMemberChain: new HookMap( () => new SyncBailHook([ @@ -126929,29 +132644,35 @@ class JavascriptParser extends Parser { "members" ]) ), - /** @type {SyncBailHook<[ChainExpressionNode], boolean | void>} */ + /** @type {SyncBailHook<[ChainExpression], boolean | void>} */ optionalChaining: new SyncBailHook(["optionalChaining"]), - /** @type {HookMap>} */ + /** @type {HookMap>} */ new: new HookMap(() => new SyncBailHook(["expression"])), - /** @type {SyncBailHook<[BinaryExpressionNode], boolean | void>} */ + /** @type {SyncBailHook<[BinaryExpression], boolean | void>} */ binaryExpression: new SyncBailHook(["binaryExpression"]), - /** @type {HookMap>} */ + /** @type {HookMap>} */ expression: new HookMap(() => new SyncBailHook(["expression"])), - /** @type {HookMap>} */ + /** @type {HookMap>} */ expressionMemberChain: new HookMap( - () => new SyncBailHook(["expression", "members", "membersOptionals"]) + () => + new SyncBailHook([ + "expression", + "members", + "membersOptionals", + "memberRanges" + ]) ), - /** @type {HookMap>} */ + /** @type {HookMap>} */ unhandledExpressionMemberChain: new HookMap( () => new SyncBailHook(["expression", "members"]) ), - /** @type {SyncBailHook<[ExpressionNode], boolean | void>} */ + /** @type {SyncBailHook<[ConditionalExpression], boolean | void>} */ expressionConditionalOperator: new SyncBailHook(["expression"]), - /** @type {SyncBailHook<[ExpressionNode], boolean | void>} */ + /** @type {SyncBailHook<[LogicalExpression], boolean | void>} */ expressionLogicalOperator: new SyncBailHook(["expression"]), - /** @type {SyncBailHook<[ProgramNode, CommentNode[]], boolean | void>} */ + /** @type {SyncBailHook<[Program, Comment[]], boolean | void>} */ program: new SyncBailHook(["ast", "comments"]), - /** @type {SyncBailHook<[ProgramNode, CommentNode[]], boolean | void>} */ + /** @type {SyncBailHook<[Program, Comment[]], boolean | void>} */ finish: new SyncBailHook(["ast", "comments"]) }); this.sourceType = sourceType; @@ -126961,46 +132682,51 @@ class JavascriptParser extends Parser { this.state = undefined; this.comments = undefined; this.semicolons = undefined; - /** @type {(StatementNode|ExpressionNode)[]} */ + /** @type {(Statement | ModuleDeclaration | Expression)[]} */ this.statementPath = undefined; + /** @type {Statement | ModuleDeclaration | Expression | undefined} */ this.prevStatement = undefined; + /** @type {WeakMap>} */ + this.destructuringAssignmentProperties = undefined; this.currentTagData = undefined; this._initializeEvaluating(); } _initializeEvaluating() { this.hooks.evaluate.for("Literal").tap("JavascriptParser", _expr => { - const expr = /** @type {LiteralNode} */ (_expr); + const expr = /** @type {Literal} */ (_expr); switch (typeof expr.value) { case "number": return new BasicEvaluatedExpression() .setNumber(expr.value) - .setRange(expr.range); + .setRange(/** @type {Range} */ (expr.range)); case "bigint": return new BasicEvaluatedExpression() .setBigInt(expr.value) - .setRange(expr.range); + .setRange(/** @type {Range} */ (expr.range)); case "string": return new BasicEvaluatedExpression() .setString(expr.value) - .setRange(expr.range); + .setRange(/** @type {Range} */ (expr.range)); case "boolean": return new BasicEvaluatedExpression() .setBoolean(expr.value) - .setRange(expr.range); + .setRange(/** @type {Range} */ (expr.range)); } if (expr.value === null) { - return new BasicEvaluatedExpression().setNull().setRange(expr.range); + return new BasicEvaluatedExpression() + .setNull() + .setRange(/** @type {Range} */ (expr.range)); } if (expr.value instanceof RegExp) { return new BasicEvaluatedExpression() .setRegExp(expr.value) - .setRange(expr.range); + .setRange(/** @type {Range} */ (expr.range)); } }); this.hooks.evaluate.for("NewExpression").tap("JavascriptParser", _expr => { - const expr = /** @type {NewExpressionNode} */ (_expr); + const expr = /** @type {NewExpression} */ (_expr); const callee = expr.callee; if (callee.type !== "Identifier") return; if (callee.name !== "RegExp") { @@ -127031,7 +132757,7 @@ class JavascriptParser extends Parser { } else { return new BasicEvaluatedExpression() .setRegExp(new RegExp("")) - .setRange(expr.range); + .setRange(/** @type {Range} */ (expr.range)); } const arg2 = expr.arguments[1]; @@ -127056,12 +132782,12 @@ class JavascriptParser extends Parser { return new BasicEvaluatedExpression() .setRegExp(flags ? new RegExp(regExp, flags) : new RegExp(regExp)) - .setRange(expr.range); + .setRange(/** @type {Range} */ (expr.range)); }); this.hooks.evaluate .for("LogicalExpression") .tap("JavascriptParser", _expr => { - const expr = /** @type {LogicalExpressionNode} */ (_expr); + const expr = /** @type {LogicalExpression} */ (_expr); const left = this.evaluateExpression(expr.left); let returnRight = false; @@ -127100,44 +132826,94 @@ class JavascriptParser extends Parser { } }); + /** + * In simple logical cases, we can use valueAsExpression to assist us in evaluating the expression on + * either side of a [BinaryExpression](https://github.com/estree/estree/blob/master/es5.md#binaryexpression). + * This supports scenarios in webpack like conditionally `import()`'ing modules based on some simple evaluation: + * + * ```js + * if (1 === 3) { + * import("./moduleA"); // webpack will auto evaluate this and not import the modules + * } + * ``` + * + * Additional scenarios include evaluation of strings inside of dynamic import statements: + * + * ```js + * const foo = "foo"; + * const bar = "bar"; + * + * import("./" + foo + bar); // webpack will auto evaluate this into import("./foobar") + * ``` + * @param {boolean | number | BigInt | string} value the value to convert to an expression + * @param {BinaryExpression | UnaryExpression} expr the expression being evaluated + * @param {boolean} sideEffects whether the expression has side effects + * @returns {BasicEvaluatedExpression | undefined} the evaluated expression + * @example + * + * ```js + * const binaryExpr = new BinaryExpression("+", + * { type: "Literal", value: 2 }, + * { type: "Literal", value: 3 } + * ); + * + * const leftValue = 2; + * const rightValue = 3; + * + * const leftExpr = valueAsExpression(leftValue, binaryExpr.left, false); + * const rightExpr = valueAsExpression(rightValue, binaryExpr.right, false); + * const result = new BasicEvaluatedExpression() + * .setNumber(leftExpr.number + rightExpr.number) + * .setRange(binaryExpr.range); + * + * console.log(result.number); // Output: 5 + * ``` + */ const valueAsExpression = (value, expr, sideEffects) => { switch (typeof value) { case "boolean": return new BasicEvaluatedExpression() .setBoolean(value) .setSideEffects(sideEffects) - .setRange(expr.range); + .setRange(/** @type {Range} */ (expr.range)); case "number": return new BasicEvaluatedExpression() .setNumber(value) .setSideEffects(sideEffects) - .setRange(expr.range); + .setRange(/** @type {Range} */ (expr.range)); case "bigint": return new BasicEvaluatedExpression() .setBigInt(value) .setSideEffects(sideEffects) - .setRange(expr.range); + .setRange(/** @type {Range} */ (expr.range)); case "string": return new BasicEvaluatedExpression() .setString(value) .setSideEffects(sideEffects) - .setRange(expr.range); + .setRange(/** @type {Range} */ (expr.range)); } }; this.hooks.evaluate .for("BinaryExpression") .tap("JavascriptParser", _expr => { - const expr = /** @type {BinaryExpressionNode} */ (_expr); + const expr = /** @type {BinaryExpression} */ (_expr); - const handleConstOperation = fn => { + /** + * Evaluates a binary expression if and only if it is a const operation (e.g. 1 + 2, "a" + "b", etc.). + * + * @template T + * @param {(leftOperand: T, rightOperand: T) => boolean | number | BigInt | string} operandHandler the handler for the operation (e.g. (a, b) => a + b) + * @returns {BasicEvaluatedExpression | undefined} the evaluated expression + */ + const handleConstOperation = operandHandler => { const left = this.evaluateExpression(expr.left); if (!left.isCompileTimeValue()) return; const right = this.evaluateExpression(expr.right); if (!right.isCompileTimeValue()) return; - const result = fn( + const result = operandHandler( left.asCompileTimeValue(), right.asCompileTimeValue() ); @@ -127148,6 +132924,14 @@ class JavascriptParser extends Parser { ); }; + /** + * Helper function to determine if two booleans are always different. This is used in `handleStrictEqualityComparison` + * to determine if an expressions boolean or nullish conversion is equal or not. + * + * @param {boolean} a first boolean to compare + * @param {boolean} b second boolean to compare + * @returns {boolean} true if the two booleans are always different, false otherwise + */ const isAlwaysDifferent = (a, b) => (a === true && b === false) || (a === false && b === true); @@ -127176,11 +132960,13 @@ class JavascriptParser extends Parser { const rightSuffix = getSuffix(right.parts); const lenPrefix = Math.min(leftPrefix.length, rightPrefix.length); const lenSuffix = Math.min(leftSuffix.length, rightSuffix.length); - if ( - leftPrefix.slice(0, lenPrefix) !== - rightPrefix.slice(0, lenPrefix) || - leftSuffix.slice(-lenSuffix) !== rightSuffix.slice(-lenSuffix) - ) { + const prefixMismatch = + lenPrefix > 0 && + leftPrefix.slice(0, lenPrefix) !== rightPrefix.slice(0, lenPrefix); + const suffixMismatch = + lenSuffix > 0 && + leftSuffix.slice(-lenSuffix) !== rightSuffix.slice(-lenSuffix); + if (prefixMismatch || suffixMismatch) { return res .setBoolean(!eql) .setSideEffects( @@ -127189,11 +132975,16 @@ class JavascriptParser extends Parser { } }; + /** + * Helper function to handle BinaryExpressions using strict equality comparisons (e.g. "===" and "!=="). + * @param {boolean} eql true for "===" and false for "!==" + * @returns {BasicEvaluatedExpression | undefined} the evaluated expression + */ const handleStrictEqualityComparison = eql => { const left = this.evaluateExpression(expr.left); const right = this.evaluateExpression(expr.right); const res = new BasicEvaluatedExpression(); - res.setRange(expr.range); + res.setRange(/** @type {Range} */ (expr.range)); const leftConst = left.isCompileTimeValue(); const rightConst = right.isCompileTimeValue(); @@ -127231,8 +133022,14 @@ class JavascriptParser extends Parser { (rightPrimitive === false && (rightConst || leftPrimitive === true)) || // Different nullish or boolish status also means not equal - isAlwaysDifferent(left.asBool(), right.asBool()) || - isAlwaysDifferent(left.asNullish(), right.asNullish()) + isAlwaysDifferent( + /** @type {boolean} */ (left.asBool()), + /** @type {boolean} */ (right.asBool()) + ) || + isAlwaysDifferent( + /** @type {boolean} */ (left.asNullish()), + /** @type {boolean} */ (right.asNullish()) + ) ) { return res .setBoolean(!eql) @@ -127242,6 +133039,11 @@ class JavascriptParser extends Parser { } }; + /** + * Helper function to handle BinaryExpressions using abstract equality comparisons (e.g. "==" and "!="). + * @param {boolean} eql true for "==" and false for "!=" + * @returns {BasicEvaluatedExpression | undefined} the evaluated expression + */ const handleAbstractEqualityComparison = eql => { const left = this.evaluateExpression(expr.left); const right = this.evaluateExpression(expr.right); @@ -127452,12 +133254,19 @@ class JavascriptParser extends Parser { this.hooks.evaluate .for("UnaryExpression") .tap("JavascriptParser", _expr => { - const expr = /** @type {UnaryExpressionNode} */ (_expr); + const expr = /** @type {UnaryExpression} */ (_expr); - const handleConstOperation = fn => { + /** + * Evaluates a UnaryExpression if and only if it is a basic const operator (e.g. +a, -a, ~a). + * + * @template T + * @param {(operand: T) => boolean | number | BigInt | string} operandHandler handler for the operand + * @returns {BasicEvaluatedExpression | undefined} evaluated expression + */ + const handleConstOperation = operandHandler => { const argument = this.evaluateExpression(expr.argument); if (!argument.isCompileTimeValue()) return; - const result = fn(argument.asCompileTimeValue()); + const result = operandHandler(argument.asCompileTimeValue()); return valueAsExpression( result, expr, @@ -127575,7 +133384,7 @@ class JavascriptParser extends Parser { .setRange(expr.range); }); this.hooks.evaluate.for("Identifier").tap("JavascriptParser", expr => { - if (/** @type {IdentifierNode} */ (expr).name === "undefined") { + if (/** @type {Identifier} */ (expr).name === "undefined") { return new BasicEvaluatedExpression() .setUndefined() .setRange(expr.range); @@ -127583,16 +133392,16 @@ class JavascriptParser extends Parser { }); /** * @param {string} exprType expression type name - * @param {function(ExpressionNode): GetInfoResult | undefined} getInfo get info + * @param {function(Expression): GetInfoResult | undefined} getInfo get info * @returns {void} */ const tapEvaluateWithVariableInfo = (exprType, getInfo) => { - /** @type {ExpressionNode | undefined} */ + /** @type {Expression | undefined} */ let cachedExpression = undefined; /** @type {GetInfoResult | undefined} */ let cachedInfo = undefined; this.hooks.evaluate.for(exprType).tap("JavascriptParser", expr => { - const expression = /** @type {MemberExpressionNode} */ (expr); + const expression = /** @type {MemberExpression} */ (expr); const info = getInfo(expr); if (info !== undefined) { @@ -127623,7 +133432,8 @@ class JavascriptParser extends Parser { info.name, info.rootInfo, info.getMembers, - info.getMembersOptionals + info.getMembersOptionals, + info.getMemberRanges ) .setRange(expr.range); } @@ -127634,9 +133444,7 @@ class JavascriptParser extends Parser { }); }; tapEvaluateWithVariableInfo("Identifier", expr => { - const info = this.getVariableInfo( - /** @type {IdentifierNode} */ (expr).name - ); + const info = this.getVariableInfo(/** @type {Identifier} */ (expr).name); if ( typeof info === "string" || (info instanceof VariableInfo && typeof info.freeName === "string") @@ -127645,7 +133453,8 @@ class JavascriptParser extends Parser { name: info, rootInfo: info, getMembers: () => [], - getMembersOptionals: () => [] + getMembersOptionals: () => [], + getMemberRanges: () => [] }; } }); @@ -127659,12 +133468,13 @@ class JavascriptParser extends Parser { name: info, rootInfo: info, getMembers: () => [], - getMembersOptionals: () => [] + getMembersOptionals: () => [], + getMemberRanges: () => [] }; } }); this.hooks.evaluate.for("MetaProperty").tap("JavascriptParser", expr => { - const metaProperty = /** @type {MetaPropertyNode} */ (expr); + const metaProperty = /** @type {MetaProperty} */ (expr); return this.callHooksForName( this.hooks.evaluateIdentifier, @@ -127674,13 +133484,13 @@ class JavascriptParser extends Parser { }); tapEvaluateWithVariableInfo("MemberExpression", expr => this.getMemberExpressionInfo( - /** @type {MemberExpressionNode} */ (expr), + /** @type {MemberExpression} */ (expr), ALLOWED_MEMBER_TYPES_EXPRESSION ) ); this.hooks.evaluate.for("CallExpression").tap("JavascriptParser", _expr => { - const expr = /** @type {CallExpressionNode} */ (_expr); + const expr = /** @type {CallExpression} */ (_expr); if ( expr.callee.type === "MemberExpression" && expr.callee.property.type === @@ -127688,7 +133498,7 @@ class JavascriptParser extends Parser { ) { // type Super also possible here const param = this.evaluateExpression( - /** @type {ExpressionNode} */ (expr.callee.object) + /** @type {Expression} */ (expr.callee.object) ); const property = expr.callee.property.type === "Literal" @@ -127786,7 +133596,7 @@ class JavascriptParser extends Parser { /** * @param {"cooked" | "raw"} kind kind of values to get - * @param {TemplateLiteralNode} templateLiteralExpr TemplateLiteral expr + * @param {TemplateLiteral} templateLiteralExpr TemplateLiteral expr * @returns {{quasis: BasicEvaluatedExpression[], parts: BasicEvaluatedExpression[]}} Simplified template */ const getSimplifiedTemplateResult = (kind, templateLiteralExpr) => { @@ -127823,7 +133633,7 @@ class JavascriptParser extends Parser { const part = new BasicEvaluatedExpression() .setString(quasi) - .setRange(quasiExpr.range) + .setRange(/** @type {Range} */ (quasiExpr.range)) .setExpression(quasiExpr); quasis.push(part); parts.push(part); @@ -127837,20 +133647,20 @@ class JavascriptParser extends Parser { this.hooks.evaluate .for("TemplateLiteral") .tap("JavascriptParser", _node => { - const node = /** @type {TemplateLiteralNode} */ (_node); + const node = /** @type {TemplateLiteral} */ (_node); const { quasis, parts } = getSimplifiedTemplateResult("cooked", node); if (parts.length === 1) { - return parts[0].setRange(node.range); + return parts[0].setRange(/** @type {Range} */ (node.range)); } return new BasicEvaluatedExpression() .setTemplateString(quasis, parts, "cooked") - .setRange(node.range); + .setRange(/** @type {Range} */ (node.range)); }); this.hooks.evaluate .for("TaggedTemplateExpression") .tap("JavascriptParser", _node => { - const node = /** @type {TaggedTemplateExpressionNode} */ (_node); + const node = /** @type {TaggedTemplateExpression} */ (_node); const tag = this.evaluateExpression(node.tag); if (tag.isIdentifier() && tag.identifier === "String.raw") { @@ -127860,7 +133670,7 @@ class JavascriptParser extends Parser { ); return new BasicEvaluatedExpression() .setTemplateString(quasis, parts, "raw") - .setRange(node.range); + .setRange(/** @type {Range} */ (node.range)); } }); @@ -127890,10 +133700,10 @@ class JavascriptParser extends Parser { : "" + argExpr.number; const newString = value + (stringSuffix ? stringSuffix.string : ""); - const newRange = [ + const newRange = /** @type {Range} */ ([ argExpr.range[0], (stringSuffix || argExpr).range[1] - ]; + ]); stringSuffix = new BasicEvaluatedExpression() .setString(newString) .setSideEffects( @@ -127950,12 +133760,12 @@ class JavascriptParser extends Parser { return new BasicEvaluatedExpression() .setArray(result) .setSideEffects(param.couldHaveSideEffects()) - .setRange(expr.range); + .setRange(/** @type {Range} */ (expr.range)); }); this.hooks.evaluate .for("ConditionalExpression") .tap("JavascriptParser", _expr => { - const expr = /** @type {ConditionalExpressionNode} */ (_expr); + const expr = /** @type {ConditionalExpression} */ (_expr); const condition = this.evaluateExpression(expr.test); const conditionValue = condition.asBool(); @@ -127965,12 +133775,16 @@ class JavascriptParser extends Parser { const alternate = this.evaluateExpression(expr.alternate); res = new BasicEvaluatedExpression(); if (consequent.isConditional()) { - res.setOptions(consequent.options); + res.setOptions( + /** @type {BasicEvaluatedExpression[]} */ (consequent.options) + ); } else { res.setOptions([consequent]); } if (alternate.isConditional()) { - res.addOptions(alternate.options); + res.addOptions( + /** @type {BasicEvaluatedExpression[]} */ (alternate.options) + ); } else { res.addOptions([alternate]); } @@ -127980,13 +133794,13 @@ class JavascriptParser extends Parser { ); if (condition.couldHaveSideEffects()) res.setSideEffects(); } - res.setRange(expr.range); + res.setRange(/** @type {Range} */ (expr.range)); return res; }); this.hooks.evaluate .for("ArrayExpression") .tap("JavascriptParser", _expr => { - const expr = /** @type {ArrayExpressionNode} */ (_expr); + const expr = /** @type {ArrayExpression} */ (_expr); const items = expr.elements.map(element => { return ( @@ -127998,15 +133812,15 @@ class JavascriptParser extends Parser { if (!items.every(Boolean)) return; return new BasicEvaluatedExpression() .setItems(items) - .setRange(expr.range); + .setRange(/** @type {Range} */ (expr.range)); }); this.hooks.evaluate .for("ChainExpression") .tap("JavascriptParser", _expr => { - const expr = /** @type {ChainExpressionNode} */ (_expr); - /** @type {ExpressionNode[]} */ + const expr = /** @type {ChainExpression} */ (_expr); + /** @type {Expression[]} */ const optionalExpressionsStack = []; - /** @type {ExpressionNode|SuperNode} */ + /** @type {Expression|Super} */ let next = expr.expression; while ( @@ -128017,7 +133831,7 @@ class JavascriptParser extends Parser { if (next.optional) { // SuperNode can not be optional optionalExpressionsStack.push( - /** @type {ExpressionNode} */ (next.object) + /** @type {Expression} */ (next.object) ); } next = next.object; @@ -128025,7 +133839,7 @@ class JavascriptParser extends Parser { if (next.optional) { // SuperNode can not be optional optionalExpressionsStack.push( - /** @type {ExpressionNode} */ (next.callee) + /** @type {Expression} */ (next.callee) ); } next = next.callee; @@ -128033,17 +133847,32 @@ class JavascriptParser extends Parser { } while (optionalExpressionsStack.length > 0) { - const expression = optionalExpressionsStack.pop(); + const expression = + /** @type {Expression} */ + (optionalExpressionsStack.pop()); const evaluated = this.evaluateExpression(expression); if (evaluated.asNullish()) { - return evaluated.setRange(_expr.range); + return evaluated.setRange(/** @type {Range} */ (_expr.range)); } } return this.evaluateExpression(expr.expression); }); } + /** + * @param {Expression} node node + * @returns {Set|undefined} destructured identifiers + */ + destructuringAssignmentPropertiesFor(node) { + if (!this.destructuringAssignmentProperties) return undefined; + return this.destructuringAssignmentProperties.get(node); + } + + /** + * @param {Expression} expr expression + * @returns {string | VariableInfoInterface | undefined} identifier + */ getRenameIdentifier(expr) { const result = this.evaluateExpression(expr); if (result.isIdentifier()) { @@ -128052,7 +133881,7 @@ class JavascriptParser extends Parser { } /** - * @param {ClassExpressionNode | ClassDeclarationNode} classy a class node + * @param {ClassExpression | ClassDeclaration} classy a class node * @returns {void} */ walkClass(classy) { @@ -128062,36 +133891,47 @@ class JavascriptParser extends Parser { } } if (classy.body && classy.body.type === "ClassBody") { - for (const classElement of /** @type {TODO} */ (classy.body.body)) { - if (!this.hooks.classBodyElement.call(classElement, classy)) { - if (classElement.computed && classElement.key) { - this.walkExpression(classElement.key); - } - if (classElement.value) { - if ( - !this.hooks.classBodyValue.call( - classElement.value, - classElement, - classy - ) - ) { + const scopeParams = []; + // Add class name in scope for recursive calls + if (classy.id) { + scopeParams.push(classy.id); + } + this.inClassScope(true, scopeParams, () => { + for (const classElement of /** @type {TODO} */ (classy.body.body)) { + if (!this.hooks.classBodyElement.call(classElement, classy)) { + if (classElement.computed && classElement.key) { + this.walkExpression(classElement.key); + } + if (classElement.value) { + if ( + !this.hooks.classBodyValue.call( + classElement.value, + classElement, + classy + ) + ) { + const wasTopLevel = this.scope.topLevelScope; + this.scope.topLevelScope = false; + this.walkExpression(classElement.value); + this.scope.topLevelScope = wasTopLevel; + } + } else if (classElement.type === "StaticBlock") { const wasTopLevel = this.scope.topLevelScope; this.scope.topLevelScope = false; - this.walkExpression(classElement.value); + this.walkBlockStatement(classElement); this.scope.topLevelScope = wasTopLevel; } - } else if (classElement.type === "StaticBlock") { - const wasTopLevel = this.scope.topLevelScope; - this.scope.topLevelScope = false; - this.walkBlockStatement(classElement); - this.scope.topLevelScope = wasTopLevel; } } - } + }); } } - // Pre walking iterates the scope for variable declarations + /** + * Pre walking iterates the scope for variable declarations + * + * @param {(Statement | ModuleDeclaration)[]} statements statements + */ preWalkStatements(statements) { for (let index = 0, len = statements.length; index < len; index++) { const statement = statements[index]; @@ -128099,7 +133939,11 @@ class JavascriptParser extends Parser { } } - // Block pre walking iterates the scope for block variable declarations + /** + * Block pre walking iterates the scope for block variable declarations + * + * @param {(Statement | ModuleDeclaration)[]} statements statements + */ blockPreWalkStatements(statements) { for (let index = 0, len = statements.length; index < len; index++) { const statement = statements[index]; @@ -128107,7 +133951,11 @@ class JavascriptParser extends Parser { } } - // Walking iterates the statements and expressions and processes them + /** + * Walking iterates the statements and expressions and processes them + * + * @param {(Statement | ModuleDeclaration)[]} statements statements + */ walkStatements(statements) { for (let index = 0, len = statements.length; index < len; index++) { const statement = statements[index]; @@ -128115,6 +133963,11 @@ class JavascriptParser extends Parser { } } + /** + * Walking iterates the statements and expressions and processes them + * + * @param {Statement | ModuleDeclaration} statement statement + */ preWalkStatement(statement) { this.statementPath.push(statement); if (this.hooks.preStatement.call(statement)) { @@ -128165,6 +134018,9 @@ class JavascriptParser extends Parser { this.prevStatement = this.statementPath.pop(); } + /** + * @param {Statement | ModuleDeclaration} statement statement + */ blockPreWalkStatement(statement) { this.statementPath.push(statement); if (this.hooks.blockPreStatement.call(statement)) { @@ -128190,10 +134046,15 @@ class JavascriptParser extends Parser { case "ClassDeclaration": this.blockPreWalkClassDeclaration(statement); break; + case "ExpressionStatement": + this.blockPreWalkExpressionStatement(statement); } this.prevStatement = this.statementPath.pop(); } + /** + * @param {Statement | ModuleDeclaration} statement statement + */ walkStatement(statement) { this.statementPath.push(statement); if (this.hooks.statement.call(statement) !== undefined) { @@ -128266,8 +134127,8 @@ class JavascriptParser extends Parser { * Walks a statements that is nested within a parent statement * and can potentially be a non-block statement. * This enforces the nested statement to never be in ASI position. - * @param {StatementNode} statement the nested statement - * @returns {void} + * + * @param {Statement} statement the nested statement */ walkNestedStatement(statement) { this.prevStatement = undefined; @@ -128275,10 +134136,16 @@ class JavascriptParser extends Parser { } // Real Statements + /** + * @param {BlockStatement} statement block statement + */ preWalkBlockStatement(statement) { this.preWalkStatements(statement.body); } + /** + * @param {BlockStatement} statement block statement + */ walkBlockStatement(statement) { this.inBlockScope(() => { const body = statement.body; @@ -128289,10 +134156,16 @@ class JavascriptParser extends Parser { }); } + /** + * @param {ExpressionStatement} statement expression statement + */ walkExpressionStatement(statement) { this.walkExpression(statement.expression); } + /** + * @param {IfStatement} statement if statement + */ preWalkIfStatement(statement) { this.preWalkStatement(statement.consequent); if (statement.alternate) { @@ -128300,6 +134173,9 @@ class JavascriptParser extends Parser { } } + /** + * @param {IfStatement} statement if statement + */ walkIfStatement(statement) { const result = this.hooks.statementIf.call(statement); if (result === undefined) { @@ -128317,10 +134193,16 @@ class JavascriptParser extends Parser { } } + /** + * @param {LabeledStatement} statement with statement + */ preWalkLabeledStatement(statement) { this.preWalkStatement(statement.body); } + /** + * @param {LabeledStatement} statement with statement + */ walkLabeledStatement(statement) { const hook = this.hooks.label.get(statement.label.name); if (hook !== undefined) { @@ -128330,42 +134212,69 @@ class JavascriptParser extends Parser { this.walkNestedStatement(statement.body); } + /** + * @param {WithStatement} statement with statement + */ preWalkWithStatement(statement) { this.preWalkStatement(statement.body); } + /** + * @param {WithStatement} statement with statement + */ walkWithStatement(statement) { this.walkExpression(statement.object); this.walkNestedStatement(statement.body); } + /** + * @param {SwitchStatement} statement switch statement + */ preWalkSwitchStatement(statement) { this.preWalkSwitchCases(statement.cases); } + /** + * @param {SwitchStatement} statement switch statement + */ walkSwitchStatement(statement) { this.walkExpression(statement.discriminant); this.walkSwitchCases(statement.cases); } + /** + * @param {ReturnStatement | ThrowStatement} statement return or throw statement + */ walkTerminatingStatement(statement) { if (statement.argument) this.walkExpression(statement.argument); } + /** + * @param {ReturnStatement} statement return statement + */ walkReturnStatement(statement) { this.walkTerminatingStatement(statement); } + /** + * @param {ThrowStatement} statement return statement + */ walkThrowStatement(statement) { this.walkTerminatingStatement(statement); } + /** + * @param {TryStatement} statement try statement + */ preWalkTryStatement(statement) { this.preWalkStatement(statement.block); if (statement.handler) this.preWalkCatchClause(statement.handler); - if (statement.finializer) this.preWalkStatement(statement.finializer); + if (statement.finalizer) this.preWalkStatement(statement.finalizer); } + /** + * @param {TryStatement} statement try statement + */ walkTryStatement(statement) { if (this.scope.inTry) { this.walkStatement(statement.block); @@ -128378,24 +134287,39 @@ class JavascriptParser extends Parser { if (statement.finalizer) this.walkStatement(statement.finalizer); } + /** + * @param {WhileStatement} statement while statement + */ preWalkWhileStatement(statement) { this.preWalkStatement(statement.body); } + /** + * @param {WhileStatement} statement while statement + */ walkWhileStatement(statement) { this.walkExpression(statement.test); this.walkNestedStatement(statement.body); } + /** + * @param {DoWhileStatement} statement do while statement + */ preWalkDoWhileStatement(statement) { this.preWalkStatement(statement.body); } + /** + * @param {DoWhileStatement} statement do while statement + */ walkDoWhileStatement(statement) { this.walkNestedStatement(statement.body); this.walkExpression(statement.test); } + /** + * @param {ForStatement} statement for statement + */ preWalkForStatement(statement) { if (statement.init) { if (statement.init.type === "VariableDeclaration") { @@ -128405,6 +134329,9 @@ class JavascriptParser extends Parser { this.preWalkStatement(statement.body); } + /** + * @param {ForStatement} statement for statement + */ walkForStatement(statement) { this.inBlockScope(() => { if (statement.init) { @@ -128435,6 +134362,9 @@ class JavascriptParser extends Parser { }); } + /** + * @param {ForInStatement} statement for statement + */ preWalkForInStatement(statement) { if (statement.left.type === "VariableDeclaration") { this.preWalkVariableDeclaration(statement.left); @@ -128442,6 +134372,9 @@ class JavascriptParser extends Parser { this.preWalkStatement(statement.body); } + /** + * @param {ForInStatement} statement for statement + */ walkForInStatement(statement) { this.inBlockScope(() => { if (statement.left.type === "VariableDeclaration") { @@ -128474,6 +134407,9 @@ class JavascriptParser extends Parser { this.preWalkStatement(statement.body); } + /** + * @param {ForOfStatement} statement for statement + */ walkForOfStatement(statement) { this.inBlockScope(() => { if (statement.left.type === "VariableDeclaration") { @@ -128496,13 +134432,18 @@ class JavascriptParser extends Parser { }); } - // Declarations + /** + * @param {FunctionDeclaration} statement function declaration + */ preWalkFunctionDeclaration(statement) { if (statement.id) { this.defineVariable(statement.id.name); } } + /** + * @param {FunctionDeclaration} statement function declaration + */ walkFunctionDeclaration(statement) { const wasTopLevel = this.scope.topLevelScope; this.scope.topLevelScope = false; @@ -128523,6 +134464,48 @@ class JavascriptParser extends Parser { this.scope.topLevelScope = wasTopLevel; } + /** + * @param {ExpressionStatement} statement expression statement + */ + blockPreWalkExpressionStatement(statement) { + const expression = statement.expression; + switch (expression.type) { + case "AssignmentExpression": + this.preWalkAssignmentExpression(expression); + } + } + + /** + * @param {AssignmentExpression} expression assignment expression + */ + preWalkAssignmentExpression(expression) { + if ( + expression.left.type !== "ObjectPattern" || + !this.destructuringAssignmentProperties + ) + return; + const keys = this._preWalkObjectPattern(expression.left); + if (!keys) return; + + // check multiple assignments + if (this.destructuringAssignmentProperties.has(expression)) { + const set = this.destructuringAssignmentProperties.get(expression); + this.destructuringAssignmentProperties.delete(expression); + for (const id of set) keys.add(id); + } + + this.destructuringAssignmentProperties.set( + expression.right.type === "AwaitExpression" + ? expression.right.argument + : expression.right, + keys + ); + + if (expression.right.type === "AssignmentExpression") { + this.preWalkAssignmentExpression(expression.right); + } + } + blockPreWalkImportDeclaration(statement) { const source = statement.source.value; this.hooks.import.call(statement, source); @@ -128635,6 +134618,9 @@ class JavascriptParser extends Parser { } } + /** + * @param {ExportNamedDeclaration} statement the statement + */ walkExportNamedDeclaration(statement) { if (statement.declaration) { this.walkStatement(statement.declaration); @@ -128702,11 +134688,17 @@ class JavascriptParser extends Parser { this.hooks.exportImportSpecifier.call(statement, source, null, name, 0); } + /** + * @param {VariableDeclaration} statement variable declaration + */ preWalkVariableDeclaration(statement) { if (statement.kind !== "var") return; this._preWalkVariableDeclaration(statement, this.hooks.varDeclarationVar); } + /** + * @param {VariableDeclaration} statement variable declaration + */ blockPreWalkVariableDeclaration(statement) { if (statement.kind === "var") return; const hookMap = @@ -128716,10 +134708,15 @@ class JavascriptParser extends Parser { this._preWalkVariableDeclaration(statement, hookMap); } + /** + * @param {VariableDeclaration} statement variable declaration + * @param {TODO} hookMap map of hooks + */ _preWalkVariableDeclaration(statement, hookMap) { for (const declarator of statement.declarations) { switch (declarator.type) { case "VariableDeclarator": { + this.preWalkVariableDeclarator(declarator); if (!this.hooks.preDeclarator.call(declarator, statement)) { this.enterPattern(declarator.id, (name, decl) => { let hook = hookMap.get(name); @@ -128737,6 +134734,62 @@ class JavascriptParser extends Parser { } } + /** + * @param {ObjectPattern} objectPattern object pattern + * @returns {Set | undefined} set of names or undefined if not all keys are identifiers + */ + _preWalkObjectPattern(objectPattern) { + const ids = new Set(); + const properties = objectPattern.properties; + for (let i = 0; i < properties.length; i++) { + const property = properties[i]; + if (property.type !== "Property") return; + const key = property.key; + if (key.type === "Identifier") { + ids.add(key.name); + } else { + const id = this.evaluateExpression(key); + const str = id.asString(); + if (str) { + ids.add(str); + } else { + // could not evaluate key + return; + } + } + } + + return ids; + } + + /** + * @param {VariableDeclarator} declarator variable declarator + */ + preWalkVariableDeclarator(declarator) { + if ( + !declarator.init || + declarator.id.type !== "ObjectPattern" || + !this.destructuringAssignmentProperties + ) + return; + const keys = this._preWalkObjectPattern(declarator.id); + + if (!keys) return; + this.destructuringAssignmentProperties.set( + declarator.init.type === "AwaitExpression" + ? declarator.init.argument + : declarator.init, + keys + ); + + if (declarator.init.type === "AssignmentExpression") { + this.preWalkAssignmentExpression(declarator.init); + } + } + + /** + * @param {VariableDeclaration} statement variable declaration + */ walkVariableDeclaration(statement) { for (const declarator of statement.declarations) { switch (declarator.type) { @@ -128764,16 +134817,25 @@ class JavascriptParser extends Parser { } } + /** + * @param {ClassDeclaration} statement class declaration + */ blockPreWalkClassDeclaration(statement) { if (statement.id) { this.defineVariable(statement.id.name); } } + /** + * @param {ClassDeclaration} statement class declaration + */ walkClassDeclaration(statement) { this.walkClass(statement); } + /** + * @param {SwitchCase[]} switchCases switch statement + */ preWalkSwitchCases(switchCases) { for (let index = 0, len = switchCases.length; index < len; index++) { const switchCase = switchCases[index]; @@ -128781,6 +134843,9 @@ class JavascriptParser extends Parser { } } + /** + * @param {SwitchCase[]} switchCases switch statement + */ walkSwitchCases(switchCases) { this.inBlockScope(() => { const len = switchCases.length; @@ -128816,10 +134881,16 @@ class JavascriptParser extends Parser { }); } + /** + * @param {CatchClause} catchClause catch clause + */ preWalkCatchClause(catchClause) { this.preWalkStatement(catchClause.body); } + /** + * @param {CatchClause} catchClause catch clause + */ walkCatchClause(catchClause) { this.inBlockScope(() => { // Error binding is optional in catch clause since ECMAScript 2019 @@ -128836,6 +134907,9 @@ class JavascriptParser extends Parser { }); } + /** + * @param {Pattern} pattern pattern + */ walkPattern(pattern) { switch (pattern.type) { case "ArrayPattern": @@ -128856,6 +134930,9 @@ class JavascriptParser extends Parser { } } + /** + * @param {AssignmentPattern} pattern assignment pattern + */ walkAssignmentPattern(pattern) { this.walkExpression(pattern.right); this.walkPattern(pattern.left); @@ -128871,6 +134948,9 @@ class JavascriptParser extends Parser { } } + /** + * @param {ArrayPattern} pattern array pattern + */ walkArrayPattern(pattern) { for (let i = 0, len = pattern.elements.length; i < len; i++) { const element = pattern.elements[i]; @@ -128878,10 +134958,16 @@ class JavascriptParser extends Parser { } } + /** + * @param {RestElement} pattern rest element + */ walkRestElement(pattern) { this.walkPattern(pattern.argument); } + /** + * @param {(Expression | SpreadElement | null)[]} expressions expressions + */ walkExpressions(expressions) { for (const expression of expressions) { if (expression) { @@ -128890,6 +134976,9 @@ class JavascriptParser extends Parser { } } + /** + * @param {TODO} expression expression + */ walkExpression(expression) { switch (expression.type) { case "ArrayExpression": @@ -128970,24 +135059,36 @@ class JavascriptParser extends Parser { } } + /** + * @param {AwaitExpression} expression await expression + */ walkAwaitExpression(expression) { if (this.scope.topLevelScope === true) this.hooks.topLevelAwait.call(expression); this.walkExpression(expression.argument); } + /** + * @param {ArrayExpression} expression array expression + */ walkArrayExpression(expression) { if (expression.elements) { this.walkExpressions(expression.elements); } } + /** + * @param {SpreadElement} expression spread element + */ walkSpreadElement(expression) { if (expression.argument) { this.walkExpression(expression.argument); } } + /** + * @param {ObjectExpression} expression object expression + */ walkObjectExpression(expression) { for ( let propIndex = 0, len = expression.properties.length; @@ -128999,6 +135100,9 @@ class JavascriptParser extends Parser { } } + /** + * @param {Property | SpreadElement} prop property or spread element + */ walkProperty(prop) { if (prop.type === "SpreadElement") { this.walkExpression(prop.argument); @@ -129016,14 +135120,17 @@ class JavascriptParser extends Parser { } } + /** + * @param {FunctionExpression} expression arrow function expression + */ walkFunctionExpression(expression) { const wasTopLevel = this.scope.topLevelScope; this.scope.topLevelScope = false; - const scopeParams = expression.params; + const scopeParams = [...expression.params]; // Add function name in scope for recursive calls if (expression.id) { - scopeParams.push(expression.id.name); + scopeParams.push(expression.id); } this.inFunctionScope(true, scopeParams, () => { @@ -129043,6 +135150,9 @@ class JavascriptParser extends Parser { this.scope.topLevelScope = wasTopLevel; } + /** + * @param {ArrowFunctionExpression} expression arrow function expression + */ walkArrowFunctionExpression(expression) { const wasTopLevel = this.scope.topLevelScope; this.scope.topLevelScope = wasTopLevel ? "arrow" : false; @@ -129064,7 +135174,7 @@ class JavascriptParser extends Parser { } /** - * @param {SequenceExpressionNode} expression the sequence + * @param {SequenceExpression} expression the sequence */ walkSequenceExpression(expression) { if (!expression.expressions) return; @@ -129088,10 +135198,16 @@ class JavascriptParser extends Parser { } } + /** + * @param {UpdateExpression} expression the update expression + */ walkUpdateExpression(expression) { this.walkExpression(expression.argument); } + /** + * @param {UnaryExpression} expression the unary expression + */ walkUnaryExpression(expression) { if (expression.operator === "typeof") { const result = this.callHooksForExpression( @@ -129112,17 +135228,26 @@ class JavascriptParser extends Parser { this.walkExpression(expression.argument); } + /** + * @param {LogicalExpression | BinaryExpression} expression the expression + */ walkLeftRightExpression(expression) { this.walkExpression(expression.left); this.walkExpression(expression.right); } + /** + * @param {BinaryExpression} expression the binary expression + */ walkBinaryExpression(expression) { if (this.hooks.binaryExpression.call(expression) === undefined) { this.walkLeftRightExpression(expression); } } + /** + * @param {LogicalExpression} expression the logical expression + */ walkLogicalExpression(expression) { const result = this.hooks.expressionLogicalOperator.call(expression); if (result === undefined) { @@ -129134,6 +135259,9 @@ class JavascriptParser extends Parser { } } + /** + * @param {AssignmentExpression} expression assignment expression + */ walkAssignmentExpression(expression) { if (expression.left.type === "Identifier") { const renameIdentifier = this.getRenameIdentifier(expression.right); @@ -129204,6 +135332,9 @@ class JavascriptParser extends Parser { } } + /** + * @param {ConditionalExpression} expression conditional expression + */ walkConditionalExpression(expression) { const result = this.hooks.expressionConditionalOperator.call(expression); if (result === undefined) { @@ -129221,6 +135352,9 @@ class JavascriptParser extends Parser { } } + /** + * @param {NewExpression} expression new expression + */ walkNewExpression(expression) { const result = this.callHooksForExpression( this.hooks.new, @@ -129234,33 +135368,47 @@ class JavascriptParser extends Parser { } } + /** + * @param {YieldExpression} expression yield expression + */ walkYieldExpression(expression) { if (expression.argument) { this.walkExpression(expression.argument); } } + /** + * @param {TemplateLiteral} expression template literal + */ walkTemplateLiteral(expression) { if (expression.expressions) { this.walkExpressions(expression.expressions); } } + /** + * @param {TaggedTemplateExpression} expression tagged template expression + */ walkTaggedTemplateExpression(expression) { if (expression.tag) { + this.scope.inTaggedTemplateTag = true; this.walkExpression(expression.tag); + this.scope.inTaggedTemplateTag = false; } if (expression.quasi && expression.quasi.expressions) { this.walkExpressions(expression.quasi.expressions); } } + /** + * @param {ClassExpression} expression the class expression + */ walkClassExpression(expression) { this.walkClass(expression); } /** - * @param {ChainExpressionNode} expression expression + * @param {ChainExpression} expression expression */ walkChainExpression(expression) { const result = this.hooks.optionalChaining.call(expression); @@ -129338,6 +135486,9 @@ class JavascriptParser extends Parser { this.scope.topLevelScope = wasTopLevel; } + /** + * @param {ImportExpression} expression import expression + */ walkImportExpression(expression) { let result = this.hooks.importCall.call(expression); if (result === true) return; @@ -129397,7 +135548,8 @@ class JavascriptParser extends Parser { callee.getMembers(), callee.getMembersOptionals ? callee.getMembersOptionals() - : callee.getMembers().map(() => false) + : callee.getMembers().map(() => false), + callee.getMemberRanges ? callee.getMemberRanges() : [] ); if (result1 === true) return; const result2 = this.callHooksForInfo( @@ -129422,6 +135574,9 @@ class JavascriptParser extends Parser { } } + /** + * @param {MemberExpression} expression member expression + */ walkMemberExpression(expression) { const exprInfo = this.getMemberExpressionInfo( expression, @@ -129438,12 +135593,14 @@ class JavascriptParser extends Parser { if (result1 === true) return; const members = exprInfo.getMembers(); const membersOptionals = exprInfo.getMembersOptionals(); + const memberRanges = exprInfo.getMemberRanges(); const result2 = this.callHooksForInfo( this.hooks.expressionMemberChain, exprInfo.rootInfo, expression, members, - membersOptionals + membersOptionals, + memberRanges ); if (result2 === true) return; this.walkMemberExpressionWithExpressionName( @@ -129515,16 +135672,22 @@ class JavascriptParser extends Parser { if (expression.computed === true) this.walkExpression(expression.property); } + /** + * @param {ThisExpression} expression this expression + */ walkThisExpression(expression) { this.callHooksForName(this.hooks.expression, "this", expression); } + /** + * @param {Identifier} expression identifier + */ walkIdentifier(expression) { this.callHooksForName(this.hooks.expression, expression.name, expression); } /** - * @param {MetaPropertyNode} metaProperty meta property + * @param {MetaProperty} metaProperty meta property */ walkMetaProperty(metaProperty) { this.hooks.expression.for(getRootName(metaProperty)).call(metaProperty); @@ -129544,11 +135707,11 @@ class JavascriptParser extends Parser { * @template T * @template R * @param {HookMap>} hookMap hooks the should be called - * @param {MemberExpressionNode} expr expression info - * @param {function(string, string | ScopeInfo | VariableInfo, function(): string[]): any} fallback callback when variable in not handled by hooks - * @param {function(string): any} defined callback when variable is defined + * @param {MemberExpression} expr expression info + * @param {(function(string, string | ScopeInfo | VariableInfo, function(): string[]): any) | undefined} fallback callback when variable in not handled by hooks + * @param {(function(string): any) | undefined} defined callback when variable is defined * @param {AsArray} args args for the hook - * @returns {R} result of hook + * @returns {R | undefined} result of hook */ callHooksForExpressionWithFallback( hookMap, @@ -129580,7 +135743,7 @@ class JavascriptParser extends Parser { * @param {HookMap>} hookMap hooks the should be called * @param {string} name key in map * @param {AsArray} args args for the hook - * @returns {R} result of hook + * @returns {R | undefined} result of hook */ callHooksForName(hookMap, name, ...args) { return this.callHooksForNameWithFallback( @@ -129598,7 +135761,7 @@ class JavascriptParser extends Parser { * @param {HookMap>} hookMap hooks that should be called * @param {ExportedVariableInfo} info variable info * @param {AsArray} args args for the hook - * @returns {R} result of hook + * @returns {R | undefined} result of hook */ callHooksForInfo(hookMap, info, ...args) { return this.callHooksForInfoWithFallback( @@ -129615,10 +135778,10 @@ class JavascriptParser extends Parser { * @template R * @param {HookMap>} hookMap hooks the should be called * @param {ExportedVariableInfo} info variable info - * @param {function(string): any} fallback callback when variable in not handled by hooks - * @param {function(): any} defined callback when variable is defined + * @param {(function(string): any) | undefined} fallback callback when variable in not handled by hooks + * @param {(function(): any) | undefined} defined callback when variable is defined * @param {AsArray} args args for the hook - * @returns {R} result of hook + * @returns {R | undefined} result of hook */ callHooksForInfoWithFallback(hookMap, info, fallback, defined, ...args) { let name; @@ -129665,10 +135828,10 @@ class JavascriptParser extends Parser { * @template R * @param {HookMap>} hookMap hooks the should be called * @param {string} name key in map - * @param {function(string): any} fallback callback when variable in not handled by hooks - * @param {function(): any} defined callback when variable is defined + * @param {(function(string): any) | undefined} fallback callback when variable in not handled by hooks + * @param {(function(): any) | undefined} defined callback when variable is defined * @param {AsArray} args args for the hook - * @returns {R} result of hook + * @returns {R | undefined} result of hook */ callHooksForNameWithFallback(hookMap, name, fallback, defined, ...args) { return this.callHooksForInfoWithFallback( @@ -129692,6 +135855,7 @@ class JavascriptParser extends Parser { topLevelScope: oldScope.topLevelScope, inTry: false, inShorthand: false, + inTaggedTemplateTag: false, isStrict: oldScope.isStrict, isAsmJs: oldScope.isAsmJs, definitions: oldScope.definitions.createChild() @@ -129708,12 +135872,50 @@ class JavascriptParser extends Parser { this.scope = oldScope; } + /** + * @param {boolean} hasThis true, when this is defined + * @param {any} params scope params + * @param {function(): void} fn inner function + * @returns {void} + */ + inClassScope(hasThis, params, fn) { + const oldScope = this.scope; + this.scope = { + topLevelScope: oldScope.topLevelScope, + inTry: false, + inShorthand: false, + inTaggedTemplateTag: false, + isStrict: oldScope.isStrict, + isAsmJs: oldScope.isAsmJs, + definitions: oldScope.definitions.createChild() + }; + + if (hasThis) { + this.undefineVariable("this"); + } + + this.enterPatterns(params, (ident, pattern) => { + this.defineVariable(ident); + }); + + fn(); + + this.scope = oldScope; + } + + /** + * @param {boolean} hasThis true, when this is defined + * @param {any} params scope params + * @param {function(): void} fn inner function + * @returns {void} + */ inFunctionScope(hasThis, params, fn) { const oldScope = this.scope; this.scope = { topLevelScope: oldScope.topLevelScope, inTry: false, inShorthand: false, + inTaggedTemplateTag: false, isStrict: oldScope.isStrict, isAsmJs: oldScope.isAsmJs, definitions: oldScope.definitions.createChild() @@ -129732,12 +135934,17 @@ class JavascriptParser extends Parser { this.scope = oldScope; } + /** + * @param {function(): void} fn inner function + * @returns {void} + */ inBlockScope(fn) { const oldScope = this.scope; this.scope = { topLevelScope: oldScope.topLevelScope, inTry: oldScope.inTry, inShorthand: false, + inTaggedTemplateTag: false, isStrict: oldScope.isStrict, isAsmJs: oldScope.isAsmJs, definitions: oldScope.definitions.createChild() @@ -129748,15 +135955,28 @@ class JavascriptParser extends Parser { this.scope = oldScope; } + /** + * @param {Array} statements statements + */ detectMode(statements) { const isLiteral = statements.length >= 1 && statements[0].type === "ExpressionStatement" && statements[0].expression.type === "Literal"; - if (isLiteral && statements[0].expression.value === "use strict") { + if ( + isLiteral && + /** @type {Literal} */ + (/** @type {ExpressionStatement} */ (statements[0]).expression).value === + "use strict" + ) { this.scope.isStrict = true; } - if (isLiteral && statements[0].expression.value === "use asm") { + if ( + isLiteral && + /** @type {Literal} */ + (/** @type {ExpressionStatement} */ (statements[0]).expression).value === + "use asm" + ) { this.scope.isAsmJs = true; } } @@ -129801,12 +136021,20 @@ class JavascriptParser extends Parser { } } + /** + * @param {Identifier} pattern identifier pattern + * @param {TODO} onIdent callback + */ enterIdentifier(pattern, onIdent) { if (!this.callHooksForName(this.hooks.pattern, pattern.name, pattern)) { onIdent(pattern.name, pattern); } } + /** + * @param {ObjectPattern} pattern object pattern + * @param {TODO} onIdent callback + */ enterObjectPattern(pattern, onIdent) { for ( let propIndex = 0, len = pattern.properties.length; @@ -129818,6 +136046,10 @@ class JavascriptParser extends Parser { } } + /** + * @param {ArrayPattern} pattern object pattern + * @param {TODO} onIdent callback + */ enterArrayPattern(pattern, onIdent) { for ( let elementIndex = 0, len = pattern.elements.length; @@ -129825,20 +136057,29 @@ class JavascriptParser extends Parser { elementIndex++ ) { const element = pattern.elements[elementIndex]; + // TODO check on `null`? this.enterPattern(element, onIdent); } } + /** + * @param {RestElement} pattern object pattern + * @param {TODO} onIdent callback + */ enterRestElement(pattern, onIdent) { this.enterPattern(pattern.argument, onIdent); } + /** + * @param {AssignmentPattern} pattern object pattern + * @param {TODO} onIdent callback + */ enterAssignmentPattern(pattern, onIdent) { this.enterPattern(pattern.left, onIdent); } /** - * @param {ExpressionNode} expression expression node + * @param {TODO} expression expression node * @returns {BasicEvaluatedExpression} evaluation result */ evaluateExpression(expression) { @@ -129856,10 +136097,14 @@ class JavascriptParser extends Parser { // ignore error } return new BasicEvaluatedExpression() - .setRange(expression.range) + .setRange(/** @type {Range} */ (expression.range)) .setExpression(expression); } + /** + * @param {Expression} expression expression + * @returns {string} parsed string + */ parseString(expression) { switch (expression.type) { case "BinaryExpression": @@ -129968,7 +136213,7 @@ class JavascriptParser extends Parser { source = source.toString("utf-8"); } if (typeof source === "object") { - ast = /** @type {ProgramNode} */ (source); + ast = /** @type {Program} */ (source); comments = source.comments; } else { comments = []; @@ -129989,6 +136234,7 @@ class JavascriptParser extends Parser { topLevelScope: true, inTry: false, inShorthand: false, + inTaggedTemplateTag: false, isStrict: false, isAsmJs: false, definitions: new StackedMap() @@ -130000,12 +136246,14 @@ class JavascriptParser extends Parser { this.statementPath = []; this.prevStatement = undefined; if (this.hooks.program.call(ast, comments) === undefined) { + this.destructuringAssignmentProperties = new WeakMap(); this.detectMode(ast.body); this.preWalkStatements(ast.body); this.prevStatement = undefined; this.blockPreWalkStatements(ast.body); this.prevStatement = undefined; this.walkStatements(ast.body); + this.destructuringAssignmentProperties = undefined; } this.hooks.finish.call(ast, comments); this.scope = oldScope; @@ -130034,7 +136282,7 @@ class JavascriptParser extends Parser { } /** - * @param {ExpressionNode | DeclarationNode | PrivateIdentifierNode | null | undefined} expr an expression + * @param {Expression | Declaration | PrivateIdentifier | null | undefined} expr an expression * @param {number} commentsStartPos source position from which annotation comments are checked * @returns {boolean} true, when the expression is pure */ @@ -130045,6 +136293,7 @@ class JavascriptParser extends Parser { .call(expr, commentsStartPos); if (typeof result === "boolean") return result; switch (expr.type) { + // TODO handle more cases case "ClassDeclaration": case "ClassExpression": { if (expr.body.type !== "ClassBody") return false; @@ -130052,63 +136301,94 @@ class JavascriptParser extends Parser { return false; } const items = - /** @type {(MethodDefinitionNode | PropertyDefinitionNode)[]} */ ( - expr.body.body - ); - return items.every( - item => - (!item.computed || - !item.key || - this.isPure(item.key, item.range[0])) && - (!item.static || - !item.value || - this.isPure( - item.value, - item.key ? item.key.range[1] : item.range[0] - )) - ); + /** @type {TODO[]} */ + (expr.body.body); + return items.every(item => { + if ( + item.computed && + item.key && + !this.isPure(item.key, item.range[0]) + ) { + return false; + } + + if ( + item.static && + item.value && + !this.isPure( + item.value, + item.key ? item.key.range[1] : item.range[0] + ) + ) { + return false; + } + + if (item.type === "StaticBlock") { + return false; + } + + return true; + }); } case "FunctionDeclaration": case "FunctionExpression": case "ArrowFunctionExpression": + case "ThisExpression": case "Literal": + case "TemplateLiteral": + case "Identifier": case "PrivateIdentifier": return true; case "VariableDeclaration": return expr.declarations.every(decl => - this.isPure(decl.init, decl.range[0]) + this.isPure(decl.init, /** @type {Range} */ (decl.range)[0]) ); case "ConditionalExpression": return ( this.isPure(expr.test, commentsStartPos) && - this.isPure(expr.consequent, expr.test.range[1]) && - this.isPure(expr.alternate, expr.consequent.range[1]) + this.isPure( + expr.consequent, + /** @type {Range} */ (expr.test.range)[1] + ) && + this.isPure( + expr.alternate, + /** @type {Range} */ (expr.consequent.range)[1] + ) + ); + + case "LogicalExpression": + return ( + this.isPure(expr.left, commentsStartPos) && + this.isPure(expr.right, /** @type {Range} */ (expr.left.range)[1]) ); case "SequenceExpression": return expr.expressions.every(expr => { const pureFlag = this.isPure(expr, commentsStartPos); - commentsStartPos = expr.range[1]; + commentsStartPos = /** @type {Range} */ (expr.range)[1]; return pureFlag; }); case "CallExpression": { const pureFlag = - expr.range[0] - commentsStartPos > 12 && - this.getComments([commentsStartPos, expr.range[0]]).some( + /** @type {Range} */ (expr.range)[0] - commentsStartPos > 12 && + this.getComments([ + commentsStartPos, + /** @type {Range} */ (expr.range)[0] + ]).some( comment => comment.type === "Block" && /^\s*(#|@)__PURE__\s*$/.test(comment.value) ); if (!pureFlag) return false; - commentsStartPos = expr.callee.range[1]; + commentsStartPos = /** @type {Range} */ (expr.callee.range)[1]; return expr.arguments.every(arg => { if (arg.type === "SpreadElement") return false; const pureFlag = this.isPure(arg, commentsStartPos); - commentsStartPos = arg.range[1]; + commentsStartPos = /** @type {Range} */ (arg.range)[1]; return pureFlag; }); } @@ -130117,6 +136397,10 @@ class JavascriptParser extends Parser { return !evaluated.couldHaveSideEffects(); } + /** + * @param {Range} range range + * @returns {TODO[]} comments in the range + */ getComments(range) { const [rangeStart, rangeEnd] = range; const compare = (comment, needle) => comment.range[0] - needle; @@ -130158,6 +136442,10 @@ class JavascriptParser extends Parser { this.semicolons.delete(pos); } + /** + * @param {Expression} expr expression + * @returns {boolean} true, when the expression is a statement level expression + */ isStatementLevelExpression(expr) { const currentStatement = this.statementPath[this.statementPath.length - 1]; return ( @@ -130204,6 +136492,9 @@ class JavascriptParser extends Parser { this.scope.definitions.set(name, newInfo); } + /** + * @param {string} name variable name + */ defineVariable(name) { const oldInfo = this.scope.definitions.get(name); // Don't redefine variable in same scope to keep existing tags @@ -130212,10 +136503,17 @@ class JavascriptParser extends Parser { this.scope.definitions.set(name, this.scope); } + /** + * @param {string} name variable name + */ undefineVariable(name) { this.scope.definitions.delete(name); } + /** + * @param {string} name variable name + * @returns {boolean} true, when variable is defined + */ isVariableDefined(name) { const info = this.scope.definitions.get(name); if (info === undefined) return false; @@ -130258,10 +136556,18 @@ class JavascriptParser extends Parser { } } + /** + * @param {TagInfo} tagInfo tag info + * @returns {VariableInfo} variable info + */ evaluatedVariable(tagInfo) { return new VariableInfo(this.scope, undefined, tagInfo); } + /** + * @param {Range} range range of the comment + * @returns {TODO} TODO + */ parseCommentOptions(range) { const comments = this.getComments(range); if (comments.length === 0) { @@ -130296,21 +136602,24 @@ class JavascriptParser extends Parser { } /** - * @param {MemberExpressionNode} expression a member expression - * @returns {{ members: string[], object: ExpressionNode | SuperNode, membersOptionals: boolean[] }} member names (reverse order) and remaining object + * @param {MemberExpression} expression a member expression + * @returns {{ members: string[], object: Expression | Super, membersOptionals: boolean[], memberRanges: Range[] }} member names (reverse order) and remaining object */ extractMemberExpressionChain(expression) { /** @type {AnyNode} */ let expr = expression; const members = []; const membersOptionals = []; + const memberRanges = []; while (expr.type === "MemberExpression") { if (expr.computed) { if (expr.property.type !== "Literal") break; - members.push(`${expr.property.value}`); + members.push(`${expr.property.value}`); // the literal + memberRanges.push(expr.object.range); // the range of the expression fragment before the literal } else { if (expr.property.type !== "Identifier") break; - members.push(expr.property.name); + members.push(expr.property.name); // the identifier + memberRanges.push(expr.object.range); // the range of the expression fragment before the identifier } membersOptionals.push(expr.optional); expr = expr.object; @@ -130319,13 +136628,14 @@ class JavascriptParser extends Parser { return { members, membersOptionals, + memberRanges, object: expr }; } /** * @param {string} varName variable name - * @returns {{name: string, info: VariableInfo | string}} name of the free variable and variable info for that + * @returns {{name: string, info: VariableInfo | string} | undefined} name of the free variable and variable info for that */ getFreeInfoFromVariable(varName) { const info = this.getVariableInfo(varName); @@ -130341,16 +136651,16 @@ class JavascriptParser extends Parser { return { info, name }; } - /** @typedef {{ type: "call", call: CallExpressionNode, calleeName: string, rootInfo: string | VariableInfo, getCalleeMembers: () => string[], name: string, getMembers: () => string[], getMembersOptionals: () => boolean[]}} CallExpressionInfo */ - /** @typedef {{ type: "expression", rootInfo: string | VariableInfo, name: string, getMembers: () => string[], getMembersOptionals: () => boolean[]}} ExpressionExpressionInfo */ + /** @typedef {{ type: "call", call: CallExpression, calleeName: string, rootInfo: string | VariableInfo, getCalleeMembers: () => string[], name: string, getMembers: () => string[], getMembersOptionals: () => boolean[], getMemberRanges: () => Range[]}} CallExpressionInfo */ + /** @typedef {{ type: "expression", rootInfo: string | VariableInfo, name: string, getMembers: () => string[], getMembersOptionals: () => boolean[], getMemberRanges: () => Range[]}} ExpressionExpressionInfo */ /** - * @param {MemberExpressionNode} expression a member expression + * @param {MemberExpression} expression a member expression * @param {number} allowedTypes which types should be returned, presented in bit mask * @returns {CallExpressionInfo | ExpressionExpressionInfo | undefined} expression info */ getMemberExpressionInfo(expression, allowedTypes) { - const { object, members, membersOptionals } = + const { object, members, membersOptionals, memberRanges } = this.extractMemberExpressionChain(expression); switch (object.type) { case "CallExpression": { @@ -130376,7 +136686,8 @@ class JavascriptParser extends Parser { getCalleeMembers: memoize(() => rootMembers.reverse()), name: objectAndMembersToName(`${calleeName}()`, members), getMembers: memoize(() => members.reverse()), - getMembersOptionals: memoize(() => membersOptionals.reverse()) + getMembersOptionals: memoize(() => membersOptionals.reverse()), + getMemberRanges: memoize(() => memberRanges.reverse()) }; } case "Identifier": @@ -130395,15 +136706,16 @@ class JavascriptParser extends Parser { name: objectAndMembersToName(resolvedRoot, members), rootInfo, getMembers: memoize(() => members.reverse()), - getMembersOptionals: memoize(() => membersOptionals.reverse()) + getMembersOptionals: memoize(() => membersOptionals.reverse()), + getMemberRanges: memoize(() => memberRanges.reverse()) }; } } } /** - * @param {MemberExpressionNode} expression an expression - * @returns {{ name: string, rootInfo: ExportedVariableInfo, getMembers: () => string[]}} name info + * @param {MemberExpression} expression an expression + * @returns {{ name: string, rootInfo: ExportedVariableInfo, getMembers: () => string[]} | undefined} name info */ getNameForExpression(expression) { return this.getMemberExpressionInfo( @@ -130415,7 +136727,7 @@ class JavascriptParser extends Parser { /** * @param {string} code source code * @param {ParseOptions} options parsing options - * @returns {ProgramNode} parsed ast + * @returns {Program} parsed ast */ static _parse(code, options) { const type = options ? options.sourceType : "module"; @@ -130427,7 +136739,7 @@ class JavascriptParser extends Parser { sourceType: type === "auto" ? "module" : type }; - /** @type {AnyNode} */ + /** @type {AnyNode | undefined} */ let ast; let error; let threw = false; @@ -130459,7 +136771,7 @@ class JavascriptParser extends Parser { throw error; } - return /** @type {ProgramNode} */ (ast); + return /** @type {Program} */ (ast); } } @@ -130473,7 +136785,7 @@ module.exports.ALLOWED_MEMBER_TYPES_CALL_EXPRESSION = /***/ }), -/***/ 645: +/***/ 94213: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; @@ -130484,24 +136796,30 @@ module.exports.ALLOWED_MEMBER_TYPES_CALL_EXPRESSION = -const UnsupportedFeatureWarning = __webpack_require__(19290); -const ConstDependency = __webpack_require__(78284); -const BasicEvaluatedExpression = __webpack_require__(88981); +const UnsupportedFeatureWarning = __webpack_require__(84099); +const ConstDependency = __webpack_require__(67538); +const BasicEvaluatedExpression = __webpack_require__(52493); -/** @typedef {import("estree").Expression} ExpressionNode */ +/** @typedef {import("estree").Expression} Expression */ /** @typedef {import("estree").Node} Node */ +/** @typedef {import("estree").SourceLocation} SourceLocation */ /** @typedef {import("./JavascriptParser")} JavascriptParser */ +/** @typedef {import("./JavascriptParser").Range} Range */ /** * @param {JavascriptParser} parser the parser * @param {string} value the const value * @param {string[]=} runtimeRequirements runtime requirements - * @returns {function(ExpressionNode): true} plugin function + * @returns {function(Expression): true} plugin function */ exports.toConstantDependency = (parser, value, runtimeRequirements) => { return function constDependency(expr) { - const dep = new ConstDependency(value, expr.range, runtimeRequirements); - dep.loc = expr.loc; + const dep = new ConstDependency( + value, + /** @type {Range} */ (expr.range), + runtimeRequirements + ); + dep.loc = /** @type {SourceLocation} */ (expr.loc); parser.state.module.addPresentationalDependency(dep); return true; }; @@ -130509,33 +136827,37 @@ exports.toConstantDependency = (parser, value, runtimeRequirements) => { /** * @param {string} value the string value - * @returns {function(ExpressionNode): BasicEvaluatedExpression} plugin function + * @returns {function(Expression): BasicEvaluatedExpression} plugin function */ exports.evaluateToString = value => { return function stringExpression(expr) { - return new BasicEvaluatedExpression().setString(value).setRange(expr.range); + return new BasicEvaluatedExpression() + .setString(value) + .setRange(/** @type {Range} */ (expr.range)); }; }; /** * @param {number} value the number value - * @returns {function(ExpressionNode): BasicEvaluatedExpression} plugin function + * @returns {function(Expression): BasicEvaluatedExpression} plugin function */ exports.evaluateToNumber = value => { return function stringExpression(expr) { - return new BasicEvaluatedExpression().setNumber(value).setRange(expr.range); + return new BasicEvaluatedExpression() + .setNumber(value) + .setRange(/** @type {Range} */ (expr.range)); }; }; /** * @param {boolean} value the boolean value - * @returns {function(ExpressionNode): BasicEvaluatedExpression} plugin function + * @returns {function(Expression): BasicEvaluatedExpression} plugin function */ exports.evaluateToBoolean = value => { return function booleanExpression(expr) { return new BasicEvaluatedExpression() .setBoolean(value) - .setRange(expr.range); + .setRange(/** @type {Range} */ (expr.range)); }; }; @@ -130544,14 +136866,14 @@ exports.evaluateToBoolean = value => { * @param {string} rootInfo rootInfo * @param {function(): string[]} getMembers getMembers * @param {boolean|null=} truthy is truthy, null if nullish - * @returns {function(ExpressionNode): BasicEvaluatedExpression} callback + * @returns {function(Expression): BasicEvaluatedExpression} callback */ exports.evaluateToIdentifier = (identifier, rootInfo, getMembers, truthy) => { return function identifierExpression(expr) { let evaluatedExpression = new BasicEvaluatedExpression() .setIdentifier(identifier, rootInfo, getMembers) .setSideEffects(false) - .setRange(expr.range); + .setRange(/** @type {Range} */ (expr.range)); switch (truthy) { case true: evaluatedExpression.setTruthy(); @@ -130568,14 +136890,26 @@ exports.evaluateToIdentifier = (identifier, rootInfo, getMembers, truthy) => { }; }; +/** + * @param {JavascriptParser} parser the parser + * @param {string} message the message + * @returns {function(Expression): boolean | undefined} callback to handle unsupported expression + */ exports.expressionIsUnsupported = (parser, message) => { return function unsupportedExpression(expr) { - const dep = new ConstDependency("(void 0)", expr.range, null); - dep.loc = expr.loc; + const dep = new ConstDependency( + "(void 0)", + /** @type {Range} */ (expr.range), + null + ); + dep.loc = /** @type {SourceLocation} */ (expr.loc); parser.state.module.addPresentationalDependency(dep); if (!parser.state.module) return; parser.state.module.addWarning( - new UnsupportedFeatureWarning(message, expr.loc) + new UnsupportedFeatureWarning( + message, + /** @type {SourceLocation} */ (expr.loc) + ) ); return true; }; @@ -130588,7 +136922,7 @@ exports.approve = () => true; /***/ }), -/***/ 67164: +/***/ 61554: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; @@ -130599,10 +136933,10 @@ exports.approve = () => true; -const RuntimeGlobals = __webpack_require__(34623); -const Template = __webpack_require__(88070); -const { isSubset } = __webpack_require__(97045); -const { getAllChunks } = __webpack_require__(99561); +const RuntimeGlobals = __webpack_require__(61539); +const Template = __webpack_require__(88835); +const { isSubset } = __webpack_require__(24352); +const { getAllChunks } = __webpack_require__(70428); /** @typedef {import("../util/Hash")} Hash */ /** @typedef {import("../Chunk")} Chunk */ @@ -130613,7 +136947,7 @@ const { getAllChunks } = __webpack_require__(99561); /** @typedef {import("../RuntimeTemplate")} RuntimeTemplate */ /** @typedef {(string|number)[]} EntryItem */ -const EXPORT_PREFIX = "var __webpack_exports__ = "; +const EXPORT_PREFIX = `var ${RuntimeGlobals.exports} = `; /** * @param {ChunkGraph} chunkGraph chunkGraph @@ -130633,7 +136967,7 @@ exports.generateEntryStartup = ( /** @type {string[]} */ const runtime = [ `var __webpack_exec__ = ${runtimeTemplate.returningFunction( - `__webpack_require__(${RuntimeGlobals.entryModuleId} = moduleId)`, + `${RuntimeGlobals.require}(${RuntimeGlobals.entryModuleId} = moduleId)`, "moduleId" )}` ]; @@ -130728,7 +137062,7 @@ exports.getInitialChunkIds = (chunk, chunkGraph, filterFn) => { /***/ }), -/***/ 51315: +/***/ 19049: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -130739,11 +137073,21 @@ exports.getInitialChunkIds = (chunk, chunkGraph, filterFn) => { -const { register } = __webpack_require__(94965); +const { register } = __webpack_require__(93141); + +/** @typedef {import("../serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */ +/** @typedef {import("../util/Hash")} Hash */ +/** @typedef {import("./JsonModulesPlugin").RawJsonData} RawJsonData */ class JsonData { + /** + * @param {Buffer | RawJsonData} data JSON data + */ constructor(data) { + /** @type {Buffer | undefined} */ this._buffer = undefined; + /** @type {RawJsonData | undefined} */ this._data = undefined; if (Buffer.isBuffer(data)) { this._buffer = data; @@ -130752,6 +137096,9 @@ class JsonData { } } + /** + * @returns {RawJsonData|undefined} Raw JSON data + */ get() { if (this._data === undefined && this._buffer !== undefined) { this._data = JSON.parse(this._buffer.toString()); @@ -130759,22 +137106,34 @@ class JsonData { return this._data; } + /** + * @param {Hash} hash hash to be updated + * @returns {void} the updated hash + */ updateHash(hash) { if (this._buffer === undefined && this._data !== undefined) { this._buffer = Buffer.from(JSON.stringify(this._data)); } - if (this._buffer) return hash.update(this._buffer); + if (this._buffer) hash.update(this._buffer); } } register(JsonData, "webpack/lib/json/JsonData", null, { + /** + * @param {JsonData} obj JSONData object + * @param {ObjectSerializerContext} context context + */ serialize(obj, { write }) { if (obj._buffer === undefined && obj._data !== undefined) { obj._buffer = Buffer.from(JSON.stringify(obj._data)); } write(obj._buffer); }, + /** + * @param {ObjectDeserializerContext} context context + * @returns {JsonData} deserialized JSON data + */ deserialize({ read }) { return new JsonData(read()); } @@ -130785,7 +137144,7 @@ module.exports = JsonData; /***/ }), -/***/ 62355: +/***/ 56639: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -130797,10 +137156,10 @@ module.exports = JsonData; const { RawSource } = __webpack_require__(59728); -const ConcatenationScope = __webpack_require__(68645); -const { UsageState } = __webpack_require__(1723); -const Generator = __webpack_require__(8635); -const RuntimeGlobals = __webpack_require__(34623); +const ConcatenationScope = __webpack_require__(92811); +const { UsageState } = __webpack_require__(14768); +const Generator = __webpack_require__(58387); +const RuntimeGlobals = __webpack_require__(61539); /** @typedef {import("webpack-sources").Source} Source */ /** @typedef {import("../ExportsInfo")} ExportsInfo */ @@ -130808,7 +137167,13 @@ const RuntimeGlobals = __webpack_require__(34623); /** @typedef {import("../Module").ConcatenationBailoutReasonContext} ConcatenationBailoutReasonContext */ /** @typedef {import("../NormalModule")} NormalModule */ /** @typedef {import("../util/runtime").RuntimeSpec} RuntimeSpec */ +/** @typedef {import("./JsonData")} JsonData */ +/** @typedef {import("./JsonModulesPlugin").RawJsonData} RawJsonData */ +/** + * @param {RawJsonData} data Raw JSON data + * @returns {undefined|string} stringified data + */ const stringifySafe = data => { const stringified = JSON.stringify(data); if (!stringified) { @@ -130821,21 +137186,23 @@ const stringifySafe = data => { }; /** - * @param {Object} data data (always an object or array) + * @param {RawJsonData} data Raw JSON data (always an object or array) * @param {ExportsInfo} exportsInfo exports info * @param {RuntimeSpec} runtime the runtime - * @returns {Object} reduced data + * @returns {RawJsonData} reduced data */ const createObjectForExportsInfo = (data, exportsInfo, runtime) => { if (exportsInfo.otherExportsInfo.getUsed(runtime) !== UsageState.Unused) return data; const isArray = Array.isArray(data); + /** @type {RawJsonData} */ const reducedData = isArray ? [] : {}; for (const key of Object.keys(data)) { const exportInfo = exportsInfo.getReadOnlyExportInfo(key); const used = exportInfo.getUsed(runtime); if (used === UsageState.Unused) continue; + /** @type {RawJsonData} */ let value; if (used === UsageState.OnlyPropertiesUsed && exportInfo.exportsInfo) { value = createObjectForExportsInfo( @@ -130846,8 +137213,9 @@ const createObjectForExportsInfo = (data, exportsInfo, runtime) => { } else { value = data[key]; } - const name = exportInfo.getUsedName(key, runtime); - reducedData[name] = value; + + const name = /** @type {string} */ (exportInfo.getUsedName(key, runtime)); + /** @type {Record} */ (reducedData)[name] = value; } if (isArray) { let arrayLengthWhenUsed = @@ -130877,6 +137245,7 @@ const createObjectForExportsInfo = (data, exportsInfo, runtime) => { : { length: arrayLengthWhenUsed }, reducedData ); + /** @type {number} */ const generatedLength = arrayLengthWhenUsed !== undefined ? Math.max(arrayLengthWhenUsed, reducedData.length) @@ -130907,12 +137276,13 @@ class JsonGenerator extends Generator { * @returns {number} estimate size of the module */ getSize(module, type) { - let data = + /** @type {RawJsonData | undefined} */ + const data = module.buildInfo && module.buildInfo.jsonData && module.buildInfo.jsonData.get(); if (!data) return 0; - return stringifySafe(data).length + 10; + return /** @type {string} */ (stringifySafe(data)).length + 10; } /** @@ -130939,6 +137309,7 @@ class JsonGenerator extends Generator { concatenationScope } ) { + /** @type {RawJsonData | undefined} */ const data = module.buildInfo && module.buildInfo.jsonData && @@ -130951,6 +137322,7 @@ class JsonGenerator extends Generator { ); } const exportsInfo = moduleGraph.getExportsInfo(module); + /** @type {RawJsonData} */ let finalJson = typeof data === "object" && data && @@ -130958,11 +137330,12 @@ class JsonGenerator extends Generator { ? createObjectForExportsInfo(data, exportsInfo, runtime) : data; // Use JSON because JSON.parse() is much faster than JavaScript evaluation - const jsonStr = stringifySafe(finalJson); + const jsonStr = /** @type {string} */ (stringifySafe(finalJson)); const jsonExpr = jsonStr.length > 20 && typeof finalJson === "object" ? `JSON.parse('${jsonStr.replace(/[\\']/g, "\\$&")}')` : jsonStr; + /** @type {string} */ let content; if (concatenationScope) { content = `${runtimeTemplate.supportsConst() ? "const" : "var"} ${ @@ -130984,7 +137357,7 @@ module.exports = JsonGenerator; /***/ }), -/***/ 86857: +/***/ 33202: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -130995,41 +137368,50 @@ module.exports = JsonGenerator; -const createSchemaValidation = __webpack_require__(94091); -const JsonGenerator = __webpack_require__(62355); -const JsonParser = __webpack_require__(42181); +const { JSON_MODULE_TYPE } = __webpack_require__(92891); +const createSchemaValidation = __webpack_require__(45488); +const JsonGenerator = __webpack_require__(56639); +const JsonParser = __webpack_require__(81367); /** @typedef {import("../Compiler")} Compiler */ +/** @typedef {Record} RawJsonData */ const validate = createSchemaValidation( - __webpack_require__(96275), - () => __webpack_require__(56868), + __webpack_require__(18609), + () => __webpack_require__(55314), { name: "Json Modules Plugin", baseDataPath: "parser" } ); +const PLUGIN_NAME = "JsonModulesPlugin"; + +/** + * The JsonModulesPlugin is the entrypoint plugin for the json modules feature. + * It adds the json module type to the compiler and registers the json parser and generator. + */ class JsonModulesPlugin { /** * Apply the plugin * @param {Compiler} compiler the compiler instance * @returns {void} + * */ apply(compiler) { compiler.hooks.compilation.tap( - "JsonModulesPlugin", + PLUGIN_NAME, (compilation, { normalModuleFactory }) => { normalModuleFactory.hooks.createParser - .for("json") - .tap("JsonModulesPlugin", parserOptions => { + .for(JSON_MODULE_TYPE) + .tap(PLUGIN_NAME, parserOptions => { validate(parserOptions); return new JsonParser(parserOptions); }); normalModuleFactory.hooks.createGenerator - .for("json") - .tap("JsonModulesPlugin", () => { + .for(JSON_MODULE_TYPE) + .tap(PLUGIN_NAME, () => { return new JsonGenerator(); }); } @@ -131042,7 +137424,7 @@ module.exports = JsonModulesPlugin; /***/ }), -/***/ 42181: +/***/ 81367: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -131053,14 +137435,19 @@ module.exports = JsonModulesPlugin; -const parseJson = __webpack_require__(89227); -const Parser = __webpack_require__(66425); -const JsonExportsDependency = __webpack_require__(72610); -const JsonData = __webpack_require__(51315); +const Parser = __webpack_require__(76690); +const JsonExportsDependency = __webpack_require__(71528); +const memoize = __webpack_require__(62377); +const JsonData = __webpack_require__(19049); /** @typedef {import("../../declarations/plugins/JsonModulesPluginParser").JsonModulesPluginParserOptions} JsonModulesPluginParserOptions */ +/** @typedef {import("../Module").BuildInfo} BuildInfo */ +/** @typedef {import("../Module").BuildMeta} BuildMeta */ /** @typedef {import("../Parser").ParserState} ParserState */ /** @typedef {import("../Parser").PreparsedAst} PreparsedAst */ +/** @typedef {import("./JsonModulesPlugin").RawJsonData} RawJsonData */ + +const getParseJson = memoize(() => __webpack_require__(89227)); class JsonParser extends Parser { /** @@ -131081,19 +137468,28 @@ class JsonParser extends Parser { source = source.toString("utf-8"); } - /** @type {JsonModulesPluginParserOptions["parse"]} */ + /** @type {NonNullable} */ const parseFn = - typeof this.options.parse === "function" ? this.options.parse : parseJson; - - const data = - typeof source === "object" - ? source - : parseFn(source[0] === "\ufeff" ? source.slice(1) : source); - const jsonData = new JsonData(data); - state.module.buildInfo.jsonData = jsonData; - state.module.buildInfo.strict = true; - state.module.buildMeta.exportsType = "default"; - state.module.buildMeta.defaultObject = + typeof this.options.parse === "function" + ? this.options.parse + : getParseJson(); + /** @type {Buffer | RawJsonData | undefined} */ + let data; + try { + data = + typeof source === "object" + ? source + : parseFn(source[0] === "\ufeff" ? source.slice(1) : source); + } catch (e) { + throw new Error(`Cannot parse JSON: ${/** @type {Error} */ (e).message}`); + } + const jsonData = new JsonData(/** @type {Buffer | RawJsonData} */ (data)); + const buildInfo = /** @type {BuildInfo} */ (state.module.buildInfo); + buildInfo.jsonData = jsonData; + buildInfo.strict = true; + const buildMeta = /** @type {BuildMeta} */ (state.module.buildMeta); + buildMeta.exportsType = "default"; + buildMeta.defaultObject = typeof data === "object" ? "redirect-warn" : false; state.module.addDependency(new JsonExportsDependency(jsonData)); return state; @@ -131105,7 +137501,7 @@ module.exports = JsonParser; /***/ }), -/***/ 44073: +/***/ 2303: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -131116,8 +137512,8 @@ module.exports = JsonParser; -const RuntimeGlobals = __webpack_require__(34623); -const JavascriptModulesPlugin = __webpack_require__(96230); +const RuntimeGlobals = __webpack_require__(61539); +const JavascriptModulesPlugin = __webpack_require__(70061); /** @typedef {import("webpack-sources").Source} Source */ /** @typedef {import("../../declarations/WebpackOptions").LibraryOptions} LibraryOptions */ @@ -131198,6 +137594,10 @@ class AbstractLibraryPlugin { } ); + /** + * @param {Chunk} chunk chunk + * @returns {TODO} options for the chunk + */ const getOptionsForChunk = chunk => { if (compilation.chunkGraph.getNumberOfEntryModules(chunk) === 0) return false; @@ -131325,7 +137725,7 @@ class AbstractLibraryPlugin { * @returns {T | false} preprocess as needed by overriding */ parseOptions(library) { - const AbstractMethodError = __webpack_require__(26907); + const AbstractMethodError = __webpack_require__(9906); throw new AbstractMethodError(); } @@ -131410,7 +137810,7 @@ module.exports = AbstractLibraryPlugin; /***/ }), -/***/ 61343: +/***/ 15949: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -131422,9 +137822,9 @@ module.exports = AbstractLibraryPlugin; const { ConcatSource } = __webpack_require__(59728); -const ExternalModule = __webpack_require__(43308); -const Template = __webpack_require__(88070); -const AbstractLibraryPlugin = __webpack_require__(44073); +const ExternalModule = __webpack_require__(90790); +const Template = __webpack_require__(88835); +const AbstractLibraryPlugin = __webpack_require__(2303); /** @typedef {import("webpack-sources").Source} Source */ /** @typedef {import("../../declarations/WebpackOptions").LibraryOptions} LibraryOptions */ @@ -131445,6 +137845,7 @@ const AbstractLibraryPlugin = __webpack_require__(44073); /** * @typedef {Object} AmdLibraryPluginParsed * @property {string} name + * @property {string} amdContainer */ /** @@ -131468,7 +137869,7 @@ class AmdLibraryPlugin extends AbstractLibraryPlugin { * @returns {T | false} preprocess as needed by overriding */ parseOptions(library) { - const { name } = library; + const { name, amdContainer } = library; if (this.requireAsWrapper) { if (name) { throw new Error( @@ -131483,7 +137884,8 @@ class AmdLibraryPlugin extends AbstractLibraryPlugin { } } return { - name: /** @type {string=} */ (name) + name: /** @type {string} */ (name), + amdContainer: /** @type {string} */ (amdContainer) }; } @@ -131527,9 +137929,14 @@ class AmdLibraryPlugin extends AbstractLibraryPlugin { (iife || !chunk.hasRuntime() ? " return " : "\n"); const fnEnd = iife ? ";\n}" : "\n}"; + let amdContainerPrefix = ""; + if (options.amdContainer) { + amdContainerPrefix = `${options.amdContainer}.`; + } + if (this.requireAsWrapper) { return new ConcatSource( - `require(${externalsDepsArray}, ${fnStart}`, + `${amdContainerPrefix}require(${externalsDepsArray}, ${fnStart}`, source, `${fnEnd});` ); @@ -131539,18 +137946,24 @@ class AmdLibraryPlugin extends AbstractLibraryPlugin { }); return new ConcatSource( - `define(${JSON.stringify(name)}, ${externalsDepsArray}, ${fnStart}`, + `${amdContainerPrefix}define(${JSON.stringify( + name + )}, ${externalsDepsArray}, ${fnStart}`, source, `${fnEnd});` ); } else if (externalsArguments) { return new ConcatSource( - `define(${externalsDepsArray}, ${fnStart}`, + `${amdContainerPrefix}define(${externalsDepsArray}, ${fnStart}`, source, `${fnEnd});` ); } else { - return new ConcatSource(`define(${fnStart}`, source, `${fnEnd});`); + return new ConcatSource( + `${amdContainerPrefix}define(${fnStart}`, + source, + `${fnEnd});` + ); } } @@ -131571,6 +137984,9 @@ class AmdLibraryPlugin extends AbstractLibraryPlugin { chunk }); hash.update(name); + } else if (options.amdContainer) { + hash.update("amdContainer"); + hash.update(options.amdContainer); } } } @@ -131580,7 +137996,7 @@ module.exports = AmdLibraryPlugin; /***/ }), -/***/ 95465: +/***/ 36066: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -131592,16 +138008,18 @@ module.exports = AmdLibraryPlugin; const { ConcatSource } = __webpack_require__(59728); -const { UsageState } = __webpack_require__(1723); -const Template = __webpack_require__(88070); -const propertyAccess = __webpack_require__(92884); -const { getEntryRuntime } = __webpack_require__(55693); -const AbstractLibraryPlugin = __webpack_require__(44073); +const { UsageState } = __webpack_require__(14768); +const RuntimeGlobals = __webpack_require__(61539); +const Template = __webpack_require__(88835); +const propertyAccess = __webpack_require__(60305); +const { getEntryRuntime } = __webpack_require__(69965); +const AbstractLibraryPlugin = __webpack_require__(2303); /** @typedef {import("webpack-sources").Source} Source */ /** @typedef {import("../../declarations/WebpackOptions").LibraryOptions} LibraryOptions */ /** @typedef {import("../../declarations/WebpackOptions").LibraryType} LibraryType */ /** @typedef {import("../Chunk")} Chunk */ +/** @typedef {import("../Compilation")} Compilation */ /** @typedef {import("../Compilation").ChunkHashContext} ChunkHashContext */ /** @typedef {import("../Compiler")} Compiler */ /** @typedef {import("../Module")} Module */ @@ -131644,6 +138062,7 @@ const accessWithInit = (accessor, existingLength, initLast = false) => { let i = 1; // all properties printed so far (excluding base) + /** @type {string[] | undefined} */ let propsSoFar; // if there is existingLength, print all properties until this position as property access @@ -131727,7 +138146,7 @@ class AssignLibraryPlugin extends AbstractLibraryPlugin { } } return { - name: /** @type {string|string[]=} */ (name), + name: /** @type {string | string[]} */ (name), export: library.export }; } @@ -131758,12 +138177,22 @@ class AssignLibraryPlugin extends AbstractLibraryPlugin { moduleGraph.addExtraReason(module, "used as library export"); } + /** + * @param {Compilation} compilation the compilation + * @returns {string[]} the prefix + */ _getPrefix(compilation) { return this.prefix === "global" ? [compilation.runtimeTemplate.globalObject] : this.prefix; } + /** + * @param {AssignLibraryPluginParsed} options the library options + * @param {Chunk} chunk the chunk + * @param {Compilation} compilation the compilation + * @returns {Array} the resolved full name + */ _getResolvedFullName(options, chunk, compilation) { const prefix = this._getPrefix(compilation); const fullName = options.name ? prefix.concat(options.name) : prefix; @@ -131882,7 +138311,7 @@ class AssignLibraryPlugin extends AbstractLibraryPlugin { if (!exportInfo.provided) continue; const nameAccess = propertyAccess([exportInfo.name]); result.add( - `${exportTarget}${nameAccess} = __webpack_exports__${exportAccess}${nameAccess};\n` + `${exportTarget}${nameAccess} = ${RuntimeGlobals.exports}${exportAccess}${nameAccess};\n` ); } result.add( @@ -131896,10 +138325,11 @@ class AssignLibraryPlugin extends AbstractLibraryPlugin { true )};\n` ); - let exports = "__webpack_exports__"; + /** @type {String} */ + let exports = RuntimeGlobals.exports; if (exportAccess) { result.add( - `var __webpack_exports_export__ = __webpack_exports__${exportAccess};\n` + `var __webpack_exports_export__ = ${RuntimeGlobals.exports}${exportAccess};\n` ); exports = "__webpack_exports_export__"; } @@ -131915,7 +138345,7 @@ class AssignLibraryPlugin extends AbstractLibraryPlugin { fullNameResolved, this._getPrefix(compilation).length, false - )} = __webpack_exports__${exportAccess};\n` + )} = ${RuntimeGlobals.exports}${exportAccess};\n` ); } return result; @@ -131963,7 +138393,7 @@ module.exports = AssignLibraryPlugin; /***/ }), -/***/ 3580: +/***/ 90487: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -131981,6 +138411,10 @@ module.exports = AssignLibraryPlugin; /** @type {WeakMap>} */ const enabledTypes = new WeakMap(); +/** + * @param {Compiler} compiler the compiler instance + * @returns {Set} enabled types + */ const getEnabledTypes = compiler => { let set = enabledTypes.get(compiler); if (set === undefined) { @@ -132040,7 +138474,7 @@ class EnableLibraryPlugin { if (typeof type === "string") { const enableExportProperty = () => { - const ExportPropertyTemplatePlugin = __webpack_require__(30430); + const ExportPropertyTemplatePlugin = __webpack_require__(79823); new ExportPropertyTemplatePlugin({ type, nsObjectUsed: type !== "module" @@ -132049,7 +138483,7 @@ class EnableLibraryPlugin { switch (type) { case "var": { //@ts-expect-error https://github.com/microsoft/TypeScript/issues/41697 - const AssignLibraryPlugin = __webpack_require__(95465); + const AssignLibraryPlugin = __webpack_require__(36066); new AssignLibraryPlugin({ type, prefix: [], @@ -132060,7 +138494,7 @@ class EnableLibraryPlugin { } case "assign-properties": { //@ts-expect-error https://github.com/microsoft/TypeScript/issues/41697 - const AssignLibraryPlugin = __webpack_require__(95465); + const AssignLibraryPlugin = __webpack_require__(36066); new AssignLibraryPlugin({ type, prefix: [], @@ -132072,7 +138506,7 @@ class EnableLibraryPlugin { } case "assign": { //@ts-expect-error https://github.com/microsoft/TypeScript/issues/41697 - const AssignLibraryPlugin = __webpack_require__(95465); + const AssignLibraryPlugin = __webpack_require__(36066); new AssignLibraryPlugin({ type, prefix: [], @@ -132083,7 +138517,7 @@ class EnableLibraryPlugin { } case "this": { //@ts-expect-error https://github.com/microsoft/TypeScript/issues/41697 - const AssignLibraryPlugin = __webpack_require__(95465); + const AssignLibraryPlugin = __webpack_require__(36066); new AssignLibraryPlugin({ type, prefix: ["this"], @@ -132094,7 +138528,7 @@ class EnableLibraryPlugin { } case "window": { //@ts-expect-error https://github.com/microsoft/TypeScript/issues/41697 - const AssignLibraryPlugin = __webpack_require__(95465); + const AssignLibraryPlugin = __webpack_require__(36066); new AssignLibraryPlugin({ type, prefix: ["window"], @@ -132105,7 +138539,7 @@ class EnableLibraryPlugin { } case "self": { //@ts-expect-error https://github.com/microsoft/TypeScript/issues/41697 - const AssignLibraryPlugin = __webpack_require__(95465); + const AssignLibraryPlugin = __webpack_require__(36066); new AssignLibraryPlugin({ type, prefix: ["self"], @@ -132116,7 +138550,7 @@ class EnableLibraryPlugin { } case "global": { //@ts-expect-error https://github.com/microsoft/TypeScript/issues/41697 - const AssignLibraryPlugin = __webpack_require__(95465); + const AssignLibraryPlugin = __webpack_require__(36066); new AssignLibraryPlugin({ type, prefix: "global", @@ -132127,7 +138561,7 @@ class EnableLibraryPlugin { } case "commonjs": { //@ts-expect-error https://github.com/microsoft/TypeScript/issues/41697 - const AssignLibraryPlugin = __webpack_require__(95465); + const AssignLibraryPlugin = __webpack_require__(36066); new AssignLibraryPlugin({ type, prefix: ["exports"], @@ -132138,7 +138572,7 @@ class EnableLibraryPlugin { } case "commonjs-static": { //@ts-expect-error https://github.com/microsoft/TypeScript/issues/41697 - const AssignLibraryPlugin = __webpack_require__(95465); + const AssignLibraryPlugin = __webpack_require__(36066); new AssignLibraryPlugin({ type, prefix: ["exports"], @@ -132150,7 +138584,7 @@ class EnableLibraryPlugin { case "commonjs2": case "commonjs-module": { //@ts-expect-error https://github.com/microsoft/TypeScript/issues/41697 - const AssignLibraryPlugin = __webpack_require__(95465); + const AssignLibraryPlugin = __webpack_require__(36066); new AssignLibraryPlugin({ type, prefix: ["module", "exports"], @@ -132162,7 +138596,7 @@ class EnableLibraryPlugin { case "amd": case "amd-require": { enableExportProperty(); - const AmdLibraryPlugin = __webpack_require__(61343); + const AmdLibraryPlugin = __webpack_require__(15949); new AmdLibraryPlugin({ type, requireAsWrapper: type === "amd-require" @@ -132172,7 +138606,7 @@ class EnableLibraryPlugin { case "umd": case "umd2": { enableExportProperty(); - const UmdLibraryPlugin = __webpack_require__(75956); + const UmdLibraryPlugin = __webpack_require__(49483); new UmdLibraryPlugin({ type, optionalAmdExternalAsGlobal: type === "umd2" @@ -132181,7 +138615,7 @@ class EnableLibraryPlugin { } case "system": { enableExportProperty(); - const SystemLibraryPlugin = __webpack_require__(94441); + const SystemLibraryPlugin = __webpack_require__(6258); new SystemLibraryPlugin({ type }).apply(compiler); @@ -132189,7 +138623,7 @@ class EnableLibraryPlugin { } case "jsonp": { enableExportProperty(); - const JsonpLibraryPlugin = __webpack_require__(58314); + const JsonpLibraryPlugin = __webpack_require__(53750); new JsonpLibraryPlugin({ type }).apply(compiler); @@ -132197,7 +138631,7 @@ class EnableLibraryPlugin { } case "module": { enableExportProperty(); - const ModuleLibraryPlugin = __webpack_require__(15705); + const ModuleLibraryPlugin = __webpack_require__(93147); new ModuleLibraryPlugin({ type }).apply(compiler); @@ -132219,7 +138653,7 @@ module.exports = EnableLibraryPlugin; /***/ }), -/***/ 30430: +/***/ 79823: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -132231,10 +138665,11 @@ module.exports = EnableLibraryPlugin; const { ConcatSource } = __webpack_require__(59728); -const { UsageState } = __webpack_require__(1723); -const propertyAccess = __webpack_require__(92884); -const { getEntryRuntime } = __webpack_require__(55693); -const AbstractLibraryPlugin = __webpack_require__(44073); +const { UsageState } = __webpack_require__(14768); +const RuntimeGlobals = __webpack_require__(61539); +const propertyAccess = __webpack_require__(60305); +const { getEntryRuntime } = __webpack_require__(69965); +const AbstractLibraryPlugin = __webpack_require__(2303); /** @typedef {import("webpack-sources").Source} Source */ /** @typedef {import("../../declarations/WebpackOptions").LibraryOptions} LibraryOptions */ @@ -132328,7 +138763,9 @@ class ExportPropertyLibraryPlugin extends AbstractLibraryPlugin { */ renderStartup(source, module, renderContext, { options }) { if (!options.export) return source; - const postfix = `__webpack_exports__ = __webpack_exports__${propertyAccess( + const postfix = `${RuntimeGlobals.exports} = ${ + RuntimeGlobals.exports + }${propertyAccess( Array.isArray(options.export) ? options.export : [options.export] )};\n`; return new ConcatSource(source, postfix); @@ -132340,7 +138777,7 @@ module.exports = ExportPropertyLibraryPlugin; /***/ }), -/***/ 58314: +/***/ 53750: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -132352,7 +138789,7 @@ module.exports = ExportPropertyLibraryPlugin; const { ConcatSource } = __webpack_require__(59728); -const AbstractLibraryPlugin = __webpack_require__(44073); +const AbstractLibraryPlugin = __webpack_require__(2303); /** @typedef {import("webpack-sources").Source} Source */ /** @typedef {import("../../declarations/WebpackOptions").LibraryOptions} LibraryOptions */ @@ -132436,7 +138873,7 @@ module.exports = JsonpLibraryPlugin; /***/ }), -/***/ 15705: +/***/ 93147: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -132448,9 +138885,10 @@ module.exports = JsonpLibraryPlugin; const { ConcatSource } = __webpack_require__(59728); -const Template = __webpack_require__(88070); -const propertyAccess = __webpack_require__(92884); -const AbstractLibraryPlugin = __webpack_require__(44073); +const RuntimeGlobals = __webpack_require__(61539); +const Template = __webpack_require__(88835); +const propertyAccess = __webpack_require__(60305); +const AbstractLibraryPlugin = __webpack_require__(2303); /** @typedef {import("webpack-sources").Source} Source */ /** @typedef {import("../../declarations/WebpackOptions").LibraryOptions} LibraryOptions */ @@ -132522,16 +138960,19 @@ class ModuleLibraryPlugin extends AbstractLibraryPlugin { const exports = []; const isAsync = moduleGraph.isAsync(module); if (isAsync) { - result.add(`__webpack_exports__ = await __webpack_exports__;\n`); + result.add( + `${RuntimeGlobals.exports} = await ${RuntimeGlobals.exports};\n` + ); } for (const exportInfo of exportsInfo.orderedExports) { if (!exportInfo.provided) continue; - const varName = `__webpack_exports__${Template.toIdentifier( + const varName = `${RuntimeGlobals.exports}${Template.toIdentifier( exportInfo.name )}`; result.add( - `var ${varName} = __webpack_exports__${propertyAccess([ - exportInfo.getUsedName(exportInfo.name, chunk.runtime) + `var ${varName} = ${RuntimeGlobals.exports}${propertyAccess([ + /** @type {string} */ + (exportInfo.getUsedName(exportInfo.name, chunk.runtime)) ])};\n` ); exports.push(`${varName} as ${exportInfo.name}`); @@ -132548,7 +138989,7 @@ module.exports = ModuleLibraryPlugin; /***/ }), -/***/ 94441: +/***/ 6258: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -132560,11 +139001,11 @@ module.exports = ModuleLibraryPlugin; const { ConcatSource } = __webpack_require__(59728); -const { UsageState } = __webpack_require__(1723); -const ExternalModule = __webpack_require__(43308); -const Template = __webpack_require__(88070); -const propertyAccess = __webpack_require__(92884); -const AbstractLibraryPlugin = __webpack_require__(44073); +const { UsageState } = __webpack_require__(14768); +const ExternalModule = __webpack_require__(90790); +const Template = __webpack_require__(88835); +const propertyAccess = __webpack_require__(60305); +const AbstractLibraryPlugin = __webpack_require__(2303); /** @typedef {import("webpack-sources").Source} Source */ /** @typedef {import("../../declarations/WebpackOptions").LibraryOptions} LibraryOptions */ @@ -132613,7 +139054,7 @@ class SystemLibraryPlugin extends AbstractLibraryPlugin { ); } return { - name: /** @type {string=} */ (name) + name: /** @type {string} */ (name) }; } @@ -132660,6 +139101,7 @@ class SystemLibraryPlugin extends AbstractLibraryPlugin { .join("\n"); // Define __esModule flag on all internal variables and helpers + /** @type {string[]} */ const externalVarInitialization = []; // The system.register format requires an array of setter functions for externals. @@ -132789,7 +139231,7 @@ module.exports = SystemLibraryPlugin; /***/ }), -/***/ 75956: +/***/ 49483: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -132801,9 +139243,9 @@ module.exports = SystemLibraryPlugin; const { ConcatSource, OriginalSource } = __webpack_require__(59728); -const ExternalModule = __webpack_require__(43308); -const Template = __webpack_require__(88070); -const AbstractLibraryPlugin = __webpack_require__(44073); +const ExternalModule = __webpack_require__(90790); +const Template = __webpack_require__(88835); +const AbstractLibraryPlugin = __webpack_require__(2303); /** @typedef {import("webpack-sources").Source} Source */ /** @typedef {import("../../declarations/WebpackOptions").LibraryCustomUmdCommentObject} LibraryCustomUmdCommentObject */ @@ -132943,6 +139385,10 @@ class UmdLibraryPlugin extends AbstractLibraryPlugin { requiredExternals = externals; } + /** + * @param {string} str the string to replace + * @returns {string} the replaced keys + */ const replaceKeys = str => { return compilation.getPath(str, { chunk @@ -132973,6 +139419,10 @@ class UmdLibraryPlugin extends AbstractLibraryPlugin { ); }; + /** + * @param {string} type the type + * @returns {string} external require array + */ const externalsRequireArray = type => { return replaceKeys( externals @@ -132980,7 +139430,9 @@ class UmdLibraryPlugin extends AbstractLibraryPlugin { let expr; let request = m.request; if (typeof request === "object") { - request = request[type]; + request = + /** @type {Record} */ + (request)[type]; } if (request === undefined) { throw new Error( @@ -133003,6 +139455,10 @@ class UmdLibraryPlugin extends AbstractLibraryPlugin { ); }; + /** + * @param {ExternalModule[]} modules external modules + * @returns {string} arguments + */ const externalsArguments = modules => { return modules .map( @@ -133037,6 +139493,10 @@ class UmdLibraryPlugin extends AbstractLibraryPlugin { const { auxiliaryComment, namedDefine, names } = options; + /** + * @param {keyof LibraryCustomUmdCommentObject} type type + * @returns {string} comment + */ const getAuxiliaryComment = type => { if (auxiliaryComment) { if (typeof auxiliaryComment === "string") @@ -133090,7 +139550,11 @@ class UmdLibraryPlugin extends AbstractLibraryPlugin { " else\n" + " " + replaceKeys( - accessorAccess("root", names.root || names.commonjs) + accessorAccess( + "root", + /** @type {string | string[]} */ (names.root) || + /** @type {string} */ (names.commonjs) + ) ) + " = factory(" + externalsRootArray(externals) + @@ -133123,7 +139587,7 @@ module.exports = UmdLibraryPlugin; /***/ }), -/***/ 10689: +/***/ 52249: /***/ (function(__unused_webpack_module, exports) { "use strict"; @@ -133294,7 +139758,7 @@ exports.Logger = WebpackLogger; /***/ }), -/***/ 11732: +/***/ 28128: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -133305,7 +139769,7 @@ exports.Logger = WebpackLogger; -const { LogType } = __webpack_require__(10689); +const { LogType } = __webpack_require__(52249); /** @typedef {import("../../declarations/WebpackOptions").FilterItemTypes} FilterItemTypes */ /** @typedef {import("../../declarations/WebpackOptions").FilterTypes} FilterTypes */ @@ -133530,7 +139994,7 @@ module.exports = ({ level = "info", debug = false, console }) => { /***/ }), -/***/ 83732: +/***/ 64402: /***/ (function(module) { "use strict"; @@ -133541,6 +140005,10 @@ module.exports = ({ level = "info", debug = false, console }) => { +/** + * @param {Array} array array of numbers + * @returns {number} sum of all numbers in array + */ const arraySum = array => { let sum = 0; for (const item of array) sum += item; @@ -133620,7 +140088,7 @@ module.exports = truncateArgs; /***/ }), -/***/ 39263: +/***/ 48473: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -133631,14 +140099,21 @@ module.exports = truncateArgs; -const RuntimeGlobals = __webpack_require__(34623); -const StartupChunkDependenciesPlugin = __webpack_require__(13824); +const RuntimeGlobals = __webpack_require__(61539); +const StartupChunkDependenciesPlugin = __webpack_require__(81459); +/** @typedef {import("../Chunk")} Chunk */ /** @typedef {import("../Compiler")} Compiler */ +/** @typedef {Object} CommonJsChunkLoadingPluginOptions + * @property {boolean} [asyncChunkLoading] enable async chunk loading + */ + class CommonJsChunkLoadingPlugin { - constructor(options) { - options = options || {}; + /** + * @param {CommonJsChunkLoadingPluginOptions} [options] options + */ + constructor(options = {}) { this._asyncChunkLoading = options.asyncChunkLoading; } @@ -133649,8 +140124,8 @@ class CommonJsChunkLoadingPlugin { */ apply(compiler) { const ChunkLoadingRuntimeModule = this._asyncChunkLoading - ? __webpack_require__(54306) - : __webpack_require__(21134); + ? __webpack_require__(25292) + : __webpack_require__(50848); const chunkLoadingValue = this._asyncChunkLoading ? "async-node" : "require"; @@ -133662,6 +140137,10 @@ class CommonJsChunkLoadingPlugin { "CommonJsChunkLoadingPlugin", compilation => { const globalChunkLoading = compilation.outputOptions.chunkLoading; + /** + * @param {Chunk} chunk chunk + * @returns {boolean} true, if wasm loading is enabled for the chunk + */ const isEnabledForChunk = chunk => { const options = chunk.getEntryOptions(); const chunkLoading = @@ -133671,6 +140150,10 @@ class CommonJsChunkLoadingPlugin { return chunkLoading === chunkLoadingValue; }; const onceForChunkSet = new WeakSet(); + /** + * @param {Chunk} chunk chunk + * @param {Set} set runtime requirements + */ const handler = (chunk, set) => { if (onceForChunkSet.has(chunk)) return; onceForChunkSet.add(chunk); @@ -133733,7 +140216,7 @@ module.exports = CommonJsChunkLoadingPlugin; /***/ }), -/***/ 49896: +/***/ 98084: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -133744,11 +140227,11 @@ module.exports = CommonJsChunkLoadingPlugin; -const CachedInputFileSystem = __webpack_require__(60152); -const fs = __webpack_require__(78127); -const createConsoleLogger = __webpack_require__(11732); -const NodeWatchFileSystem = __webpack_require__(76919); -const nodeConsole = __webpack_require__(38237); +const CachedInputFileSystem = __webpack_require__(38865); +const fs = __webpack_require__(78885); +const createConsoleLogger = __webpack_require__(28128); +const NodeWatchFileSystem = __webpack_require__(87977); +const nodeConsole = __webpack_require__(65697); /** @typedef {import("../../declarations/WebpackOptions").InfrastructureLogging} InfrastructureLogging */ /** @typedef {import("../Compiler")} Compiler */ @@ -133801,7 +140284,7 @@ module.exports = NodeEnvironmentPlugin; /***/ }), -/***/ 24378: +/***/ 47789: /***/ (function(module) { "use strict"; @@ -133828,7 +140311,7 @@ module.exports = NodeSourcePlugin; /***/ }), -/***/ 6640: +/***/ 63887: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -133839,7 +140322,7 @@ module.exports = NodeSourcePlugin; -const ExternalsPlugin = __webpack_require__(3021); +const ExternalsPlugin = __webpack_require__(42605); /** @typedef {import("../Compiler")} Compiler */ @@ -133865,6 +140348,7 @@ const builtins = [ "http2", "https", "inspector", + "inspector/promises", "module", "net", "os", @@ -133876,8 +140360,10 @@ const builtins = [ "punycode", "querystring", "readline", + "readline/promises", "repl", "stream", + "stream/consumers", "stream/promises", "stream/web", "string_decoder", @@ -133918,7 +140404,7 @@ module.exports = NodeTargetPlugin; /***/ }), -/***/ 66235: +/***/ 16842: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -133929,14 +140415,22 @@ module.exports = NodeTargetPlugin; -const CommonJsChunkFormatPlugin = __webpack_require__(19398); -const EnableChunkLoadingPlugin = __webpack_require__(14622); +const CommonJsChunkFormatPlugin = __webpack_require__(77422); +const EnableChunkLoadingPlugin = __webpack_require__(51050); /** @typedef {import("../Compiler")} Compiler */ +/** + * @typedef {Object} NodeTemplatePluginOptions + * @property {boolean} [asyncChunkLoading] enable async chunk loading + */ + class NodeTemplatePlugin { - constructor(options) { - this._options = options || {}; + /** + * @param {NodeTemplatePluginOptions} [options] options object + */ + constructor(options = {}) { + this._options = options; } /** @@ -133959,7 +140453,7 @@ module.exports = NodeTemplatePlugin; /***/ }), -/***/ 76919: +/***/ 87977: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -133994,7 +140488,7 @@ class NodeWatchFileSystem { * @param {Iterable} missing watched exitance entries * @param {number} startTime timestamp of start time * @param {WatchOptions} options options object - * @param {function(Error=, Map, Map, Set, Set): void} callback aggregated callback + * @param {function((Error | null)=, Map, Map, Set, Set): void} callback aggregated callback * @param {function(string, number): void} callbackUndelayed callback when the first change was detected * @returns {Watcher} a watcher */ @@ -134161,7 +140655,7 @@ module.exports = NodeWatchFileSystem; /***/ }), -/***/ 54306: +/***/ 25292: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -134171,20 +140665,25 @@ module.exports = NodeWatchFileSystem; -const RuntimeGlobals = __webpack_require__(34623); -const RuntimeModule = __webpack_require__(81196); -const Template = __webpack_require__(88070); +const RuntimeGlobals = __webpack_require__(61539); +const RuntimeModule = __webpack_require__(21296); +const Template = __webpack_require__(88835); const { chunkHasJs, getChunkFilenameTemplate -} = __webpack_require__(96230); -const { getInitialChunkIds } = __webpack_require__(67164); -const compileBooleanMatcher = __webpack_require__(25526); -const { getUndoPath } = __webpack_require__(63146); +} = __webpack_require__(70061); +const { getInitialChunkIds } = __webpack_require__(61554); +const compileBooleanMatcher = __webpack_require__(1258); +const { getUndoPath } = __webpack_require__(97451); /** @typedef {import("../Chunk")} Chunk */ +/** @typedef {import("../ChunkGraph")} ChunkGraph */ +/** @typedef {import("../Compilation")} Compilation */ class ReadFileChunkLoadingRuntimeModule extends RuntimeModule { + /** + * @param {ReadonlySet} runtimeRequirements runtime requirements + */ constructor(runtimeRequirements) { super("readFile chunk loading", RuntimeModule.STAGE_ATTACH); this.runtimeRequirements = runtimeRequirements; @@ -134210,11 +140709,13 @@ class ReadFileChunkLoadingRuntimeModule extends RuntimeModule { } /** - * @returns {string} runtime code + * @returns {string | null} runtime code */ generate() { - const { chunkGraph, chunk } = this; - const { runtimeTemplate } = this.compilation; + const compilation = /** @type {Compilation} */ (this.compilation); + const chunkGraph = /** @type {ChunkGraph} */ (this.chunkGraph); + const chunk = /** @type {Chunk} */ (this.chunk); + const { runtimeTemplate } = compilation; const fn = RuntimeGlobals.ensureChunkHandlers; const withBaseURI = this.runtimeRequirements.has(RuntimeGlobals.baseURI); const withExternalInstallChunk = this.runtimeRequirements.has( @@ -134236,8 +140737,8 @@ class ReadFileChunkLoadingRuntimeModule extends RuntimeModule { const hasJsMatcher = compileBooleanMatcher(conditionMap); const initialChunkIds = getInitialChunkIds(chunk, chunkGraph, chunkHasJs); - const outputName = this.compilation.getPath( - getChunkFilenameTemplate(chunk, this.compilation.outputOptions), + const outputName = compilation.getPath( + getChunkFilenameTemplate(chunk, compilation.outputOptions), { chunk, contentHashType: "javascript" @@ -134245,7 +140746,7 @@ class ReadFileChunkLoadingRuntimeModule extends RuntimeModule { ); const rootOutputDir = getUndoPath( outputName, - this.compilation.outputOptions.path, + /** @type {string} */ (compilation.outputOptions.path), false ); @@ -134291,7 +140792,7 @@ class ReadFileChunkLoadingRuntimeModule extends RuntimeModule { "}" ]), "}", - `if(runtime) runtime(__webpack_require__);`, + `if(runtime) runtime(${RuntimeGlobals.require});`, "for(var i = 0; i < chunkIds.length; i++) {", Template.indent([ "if(installedChunks[chunkIds[i]]) {", @@ -134345,7 +140846,9 @@ class ReadFileChunkLoadingRuntimeModule extends RuntimeModule { "});", "promises.push(installedChunkData[2] = promise);" ]), - "} else installedChunks[chunkId] = 0;" + hasJsMatcher === true + ? "}" + : "} else installedChunks[chunkId] = 0;" ]), "}" ]), @@ -134358,7 +140861,7 @@ class ReadFileChunkLoadingRuntimeModule extends RuntimeModule { "", withExternalInstallChunk ? Template.asString([ - "module.exports = __webpack_require__;", + `module.exports = ${RuntimeGlobals.require};`, `${RuntimeGlobals.externalInstallChunk} = installChunk;` ]) : "// no external install chunk", @@ -134460,7 +140963,7 @@ module.exports = ReadFileChunkLoadingRuntimeModule; /***/ }), -/***/ 80266: +/***/ 39382: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -134471,10 +140974,12 @@ module.exports = ReadFileChunkLoadingRuntimeModule; -const RuntimeGlobals = __webpack_require__(34623); -const Template = __webpack_require__(88070); -const AsyncWasmLoadingRuntimeModule = __webpack_require__(13119); +const { WEBASSEMBLY_MODULE_TYPE_ASYNC } = __webpack_require__(92891); +const RuntimeGlobals = __webpack_require__(61539); +const Template = __webpack_require__(88835); +const AsyncWasmLoadingRuntimeModule = __webpack_require__(29023); +/** @typedef {import("../Chunk")} Chunk */ /** @typedef {import("../Compiler")} Compiler */ class ReadFileCompileAsyncWasmPlugin { @@ -134492,6 +140997,10 @@ class ReadFileCompileAsyncWasmPlugin { "ReadFileCompileAsyncWasmPlugin", compilation => { const globalWasmLoading = compilation.outputOptions.wasmLoading; + /** + * @param {Chunk} chunk chunk + * @returns {boolean} true, if wasm loading is enabled for the chunk + */ const isEnabledForChunk = chunk => { const options = chunk.getEntryOptions(); const wasmLoading = @@ -134500,12 +141009,16 @@ class ReadFileCompileAsyncWasmPlugin { : globalWasmLoading; return wasmLoading === this._type; }; + const { importMetaName } = compilation.outputOptions; + /** + * @type {(path: string) => string} + */ const generateLoadBinaryCode = this._import ? path => Template.asString([ "Promise.all([import('fs'), import('url')]).then(([{ readFile }, { URL }]) => new Promise((resolve, reject) => {", Template.indent([ - `readFile(new URL(${path}, import.meta.url), (err, buffer) => {`, + `readFile(new URL(${path}, ${importMetaName}.url), (err, buffer) => {`, Template.indent([ "if (err) return reject(err);", "", @@ -134551,7 +141064,7 @@ class ReadFileCompileAsyncWasmPlugin { if ( !chunkGraph.hasModuleInGraph( chunk, - m => m.type === "webassembly/async" + m => m.type === WEBASSEMBLY_MODULE_TYPE_ASYNC ) ) { return; @@ -134575,7 +141088,7 @@ module.exports = ReadFileCompileAsyncWasmPlugin; /***/ }), -/***/ 67792: +/***/ 13843: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -134586,17 +141099,27 @@ module.exports = ReadFileCompileAsyncWasmPlugin; -const RuntimeGlobals = __webpack_require__(34623); -const Template = __webpack_require__(88070); -const WasmChunkLoadingRuntimeModule = __webpack_require__(10726); +const { WEBASSEMBLY_MODULE_TYPE_SYNC } = __webpack_require__(92891); +const RuntimeGlobals = __webpack_require__(61539); +const Template = __webpack_require__(88835); +const WasmChunkLoadingRuntimeModule = __webpack_require__(91214); +/** @typedef {import("../Chunk")} Chunk */ /** @typedef {import("../Compiler")} Compiler */ +/** + * @typedef {Object} ReadFileCompileWasmPluginOptions + * @property {boolean} [mangleImports] mangle imports + */ + // TODO webpack 6 remove class ReadFileCompileWasmPlugin { - constructor(options) { - this.options = options || {}; + /** + * @param {ReadFileCompileWasmPluginOptions} [options] options object + */ + constructor(options = {}) { + this.options = options; } /** @@ -134609,6 +141132,10 @@ class ReadFileCompileWasmPlugin { "ReadFileCompileWasmPlugin", compilation => { const globalWasmLoading = compilation.outputOptions.wasmLoading; + /** + * @param {Chunk} chunk chunk + * @returns {boolean} true, when wasm loading is enabled for the chunk + */ const isEnabledForChunk = chunk => { const options = chunk.getEntryOptions(); const wasmLoading = @@ -134617,6 +141144,10 @@ class ReadFileCompileWasmPlugin { : globalWasmLoading; return wasmLoading === "async-node"; }; + /** + * @param {string} path path to wasm file + * @returns {string} generated code to load the wasm file + */ const generateLoadBinaryCode = path => Template.asString([ "new Promise(function (resolve, reject) {", @@ -134650,7 +141181,7 @@ class ReadFileCompileWasmPlugin { if ( !chunkGraph.hasModuleInGraph( chunk, - m => m.type === "webassembly/sync" + m => m.type === WEBASSEMBLY_MODULE_TYPE_SYNC ) ) { return; @@ -134676,7 +141207,7 @@ module.exports = ReadFileCompileWasmPlugin; /***/ }), -/***/ 21134: +/***/ 50848: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -134686,20 +141217,25 @@ module.exports = ReadFileCompileWasmPlugin; -const RuntimeGlobals = __webpack_require__(34623); -const RuntimeModule = __webpack_require__(81196); -const Template = __webpack_require__(88070); +const RuntimeGlobals = __webpack_require__(61539); +const RuntimeModule = __webpack_require__(21296); +const Template = __webpack_require__(88835); const { chunkHasJs, getChunkFilenameTemplate -} = __webpack_require__(96230); -const { getInitialChunkIds } = __webpack_require__(67164); -const compileBooleanMatcher = __webpack_require__(25526); -const { getUndoPath } = __webpack_require__(63146); +} = __webpack_require__(70061); +const { getInitialChunkIds } = __webpack_require__(61554); +const compileBooleanMatcher = __webpack_require__(1258); +const { getUndoPath } = __webpack_require__(97451); /** @typedef {import("../Chunk")} Chunk */ +/** @typedef {import("../ChunkGraph")} ChunkGraph */ +/** @typedef {import("../Compilation")} Compilation */ class RequireChunkLoadingRuntimeModule extends RuntimeModule { + /** + * @param {ReadonlySet} runtimeRequirements runtime requirements + */ constructor(runtimeRequirements) { super("require chunk loading", RuntimeModule.STAGE_ATTACH); this.runtimeRequirements = runtimeRequirements; @@ -134725,11 +141261,13 @@ class RequireChunkLoadingRuntimeModule extends RuntimeModule { } /** - * @returns {string} runtime code + * @returns {string | null} runtime code */ generate() { - const { chunkGraph, chunk } = this; - const { runtimeTemplate } = this.compilation; + const compilation = /** @type {Compilation} */ (this.compilation); + const chunkGraph = /** @type {ChunkGraph} */ (this.chunkGraph); + const chunk = /** @type {Chunk} */ (this.chunk); + const { runtimeTemplate } = compilation; const fn = RuntimeGlobals.ensureChunkHandlers; const withBaseURI = this.runtimeRequirements.has(RuntimeGlobals.baseURI); const withExternalInstallChunk = this.runtimeRequirements.has( @@ -134751,8 +141289,8 @@ class RequireChunkLoadingRuntimeModule extends RuntimeModule { const hasJsMatcher = compileBooleanMatcher(conditionMap); const initialChunkIds = getInitialChunkIds(chunk, chunkGraph, chunkHasJs); - const outputName = this.compilation.getPath( - getChunkFilenameTemplate(chunk, this.compilation.outputOptions), + const outputName = compilation.getPath( + getChunkFilenameTemplate(chunk, compilation.outputOptions), { chunk, contentHashType: "javascript" @@ -134760,7 +141298,7 @@ class RequireChunkLoadingRuntimeModule extends RuntimeModule { ); const rootOutputDir = getUndoPath( outputName, - this.compilation.outputOptions.path, + /** @type {string} */ (compilation.outputOptions.path), true ); @@ -134806,7 +141344,7 @@ class RequireChunkLoadingRuntimeModule extends RuntimeModule { "}" ]), "}", - `if(runtime) runtime(__webpack_require__);`, + `if(runtime) runtime(${RuntimeGlobals.require});`, "for(var i = 0; i < chunkIds.length; i++)", Template.indent("installedChunks[chunkIds[i]] = 1;"), withOnChunkLoad ? `${RuntimeGlobals.onChunksLoaded}();` : "" @@ -134845,7 +141383,7 @@ class RequireChunkLoadingRuntimeModule extends RuntimeModule { "", withExternalInstallChunk ? Template.asString([ - "module.exports = __webpack_require__;", + `module.exports = ${RuntimeGlobals.require};`, `${RuntimeGlobals.externalInstallChunk} = installChunk;` ]) : "// no external install chunk", @@ -134922,7 +141460,7 @@ module.exports = RequireChunkLoadingRuntimeModule; /***/ }), -/***/ 38237: +/***/ 65697: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -134934,7 +141472,7 @@ module.exports = RequireChunkLoadingRuntimeModule; const util = __webpack_require__(73837); -const truncateArgs = __webpack_require__(83732); +const truncateArgs = __webpack_require__(64402); module.exports = ({ colors, appendOnly, stream }) => { let currentStatusMessage = undefined; @@ -134966,10 +141504,8 @@ module.exports = ({ colors, appendOnly, stream }) => { const writeStatusMessage = () => { if (!currentStatusMessage) return; - const l = stream.columns; - const args = l - ? truncateArgs(currentStatusMessage, l - 1) - : currentStatusMessage; + const l = stream.columns || 40; + const args = truncateArgs(currentStatusMessage, l - 1); const str = args.join(" "); const coloredStr = `\u001b[1m${str}\u001b[39m\u001b[22m`; stream.write(`\x1b[2K\r${coloredStr}`); @@ -135073,7 +141609,7 @@ module.exports = ({ colors, appendOnly, stream }) => { /***/ }), -/***/ 70188: +/***/ 74280: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -135084,12 +141620,20 @@ module.exports = ({ colors, appendOnly, stream }) => { -const { STAGE_ADVANCED } = __webpack_require__(36760); +const { STAGE_ADVANCED } = __webpack_require__(6537); /** @typedef {import("../Chunk")} Chunk */ /** @typedef {import("../Compiler")} Compiler */ +/** + * @typedef {Object} AggressiveMergingPluginOptions + * @property {number=} minSizeReduce minimal size reduction to trigger merging + */ + class AggressiveMergingPlugin { + /** + * @param {AggressiveMergingPluginOptions=} [options] options object + */ constructor(options) { if ( (options !== undefined && typeof options !== "object") || @@ -135173,7 +141717,7 @@ module.exports = AggressiveMergingPlugin; /***/ }), -/***/ 51361: +/***/ 58561: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -135184,14 +141728,14 @@ module.exports = AggressiveMergingPlugin; -const { STAGE_ADVANCED } = __webpack_require__(36760); -const { intersect } = __webpack_require__(97045); +const { STAGE_ADVANCED } = __webpack_require__(6537); +const { intersect } = __webpack_require__(24352); const { compareModulesByIdentifier, compareChunks -} = __webpack_require__(29355); -const createSchemaValidation = __webpack_require__(94091); -const identifierUtils = __webpack_require__(63146); +} = __webpack_require__(95978); +const createSchemaValidation = __webpack_require__(45488); +const identifierUtils = __webpack_require__(97451); /** @typedef {import("../../declarations/plugins/optimize/AggressiveSplittingPlugin").AggressiveSplittingPluginOptions} AggressiveSplittingPluginOptions */ /** @typedef {import("../Chunk")} Chunk */ @@ -135200,15 +141744,21 @@ const identifierUtils = __webpack_require__(63146); /** @typedef {import("../Module")} Module */ const validate = createSchemaValidation( - __webpack_require__(38020), + __webpack_require__(20166), () => - __webpack_require__(50298), + __webpack_require__(48892), { name: "Aggressive Splitting Plugin", baseDataPath: "options" } ); +/** + * @param {ChunkGraph} chunkGraph the chunk graph + * @param {Chunk} oldChunk the old chunk + * @param {Chunk} newChunk the new chunk + * @returns {(module: Module) => void} function to move module between chunks + */ const moveModuleBetween = (chunkGraph, oldChunk, newChunk) => { return module => { chunkGraph.disconnectChunkAndModule(oldChunk, module); @@ -135271,6 +141821,7 @@ class AggressiveSplittingPlugin { compilation => { let needAdditionalSeal = false; let newSplits; + /** @type {Set} */ let fromAggressiveSplittingSet; let chunkSplitDataMap; compilation.hooks.optimize.tap("AggressiveSplittingPlugin", () => { @@ -135312,8 +141863,8 @@ class AggressiveSplittingPlugin { ? recordedSplits.concat(newSplits) : recordedSplits; - const minSize = this.options.minSize; - const maxSize = this.options.maxSize; + const minSize = /** @type {number} */ (this.options.minSize); + const maxSize = /** @type {number} */ (this.options.maxSize); const applySplit = splitData => { // Cannot split if id is already taken @@ -135510,7 +142061,7 @@ module.exports = AggressiveSplittingPlugin; /***/ }), -/***/ 10742: +/***/ 22590: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -135528,20 +142079,22 @@ const { ConcatSource, ReplaceSource } = __webpack_require__(59728); -const ConcatenationScope = __webpack_require__(68645); -const { UsageState } = __webpack_require__(1723); -const Module = __webpack_require__(96040); -const RuntimeGlobals = __webpack_require__(34623); -const Template = __webpack_require__(88070); -const HarmonyImportDependency = __webpack_require__(52405); -const JavascriptParser = __webpack_require__(23628); -const { equals } = __webpack_require__(91696); -const LazySet = __webpack_require__(66205); -const { concatComparators } = __webpack_require__(29355); -const createHash = __webpack_require__(94624); -const { makePathsRelative } = __webpack_require__(63146); -const makeSerializable = __webpack_require__(23827); -const propertyAccess = __webpack_require__(92884); +const ConcatenationScope = __webpack_require__(92811); +const { UsageState } = __webpack_require__(14768); +const Module = __webpack_require__(6309); +const { JAVASCRIPT_MODULE_TYPE_ESM } = __webpack_require__(92891); +const RuntimeGlobals = __webpack_require__(61539); +const Template = __webpack_require__(88835); +const HarmonyImportDependency = __webpack_require__(75650); +const JavascriptParser = __webpack_require__(27865); +const { equals } = __webpack_require__(22150); +const LazySet = __webpack_require__(57876); +const { concatComparators } = __webpack_require__(95978); +const createHash = __webpack_require__(31147); +const { makePathsRelative } = __webpack_require__(97451); +const makeSerializable = __webpack_require__(83626); +const propertyAccess = __webpack_require__(60305); +const { propertyName } = __webpack_require__(40234); const { filterRuntime, intersectRuntime, @@ -135549,7 +142102,7 @@ const { mergeRuntimeConditionNonFalse, runtimeConditionToString, subtractRuntimeCondition -} = __webpack_require__(55693); +} = __webpack_require__(69965); /** @typedef {import("eslint-scope").Scope} Scope */ /** @typedef {import("webpack-sources").Source} Source */ @@ -136199,7 +142752,7 @@ class ConcatenatedModule extends Module { * @param {Set=} options.modules all concatenated modules */ constructor({ identifier, rootModule, modules, runtime }) { - super("javascript/esm", null, rootModule && rootModule.layer); + super(JAVASCRIPT_MODULE_TYPE_ESM, null, rootModule && rootModule.layer); // Info from Factory /** @type {string} */ @@ -136999,7 +143552,7 @@ class ConcatenatedModule extends Module { const definitions = []; for (const [key, value] of exportsMap) { definitions.push( - `\n ${JSON.stringify(key)}: ${runtimeTemplate.returningFunction( + `\n ${propertyName(key)}: ${runtimeTemplate.returningFunction( value(requestShortener) )}` ); @@ -137044,9 +143597,9 @@ class ConcatenatedModule extends Module { true ); nsObj.push( - `\n ${JSON.stringify( - usedName - )}: ${runtimeTemplate.returningFunction(finalName)}` + `\n ${propertyName(usedName)}: ${runtimeTemplate.returningFunction( + finalName + )}` ); } } @@ -137125,7 +143678,7 @@ ${defineGetters}` result.add(`if (${condition}) {\n`); } result.add( - `var ${info.name} = __webpack_require__(${JSON.stringify( + `var ${info.name} = ${RuntimeGlobals.require}(${JSON.stringify( chunkGraph.getModuleId(info.module) )});` ); @@ -137421,7 +143974,7 @@ module.exports = ConcatenatedModule; /***/ }), -/***/ 20612: +/***/ 76949: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -137432,7 +143985,7 @@ module.exports = ConcatenatedModule; -const { STAGE_BASIC } = __webpack_require__(36760); +const { STAGE_BASIC } = __webpack_require__(6537); /** @typedef {import("../Chunk")} Chunk */ /** @typedef {import("../ChunkGroup")} ChunkGroup */ @@ -137448,6 +144001,9 @@ class EnsureChunkConditionsPlugin { compiler.hooks.compilation.tap( "EnsureChunkConditionsPlugin", compilation => { + /** + * @param {Iterable} chunks the chunks + */ const handler = chunks => { const chunkGraph = compilation.chunkGraph; // These sets are hoisted here to save memory @@ -137514,7 +144070,7 @@ module.exports = EnsureChunkConditionsPlugin; /***/ }), -/***/ 47354: +/***/ 33613: /***/ (function(module) { "use strict"; @@ -137526,6 +144082,7 @@ module.exports = EnsureChunkConditionsPlugin; /** @typedef {import("../Chunk")} Chunk */ +/** @typedef {import("../Chunk").ChunkId} ChunkId */ /** @typedef {import("../Compiler")} Compiler */ /** @typedef {import("../Module")} Module */ @@ -137581,13 +144138,15 @@ class FlagIncludedChunksPlugin { for (const chunk of chunks) { let hash = 0; for (const module of chunkGraph.getChunkModulesIterable(chunk)) { - hash |= moduleBits.get(module); + hash |= /** @type {number} */ (moduleBits.get(module)); } chunkModulesHash.set(chunk, hash); } for (const chunkA of chunks) { - const chunkAHash = chunkModulesHash.get(chunkA); + const chunkAHash = + /** @type {number} */ + (chunkModulesHash.get(chunkA)); const chunkAModulesCount = chunkGraph.getNumberOfChunkModules(chunkA); if (chunkAModulesCount === 0) continue; @@ -137601,7 +144160,7 @@ class FlagIncludedChunksPlugin { bestModule = module; } loopB: for (const chunkB of chunkGraph.getModuleChunksIterable( - bestModule + /** @type {Module} */ (bestModule) )) { // as we iterate the same iterables twice // skip if we find ourselves @@ -137620,14 +144179,17 @@ class FlagIncludedChunksPlugin { // is chunkA in chunkB? // we do a cheap check for the hash value - const chunkBHash = chunkModulesHash.get(chunkB); + const chunkBHash = + /** @type {number} */ + (chunkModulesHash.get(chunkB)); if ((chunkBHash & chunkAHash) !== chunkAHash) continue; // compare all modules for (const m of chunkGraph.getChunkModulesIterable(chunkA)) { if (!chunkGraph.isModuleInChunk(m, chunkB)) continue loopB; } - chunkB.ids.push(chunkA.id); + /** @type {ChunkId[]} */ + (chunkB.ids).push(/** @type {ChunkId} */ (chunkA.id)); } } } @@ -137640,7 +144202,7 @@ module.exports = FlagIncludedChunksPlugin; /***/ }), -/***/ 91424: +/***/ 53310: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; @@ -137651,7 +144213,7 @@ module.exports = FlagIncludedChunksPlugin; -const { UsageState } = __webpack_require__(1723); +const { UsageState } = __webpack_require__(14768); /** @typedef {import("estree").Node} AnyNode */ /** @typedef {import("../Dependency")} Dependency */ @@ -137662,7 +144224,7 @@ const { UsageState } = __webpack_require__(1723); /** @typedef {import("../javascript/JavascriptParser")} JavascriptParser */ /** @typedef {import("../util/runtime").RuntimeSpec} RuntimeSpec */ -/** @typedef {Map | true>} InnerGraph */ +/** @typedef {Map | true | undefined>} InnerGraph */ /** @typedef {function(boolean | Set | undefined): void} UsageCallback */ /** @@ -137680,7 +144242,7 @@ const topLevelSymbolTag = Symbol("top level symbol"); /** * @param {ParserState} parserState parser state - * @returns {State} state + * @returns {State | undefined} state */ function getState(parserState) { return parserStateMap.get(parserState); @@ -137881,7 +144443,7 @@ exports.onUsage = (state, onUsageCallback) => { /** * @param {ParserState} state parser state - * @param {TopLevelSymbol} symbol the symbol + * @param {TopLevelSymbol | undefined} symbol the symbol */ exports.setTopLevelSymbol = (state, symbol) => { const innerGraphState = getState(state); @@ -137906,7 +144468,7 @@ exports.getTopLevelSymbol = state => { /** * @param {JavascriptParser} parser parser * @param {string} name name of variable - * @returns {TopLevelSymbol} symbol + * @returns {TopLevelSymbol | undefined} symbol */ exports.tagTopLevelSymbol = (parser, name) => { const innerGraphState = getState(parser.state); @@ -137955,7 +144517,7 @@ exports.isDependencyUsedByExports = ( /** * @param {Dependency} dependency the dependency - * @param {Set | boolean} usedByExports usedByExports info + * @param {Set | boolean | undefined} usedByExports usedByExports info * @param {ModuleGraph} moduleGraph moduleGraph * @returns {null | false | function(ModuleGraphConnection, RuntimeSpec): ConnectionState} function to determine if the connection is active */ @@ -137994,7 +144556,7 @@ exports.topLevelSymbolTag = topLevelSymbolTag; /***/ }), -/***/ 99231: +/***/ 96404: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -138005,13 +144567,18 @@ exports.topLevelSymbolTag = topLevelSymbolTag; -const PureExpressionDependency = __webpack_require__(94535); -const InnerGraph = __webpack_require__(91424); +const { + JAVASCRIPT_MODULE_TYPE_AUTO, + JAVASCRIPT_MODULE_TYPE_ESM +} = __webpack_require__(92891); +const PureExpressionDependency = __webpack_require__(80510); +const InnerGraph = __webpack_require__(53310); /** @typedef {import("estree").ClassDeclaration} ClassDeclarationNode */ /** @typedef {import("estree").ClassExpression} ClassExpressionNode */ /** @typedef {import("estree").Node} Node */ /** @typedef {import("estree").VariableDeclarator} VariableDeclaratorNode */ +/** @typedef {import("../../declarations/WebpackOptions").JavascriptParserOptions} JavascriptParserOptions */ /** @typedef {import("../Compiler")} Compiler */ /** @typedef {import("../Dependency")} Dependency */ /** @typedef {import("../dependencies/HarmonyImportSpecifierDependency")} HarmonyImportSpecifierDependency */ @@ -138021,6 +144588,8 @@ const InnerGraph = __webpack_require__(91424); const { topLevelSymbolTag } = InnerGraph; +const PLUGIN_NAME = "InnerGraphPlugin"; + class InnerGraphPlugin { /** * Apply the plugin @@ -138029,7 +144598,7 @@ class InnerGraphPlugin { */ apply(compiler) { compiler.hooks.compilation.tap( - "InnerGraphPlugin", + PLUGIN_NAME, (compilation, { normalModuleFactory }) => { const logger = compilation.getLogger("webpack.InnerGraphPlugin"); @@ -138040,7 +144609,7 @@ class InnerGraphPlugin { /** * @param {JavascriptParser} parser the parser - * @param {Object} parserOptions options + * @param {JavascriptParserOptions} parserOptions options * @returns {void} */ const handler = (parser, parserOptions) => { @@ -138061,11 +144630,11 @@ class InnerGraphPlugin { }); }; - parser.hooks.program.tap("InnerGraphPlugin", () => { + parser.hooks.program.tap(PLUGIN_NAME, () => { InnerGraph.enable(parser.state); }); - parser.hooks.finish.tap("InnerGraphPlugin", () => { + parser.hooks.finish.tap(PLUGIN_NAME, () => { if (!InnerGraph.isEnabled(parser.state)) return; logger.time("infer dependency usage"); @@ -138097,7 +144666,7 @@ class InnerGraphPlugin { // The following hooks are used during prewalking: - parser.hooks.preStatement.tap("InnerGraphPlugin", statement => { + parser.hooks.preStatement.tap(PLUGIN_NAME, statement => { if (!InnerGraph.isEnabled(parser.state)) return; if (parser.scope.topLevelScope === true) { @@ -138110,11 +144679,14 @@ class InnerGraphPlugin { } }); - parser.hooks.blockPreStatement.tap("InnerGraphPlugin", statement => { + parser.hooks.blockPreStatement.tap(PLUGIN_NAME, statement => { if (!InnerGraph.isEnabled(parser.state)) return; if (parser.scope.topLevelScope === true) { - if (statement.type === "ClassDeclaration") { + if ( + statement.type === "ClassDeclaration" && + parser.isPure(statement, statement.range[0]) + ) { const name = statement.id ? statement.id.name : "*default*"; const fn = InnerGraph.tagTopLevelSymbol(parser, name); classWithTopLevelSymbol.set(statement, fn); @@ -138125,8 +144697,9 @@ class InnerGraphPlugin { const fn = InnerGraph.tagTopLevelSymbol(parser, name); const decl = statement.declaration; if ( - decl.type === "ClassExpression" || - decl.type === "ClassDeclaration" + (decl.type === "ClassExpression" || + decl.type === "ClassDeclaration") && + parser.isPure(decl, decl.range[0]) ) { classWithTopLevelSymbol.set(decl, fn); } else if (parser.isPure(decl, statement.range[0])) { @@ -138143,33 +144716,33 @@ class InnerGraphPlugin { } }); - parser.hooks.preDeclarator.tap( - "InnerGraphPlugin", - (decl, statement) => { - if (!InnerGraph.isEnabled(parser.state)) return; + parser.hooks.preDeclarator.tap(PLUGIN_NAME, (decl, statement) => { + if (!InnerGraph.isEnabled(parser.state)) return; + if ( + parser.scope.topLevelScope === true && + decl.init && + decl.id.type === "Identifier" + ) { + const name = decl.id.name; if ( - parser.scope.topLevelScope === true && - decl.init && - decl.id.type === "Identifier" + decl.init.type === "ClassExpression" && + parser.isPure(decl.init, decl.id.range[1]) ) { - const name = decl.id.name; - if (decl.init.type === "ClassExpression") { - const fn = InnerGraph.tagTopLevelSymbol(parser, name); - classWithTopLevelSymbol.set(decl.init, fn); - } else if (parser.isPure(decl.init, decl.id.range[1])) { - const fn = InnerGraph.tagTopLevelSymbol(parser, name); - declWithTopLevelSymbol.set(decl, fn); - if ( - !decl.init.type.endsWith("FunctionExpression") && - decl.init.type !== "Literal" - ) { - pureDeclarators.add(decl); - } - return true; + const fn = InnerGraph.tagTopLevelSymbol(parser, name); + classWithTopLevelSymbol.set(decl.init, fn); + } else if (parser.isPure(decl.init, decl.id.range[1])) { + const fn = InnerGraph.tagTopLevelSymbol(parser, name); + declWithTopLevelSymbol.set(decl, fn); + if ( + !decl.init.type.endsWith("FunctionExpression") && + decl.init.type !== "Literal" + ) { + pureDeclarators.add(decl); } + return true; } } - ); + }); // During real walking we set the TopLevelSymbol state to the assigned // TopLevelSymbol by using the fill datastructures. @@ -138187,7 +144760,7 @@ class InnerGraphPlugin { // The following hooks are called during walking: - parser.hooks.statement.tap("InnerGraphPlugin", statement => { + parser.hooks.statement.tap(PLUGIN_NAME, statement => { if (!InnerGraph.isEnabled(parser.state)) return; if (parser.scope.topLevelScope === true) { InnerGraph.setTopLevelSymbol(parser.state, undefined); @@ -138219,7 +144792,7 @@ class InnerGraphPlugin { }); parser.hooks.classExtendsExpression.tap( - "InnerGraphPlugin", + PLUGIN_NAME, (expr, statement) => { if (!InnerGraph.isEnabled(parser.state)) return; if (parser.scope.topLevelScope === true) { @@ -138239,7 +144812,7 @@ class InnerGraphPlugin { ); parser.hooks.classBodyElement.tap( - "InnerGraphPlugin", + PLUGIN_NAME, (element, classDefinition) => { if (!InnerGraph.isEnabled(parser.state)) return; if (parser.scope.topLevelScope === true) { @@ -138252,7 +144825,7 @@ class InnerGraphPlugin { ); parser.hooks.classBodyValue.tap( - "InnerGraphPlugin", + PLUGIN_NAME, (expression, element, classDefinition) => { if (!InnerGraph.isEnabled(parser.state)) return; if (parser.scope.topLevelScope === true) { @@ -138292,7 +144865,7 @@ class InnerGraphPlugin { } ); - parser.hooks.declarator.tap("InnerGraphPlugin", (decl, statement) => { + parser.hooks.declarator.tap(PLUGIN_NAME, (decl, statement) => { if (!InnerGraph.isEnabled(parser.state)) return; const fn = declWithTopLevelSymbol.get(decl); @@ -138330,7 +144903,7 @@ class InnerGraphPlugin { parser.hooks.expression .for(topLevelSymbolTag) - .tap("InnerGraphPlugin", () => { + .tap(PLUGIN_NAME, () => { const topLevelSymbol = /** @type {TopLevelSymbol} */ ( parser.currentTagData ); @@ -138343,21 +144916,19 @@ class InnerGraphPlugin { currentTopLevelSymbol || true ); }); - parser.hooks.assign - .for(topLevelSymbolTag) - .tap("InnerGraphPlugin", expr => { - if (!InnerGraph.isEnabled(parser.state)) return; - if (expr.operator === "=") return true; - }); + parser.hooks.assign.for(topLevelSymbolTag).tap(PLUGIN_NAME, expr => { + if (!InnerGraph.isEnabled(parser.state)) return; + if (expr.operator === "=") return true; + }); }; normalModuleFactory.hooks.parser - .for("javascript/auto") - .tap("InnerGraphPlugin", handler); + .for(JAVASCRIPT_MODULE_TYPE_AUTO) + .tap(PLUGIN_NAME, handler); normalModuleFactory.hooks.parser - .for("javascript/esm") - .tap("InnerGraphPlugin", handler); + .for(JAVASCRIPT_MODULE_TYPE_ESM) + .tap(PLUGIN_NAME, handler); - compilation.hooks.finishModules.tap("InnerGraphPlugin", () => { + compilation.hooks.finishModules.tap(PLUGIN_NAME, () => { logger.timeAggregateEnd("infer dependency usage"); }); } @@ -138370,7 +144941,7 @@ module.exports = InnerGraphPlugin; /***/ }), -/***/ 57823: +/***/ 96296: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -138381,18 +144952,18 @@ module.exports = InnerGraphPlugin; -const { STAGE_ADVANCED } = __webpack_require__(36760); -const LazyBucketSortedSet = __webpack_require__(73474); -const { compareChunks } = __webpack_require__(29355); -const createSchemaValidation = __webpack_require__(94091); +const { STAGE_ADVANCED } = __webpack_require__(6537); +const LazyBucketSortedSet = __webpack_require__(9636); +const { compareChunks } = __webpack_require__(95978); +const createSchemaValidation = __webpack_require__(45488); /** @typedef {import("../../declarations/plugins/optimize/LimitChunkCountPlugin").LimitChunkCountPluginOptions} LimitChunkCountPluginOptions */ /** @typedef {import("../Chunk")} Chunk */ /** @typedef {import("../Compiler")} Compiler */ const validate = createSchemaValidation( - __webpack_require__(14647), - () => __webpack_require__(70757), + __webpack_require__(90033), + () => __webpack_require__(42536), { name: "Limit Chunk Count Plugin", baseDataPath: "options" @@ -138412,6 +144983,12 @@ const validate = createSchemaValidation( * @property {number} bSize */ +/** + * @template K, V + * @param {Map>} map map + * @param {K} key key + * @param {V} value value + */ const addToSetMap = (map, key, value) => { const set = map.get(key); if (set === undefined) { @@ -138444,7 +145021,9 @@ class LimitChunkCountPlugin { }, chunks => { const chunkGraph = compilation.chunkGraph; - const maxChunks = options.maxChunks; + const maxChunks = + /** @type {LimitChunkCountPluginOptions} */ + (options).maxChunks; if (!maxChunks) return; if (maxChunks < 1) return; if (compilation.chunks.size <= maxChunks) return; @@ -138464,9 +145043,17 @@ class LimitChunkCountPlugin { c => c.sizeDiff, (a, b) => b - a, // Layer 2: ordered by smallest combined size + /** + * @param {ChunkCombination} c combination + * @returns {number} integrated size + */ c => c.integratedSize, (a, b) => a - b, // Layer 3: ordered by position difference in orderedChunk (-> to be deterministic) + /** + * @param {ChunkCombination} c combination + * @returns {number} position difference + */ c => c.bIdx - c.aIdx, (a, b) => a - b, // Layer 4: ordered by position in orderedChunk (-> to be deterministic) @@ -138569,14 +145156,18 @@ class LimitChunkCountPlugin { // Update all affected combinations // delete all combination with the removed chunk // we will use combinations with the kept chunk instead - for (const combination of combinationsByChunk.get(a)) { + for (const combination of /** @type {Set} */ ( + combinationsByChunk.get(a) + )) { if (combination.deleted) continue; combination.deleted = true; combinations.delete(combination); } // Update combinations with the kept chunk with new sizes - for (const combination of combinationsByChunk.get(b)) { + for (const combination of /** @type {Set} */ ( + combinationsByChunk.get(b) + )) { if (combination.deleted) continue; if (combination.a === b) { if (!chunkGraph.canChunksBeIntegrated(a, combination.b)) { @@ -138619,7 +145210,12 @@ class LimitChunkCountPlugin { finishUpdate(); } } - combinationsByChunk.set(a, combinationsByChunk.get(b)); + combinationsByChunk.set( + a, + /** @type {Set} */ ( + combinationsByChunk.get(b) + ) + ); combinationsByChunk.delete(b); } } @@ -138634,7 +145230,7 @@ module.exports = LimitChunkCountPlugin; /***/ }), -/***/ 11179: +/***/ 19966: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -138645,14 +145241,14 @@ module.exports = LimitChunkCountPlugin; -const { UsageState } = __webpack_require__(1723); +const { UsageState } = __webpack_require__(14768); const { numberToIdentifier, NUMBER_OF_IDENTIFIER_START_CHARS, NUMBER_OF_IDENTIFIER_CONTINUATION_CHARS -} = __webpack_require__(88070); -const { assignDeterministicIds } = __webpack_require__(15869); -const { compareSelect, compareStringsNumeric } = __webpack_require__(29355); +} = __webpack_require__(88835); +const { assignDeterministicIds } = __webpack_require__(2970); +const { compareSelect, compareStringsNumeric } = __webpack_require__(95978); /** @typedef {import("../Compiler")} Compiler */ /** @typedef {import("../ExportsInfo")} ExportsInfo */ @@ -138679,7 +145275,7 @@ const comparator = compareSelect(e => e.name, compareStringsNumeric); /** * @param {boolean} deterministic use deterministic names * @param {ExportsInfo} exportsInfo exports info - * @param {boolean} isNamespace is namespace object + * @param {boolean | undefined} isNamespace is namespace object * @returns {void} */ const mangleExportsInfo = (deterministic, exportsInfo, isNamespace) => { @@ -138819,7 +145415,7 @@ module.exports = MangleExportsPlugin; /***/ }), -/***/ 16767: +/***/ 43505: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -138830,8 +145426,8 @@ module.exports = MangleExportsPlugin; -const { STAGE_BASIC } = __webpack_require__(36760); -const { runtimeEqual } = __webpack_require__(55693); +const { STAGE_BASIC } = __webpack_require__(6537); +const { runtimeEqual } = __webpack_require__(69965); /** @typedef {import("../Compiler")} Compiler */ @@ -138942,7 +145538,7 @@ module.exports = MergeDuplicateChunksPlugin; /***/ }), -/***/ 38827: +/***/ 89331: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -138953,16 +145549,16 @@ module.exports = MergeDuplicateChunksPlugin; -const { STAGE_ADVANCED } = __webpack_require__(36760); -const createSchemaValidation = __webpack_require__(94091); +const { STAGE_ADVANCED } = __webpack_require__(6537); +const createSchemaValidation = __webpack_require__(45488); /** @typedef {import("../../declarations/plugins/optimize/MinChunkSizePlugin").MinChunkSizePluginOptions} MinChunkSizePluginOptions */ /** @typedef {import("../Chunk")} Chunk */ /** @typedef {import("../Compiler")} Compiler */ const validate = createSchemaValidation( - __webpack_require__(98206), - () => __webpack_require__(87260), + __webpack_require__(42945), + () => __webpack_require__(54973), { name: "Min Chunk Size Plugin", baseDataPath: "options" @@ -139063,7 +145659,7 @@ module.exports = MinChunkSizePlugin; /***/ }), -/***/ 90508: +/***/ 97061: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -139074,10 +145670,15 @@ module.exports = MinChunkSizePlugin; -const SizeFormatHelpers = __webpack_require__(53592); -const WebpackError = __webpack_require__(10841); +const SizeFormatHelpers = __webpack_require__(73273); +const WebpackError = __webpack_require__(49999); class MinMaxSizeWarning extends WebpackError { + /** + * @param {string[] | undefined} keys keys + * @param {number} minSize minimum size + * @param {number} maxSize maximum size + */ constructor(keys, minSize, maxSize) { let keysMessage = "Fallback cache group"; if (keys) { @@ -139101,7 +145702,7 @@ module.exports = MinMaxSizeWarning; /***/ }), -/***/ 2410: +/***/ 11837: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -139113,19 +145714,19 @@ module.exports = MinMaxSizeWarning; const asyncLib = __webpack_require__(47087); -const ChunkGraph = __webpack_require__(64438); -const ModuleGraph = __webpack_require__(85215); -const { STAGE_DEFAULT } = __webpack_require__(36760); -const HarmonyImportDependency = __webpack_require__(52405); -const { compareModulesByIdentifier } = __webpack_require__(29355); +const ChunkGraph = __webpack_require__(84275); +const ModuleGraph = __webpack_require__(43714); +const { STAGE_DEFAULT } = __webpack_require__(6537); +const HarmonyImportDependency = __webpack_require__(75650); +const { compareModulesByIdentifier } = __webpack_require__(95978); const { intersectRuntime, mergeRuntimeOwned, filterRuntime, runtimeToString, mergeRuntime -} = __webpack_require__(55693); -const ConcatenatedModule = __webpack_require__(10742); +} = __webpack_require__(69965); +const ConcatenatedModule = __webpack_require__(22590); /** @typedef {import("../Compilation")} Compilation */ /** @typedef {import("../Compiler")} Compiler */ @@ -139147,6 +145748,10 @@ const ConcatenatedModule = __webpack_require__(10742); * @property {number} added */ +/** + * @param {string} msg message + * @returns {string} formatted message + */ const formatBailoutReason = msg => { return "ModuleConcatenation bailout: " + msg; }; @@ -139171,8 +145776,13 @@ class ModuleConcatenationPlugin { ); } const moduleGraph = compilation.moduleGraph; + /** @type {Map string)>} */ const bailoutReasonMap = new Map(); + /** + * @param {Module} module the module + * @param {string | ((requestShortener: RequestShortener) => string)} reason the reason + */ const setBailoutReason = (module, reason) => { setInnerBailoutReason(module, reason); moduleGraph @@ -139184,16 +145794,30 @@ class ModuleConcatenationPlugin { ); }; + /** + * @param {Module} module the module + * @param {string | ((requestShortener: RequestShortener) => string)} reason the reason + */ const setInnerBailoutReason = (module, reason) => { bailoutReasonMap.set(module, reason); }; + /** + * @param {Module} module the module + * @param {RequestShortener} requestShortener the request shortener + * @returns {string | ((requestShortener: RequestShortener) => string) | undefined} the reason + */ const getInnerBailoutReason = (module, requestShortener) => { const reason = bailoutReasonMap.get(module); if (typeof reason === "function") return reason(requestShortener); return reason; }; + /** + * @param {Module} module the module + * @param {Module | function(RequestShortener): string} problem the problem + * @returns {(requestShortener: RequestShortener) => string} the reason + */ const formatBailoutWarning = (module, problem) => requestShortener => { if (typeof problem === "function") { return formatBailoutReason( @@ -139567,7 +146191,7 @@ class ModuleConcatenationPlugin { c.module === rootModule ? c.originModule : c.module; const innerConnection = c.dependency instanceof HarmonyImportDependency && - modules.has(otherModule); + modules.has(/** @type {Module} */ (otherModule)); return !innerConnection; }); // add concatenated module to the compilation @@ -139640,7 +146264,7 @@ class ModuleConcatenationPlugin { * @param {ChunkGraph} chunkGraph the chunk graph * @param {boolean} avoidMutateOnFailure avoid mutating the config when adding fails * @param {Statistics} statistics gathering metrics - * @returns {Module | function(RequestShortener): string} the problematic module + * @returns {null | Module | function(RequestShortener): string} the problematic module */ _tryToAdd( compilation, @@ -139679,6 +146303,10 @@ class ModuleConcatenationPlugin { chunkGraph.getModuleChunksIterable(config.rootModule) ).filter(chunk => !chunkGraph.isModuleInChunk(module, chunk)); if (missingChunks.length > 0) { + /** + * @param {RequestShortener} requestShortener request shortener + * @returns {string} problem description + */ const problem = requestShortener => { const missingChunksList = Array.from( new Set(missingChunks.map(chunk => chunk.name || "unnamed chunk(s)")) @@ -139716,6 +146344,10 @@ class ModuleConcatenationPlugin { return connection.isActive(runtime); }); if (activeNonModulesConnections.length > 0) { + /** + * @param {RequestShortener} requestShortener request shortener + * @returns {string} problem description + */ const problem = requestShortener => { const importingExplanations = new Set( activeNonModulesConnections.map(c => c.explanation).filter(Boolean) @@ -139773,6 +146405,10 @@ class ModuleConcatenationPlugin { return false; }); if (otherChunkModules.length > 0) { + /** + * @param {RequestShortener} requestShortener request shortener + * @returns {string} problem description + */ const problem = requestShortener => { const names = otherChunkModules .map(m => m.readableIdentifier(requestShortener)) @@ -139800,6 +146436,10 @@ class ModuleConcatenationPlugin { nonHarmonyConnections.set(originModule, connections); } if (nonHarmonyConnections.size > 0) { + /** + * @param {RequestShortener} requestShortener request shortener + * @returns {string} problem description + */ const problem = requestShortener => { const names = Array.from(nonHarmonyConnections) .map(([originModule, connections]) => { @@ -139860,6 +146500,10 @@ class ModuleConcatenationPlugin { } } if (otherRuntimeConnections.length > 0) { + /** + * @param {RequestShortener} requestShortener request shortener + * @returns {string} problem description + */ const problem = requestShortener => { return `Module ${module.readableIdentifier( requestShortener @@ -139938,10 +146582,17 @@ class ConcatConfiguration { this.warnings = new Map(); } + /** + * @param {Module} module the module + */ add(module) { this.modules.add(module); } + /** + * @param {Module} module the module + * @returns {boolean} true, when the module is in the module set + */ has(module) { return this.modules.has(module); } @@ -139950,10 +146601,17 @@ class ConcatConfiguration { return this.modules.size === 1; } + /** + * @param {Module} module the module + * @param {Module | function(RequestShortener): string} problem the problem + */ addWarning(module, problem) { this.warnings.set(module, problem); } + /** + * @returns {Map} warnings + */ getWarningsSorted() { return new Map( Array.from(this.warnings).sort((a, b) => { @@ -139994,7 +146652,7 @@ module.exports = ModuleConcatenationPlugin; /***/ }), -/***/ 30471: +/***/ 79512: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -140007,17 +146665,24 @@ module.exports = ModuleConcatenationPlugin; const { SyncBailHook } = __webpack_require__(70793); const { RawSource, CachedSource, CompatSource } = __webpack_require__(59728); -const Compilation = __webpack_require__(38292); -const WebpackError = __webpack_require__(10841); -const { compareSelect, compareStrings } = __webpack_require__(29355); -const createHash = __webpack_require__(94624); +const Compilation = __webpack_require__(20417); +const WebpackError = __webpack_require__(49999); +const { compareSelect, compareStrings } = __webpack_require__(95978); +const createHash = __webpack_require__(31147); /** @typedef {import("webpack-sources").Source} Source */ +/** @typedef {import("../Cache").Etag} Etag */ /** @typedef {import("../Compilation").AssetInfo} AssetInfo */ /** @typedef {import("../Compiler")} Compiler */ +/** @typedef {typeof import("../util/Hash")} Hash */ const EMPTY_SET = new Set(); +/** + * @template T + * @param {T | T[]} itemOrItems item or items + * @param {Set} list list + */ const addToList = (itemOrItems, list) => { if (Array.isArray(itemOrItems)) { for (const item of itemOrItems) { @@ -140060,6 +146725,10 @@ const quoteMeta = str => { const cachedSourceMap = new WeakMap(); +/** + * @param {Source} source source + * @returns {CachedSource} cached source + */ const toCachedSource = source => { if (source instanceof CachedSource) { return source; @@ -140071,6 +146740,10 @@ const toCachedSource = source => { return newSource; }; +/** @typedef {Set} OwnHashes */ +/** @typedef {Set} ReferencedHashes */ +/** @typedef {Set} Hashes */ + /** * @typedef {Object} AssetInfoForRealContentHash * @property {string} name @@ -140079,11 +146752,11 @@ const toCachedSource = source => { * @property {RawSource | undefined} newSource * @property {RawSource | undefined} newSourceWithoutOwn * @property {string} content - * @property {Set} ownHashes - * @property {Promise} contentComputePromise - * @property {Promise} contentComputeWithoutOwnPromise - * @property {Set} referencedHashes - * @property {Set} hashes + * @property {OwnHashes | undefined} ownHashes + * @property {Promise | undefined} contentComputePromise + * @property {Promise | undefined} contentComputeWithoutOwnPromise + * @property {ReferencedHashes | undefined} referencedHashes + * @property {Hashes} hashes */ /** @@ -140115,6 +146788,11 @@ class RealContentHashPlugin { return hooks; } + /** + * @param {Object} options options object + * @param {string | Hash} options.hashFunction the hash function to use + * @param {string} options.hashDigest the hash digest to use + */ constructor({ hashFunction, hashDigest }) { this._hashFunction = hashFunction; this._hashDigest = hashDigest; @@ -140143,27 +146821,25 @@ class RealContentHashPlugin { const assets = compilation.getAssets(); /** @type {AssetInfoForRealContentHash[]} */ const assetsWithInfo = []; + /** @type {Map} */ const hashToAssets = new Map(); for (const { source, info, name } of assets) { const cachedSource = toCachedSource(source); - const content = cachedSource.source(); - /** @type {Set} */ + const content = /** @type {string} */ (cachedSource.source()); + /** @type {Hashes} */ const hashes = new Set(); addToList(info.contenthash, hashes); + /** @type {AssetInfoForRealContentHash} */ const data = { name, info, source: cachedSource, - /** @type {RawSource | undefined} */ newSource: undefined, - /** @type {RawSource | undefined} */ newSourceWithoutOwn: undefined, content, - /** @type {Set} */ ownHashes: undefined, contentComputePromise: undefined, contentComputeWithoutOwnPromise: undefined, - /** @type {Set} */ referencedHashes: undefined, hashes }; @@ -140212,11 +146888,17 @@ class RealContentHashPlugin { }); }) ); + /** + * @param {string} hash the hash + * @returns {undefined | ReferencedHashes} the referenced hashes + */ const getDependencies = hash => { const assets = hashToAssets.get(hash); if (!assets) { const referencingAssets = assetsWithInfo.filter(asset => - asset.referencedHashes.has(hash) + /** @type {ReferencedHashes} */ (asset.referencedHashes).has( + hash + ) ); const err = new WebpackError(`RealContentHashPlugin Some kind of unexpected caching problem occurred. @@ -140236,23 +146918,36 @@ ${referencingAssets } const hashes = new Set(); for (const { referencedHashes, ownHashes } of assets) { - if (!ownHashes.has(hash)) { - for (const hash of ownHashes) { + if (!(/** @type {OwnHashes} */ (ownHashes).has(hash))) { + for (const hash of /** @type {OwnHashes} */ (ownHashes)) { hashes.add(hash); } } - for (const hash of referencedHashes) { + for (const hash of /** @type {ReferencedHashes} */ ( + referencedHashes + )) { hashes.add(hash); } } return hashes; }; + /** + * @param {string} hash the hash + * @returns {string} the hash info + */ const hashInfo = hash => { const assets = hashToAssets.get(hash); - return `${hash} (${Array.from(assets, a => a.name)})`; + return `${hash} (${Array.from( + /** @type {AssetInfoForRealContentHash[]} */ (assets), + a => a.name + )})`; }; const hashesInOrder = new Set(); for (const hash of hashToAssets.keys()) { + /** + * @param {string} hash the hash + * @param {Set} stack stack of hashes + */ const add = (hash, stack) => { const deps = getDependencies(hash); if (!deps) return; @@ -140276,21 +146971,31 @@ ${referencingAssets add(hash, new Set()); } const hashToNewHash = new Map(); + /** + * @param {AssetInfoForRealContentHash} asset asset info + * @returns {Etag} etag + */ const getEtag = asset => cacheGenerate.mergeEtags( cacheGenerate.getLazyHashedEtag(asset.source), - Array.from(asset.referencedHashes, hash => - hashToNewHash.get(hash) + Array.from( + /** @type {ReferencedHashes} */ (asset.referencedHashes), + hash => hashToNewHash.get(hash) ).join("|") ); + /** + * @param {AssetInfoForRealContentHash} asset asset info + * @returns {Promise} + */ const computeNewContent = asset => { if (asset.contentComputePromise) return asset.contentComputePromise; return (asset.contentComputePromise = (async () => { if ( - asset.ownHashes.size > 0 || - Array.from(asset.referencedHashes).some( - hash => hashToNewHash.get(hash) !== hash - ) + /** @type {OwnHashes} */ (asset.ownHashes).size > 0 || + Array.from( + /** @type {ReferencedHashes} */ + (asset.referencedHashes) + ).some(hash => hashToNewHash.get(hash) !== hash) ) { const identifier = asset.name; const etag = getEtag(asset); @@ -140307,15 +147012,20 @@ ${referencingAssets } })()); }; + /** + * @param {AssetInfoForRealContentHash} asset asset info + * @returns {Promise} + */ const computeNewContentWithoutOwn = asset => { if (asset.contentComputeWithoutOwnPromise) return asset.contentComputeWithoutOwnPromise; return (asset.contentComputeWithoutOwnPromise = (async () => { if ( - asset.ownHashes.size > 0 || - Array.from(asset.referencedHashes).some( - hash => hashToNewHash.get(hash) !== hash - ) + /** @type {OwnHashes} */ (asset.ownHashes).size > 0 || + Array.from( + /** @type {ReferencedHashes} */ + (asset.referencedHashes) + ).some(hash => hashToNewHash.get(hash) !== hash) ) { const identifier = asset.name + "|without-own"; const etag = getEtag(asset); @@ -140326,7 +147036,9 @@ ${referencingAssets const newContent = asset.content.replace( hashRegExp, hash => { - if (asset.ownHashes.has(hash)) { + if ( + /** @type {OwnHashes} */ (asset.ownHashes).has(hash) + ) { return ""; } return hashToNewHash.get(hash); @@ -140340,17 +147052,19 @@ ${referencingAssets }; const comparator = compareSelect(a => a.name, compareStrings); for (const oldHash of hashesInOrder) { - const assets = hashToAssets.get(oldHash); + const assets = + /** @type {AssetInfoForRealContentHash[]} */ + (hashToAssets.get(oldHash)); assets.sort(comparator); await Promise.all( assets.map(asset => - asset.ownHashes.has(oldHash) + /** @type {OwnHashes} */ (asset.ownHashes).has(oldHash) ? computeNewContentWithoutOwn(asset) : computeNewContent(asset) ) ); const assetsContent = mapAndDeduplicateBuffers(assets, asset => { - if (asset.ownHashes.has(oldHash)) { + if (/** @type {OwnHashes} */ (asset.ownHashes).has(oldHash)) { return asset.newSourceWithoutOwn ? asset.newSourceWithoutOwn.buffer() : asset.source.buffer(); @@ -140413,7 +147127,7 @@ module.exports = RealContentHashPlugin; /***/ }), -/***/ 3469: +/***/ 52793: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -140424,7 +147138,7 @@ module.exports = RealContentHashPlugin; -const { STAGE_BASIC, STAGE_ADVANCED } = __webpack_require__(36760); +const { STAGE_BASIC, STAGE_ADVANCED } = __webpack_require__(6537); /** @typedef {import("../Chunk")} Chunk */ /** @typedef {import("../Compiler")} Compiler */ @@ -140478,7 +147192,7 @@ module.exports = RemoveEmptyChunksPlugin; /***/ }), -/***/ 17936: +/***/ 59426: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -140489,10 +147203,12 @@ module.exports = RemoveEmptyChunksPlugin; -const { STAGE_BASIC } = __webpack_require__(36760); -const Queue = __webpack_require__(5004); -const { intersect } = __webpack_require__(97045); +const { STAGE_BASIC } = __webpack_require__(6537); +const Queue = __webpack_require__(67755); +const { intersect } = __webpack_require__(24352); +/** @typedef {import("../Chunk")} Chunk */ +/** @typedef {import("../ChunkGroup")} ChunkGroup */ /** @typedef {import("../Compiler")} Compiler */ class RemoveParentModulesPlugin { @@ -140502,6 +147218,10 @@ class RemoveParentModulesPlugin { */ apply(compiler) { compiler.hooks.compilation.tap("RemoveParentModulesPlugin", compilation => { + /** + * @param {Iterable} chunks the chunks + * @param {ChunkGroup[]} chunkGroups the chunk groups + */ const handler = (chunks, chunkGroups) => { const chunkGraph = compilation.chunkGraph; const queue = new Queue(); @@ -140607,7 +147327,7 @@ module.exports = RemoveParentModulesPlugin; /***/ }), -/***/ 32015: +/***/ 70522: /***/ (function(module) { "use strict"; @@ -140618,11 +147338,17 @@ module.exports = RemoveParentModulesPlugin; +/** @typedef {import("../Compilation").EntryData} EntryData */ /** @typedef {import("../Compiler")} Compiler */ +/** @typedef {import("../Entrypoint")} Entrypoint */ class RuntimeChunkPlugin { constructor(options) { this.options = { + /** + * @param {Entrypoint} entrypoint entrypoint name + * @returns {string} runtime chunk name + */ name: entrypoint => `runtime~${entrypoint.name}`, ...options }; @@ -140639,7 +147365,9 @@ class RuntimeChunkPlugin { "RuntimeChunkPlugin", (_, { name: entryName }) => { if (entryName === undefined) return; - const data = compilation.entries.get(entryName); + const data = + /** @type {EntryData} */ + (compilation.entries.get(entryName)); if (data.options.runtime === undefined && !data.options.dependOn) { // Determine runtime chunk name let name = this.options.name; @@ -140659,7 +147387,7 @@ module.exports = RuntimeChunkPlugin; /***/ }), -/***/ 35762: +/***/ 29848: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -140671,11 +147399,18 @@ module.exports = RuntimeChunkPlugin; const glob2regexp = __webpack_require__(7069); -const { STAGE_DEFAULT } = __webpack_require__(36760); -const HarmonyExportImportedSpecifierDependency = __webpack_require__(49933); -const HarmonyImportSpecifierDependency = __webpack_require__(13474); -const formatLocation = __webpack_require__(49064); - +const { + JAVASCRIPT_MODULE_TYPE_AUTO, + JAVASCRIPT_MODULE_TYPE_ESM, + JAVASCRIPT_MODULE_TYPE_DYNAMIC +} = __webpack_require__(92891); +const { STAGE_DEFAULT } = __webpack_require__(6537); +const HarmonyExportImportedSpecifierDependency = __webpack_require__(75624); +const HarmonyImportSpecifierDependency = __webpack_require__(72952); +const formatLocation = __webpack_require__(60246); + +/** @typedef {import("estree").ModuleDeclaration} ModuleDeclaration */ +/** @typedef {import("estree").Statement} Statement */ /** @typedef {import("../Compiler")} Compiler */ /** @typedef {import("../Dependency")} Dependency */ /** @typedef {import("../Module")} Module */ @@ -140715,6 +147450,8 @@ const globToRegexp = (glob, cache) => { return regexp; }; +const PLUGIN_NAME = "SideEffectsFlagPlugin"; + class SideEffectsFlagPlugin { /** * @param {boolean} analyseSource analyse source code for side effects @@ -140734,60 +147471,54 @@ class SideEffectsFlagPlugin { globToRegexpCache.set(compiler.root, cache); } compiler.hooks.compilation.tap( - "SideEffectsFlagPlugin", + PLUGIN_NAME, (compilation, { normalModuleFactory }) => { const moduleGraph = compilation.moduleGraph; - normalModuleFactory.hooks.module.tap( - "SideEffectsFlagPlugin", - (module, data) => { - const resolveData = data.resourceResolveData; - if ( - resolveData && - resolveData.descriptionFileData && - resolveData.relativePath - ) { - const sideEffects = resolveData.descriptionFileData.sideEffects; - if (sideEffects !== undefined) { - if (module.factoryMeta === undefined) { - module.factoryMeta = {}; - } - const hasSideEffects = - SideEffectsFlagPlugin.moduleHasSideEffects( - resolveData.relativePath, - sideEffects, - cache - ); - module.factoryMeta.sideEffectFree = !hasSideEffects; - } - } - - return module; - } - ); - normalModuleFactory.hooks.module.tap( - "SideEffectsFlagPlugin", - (module, data) => { - if (typeof data.settings.sideEffects === "boolean") { + normalModuleFactory.hooks.module.tap(PLUGIN_NAME, (module, data) => { + const resolveData = data.resourceResolveData; + if ( + resolveData && + resolveData.descriptionFileData && + resolveData.relativePath + ) { + const sideEffects = resolveData.descriptionFileData.sideEffects; + if (sideEffects !== undefined) { if (module.factoryMeta === undefined) { module.factoryMeta = {}; } - module.factoryMeta.sideEffectFree = !data.settings.sideEffects; + const hasSideEffects = SideEffectsFlagPlugin.moduleHasSideEffects( + resolveData.relativePath, + sideEffects, + cache + ); + module.factoryMeta.sideEffectFree = !hasSideEffects; } - return module; } - ); + + return module; + }); + normalModuleFactory.hooks.module.tap(PLUGIN_NAME, (module, data) => { + if (typeof data.settings.sideEffects === "boolean") { + if (module.factoryMeta === undefined) { + module.factoryMeta = {}; + } + module.factoryMeta.sideEffectFree = !data.settings.sideEffects; + } + return module; + }); if (this._analyseSource) { /** * @param {JavascriptParser} parser the parser * @returns {void} */ const parserHandler = parser => { + /** @type {undefined | Statement | ModuleDeclaration} */ let sideEffectsStatement; - parser.hooks.program.tap("SideEffectsFlagPlugin", () => { + parser.hooks.program.tap(PLUGIN_NAME, () => { sideEffectsStatement = undefined; }); parser.hooks.statement.tap( - { name: "SideEffectsFlagPlugin", stage: -100 }, + { name: PLUGIN_NAME, stage: -100 }, statement => { if (sideEffectsStatement) return; if (parser.scope.topLevelScope !== true) return; @@ -140868,7 +147599,7 @@ class SideEffectsFlagPlugin { } } ); - parser.hooks.finish.tap("SideEffectsFlagPlugin", () => { + parser.hooks.finish.tap(PLUGIN_NAME, () => { if (sideEffectsStatement === undefined) { parser.state.module.buildMeta.sideEffectFree = true; } else { @@ -140885,18 +147616,18 @@ class SideEffectsFlagPlugin { }); }; for (const key of [ - "javascript/auto", - "javascript/esm", - "javascript/dynamic" + JAVASCRIPT_MODULE_TYPE_AUTO, + JAVASCRIPT_MODULE_TYPE_ESM, + JAVASCRIPT_MODULE_TYPE_DYNAMIC ]) { normalModuleFactory.hooks.parser .for(key) - .tap("SideEffectsFlagPlugin", parserHandler); + .tap(PLUGIN_NAME, parserHandler); } } compilation.hooks.optimizeDependencies.tap( { - name: "SideEffectsFlagPlugin", + name: PLUGIN_NAME, stage: STAGE_DEFAULT }, modules => { @@ -140923,7 +147654,7 @@ class SideEffectsFlagPlugin { // TODO improve for export * if (isReexport && dep.name) { const exportInfo = moduleGraph.getExportInfo( - connection.originModule, + /** @type {Module} */ (connection.originModule), dep.name ); exportInfo.moveTarget( @@ -140984,6 +147715,12 @@ class SideEffectsFlagPlugin { ); } + /** + * @param {string} moduleName the module name + * @param {undefined | boolean | string | string[]} flagValue the flag value + * @param {Map} cache cache for glob to regexp + * @returns {boolean | undefined} true, when the module has side effects, undefined or false when not + */ static moduleHasSideEffects(moduleName, flagValue, cache) { switch (typeof flagValue) { case "undefined": @@ -141004,7 +147741,7 @@ module.exports = SideEffectsFlagPlugin; /***/ }), -/***/ 53443: +/***/ 39834: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -141015,21 +147752,21 @@ module.exports = SideEffectsFlagPlugin; -const Chunk = __webpack_require__(67732); -const { STAGE_ADVANCED } = __webpack_require__(36760); -const WebpackError = __webpack_require__(10841); -const { requestToId } = __webpack_require__(15869); -const { isSubset } = __webpack_require__(97045); -const SortableSet = __webpack_require__(98203); +const Chunk = __webpack_require__(93399); +const { STAGE_ADVANCED } = __webpack_require__(6537); +const WebpackError = __webpack_require__(49999); +const { requestToId } = __webpack_require__(2970); +const { isSubset } = __webpack_require__(24352); +const SortableSet = __webpack_require__(94845); const { compareModulesByIdentifier, compareIterables -} = __webpack_require__(29355); -const createHash = __webpack_require__(94624); -const deterministicGrouping = __webpack_require__(482); -const { makePathsRelative } = __webpack_require__(63146); -const memoize = __webpack_require__(27319); -const MinMaxSizeWarning = __webpack_require__(90508); +} = __webpack_require__(95978); +const createHash = __webpack_require__(31147); +const deterministicGrouping = __webpack_require__(2096); +const { makePathsRelative } = __webpack_require__(97451); +const memoize = __webpack_require__(62377); +const MinMaxSizeWarning = __webpack_require__(97061); /** @typedef {import("../../declarations/WebpackOptions").OptimizationSplitChunksCacheGroup} OptimizationSplitChunksCacheGroup */ /** @typedef {import("../../declarations/WebpackOptions").OptimizationSplitChunksGetCacheGroups} OptimizationSplitChunksGetCacheGroups */ @@ -141051,7 +147788,7 @@ const MinMaxSizeWarning = __webpack_require__(90508); /** * @callback ChunkFilterFunction * @param {Chunk} chunk - * @returns {boolean} + * @returns {boolean | undefined} */ /** @@ -141079,7 +147816,7 @@ const MinMaxSizeWarning = __webpack_require__(90508); * @property {number=} maxInitialRequests * @property {(string | function(PathData, AssetInfo=): string)=} filename * @property {string=} idHint - * @property {string} automaticNameDelimiter + * @property {string=} automaticNameDelimiter * @property {boolean=} reuseExistingChunk * @property {boolean=} usedExports */ @@ -141264,12 +148001,24 @@ const compareEntries = (a, b) => { return compareModuleIterables(modulesA, modulesB); }; +/** + * @param {Chunk} chunk the chunk + * @returns {boolean} true, if the chunk is an entry chunk + */ const INITIAL_CHUNK_FILTER = chunk => chunk.canBeInitial(); +/** + * @param {Chunk} chunk the chunk + * @returns {boolean} true, if the chunk is an async chunk + */ const ASYNC_CHUNK_FILTER = chunk => !chunk.canBeInitial(); +/** + * @param {Chunk} chunk the chunk + * @returns {boolean} always true + */ const ALL_CHUNK_FILTER = chunk => true; /** - * @param {OptimizationSplitChunksSizes} value the sizes + * @param {OptimizationSplitChunksSizes | undefined} value the sizes * @param {string[]} defaultSizeTypes the default size types * @returns {SplitChunksSizes} normalized representation */ @@ -141396,8 +148145,8 @@ const totalSize = sizes => { }; /** - * @param {false|string|Function} name the chunk name - * @returns {GetName} a function to get the name of the chunk + * @param {false|string|Function|undefined} name the chunk name + * @returns {GetName | undefined} a function to get the name of the chunk */ const normalizeName = name => { if (typeof name === "string") { @@ -141422,6 +148171,11 @@ const normalizeChunksFilter = chunks => { if (chunks === "all") { return ALL_CHUNK_FILTER; } + if (chunks instanceof RegExp) { + return chunk => { + return chunk.name ? chunks.test(chunk.name) : false; + }; + } if (typeof chunks === "function") { return chunks; } @@ -141849,6 +148603,10 @@ module.exports = class SplitChunksPlugin { } return key; }; + /** + * @param {bigint | Chunk} key key of the chunks + * @returns {string} stringified key + */ const keyToString = key => { if (typeof key === "bigint") return key.toString(16); return chunkIndexMap.get(key).toString(16); @@ -141920,6 +148678,10 @@ module.exports = class SplitChunksPlugin { // group these set of chunks by count // to allow to check less sets via isSubset // (only smaller sets can be subset) + /** + * @param {IterableIterator>} chunkSets set of sets of chunks + * @returns {Map>>} map of sets of chunks by count + */ const groupChunkSetsByCount = chunkSets => { /** @type {Map>>} */ const chunkSetsByCount = new Map(); @@ -142029,8 +148791,9 @@ module.exports = class SplitChunksPlugin { entry = new WeakMap(); selectedChunksCacheByChunksSet.set(chunks, entry); } - /** @type {SelectedChunksResult} */ - let entry2 = entry.get(chunkFilter); + let entry2 = + /** @type {SelectedChunksResult} */ + (entry.get(chunkFilter)); if (entry2 === undefined) { /** @type {Chunk[]} */ const selectedChunks = []; @@ -142078,11 +148841,9 @@ module.exports = class SplitChunksPlugin { // Break if minimum number of chunks is not reached if (selectedChunks.length < cacheGroup.minChunks) return; // Determine name for split chunk - const name = cacheGroup.getName( - module, - selectedChunks, - cacheGroup.key - ); + const name = + /** @type {string} */ + (cacheGroup.getName(module, selectedChunks, cacheGroup.key)); // Check if the name is ok const existingChunk = compilation.namedChunks.get(name); if (existingChunk) { @@ -142149,7 +148910,7 @@ module.exports = class SplitChunksPlugin { ? ` name:${name}` : ` chunks:${keyToString(selectedChunksKey)}`); // Add module to maps - let info = chunksInfoMap.get(key); + let info = /** @type {ChunksInfoItem} */ (chunksInfoMap.get(key)); if (info === undefined) { chunksInfoMap.set( key, @@ -142214,7 +148975,9 @@ module.exports = class SplitChunksPlugin { getExportsChunkSetsInGraph(); /** @type {Set | Chunk>} */ const set = new Set(); - const groupedByUsedExports = groupedByExportsMap.get(module); + const groupedByUsedExports = + /** @type {Iterable} */ + (groupedByExportsMap.get(module)); for (const chunks of groupedByUsedExports) { const chunksKey = getKey(chunks); for (const comb of getExportsCombinations(chunksKey)) @@ -142238,7 +149001,10 @@ module.exports = class SplitChunksPlugin { if (count < cacheGroup.minChunks) continue; // Select chunks by configuration const { chunks: selectedChunks, key: selectedChunksKey } = - getSelectedChunks(chunkCombination, cacheGroup.chunksFilter); + getSelectedChunks( + chunkCombination, + /** @type {ChunkFilterFunction} */ (cacheGroup.chunksFilter) + ); addModuleToChunksInfoMap( cacheGroup, @@ -142330,12 +149096,13 @@ module.exports = class SplitChunksPlugin { } } - const item = bestEntry; - chunksInfoMap.delete(bestEntryKey); + const item = /** @type {ChunksInfoItem} */ (bestEntry); + chunksInfoMap.delete(/** @type {string} */ (bestEntryKey)); + /** @type {Chunk["name"] | undefined} */ let chunkName = item.name; // Variable for the new chunk (lazy created) - /** @type {Chunk} */ + /** @type {Chunk | undefined} */ let newChunk; // When no chunk name, check if we can reuse a chunk instead of creating a new one let isExistingChunk = false; @@ -142404,14 +149171,18 @@ module.exports = class SplitChunksPlugin { ) { for (const chunk of usedChunks) { // respect max requests - const maxRequests = chunk.isOnlyInitial() - ? item.cacheGroup.maxInitialRequests - : chunk.canBeInitial() - ? Math.min( - item.cacheGroup.maxInitialRequests, - item.cacheGroup.maxAsyncRequests - ) - : item.cacheGroup.maxAsyncRequests; + const maxRequests = /** @type {number} */ ( + chunk.isOnlyInitial() + ? item.cacheGroup.maxInitialRequests + : chunk.canBeInitial() + ? Math.min( + /** @type {number} */ + (item.cacheGroup.maxInitialRequests), + /** @type {number} */ + (item.cacheGroup.maxAsyncRequests) + ) + : item.cacheGroup.maxAsyncRequests + ); if ( isFinite(maxRequests) && getRequests(chunk) >= maxRequests @@ -142431,8 +149202,12 @@ module.exports = class SplitChunksPlugin { // Were some (invalid) chunks removed from usedChunks? // => readd all modules to the queue, as things could have been changed if (usedChunks.size < item.chunks.size) { - if (isExistingChunk) usedChunks.add(newChunk); - if (usedChunks.size >= item.cacheGroup.minChunks) { + if (isExistingChunk) + usedChunks.add(/** @type {Chunk} */ (newChunk)); + if ( + /** @type {number} */ (usedChunks.size) >= + /** @type {number} */ (item.cacheGroup.minChunks) + ) { const chunksArr = Array.from(usedChunks); for (const module of item.modules) { addModuleToChunksInfoMap( @@ -142476,7 +149251,7 @@ module.exports = class SplitChunksPlugin { ) { // queue this item again to be processed again // without violating modules - chunksInfoMap.set(bestEntryKey, item); + chunksInfoMap.set(/** @type {string} */ (bestEntryKey), item); } continue; } @@ -142706,7 +149481,9 @@ module.exports = class SplitChunksPlugin { hashFilename(name, outputOptions); } if (i !== results.length - 1) { - const newPart = compilation.addChunk(name); + const newPart = compilation.addChunk( + /** @type {Chunk["name"]} */ (name) + ); chunk.split(newPart); newPart.chunkReason = chunk.chunkReason; // Add all modules to the new chunk @@ -142721,7 +149498,7 @@ module.exports = class SplitChunksPlugin { } } else { // change the chunk to be a part - chunk.name = name; + chunk.name = /** @type {Chunk["name"]} */ (name); } } } @@ -142735,7 +149512,7 @@ module.exports = class SplitChunksPlugin { /***/ }), -/***/ 53441: +/***/ 36479: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -142746,8 +149523,8 @@ module.exports = class SplitChunksPlugin { -const { formatSize } = __webpack_require__(53592); -const WebpackError = __webpack_require__(10841); +const { formatSize } = __webpack_require__(73273); +const WebpackError = __webpack_require__(49999); /** @typedef {import("./SizeLimitsPlugin").AssetDetails} AssetDetails */ @@ -142775,7 +149552,7 @@ Assets: ${assetLists}`); /***/ }), -/***/ 67143: +/***/ 66087: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -142786,8 +149563,8 @@ Assets: ${assetLists}`); -const { formatSize } = __webpack_require__(53592); -const WebpackError = __webpack_require__(10841); +const { formatSize } = __webpack_require__(73273); +const WebpackError = __webpack_require__(49999); /** @typedef {import("./SizeLimitsPlugin").EntrypointDetails} EntrypointDetails */ @@ -142818,7 +149595,7 @@ Entrypoints:${entrypointList}\n`); /***/ }), -/***/ 31272: +/***/ 51708: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -142829,7 +149606,7 @@ Entrypoints:${entrypointList}\n`); -const WebpackError = __webpack_require__(10841); +const WebpackError = __webpack_require__(49999); module.exports = class NoAsyncChunksWarning extends WebpackError { constructor() { @@ -142846,7 +149623,7 @@ module.exports = class NoAsyncChunksWarning extends WebpackError { /***/ }), -/***/ 256: +/***/ 80028: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -142857,10 +149634,10 @@ module.exports = class NoAsyncChunksWarning extends WebpackError { -const { find } = __webpack_require__(97045); -const AssetsOverSizeLimitWarning = __webpack_require__(53441); -const EntrypointsOverSizeLimitWarning = __webpack_require__(67143); -const NoAsyncChunksWarning = __webpack_require__(31272); +const { find } = __webpack_require__(24352); +const AssetsOverSizeLimitWarning = __webpack_require__(36479); +const EntrypointsOverSizeLimitWarning = __webpack_require__(66087); +const NoAsyncChunksWarning = __webpack_require__(51708); /** @typedef {import("webpack-sources").Source} Source */ /** @typedef {import("../../declarations/WebpackOptions").PerformanceOptions} PerformanceOptions */ @@ -142947,7 +149724,7 @@ module.exports = class SizeLimitsPlugin { } const size = info.size || source.size(); - if (size > assetSizeLimit) { + if (size > /** @type {number} */ (assetSizeLimit)) { assetsOverSizeLimit.push({ name, size @@ -142966,7 +149743,7 @@ module.exports = class SizeLimitsPlugin { for (const [name, entry] of compilation.entrypoints) { const size = getEntrypointSize(entry); - if (size > entrypointSizeLimit) { + if (size > /** @type {number} */ (entrypointSizeLimit)) { entrypointsOverLimit.push({ name: name, size: size, @@ -142983,14 +149760,17 @@ module.exports = class SizeLimitsPlugin { // if !1, then 2, if !2 return if (assetsOverSizeLimit.length > 0) { warnings.push( - new AssetsOverSizeLimitWarning(assetsOverSizeLimit, assetSizeLimit) + new AssetsOverSizeLimitWarning( + assetsOverSizeLimit, + /** @type {number} */ (assetSizeLimit) + ) ); } if (entrypointsOverLimit.length > 0) { warnings.push( new EntrypointsOverSizeLimitWarning( entrypointsOverLimit, - entrypointSizeLimit + /** @type {number} */ (entrypointSizeLimit) ) ); } @@ -143019,7 +149799,7 @@ module.exports = class SizeLimitsPlugin { /***/ }), -/***/ 8005: +/***/ 98390: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -143029,9 +149809,10 @@ module.exports = class SizeLimitsPlugin { -const RuntimeModule = __webpack_require__(81196); -const Template = __webpack_require__(88070); +const RuntimeModule = __webpack_require__(21296); +const Template = __webpack_require__(88835); +/** @typedef {import("../Compilation")} Compilation */ /** @typedef {import("../RuntimeTemplate")} RuntimeTemplate */ class ChunkPrefetchFunctionRuntimeModule extends RuntimeModule { @@ -143048,11 +149829,12 @@ class ChunkPrefetchFunctionRuntimeModule extends RuntimeModule { } /** - * @returns {string} runtime code + * @returns {string | null} runtime code */ generate() { const { runtimeFunction, runtimeHandlers } = this; - const { runtimeTemplate } = this.compilation; + const compilation = /** @type {Compilation} */ (this.compilation); + const { runtimeTemplate } = compilation; return Template.asString([ `${runtimeHandlers} = {};`, `${runtimeFunction} = ${runtimeTemplate.basicFunction("chunkId", [ @@ -143071,7 +149853,7 @@ module.exports = ChunkPrefetchFunctionRuntimeModule; /***/ }), -/***/ 66294: +/***/ 527: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -143082,12 +149864,14 @@ module.exports = ChunkPrefetchFunctionRuntimeModule; -const RuntimeGlobals = __webpack_require__(34623); -const ChunkPrefetchFunctionRuntimeModule = __webpack_require__(8005); -const ChunkPrefetchStartupRuntimeModule = __webpack_require__(7658); -const ChunkPrefetchTriggerRuntimeModule = __webpack_require__(72087); -const ChunkPreloadTriggerRuntimeModule = __webpack_require__(83569); +const RuntimeGlobals = __webpack_require__(61539); +const ChunkPrefetchFunctionRuntimeModule = __webpack_require__(98390); +const ChunkPrefetchStartupRuntimeModule = __webpack_require__(4026); +const ChunkPrefetchTriggerRuntimeModule = __webpack_require__(74815); +const ChunkPreloadTriggerRuntimeModule = __webpack_require__(46356); +/** @typedef {import("../Chunk")} Chunk */ +/** @typedef {import("../ChunkGroup").RawChunkGroupOptions} RawChunkGroupOptions */ /** @typedef {import("../Compiler")} Compiler */ class ChunkPrefetchPreloadPlugin { @@ -143120,7 +149904,7 @@ class ChunkPrefetchPreloadPlugin { compilation.hooks.additionalTreeRuntimeRequirements.tap( "ChunkPrefetchPreloadPlugin", (chunk, set, { chunkGraph }) => { - const chunkMap = chunk.getChildIdsByOrdersMap(chunkGraph, false); + const chunkMap = chunk.getChildIdsByOrdersMap(chunkGraph); if (chunkMap.prefetch) { set.add(RuntimeGlobals.prefetchChunk); @@ -143174,7 +149958,7 @@ module.exports = ChunkPrefetchPreloadPlugin; /***/ }), -/***/ 7658: +/***/ 4026: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -143184,11 +149968,12 @@ module.exports = ChunkPrefetchPreloadPlugin; -const RuntimeGlobals = __webpack_require__(34623); -const RuntimeModule = __webpack_require__(81196); -const Template = __webpack_require__(88070); +const RuntimeGlobals = __webpack_require__(61539); +const RuntimeModule = __webpack_require__(21296); +const Template = __webpack_require__(88835); /** @typedef {import("../Chunk")} Chunk */ +/** @typedef {import("../Compilation")} Compilation */ /** @typedef {import("../RuntimeTemplate")} RuntimeTemplate */ class ChunkPrefetchStartupRuntimeModule extends RuntimeModule { @@ -143201,11 +149986,13 @@ class ChunkPrefetchStartupRuntimeModule extends RuntimeModule { } /** - * @returns {string} runtime code + * @returns {string | null} runtime code */ generate() { - const { startupChunks, chunk } = this; - const { runtimeTemplate } = this.compilation; + const { startupChunks } = this; + const compilation = /** @type {Compilation} */ (this.compilation); + const chunk = /** @type {Chunk} */ (this.chunk); + const { runtimeTemplate } = compilation; return Template.asString( startupChunks.map( ({ onChunks, chunks }) => @@ -143234,7 +150021,7 @@ module.exports = ChunkPrefetchStartupRuntimeModule; /***/ }), -/***/ 72087: +/***/ 74815: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -143244,10 +150031,11 @@ module.exports = ChunkPrefetchStartupRuntimeModule; -const RuntimeGlobals = __webpack_require__(34623); -const RuntimeModule = __webpack_require__(81196); -const Template = __webpack_require__(88070); +const RuntimeGlobals = __webpack_require__(61539); +const RuntimeModule = __webpack_require__(21296); +const Template = __webpack_require__(88835); +/** @typedef {import("../Compilation")} Compilation */ /** @typedef {import("../RuntimeTemplate")} RuntimeTemplate */ class ChunkPrefetchTriggerRuntimeModule extends RuntimeModule { @@ -143260,11 +150048,12 @@ class ChunkPrefetchTriggerRuntimeModule extends RuntimeModule { } /** - * @returns {string} runtime code + * @returns {string | null} runtime code */ generate() { const { chunkMap } = this; - const { runtimeTemplate } = this.compilation; + const compilation = /** @type {Compilation} */ (this.compilation); + const { runtimeTemplate } = compilation; const body = [ "var chunks = chunkToChildrenMap[chunkId];", `Array.isArray(chunks) && chunks.map(${RuntimeGlobals.prefetchChunk});` @@ -143291,7 +150080,7 @@ module.exports = ChunkPrefetchTriggerRuntimeModule; /***/ }), -/***/ 83569: +/***/ 46356: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -143301,10 +150090,11 @@ module.exports = ChunkPrefetchTriggerRuntimeModule; -const RuntimeGlobals = __webpack_require__(34623); -const RuntimeModule = __webpack_require__(81196); -const Template = __webpack_require__(88070); +const RuntimeGlobals = __webpack_require__(61539); +const RuntimeModule = __webpack_require__(21296); +const Template = __webpack_require__(88835); +/** @typedef {import("../Compilation")} Compilation */ /** @typedef {import("../RuntimeTemplate")} RuntimeTemplate */ class ChunkPreloadTriggerRuntimeModule extends RuntimeModule { @@ -143317,11 +150107,12 @@ class ChunkPreloadTriggerRuntimeModule extends RuntimeModule { } /** - * @returns {string} runtime code + * @returns {string | null} runtime code */ generate() { const { chunkMap } = this; - const { runtimeTemplate } = this.compilation; + const compilation = /** @type {Compilation} */ (this.compilation); + const { runtimeTemplate } = compilation; const body = [ "var chunks = chunkToChildrenMap[chunkId];", `Array.isArray(chunks) && chunks.map(${RuntimeGlobals.preloadChunk});` @@ -143342,7 +150133,7 @@ module.exports = ChunkPreloadTriggerRuntimeModule; /***/ }), -/***/ 24208: +/***/ 22818: /***/ (function(module) { "use strict"; @@ -143356,6 +150147,10 @@ module.exports = ChunkPreloadTriggerRuntimeModule; /** @typedef {import("./RuleSetCompiler")} RuleSetCompiler */ class BasicEffectRulePlugin { + /** + * @param {string} ruleProperty the rule property + * @param {string=} effectType the effect type + */ constructor(ruleProperty, effectType) { this.ruleProperty = ruleProperty; this.effectType = effectType || ruleProperty; @@ -143389,7 +150184,7 @@ module.exports = BasicEffectRulePlugin; /***/ }), -/***/ 43759: +/***/ 42510: /***/ (function(module) { "use strict"; @@ -143404,6 +150199,11 @@ module.exports = BasicEffectRulePlugin; /** @typedef {import("./RuleSetCompiler").RuleCondition} RuleCondition */ class BasicMatcherRulePlugin { + /** + * @param {string} ruleProperty the rule property + * @param {string=} dataProperty the data property + * @param {boolean=} invert if true, inverts the condition + */ constructor(ruleProperty, dataProperty, invert) { this.ruleProperty = ruleProperty; this.dataProperty = dataProperty || ruleProperty; @@ -143444,7 +150244,7 @@ module.exports = BasicMatcherRulePlugin; /***/ }), -/***/ 8465: +/***/ 58927: /***/ (function(module) { "use strict"; @@ -143499,7 +150299,7 @@ module.exports = ObjectMatcherRulePlugin; /***/ }), -/***/ 89023: +/***/ 49041: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -143655,9 +150455,9 @@ class RuleSetCompiler { * @returns {CompiledRule[]} rules */ compileRules(path, rules, refs) { - return rules.map((rule, i) => - this.compileRule(`${path}[${i}]`, rule, refs) - ); + return rules + .filter(Boolean) + .map((rule, i) => this.compileRule(`${path}[${i}]`, rule, refs)); } /** @@ -143886,7 +150686,7 @@ module.exports = RuleSetCompiler; /***/ }), -/***/ 20552: +/***/ 20110: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -143998,9 +150798,11 @@ class UseEffectRulePlugin { */ const useToEffectsWithoutIdent = (path, items) => { if (Array.isArray(items)) { - return items.map((item, idx) => - useToEffectRaw(`${path}[${idx}]`, "[[missing ident]]", item) - ); + return items + .filter(Boolean) + .map((item, idx) => + useToEffectRaw(`${path}[${idx}]`, "[[missing ident]]", item) + ); } return [useToEffectRaw(path, "[[missing ident]]", items)]; }; @@ -144012,7 +150814,7 @@ class UseEffectRulePlugin { */ const useToEffects = (path, items) => { if (Array.isArray(items)) { - return items.map((item, idx) => { + return items.filter(Boolean).map((item, idx) => { const subPath = `${path}[${idx}]`; return useToEffect(subPath, subPath, item); }); @@ -144088,7 +150890,7 @@ module.exports = UseEffectRulePlugin; /***/ }), -/***/ 92237: +/***/ 62985: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -144098,9 +150900,11 @@ module.exports = UseEffectRulePlugin; -const RuntimeGlobals = __webpack_require__(34623); -const Template = __webpack_require__(88070); -const HelperRuntimeModule = __webpack_require__(19970); +const RuntimeGlobals = __webpack_require__(61539); +const Template = __webpack_require__(88835); +const HelperRuntimeModule = __webpack_require__(18225); + +/** @typedef {import("../Compilation")} Compilation */ class AsyncModuleRuntimeModule extends HelperRuntimeModule { constructor() { @@ -144108,17 +150912,18 @@ class AsyncModuleRuntimeModule extends HelperRuntimeModule { } /** - * @returns {string} runtime code + * @returns {string | null} runtime code */ generate() { - const { runtimeTemplate } = this.compilation; + const compilation = /** @type {Compilation} */ (this.compilation); + const { runtimeTemplate } = compilation; const fn = RuntimeGlobals.asyncModule; return Template.asString([ 'var webpackQueues = typeof Symbol === "function" ? Symbol("webpack queues") : "__webpack_queues__";', - 'var webpackExports = typeof Symbol === "function" ? Symbol("webpack exports") : "__webpack_exports__";', + `var webpackExports = typeof Symbol === "function" ? Symbol("webpack exports") : "${RuntimeGlobals.exports}";`, 'var webpackError = typeof Symbol === "function" ? Symbol("webpack error") : "__webpack_error__";', `var resolveQueue = ${runtimeTemplate.basicFunction("queue", [ - "if(queue && !queue.d) {", + "if(queue && queue.d < 1) {", Template.indent([ "queue.d = 1;", `queue.forEach(${runtimeTemplate.expressionFunction( @@ -144167,7 +150972,7 @@ class AsyncModuleRuntimeModule extends HelperRuntimeModule { )};`, `${fn} = ${runtimeTemplate.basicFunction("module, body, hasAwait", [ "var queue;", - "hasAwait && ((queue = []).d = 1);", + "hasAwait && ((queue = []).d = -1);", "var depQueues = new Set();", "var exports = module.exports;", "var currentDeps;", @@ -144215,7 +151020,7 @@ class AsyncModuleRuntimeModule extends HelperRuntimeModule { "(err ? reject(promise[webpackError] = err) : outerResolve(exports)), resolveQueue(queue)", "err" )});`, - "queue && (queue.d = 0);" + "queue && queue.d < 0 && (queue.d = 0);" ])};` ]); } @@ -144226,7 +151031,7 @@ module.exports = AsyncModuleRuntimeModule; /***/ }), -/***/ 95055: +/***/ 74537: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -144236,11 +151041,13 @@ module.exports = AsyncModuleRuntimeModule; -const RuntimeGlobals = __webpack_require__(34623); -const RuntimeModule = __webpack_require__(81196); -const Template = __webpack_require__(88070); -const JavascriptModulesPlugin = __webpack_require__(96230); -const { getUndoPath } = __webpack_require__(63146); +const RuntimeGlobals = __webpack_require__(61539); +const RuntimeModule = __webpack_require__(21296); +const Template = __webpack_require__(88835); +const JavascriptModulesPlugin = __webpack_require__(70061); +const { getUndoPath } = __webpack_require__(97451); + +/** @typedef {import("../Compilation")} Compilation */ class AutoPublicPathRuntimeModule extends RuntimeModule { constructor() { @@ -144248,10 +151055,10 @@ class AutoPublicPathRuntimeModule extends RuntimeModule { } /** - * @returns {string} runtime code + * @returns {string | null} runtime code */ generate() { - const { compilation } = this; + const compilation = /** @type {Compilation} */ (this.compilation); const { scriptType, importMetaName, path } = compilation.outputOptions; const chunkName = compilation.getPath( JavascriptModulesPlugin.getChunkFilenameTemplate( @@ -144263,7 +151070,11 @@ class AutoPublicPathRuntimeModule extends RuntimeModule { contentHashType: "javascript" } ); - const undoPath = getUndoPath(chunkName, path, false); + const undoPath = getUndoPath( + chunkName, + /** @type {string} */ (path), + false + ); return Template.asString([ "var scriptUrl;", @@ -144275,11 +151086,16 @@ class AutoPublicPathRuntimeModule extends RuntimeModule { "if (!scriptUrl && document) {", Template.indent([ `if (document.currentScript)`, - Template.indent(`scriptUrl = document.currentScript.src`), + Template.indent(`scriptUrl = document.currentScript.src;`), "if (!scriptUrl) {", Template.indent([ 'var scripts = document.getElementsByTagName("script");', - "if(scripts.length) scriptUrl = scripts[scripts.length - 1].src" + "if(scripts.length) {", + Template.indent([ + "var i = scripts.length - 1;", + "while (i > -1 && !scriptUrl) scriptUrl = scripts[i--].src;" + ]), + "}" ]), "}" ]), @@ -144303,7 +151119,7 @@ module.exports = AutoPublicPathRuntimeModule; /***/ }), -/***/ 17661: +/***/ 33022: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -144314,8 +151130,11 @@ module.exports = AutoPublicPathRuntimeModule; -const RuntimeGlobals = __webpack_require__(34623); -const RuntimeModule = __webpack_require__(81196); +const RuntimeGlobals = __webpack_require__(61539); +const RuntimeModule = __webpack_require__(21296); + +/** @typedef {import("../../declarations/WebpackOptions").EntryDescriptionNormalized} EntryDescriptionNormalized */ +/** @typedef {import("../Chunk")} Chunk */ class BaseUriRuntimeModule extends RuntimeModule { constructor() { @@ -144323,12 +151142,13 @@ class BaseUriRuntimeModule extends RuntimeModule { } /** - * @returns {string} runtime code + * @returns {string | null} runtime code */ generate() { - const { chunk } = this; - - const options = chunk.getEntryOptions(); + const chunk = /** @type {Chunk} */ (this.chunk); + const options = + /** @type {EntryDescriptionNormalized} */ + (chunk.getEntryOptions()); return `${RuntimeGlobals.baseURI} = ${ options.baseUri === undefined ? "undefined" @@ -144342,7 +151162,7 @@ module.exports = BaseUriRuntimeModule; /***/ }), -/***/ 98107: +/***/ 26891: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -144352,8 +151172,8 @@ module.exports = BaseUriRuntimeModule; -const RuntimeGlobals = __webpack_require__(34623); -const RuntimeModule = __webpack_require__(81196); +const RuntimeGlobals = __webpack_require__(61539); +const RuntimeModule = __webpack_require__(21296); class ChunkNameRuntimeModule extends RuntimeModule { /** @@ -144365,7 +151185,7 @@ class ChunkNameRuntimeModule extends RuntimeModule { } /** - * @returns {string} runtime code + * @returns {string | null} runtime code */ generate() { return `${RuntimeGlobals.chunkName} = ${JSON.stringify(this.chunkName)};`; @@ -144377,7 +151197,7 @@ module.exports = ChunkNameRuntimeModule; /***/ }), -/***/ 31480: +/***/ 85803: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -144387,9 +151207,11 @@ module.exports = ChunkNameRuntimeModule; -const RuntimeGlobals = __webpack_require__(34623); -const Template = __webpack_require__(88070); -const HelperRuntimeModule = __webpack_require__(19970); +const RuntimeGlobals = __webpack_require__(61539); +const Template = __webpack_require__(88835); +const HelperRuntimeModule = __webpack_require__(18225); + +/** @typedef {import("../Compilation")} Compilation */ class CompatGetDefaultExportRuntimeModule extends HelperRuntimeModule { constructor() { @@ -144397,10 +151219,11 @@ class CompatGetDefaultExportRuntimeModule extends HelperRuntimeModule { } /** - * @returns {string} runtime code + * @returns {string | null} runtime code */ generate() { - const { runtimeTemplate } = this.compilation; + const compilation = /** @type {Compilation} */ (this.compilation); + const { runtimeTemplate } = compilation; const fn = RuntimeGlobals.compatGetDefaultExport; return Template.asString([ "// getDefaultExport function for compatibility with non-harmony modules", @@ -144422,7 +151245,7 @@ module.exports = CompatGetDefaultExportRuntimeModule; /***/ }), -/***/ 59758: +/***/ 19172: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -144432,9 +151255,12 @@ module.exports = CompatGetDefaultExportRuntimeModule; -const RuntimeGlobals = __webpack_require__(34623); -const RuntimeModule = __webpack_require__(81196); +const RuntimeGlobals = __webpack_require__(61539); +const RuntimeModule = __webpack_require__(21296); +/** @typedef {import("../Chunk")} Chunk */ +/** @typedef {import("../ChunkGraph")} ChunkGraph */ +/** @typedef {import("../Compilation")} Compilation */ /** @typedef {import("../MainTemplate")} MainTemplate */ class CompatRuntimeModule extends RuntimeModule { @@ -144444,10 +151270,12 @@ class CompatRuntimeModule extends RuntimeModule { } /** - * @returns {string} runtime code + * @returns {string | null} runtime code */ generate() { - const { chunkGraph, chunk, compilation } = this; + const compilation = /** @type {Compilation} */ (this.compilation); + const chunkGraph = /** @type {ChunkGraph} */ (this.chunkGraph); + const chunk = /** @type {Chunk} */ (this.chunk); const { runtimeTemplate, mainTemplate, @@ -144508,7 +151336,7 @@ module.exports = CompatRuntimeModule; /***/ }), -/***/ 45075: +/***/ 67032: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -144518,9 +151346,11 @@ module.exports = CompatRuntimeModule; -const RuntimeGlobals = __webpack_require__(34623); -const Template = __webpack_require__(88070); -const HelperRuntimeModule = __webpack_require__(19970); +const RuntimeGlobals = __webpack_require__(61539); +const Template = __webpack_require__(88835); +const HelperRuntimeModule = __webpack_require__(18225); + +/** @typedef {import("../Compilation")} Compilation */ class CreateFakeNamespaceObjectRuntimeModule extends HelperRuntimeModule { constructor() { @@ -144528,10 +151358,11 @@ class CreateFakeNamespaceObjectRuntimeModule extends HelperRuntimeModule { } /** - * @returns {string} runtime code + * @returns {string | null} runtime code */ generate() { - const { runtimeTemplate } = this.compilation; + const compilation = /** @type {Compilation} */ (this.compilation); + const { runtimeTemplate } = compilation; const fn = RuntimeGlobals.createFakeNamespaceObject; return Template.asString([ `var getProto = Object.getPrototypeOf ? ${runtimeTemplate.returningFunction( @@ -144582,7 +151413,7 @@ module.exports = CreateFakeNamespaceObjectRuntimeModule; /***/ }), -/***/ 9682: +/***/ 15707: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -144592,9 +151423,11 @@ module.exports = CreateFakeNamespaceObjectRuntimeModule; -const RuntimeGlobals = __webpack_require__(34623); -const Template = __webpack_require__(88070); -const HelperRuntimeModule = __webpack_require__(19970); +const RuntimeGlobals = __webpack_require__(61539); +const Template = __webpack_require__(88835); +const HelperRuntimeModule = __webpack_require__(18225); + +/** @typedef {import("../Compilation")} Compilation */ class CreateScriptRuntimeModule extends HelperRuntimeModule { constructor() { @@ -144602,10 +151435,10 @@ class CreateScriptRuntimeModule extends HelperRuntimeModule { } /** - * @returns {string} runtime code + * @returns {string | null} runtime code */ generate() { - const { compilation } = this; + const compilation = /** @type {Compilation} */ (this.compilation); const { runtimeTemplate, outputOptions } = compilation; const { trustedTypes } = outputOptions; const fn = RuntimeGlobals.createScript; @@ -144626,7 +151459,7 @@ module.exports = CreateScriptRuntimeModule; /***/ }), -/***/ 55414: +/***/ 27426: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -144636,9 +151469,11 @@ module.exports = CreateScriptRuntimeModule; -const RuntimeGlobals = __webpack_require__(34623); -const Template = __webpack_require__(88070); -const HelperRuntimeModule = __webpack_require__(19970); +const RuntimeGlobals = __webpack_require__(61539); +const Template = __webpack_require__(88835); +const HelperRuntimeModule = __webpack_require__(18225); + +/** @typedef {import("../Compilation")} Compilation */ class CreateScriptUrlRuntimeModule extends HelperRuntimeModule { constructor() { @@ -144646,10 +151481,10 @@ class CreateScriptUrlRuntimeModule extends HelperRuntimeModule { } /** - * @returns {string} runtime code + * @returns {string | null} runtime code */ generate() { - const { compilation } = this; + const compilation = /** @type {Compilation} */ (this.compilation); const { runtimeTemplate, outputOptions } = compilation; const { trustedTypes } = outputOptions; const fn = RuntimeGlobals.createScriptUrl; @@ -144670,7 +151505,7 @@ module.exports = CreateScriptUrlRuntimeModule; /***/ }), -/***/ 47441: +/***/ 97053: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -144680,9 +151515,11 @@ module.exports = CreateScriptUrlRuntimeModule; -const RuntimeGlobals = __webpack_require__(34623); -const Template = __webpack_require__(88070); -const HelperRuntimeModule = __webpack_require__(19970); +const RuntimeGlobals = __webpack_require__(61539); +const Template = __webpack_require__(88835); +const HelperRuntimeModule = __webpack_require__(18225); + +/** @typedef {import("../Compilation")} Compilation */ class DefinePropertyGettersRuntimeModule extends HelperRuntimeModule { constructor() { @@ -144690,10 +151527,11 @@ class DefinePropertyGettersRuntimeModule extends HelperRuntimeModule { } /** - * @returns {string} runtime code + * @returns {string | null} runtime code */ generate() { - const { runtimeTemplate } = this.compilation; + const compilation = /** @type {Compilation} */ (this.compilation); + const { runtimeTemplate } = compilation; const fn = RuntimeGlobals.definePropertyGetters; return Template.asString([ "// define getter functions for harmony exports", @@ -144717,7 +151555,7 @@ module.exports = DefinePropertyGettersRuntimeModule; /***/ }), -/***/ 73057: +/***/ 91492: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -144727,34 +151565,48 @@ module.exports = DefinePropertyGettersRuntimeModule; -const RuntimeGlobals = __webpack_require__(34623); -const RuntimeModule = __webpack_require__(81196); -const Template = __webpack_require__(88070); +const RuntimeGlobals = __webpack_require__(61539); +const RuntimeModule = __webpack_require__(21296); +const Template = __webpack_require__(88835); + +/** @typedef {import("../Compilation")} Compilation */ class EnsureChunkRuntimeModule extends RuntimeModule { + /** + * @param {ReadonlySet} runtimeRequirements runtime requirements + */ constructor(runtimeRequirements) { super("ensure chunk"); this.runtimeRequirements = runtimeRequirements; } /** - * @returns {string} runtime code + * @returns {string | null} runtime code */ generate() { - const { runtimeTemplate } = this.compilation; + const compilation = /** @type {Compilation} */ (this.compilation); + const { runtimeTemplate } = compilation; // Check if there are non initial chunks which need to be imported using require-ensure if (this.runtimeRequirements.has(RuntimeGlobals.ensureChunkHandlers)) { + const withFetchPriority = this.runtimeRequirements.has( + RuntimeGlobals.hasFetchPriority + ); const handlers = RuntimeGlobals.ensureChunkHandlers; return Template.asString([ `${handlers} = {};`, "// This file contains only the entry chunk.", "// The chunk loading function for additional chunks", `${RuntimeGlobals.ensureChunk} = ${runtimeTemplate.basicFunction( - "chunkId", + `chunkId${withFetchPriority ? ", fetchPriority" : ""}`, [ `return Promise.all(Object.keys(${handlers}).reduce(${runtimeTemplate.basicFunction( "promises, key", - [`${handlers}[key](chunkId, promises);`, "return promises;"] + [ + `${handlers}[key](chunkId, promises${ + withFetchPriority ? ", fetchPriority" : "" + });`, + "return promises;" + ] )}, []));` ] )};` @@ -144779,7 +151631,7 @@ module.exports = EnsureChunkRuntimeModule; /***/ }), -/***/ 77994: +/***/ 12664: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -144789,12 +151641,13 @@ module.exports = EnsureChunkRuntimeModule; -const RuntimeGlobals = __webpack_require__(34623); -const RuntimeModule = __webpack_require__(81196); -const Template = __webpack_require__(88070); -const { first } = __webpack_require__(97045); +const RuntimeGlobals = __webpack_require__(61539); +const RuntimeModule = __webpack_require__(21296); +const Template = __webpack_require__(88835); +const { first } = __webpack_require__(24352); /** @typedef {import("../Chunk")} Chunk */ +/** @typedef {import("../ChunkGraph")} ChunkGraph */ /** @typedef {import("../Compilation")} Compilation */ /** @typedef {import("../Compilation").AssetInfo} AssetInfo */ /** @typedef {import("../Compilation").PathData} PathData */ @@ -144819,24 +151672,19 @@ class GetChunkFilenameRuntimeModule extends RuntimeModule { } /** - * @returns {string} runtime code + * @returns {string | null} runtime code */ generate() { - const { - global, - chunk, - chunkGraph, - contentType, - getFilenameForChunk, - allChunks, - compilation - } = this; + const { global, contentType, getFilenameForChunk, allChunks } = this; + const compilation = /** @type {Compilation} */ (this.compilation); + const chunkGraph = /** @type {ChunkGraph} */ (this.chunkGraph); + const chunk = /** @type {Chunk} */ (this.chunk); const { runtimeTemplate } = compilation; /** @type {Map>} */ const chunkFilenames = new Map(); let maxChunks = 0; - /** @type {string} */ + /** @type {string | undefined} */ let dynamicFilename; /** @@ -144854,9 +151702,20 @@ class GetChunkFilenameRuntimeModule extends RuntimeModule { if (typeof chunkFilename === "string") { if (set.size < maxChunks) return; if (set.size === maxChunks) { - if (chunkFilename.length < dynamicFilename.length) return; - if (chunkFilename.length === dynamicFilename.length) { - if (chunkFilename < dynamicFilename) return; + if ( + chunkFilename.length < + /** @type {string} */ (dynamicFilename).length + ) { + return; + } + + if ( + chunkFilename.length === + /** @type {string} */ (dynamicFilename).length + ) { + if (chunkFilename < /** @type {string} */ (dynamicFilename)) { + return; + } } } maxChunks = set.size; @@ -144893,7 +151752,7 @@ class GetChunkFilenameRuntimeModule extends RuntimeModule { addChunk(entrypoint.chunks[entrypoint.chunks.length - 1]); } - /** @type {Map>} */ + /** @type {Map>} */ const staticUrls = new Map(); /** @type {Set} */ const dynamicUrlChunks = new Set(); @@ -144917,6 +151776,10 @@ class GetChunkFilenameRuntimeModule extends RuntimeModule { const s = JSON.stringify(str); return s.slice(1, s.length - 1); }; + /** + * @param {string} value string + * @returns {function(number): string} string to put in quotes with length + */ const unquotedStringifyWithLength = value => length => unquotedStringify(`${value}`.slice(0, length)); const chunkFilenameValue = @@ -144933,10 +151796,14 @@ class GetChunkFilenameRuntimeModule extends RuntimeModule { hashWithLength: length => `" + ${RuntimeGlobals.getFullHash}().slice(0, ${length}) + "`, chunk: { - id: unquotedStringify(c.id), - hash: unquotedStringify(c.renderedHash), - hashWithLength: unquotedStringifyWithLength(c.renderedHash), - name: unquotedStringify(c.name || c.id), + id: unquotedStringify(/** @type {number | string} */ (c.id)), + hash: unquotedStringify(/** @type {string} */ (c.renderedHash)), + hashWithLength: unquotedStringifyWithLength( + /** @type {string} */ (c.renderedHash) + ), + name: unquotedStringify( + c.name || /** @type {number | string} */ (c.id) + ), contentHash: { [contentType]: unquotedStringify(c.contentHash[contentType]) }, @@ -144968,8 +151835,10 @@ class GetChunkFilenameRuntimeModule extends RuntimeModule { * @returns {string} code with static mapping of results of fn */ const createMap = fn => { + /** @type {Record} */ const obj = {}; let useId = false; + /** @type {number | string | undefined} */ let lastKey; let entries = 0; for (const c of dynamicUrlChunks) { @@ -144977,8 +151846,8 @@ class GetChunkFilenameRuntimeModule extends RuntimeModule { if (value === c.id) { useId = true; } else { - obj[c.id] = value; - lastKey = c.id; + obj[/** @type {number | string} */ (c.id)] = value; + lastKey = /** @type {number | string} */ (c.id); entries++; } } @@ -144986,9 +151855,9 @@ class GetChunkFilenameRuntimeModule extends RuntimeModule { if (entries === 1) { return useId ? `(chunkId === ${JSON.stringify(lastKey)} ? ${JSON.stringify( - obj[lastKey] + obj[/** @type {number | string} */ (lastKey)] )} : chunkId)` - : JSON.stringify(obj[lastKey]); + : JSON.stringify(obj[/** @type {number | string} */ (lastKey)]); } return useId ? `(${JSON.stringify(obj)}[chunkId] || chunkId)` @@ -145019,9 +151888,11 @@ class GetChunkFilenameRuntimeModule extends RuntimeModule { `" + ${RuntimeGlobals.getFullHash}().slice(0, ${length}) + "`, chunk: { id: `" + chunkId + "`, - hash: mapExpr(c => c.renderedHash), - hashWithLength: mapExprWithLength(c => c.renderedHash), - name: mapExpr(c => c.name || c.id), + hash: mapExpr(c => /** @type {string} */ (c.renderedHash)), + hashWithLength: mapExprWithLength( + c => /** @type {string} */ (c.renderedHash) + ), + name: mapExpr(c => c.name || /** @type {number | string} */ (c.id)), contentHash: { [contentType]: mapExpr(c => c.contentHash[contentType]) }, @@ -145069,7 +151940,7 @@ module.exports = GetChunkFilenameRuntimeModule; /***/ }), -/***/ 95770: +/***/ 36909: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -145079,8 +151950,8 @@ module.exports = GetChunkFilenameRuntimeModule; -const RuntimeGlobals = __webpack_require__(34623); -const RuntimeModule = __webpack_require__(81196); +const RuntimeGlobals = __webpack_require__(61539); +const RuntimeModule = __webpack_require__(21296); /** @typedef {import("../Compilation")} Compilation */ @@ -145091,12 +151962,13 @@ class GetFullHashRuntimeModule extends RuntimeModule { } /** - * @returns {string} runtime code + * @returns {string | null} runtime code */ generate() { - const { runtimeTemplate } = this.compilation; + const compilation = /** @type {Compilation} */ (this.compilation); + const { runtimeTemplate } = compilation; return `${RuntimeGlobals.getFullHash} = ${runtimeTemplate.returningFunction( - JSON.stringify(this.compilation.hash || "XXXX") + JSON.stringify(compilation.hash || "XXXX") )}`; } } @@ -145106,7 +151978,7 @@ module.exports = GetFullHashRuntimeModule; /***/ }), -/***/ 33847: +/***/ 51850: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -145116,10 +151988,11 @@ module.exports = GetFullHashRuntimeModule; -const RuntimeGlobals = __webpack_require__(34623); -const RuntimeModule = __webpack_require__(81196); -const Template = __webpack_require__(88070); +const RuntimeGlobals = __webpack_require__(61539); +const RuntimeModule = __webpack_require__(21296); +const Template = __webpack_require__(88835); +/** @typedef {import("../Chunk")} Chunk */ /** @typedef {import("../Compilation")} Compilation */ class GetMainFilenameRuntimeModule extends RuntimeModule { @@ -145135,10 +152008,12 @@ class GetMainFilenameRuntimeModule extends RuntimeModule { } /** - * @returns {string} runtime code + * @returns {string | null} runtime code */ generate() { - const { global, filename, compilation, chunk } = this; + const { global, filename } = this; + const compilation = /** @type {Compilation} */ (this.compilation); + const chunk = /** @type {Chunk} */ (this.chunk); const { runtimeTemplate } = compilation; const url = compilation.getPath(JSON.stringify(filename), { hash: `" + ${RuntimeGlobals.getFullHash}() + "`, @@ -145158,7 +152033,7 @@ module.exports = GetMainFilenameRuntimeModule; /***/ }), -/***/ 49622: +/***/ 4412: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -145168,13 +152043,15 @@ module.exports = GetMainFilenameRuntimeModule; -const RuntimeGlobals = __webpack_require__(34623); -const Template = __webpack_require__(88070); -const HelperRuntimeModule = __webpack_require__(19970); +const RuntimeGlobals = __webpack_require__(61539); +const Template = __webpack_require__(88835); +const HelperRuntimeModule = __webpack_require__(18225); + +/** @typedef {import("../Compilation")} Compilation */ class GetTrustedTypesPolicyRuntimeModule extends HelperRuntimeModule { /** - * @param {Set} runtimeRequirements runtime requirements + * @param {ReadonlySet} runtimeRequirements runtime requirements */ constructor(runtimeRequirements) { super("trusted types policy"); @@ -145182,13 +152059,16 @@ class GetTrustedTypesPolicyRuntimeModule extends HelperRuntimeModule { } /** - * @returns {string} runtime code + * @returns {string | null} runtime code */ generate() { - const { compilation } = this; + const compilation = /** @type {Compilation} */ (this.compilation); const { runtimeTemplate, outputOptions } = compilation; const { trustedTypes } = outputOptions; const fn = RuntimeGlobals.getTrustedTypesPolicy; + const wrapPolicyCreationInTryCatch = trustedTypes + ? trustedTypes.onPolicyCreationFailure === "continue" + : false; return Template.asString([ "var policy;", @@ -145222,9 +152102,25 @@ class GetTrustedTypesPolicyRuntimeModule extends HelperRuntimeModule { ? [ 'if (typeof trustedTypes !== "undefined" && trustedTypes.createPolicy) {', Template.indent([ - `policy = trustedTypes.createPolicy(${JSON.stringify( - trustedTypes.policyName - )}, policy);` + ...(wrapPolicyCreationInTryCatch ? ["try {"] : []), + ...[ + `policy = trustedTypes.createPolicy(${JSON.stringify( + trustedTypes.policyName + )}, policy);` + ].map(line => + wrapPolicyCreationInTryCatch ? Template.indent(line) : line + ), + ...(wrapPolicyCreationInTryCatch + ? [ + "} catch (e) {", + Template.indent([ + `console.warn('Could not create trusted-types policy ${JSON.stringify( + trustedTypes.policyName + )}');` + ]), + "}" + ] + : []) ]), "}" ] @@ -145242,7 +152138,7 @@ module.exports = GetTrustedTypesPolicyRuntimeModule; /***/ }), -/***/ 16255: +/***/ 91708: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -145252,9 +152148,9 @@ module.exports = GetTrustedTypesPolicyRuntimeModule; -const RuntimeGlobals = __webpack_require__(34623); -const RuntimeModule = __webpack_require__(81196); -const Template = __webpack_require__(88070); +const RuntimeGlobals = __webpack_require__(61539); +const RuntimeModule = __webpack_require__(21296); +const Template = __webpack_require__(88835); class GlobalRuntimeModule extends RuntimeModule { constructor() { @@ -145262,7 +152158,7 @@ class GlobalRuntimeModule extends RuntimeModule { } /** - * @returns {string} runtime code + * @returns {string | null} runtime code */ generate() { return Template.asString([ @@ -145297,7 +152193,7 @@ module.exports = GlobalRuntimeModule; /***/ }), -/***/ 41799: +/***/ 10590: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -145308,9 +152204,11 @@ module.exports = GlobalRuntimeModule; -const RuntimeGlobals = __webpack_require__(34623); -const RuntimeModule = __webpack_require__(81196); -const Template = __webpack_require__(88070); +const RuntimeGlobals = __webpack_require__(61539); +const RuntimeModule = __webpack_require__(21296); +const Template = __webpack_require__(88835); + +/** @typedef {import("../Compilation")} Compilation */ class HasOwnPropertyRuntimeModule extends RuntimeModule { constructor() { @@ -145318,10 +152216,11 @@ class HasOwnPropertyRuntimeModule extends RuntimeModule { } /** - * @returns {string} runtime code + * @returns {string | null} runtime code */ generate() { - const { runtimeTemplate } = this.compilation; + const compilation = /** @type {Compilation} */ (this.compilation); + const { runtimeTemplate } = compilation; return Template.asString([ `${RuntimeGlobals.hasOwnProperty} = ${runtimeTemplate.returningFunction( @@ -145337,7 +152236,7 @@ module.exports = HasOwnPropertyRuntimeModule; /***/ }), -/***/ 19970: +/***/ 18225: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -145347,7 +152246,7 @@ module.exports = HasOwnPropertyRuntimeModule; -const RuntimeModule = __webpack_require__(81196); +const RuntimeModule = __webpack_require__(21296); class HelperRuntimeModule extends RuntimeModule { /** @@ -145363,7 +152262,7 @@ module.exports = HelperRuntimeModule; /***/ }), -/***/ 13139: +/***/ 94304: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -145374,10 +152273,10 @@ module.exports = HelperRuntimeModule; const { SyncWaterfallHook } = __webpack_require__(70793); -const Compilation = __webpack_require__(38292); -const RuntimeGlobals = __webpack_require__(34623); -const Template = __webpack_require__(88070); -const HelperRuntimeModule = __webpack_require__(19970); +const Compilation = __webpack_require__(20417); +const RuntimeGlobals = __webpack_require__(61539); +const Template = __webpack_require__(88835); +const HelperRuntimeModule = __webpack_require__(18225); /** @typedef {import("../Chunk")} Chunk */ /** @typedef {import("../Compiler")} Compiler */ @@ -145413,17 +152312,19 @@ class LoadScriptRuntimeModule extends HelperRuntimeModule { /** * @param {boolean=} withCreateScriptUrl use create script url for trusted types + * @param {boolean=} withFetchPriority use `fetchPriority` attribute */ - constructor(withCreateScriptUrl) { + constructor(withCreateScriptUrl, withFetchPriority) { super("load script"); this._withCreateScriptUrl = withCreateScriptUrl; + this._withFetchPriority = withFetchPriority; } /** - * @returns {string} runtime code + * @returns {string | null} runtime code */ generate() { - const { compilation } = this; + const compilation = /** @type {Compilation} */ (this.compilation); const { runtimeTemplate, outputOptions } = compilation; const { scriptType, @@ -145441,7 +152342,7 @@ class LoadScriptRuntimeModule extends HelperRuntimeModule { "script = document.createElement('script');", scriptType ? `script.type = ${JSON.stringify(scriptType)};` : "", charset ? "script.charset = 'utf-8';" : "", - `script.timeout = ${loadTimeout / 1000};`, + `script.timeout = ${/** @type {number} */ (loadTimeout) / 1000};`, `if (${RuntimeGlobals.scriptNonce}) {`, Template.indent( `script.setAttribute("nonce", ${RuntimeGlobals.scriptNonce});` @@ -145450,6 +152351,15 @@ class LoadScriptRuntimeModule extends HelperRuntimeModule { uniqueName ? 'script.setAttribute("data-webpack", dataWebpackPrefix + key);' : "", + this._withFetchPriority + ? Template.asString([ + "if(fetchPriority) {", + Template.indent( + 'script.setAttribute("fetchpriority", fetchPriority);' + ), + "}" + ]) + : "", `script.src = ${ this._withCreateScriptUrl ? `${RuntimeGlobals.createScriptUrl}(url)` @@ -145474,54 +152384,58 @@ class LoadScriptRuntimeModule extends HelperRuntimeModule { ? `var dataWebpackPrefix = ${JSON.stringify(uniqueName + ":")};` : "// data-webpack is not used as build has no uniqueName", "// loadScript function to load a script via script tag", - `${fn} = ${runtimeTemplate.basicFunction("url, done, key, chunkId", [ - "if(inProgress[url]) { inProgress[url].push(done); return; }", - "var script, needAttach;", - "if(key !== undefined) {", - Template.indent([ - 'var scripts = document.getElementsByTagName("script");', - "for(var i = 0; i < scripts.length; i++) {", + `${fn} = ${runtimeTemplate.basicFunction( + `url, done, key, chunkId${ + this._withFetchPriority ? ", fetchPriority" : "" + }`, + [ + "if(inProgress[url]) { inProgress[url].push(done); return; }", + "var script, needAttach;", + "if(key !== undefined) {", Template.indent([ - "var s = scripts[i];", - `if(s.getAttribute("src") == url${ - uniqueName - ? ' || s.getAttribute("data-webpack") == dataWebpackPrefix + key' - : "" - }) { script = s; break; }` + 'var scripts = document.getElementsByTagName("script");', + "for(var i = 0; i < scripts.length; i++) {", + Template.indent([ + "var s = scripts[i];", + `if(s.getAttribute("src") == url${ + uniqueName + ? ' || s.getAttribute("data-webpack") == dataWebpackPrefix + key' + : "" + }) { script = s; break; }` + ]), + "}" ]), - "}" - ]), - "}", - "if(!script) {", - Template.indent([ - "needAttach = true;", - createScript.call(code, this.chunk) - ]), - "}", - "inProgress[url] = [done];", - "var onScriptComplete = " + - runtimeTemplate.basicFunction( - "prev, event", - Template.asString([ - "// avoid mem leaks in IE.", - "script.onerror = script.onload = null;", - "clearTimeout(timeout);", - "var doneFns = inProgress[url];", - "delete inProgress[url];", - "script.parentNode && script.parentNode.removeChild(script);", - `doneFns && doneFns.forEach(${runtimeTemplate.returningFunction( - "fn(event)", - "fn" - )});`, - "if(prev) return prev(event);" - ]) - ) + - ";", - `var timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), ${loadTimeout});`, - "script.onerror = onScriptComplete.bind(null, script.onerror);", - "script.onload = onScriptComplete.bind(null, script.onload);", - "needAttach && document.head.appendChild(script);" - ])};` + "}", + "if(!script) {", + Template.indent([ + "needAttach = true;", + createScript.call(code, /** @type {Chunk} */ (this.chunk)) + ]), + "}", + "inProgress[url] = [done];", + "var onScriptComplete = " + + runtimeTemplate.basicFunction( + "prev, event", + Template.asString([ + "// avoid mem leaks in IE.", + "script.onerror = script.onload = null;", + "clearTimeout(timeout);", + "var doneFns = inProgress[url];", + "delete inProgress[url];", + "script.parentNode && script.parentNode.removeChild(script);", + `doneFns && doneFns.forEach(${runtimeTemplate.returningFunction( + "fn(event)", + "fn" + )});`, + "if(prev) return prev(event);" + ]) + ), + `var timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), ${loadTimeout});`, + "script.onerror = onScriptComplete.bind(null, script.onerror);", + "script.onload = onScriptComplete.bind(null, script.onload);", + "needAttach && document.head.appendChild(script);" + ] + )};` ]); } } @@ -145531,7 +152445,7 @@ module.exports = LoadScriptRuntimeModule; /***/ }), -/***/ 89195: +/***/ 92337: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -145541,9 +152455,11 @@ module.exports = LoadScriptRuntimeModule; -const RuntimeGlobals = __webpack_require__(34623); -const Template = __webpack_require__(88070); -const HelperRuntimeModule = __webpack_require__(19970); +const RuntimeGlobals = __webpack_require__(61539); +const Template = __webpack_require__(88835); +const HelperRuntimeModule = __webpack_require__(18225); + +/** @typedef {import("../Compilation")} Compilation */ class MakeNamespaceObjectRuntimeModule extends HelperRuntimeModule { constructor() { @@ -145551,10 +152467,11 @@ class MakeNamespaceObjectRuntimeModule extends HelperRuntimeModule { } /** - * @returns {string} runtime code + * @returns {string | null} runtime code */ generate() { - const { runtimeTemplate } = this.compilation; + const compilation = /** @type {Compilation} */ (this.compilation); + const { runtimeTemplate } = compilation; const fn = RuntimeGlobals.makeNamespaceObject; return Template.asString([ "// define __esModule on exports", @@ -145575,7 +152492,7 @@ module.exports = MakeNamespaceObjectRuntimeModule; /***/ }), -/***/ 89287: +/***/ 39978: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -145586,8 +152503,8 @@ module.exports = MakeNamespaceObjectRuntimeModule; -const RuntimeGlobals = __webpack_require__(34623); -const RuntimeModule = __webpack_require__(81196); +const RuntimeGlobals = __webpack_require__(61539); +const RuntimeModule = __webpack_require__(21296); class NonceRuntimeModule extends RuntimeModule { constructor() { @@ -145595,7 +152512,7 @@ class NonceRuntimeModule extends RuntimeModule { } /** - * @returns {string} runtime code + * @returns {string | null} runtime code */ generate() { return `${RuntimeGlobals.scriptNonce} = undefined;`; @@ -145607,7 +152524,7 @@ module.exports = NonceRuntimeModule; /***/ }), -/***/ 81417: +/***/ 82777: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -145617,9 +152534,11 @@ module.exports = NonceRuntimeModule; -const RuntimeGlobals = __webpack_require__(34623); -const RuntimeModule = __webpack_require__(81196); -const Template = __webpack_require__(88070); +const RuntimeGlobals = __webpack_require__(61539); +const RuntimeModule = __webpack_require__(21296); +const Template = __webpack_require__(88835); + +/** @typedef {import("../Compilation")} Compilation */ class OnChunksLoadedRuntimeModule extends RuntimeModule { constructor() { @@ -145627,10 +152546,10 @@ class OnChunksLoadedRuntimeModule extends RuntimeModule { } /** - * @returns {string} runtime code + * @returns {string | null} runtime code */ generate() { - const { compilation } = this; + const compilation = /** @type {Compilation} */ (this.compilation); const { runtimeTemplate } = compilation; return Template.asString([ "var deferred = [];", @@ -145691,7 +152610,7 @@ module.exports = OnChunksLoadedRuntimeModule; /***/ }), -/***/ 9079: +/***/ 28825: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -145701,20 +152620,27 @@ module.exports = OnChunksLoadedRuntimeModule; -const RuntimeGlobals = __webpack_require__(34623); -const RuntimeModule = __webpack_require__(81196); +const RuntimeGlobals = __webpack_require__(61539); +const RuntimeModule = __webpack_require__(21296); + +/** @typedef {import("../../declarations/WebpackOptions").OutputNormalized} OutputOptions */ +/** @typedef {import("../Compilation")} Compilation */ class PublicPathRuntimeModule extends RuntimeModule { + /** + * @param {OutputOptions["publicPath"]} publicPath public path + */ constructor(publicPath) { super("publicPath", RuntimeModule.STAGE_BASIC); this.publicPath = publicPath; } /** - * @returns {string} runtime code + * @returns {string | null} runtime code */ generate() { - const { compilation, publicPath } = this; + const { publicPath } = this; + const compilation = /** @type {Compilation} */ (this.compilation); return `${RuntimeGlobals.publicPath} = ${JSON.stringify( compilation.getPath(publicPath || "", { @@ -145729,7 +152655,7 @@ module.exports = PublicPathRuntimeModule; /***/ }), -/***/ 52945: +/***/ 4140: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -145739,9 +152665,11 @@ module.exports = PublicPathRuntimeModule; -const RuntimeGlobals = __webpack_require__(34623); -const Template = __webpack_require__(88070); -const HelperRuntimeModule = __webpack_require__(19970); +const RuntimeGlobals = __webpack_require__(61539); +const Template = __webpack_require__(88835); +const HelperRuntimeModule = __webpack_require__(18225); + +/** @typedef {import("../Compilation")} Compilation */ class RelativeUrlRuntimeModule extends HelperRuntimeModule { constructor() { @@ -145749,10 +152677,11 @@ class RelativeUrlRuntimeModule extends HelperRuntimeModule { } /** - * @returns {string} runtime code + * @returns {string | null} runtime code */ generate() { - const { runtimeTemplate } = this.compilation; + const compilation = /** @type {Compilation} */ (this.compilation); + const { runtimeTemplate } = compilation; return Template.asString([ `${RuntimeGlobals.relativeUrl} = function RelativeURL(url) {`, Template.indent([ @@ -145778,7 +152707,7 @@ module.exports = RelativeUrlRuntimeModule; /***/ }), -/***/ 58771: +/***/ 25743: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -145788,8 +152717,11 @@ module.exports = RelativeUrlRuntimeModule; -const RuntimeGlobals = __webpack_require__(34623); -const RuntimeModule = __webpack_require__(81196); +const RuntimeGlobals = __webpack_require__(61539); +const RuntimeModule = __webpack_require__(21296); + +/** @typedef {import("../Chunk")} Chunk */ +/** @typedef {import("../ChunkGraph")} ChunkGraph */ class RuntimeIdRuntimeModule extends RuntimeModule { constructor() { @@ -145797,10 +152729,11 @@ class RuntimeIdRuntimeModule extends RuntimeModule { } /** - * @returns {string} runtime code + * @returns {string | null} runtime code */ generate() { - const { chunkGraph, chunk } = this; + const chunkGraph = /** @type {ChunkGraph} */ (this.chunkGraph); + const chunk = /** @type {Chunk} */ (this.chunk); const runtime = chunk.runtime; if (typeof runtime !== "string") throw new Error("RuntimeIdRuntimeModule must be in a single runtime"); @@ -145814,7 +152747,7 @@ module.exports = RuntimeIdRuntimeModule; /***/ }), -/***/ 13824: +/***/ 81459: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -145824,13 +152757,24 @@ module.exports = RuntimeIdRuntimeModule; -const RuntimeGlobals = __webpack_require__(34623); -const StartupChunkDependenciesRuntimeModule = __webpack_require__(67509); -const StartupEntrypointRuntimeModule = __webpack_require__(81364); +const RuntimeGlobals = __webpack_require__(61539); +const StartupChunkDependenciesRuntimeModule = __webpack_require__(36880); +const StartupEntrypointRuntimeModule = __webpack_require__(90925); +/** @typedef {import("../../declarations/WebpackOptions").ChunkLoadingType} ChunkLoadingType */ +/** @typedef {import("../Chunk")} Chunk */ /** @typedef {import("../Compiler")} Compiler */ +/** + * @typedef {Object} Options + * @property {ChunkLoadingType} chunkLoading + * @property {boolean=} asyncChunkLoading + */ + class StartupChunkDependenciesPlugin { + /** + * @param {Options} options options + */ constructor(options) { this.chunkLoading = options.chunkLoading; this.asyncChunkLoading = @@ -145849,6 +152793,10 @@ class StartupChunkDependenciesPlugin { "StartupChunkDependenciesPlugin", compilation => { const globalChunkLoading = compilation.outputOptions.chunkLoading; + /** + * @param {Chunk} chunk chunk to check + * @returns {boolean} true, when the plugin is enabled for the chunk + */ const isEnabledForChunk = chunk => { const options = chunk.getEntryOptions(); const chunkLoading = @@ -145896,7 +152844,7 @@ module.exports = StartupChunkDependenciesPlugin; /***/ }), -/***/ 67509: +/***/ 36880: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -145907,27 +152855,36 @@ module.exports = StartupChunkDependenciesPlugin; -const RuntimeGlobals = __webpack_require__(34623); -const RuntimeModule = __webpack_require__(81196); -const Template = __webpack_require__(88070); +const RuntimeGlobals = __webpack_require__(61539); +const RuntimeModule = __webpack_require__(21296); +const Template = __webpack_require__(88835); + +/** @typedef {import("../Chunk")} Chunk */ +/** @typedef {import("../ChunkGraph")} ChunkGraph */ +/** @typedef {import("../Compilation")} Compilation */ class StartupChunkDependenciesRuntimeModule extends RuntimeModule { + /** + * @param {boolean} asyncChunkLoading use async chunk loading + */ constructor(asyncChunkLoading) { super("startup chunk dependencies", RuntimeModule.STAGE_TRIGGER); this.asyncChunkLoading = asyncChunkLoading; } /** - * @returns {string} runtime code + * @returns {string | null} runtime code */ generate() { - const { chunkGraph, chunk, compilation } = this; - const { runtimeTemplate } = compilation; + const chunkGraph = /** @type {ChunkGraph} */ (this.chunkGraph); + const chunk = /** @type {Chunk} */ (this.chunk); const chunkIds = Array.from( chunkGraph.getChunkEntryDependentChunksIterable(chunk) ).map(chunk => { return chunk.id; }); + const compilation = /** @type {Compilation} */ (this.compilation); + const { runtimeTemplate } = compilation; return Template.asString([ `var next = ${RuntimeGlobals.startup};`, `${RuntimeGlobals.startup} = ${runtimeTemplate.basicFunction( @@ -145947,7 +152904,7 @@ class StartupChunkDependenciesRuntimeModule extends RuntimeModule { // using map is shorter for 3 or more chunks `return Promise.all(${JSON.stringify(chunkIds)}.map(${ RuntimeGlobals.ensureChunk - }, __webpack_require__)).then(next);` + }, ${RuntimeGlobals.require})).then(next);` ] : [ // calling ensureChunk directly is shorter for 0 - 2 chunks @@ -145971,7 +152928,7 @@ module.exports = StartupChunkDependenciesRuntimeModule; /***/ }), -/***/ 81364: +/***/ 90925: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -145981,22 +152938,26 @@ module.exports = StartupChunkDependenciesRuntimeModule; -const RuntimeGlobals = __webpack_require__(34623); -const RuntimeModule = __webpack_require__(81196); +const RuntimeGlobals = __webpack_require__(61539); +const RuntimeModule = __webpack_require__(21296); +/** @typedef {import("../Compilation")} Compilation */ /** @typedef {import("../MainTemplate")} MainTemplate */ class StartupEntrypointRuntimeModule extends RuntimeModule { + /** + * @param {boolean} asyncChunkLoading use async chunk loading + */ constructor(asyncChunkLoading) { super("startup entrypoint"); this.asyncChunkLoading = asyncChunkLoading; } /** - * @returns {string} runtime code + * @returns {string | null} runtime code */ generate() { - const { compilation } = this; + const compilation = /** @type {Compilation} */ (this.compilation); const { runtimeTemplate } = compilation; return `${ RuntimeGlobals.startupEntrypoint @@ -146004,19 +152965,19 @@ class StartupEntrypointRuntimeModule extends RuntimeModule { "// arguments: chunkIds, moduleId are deprecated", "var moduleId = chunkIds;", `if(!fn) chunkIds = result, fn = ${runtimeTemplate.returningFunction( - `__webpack_require__(${RuntimeGlobals.entryModuleId} = moduleId)` + `${RuntimeGlobals.require}(${RuntimeGlobals.entryModuleId} = moduleId)` )};`, ...(this.asyncChunkLoading ? [ - `return Promise.all(chunkIds.map(${ - RuntimeGlobals.ensureChunk - }, __webpack_require__)).then(${runtimeTemplate.basicFunction("", [ + `return Promise.all(chunkIds.map(${RuntimeGlobals.ensureChunk}, ${ + RuntimeGlobals.require + })).then(${runtimeTemplate.basicFunction("", [ "var r = fn();", "return r === undefined ? result : r;" ])})` ] : [ - `chunkIds.map(${RuntimeGlobals.ensureChunk}, __webpack_require__)`, + `chunkIds.map(${RuntimeGlobals.ensureChunk}, ${RuntimeGlobals.require})`, "var r = fn();", "return r === undefined ? result : r;" ]) @@ -146029,7 +152990,7 @@ module.exports = StartupEntrypointRuntimeModule; /***/ }), -/***/ 88194: +/***/ 58569: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -146039,8 +153000,8 @@ module.exports = StartupEntrypointRuntimeModule; -const RuntimeGlobals = __webpack_require__(34623); -const RuntimeModule = __webpack_require__(81196); +const RuntimeGlobals = __webpack_require__(61539); +const RuntimeModule = __webpack_require__(21296); /** @typedef {import("../Compilation")} Compilation */ @@ -146050,7 +153011,7 @@ class SystemContextRuntimeModule extends RuntimeModule { } /** - * @returns {string} runtime code + * @returns {string | null} runtime code */ generate() { return `${RuntimeGlobals.systemContext} = __system_context__;`; @@ -146062,7 +153023,7 @@ module.exports = SystemContextRuntimeModule; /***/ }), -/***/ 12877: +/***/ 14610: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -146073,7 +153034,7 @@ module.exports = SystemContextRuntimeModule; -const NormalModule = __webpack_require__(55443); +const NormalModule = __webpack_require__(17318); /** @typedef {import("../Compiler")} Compiler */ @@ -146081,15 +153042,28 @@ const NormalModule = __webpack_require__(55443); // http://www.ietf.org/rfc/rfc2397.txt const URIRegEx = /^data:([^;,]+)?((?:;[^;,]+)*?)(?:;(base64))?,(.*)$/i; +/** + * @param {string} uri data URI + * @returns {Buffer|null} decoded data + */ const decodeDataURI = uri => { const match = URIRegEx.exec(uri); if (!match) return null; const isBase64 = match[3]; const body = match[4]; - return isBase64 - ? Buffer.from(body, "base64") - : Buffer.from(decodeURIComponent(body), "ascii"); + + if (isBase64) { + return Buffer.from(body, "base64"); + } + + // CSS allows to use `data:image/svg+xml;utf8,` + // so we return original body if we can't `decodeURIComponent` + try { + return Buffer.from(decodeURIComponent(body), "ascii"); + } catch (_) { + return Buffer.from(body, "ascii"); + } }; class DataUriPlugin { @@ -146126,7 +153100,7 @@ module.exports = DataUriPlugin; /***/ }), -/***/ 93300: +/***/ 33405: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -146138,7 +153112,7 @@ module.exports = DataUriPlugin; const { URL, fileURLToPath } = __webpack_require__(57310); -const { NormalModule } = __webpack_require__(3516); +const { NormalModule } = __webpack_require__(7265); /** @typedef {import("../Compiler")} Compiler */ @@ -146183,7 +153157,7 @@ module.exports = FileUriPlugin; /***/ }), -/***/ 15660: +/***/ 5662: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -146198,11 +153172,11 @@ const EventEmitter = __webpack_require__(82361); const { extname, basename } = __webpack_require__(71017); const { URL } = __webpack_require__(57310); const { createGunzip, createBrotliDecompress, createInflate } = __webpack_require__(59796); -const NormalModule = __webpack_require__(55443); -const createSchemaValidation = __webpack_require__(94091); -const createHash = __webpack_require__(94624); -const { mkdirp, dirname, join } = __webpack_require__(33139); -const memoize = __webpack_require__(27319); +const NormalModule = __webpack_require__(17318); +const createSchemaValidation = __webpack_require__(45488); +const createHash = __webpack_require__(31147); +const { mkdirp, dirname, join } = __webpack_require__(96220); +const memoize = __webpack_require__(62377); /** @typedef {import("../../declarations/plugins/schemes/HttpUriPlugin").HttpUriPluginOptions} HttpUriPluginOptions */ /** @typedef {import("../Compiler")} Compiler */ @@ -146252,19 +153226,27 @@ const proxyFetch = (request, proxy) => (url, options, callback) => { let inProgressWrite = undefined; const validate = createSchemaValidation( - __webpack_require__(63318), - () => __webpack_require__(4828), + __webpack_require__(89667), + () => __webpack_require__(53529), { name: "Http Uri Plugin", baseDataPath: "options" } ); +/** + * @param {string} str path + * @returns {string} safe path + */ const toSafePath = str => str .replace(/^[^a-zA-Z0-9]+|[^a-zA-Z0-9]+$/g, "") .replace(/[^a-zA-Z0-9._-]+/g, "_"); +/** + * @param {Buffer} content content + * @returns {string} integrity + */ const computeIntegrity = content => { const hash = createHash("sha512"); hash.update(content); @@ -146272,6 +153254,11 @@ const computeIntegrity = content => { return integrity; }; +/** + * @param {Buffer} content content + * @param {string} integrity integrity + * @returns {boolean} true, if integrity matches + */ const verifyIntegrity = (content, integrity) => { if (integrity === "ignore") return true; return computeIntegrity(content) === integrity; @@ -146299,6 +153286,11 @@ const parseKeyValuePairs = str => { return result; }; +/** + * @param {string | undefined} cacheControl Cache-Control header + * @param {number} requestTime timestamp of request + * @returns {{storeCache: boolean, storeLock: boolean, validUntil: number}} Logic for storing in cache and lockfile cache + */ const parseCacheControl = (cacheControl, requestTime) => { // When false resource is not stored in cache let storeCache = true; @@ -146336,6 +153328,10 @@ const areLockfileEntriesEqual = (a, b) => { ); }; +/** + * @param {LockfileEntry} entry lockfile entry + * @returns {`resolved: ${string}, integrity: ${string}, contentType: ${*}`} stringified entry + */ const entryToString = entry => { return `resolved: ${entry.resolved}, integrity: ${entry.integrity}, contentType: ${entry.contentType}`; }; @@ -146347,6 +153343,10 @@ class Lockfile { this.entries = new Map(); } + /** + * @param {string} content content of the lockfile + * @returns {Lockfile} lockfile + */ static parse(content) { // TODO handle merge conflicts const data = JSON.parse(content); @@ -146369,6 +153369,9 @@ class Lockfile { return lockfile; } + /** + * @returns {string} stringified lockfile + */ toString() { let str = "{\n"; const entries = Array.from(this.entries).sort(([a], [b]) => @@ -146531,6 +153534,7 @@ class HttpUriPlugin { const fs = compilation.inputFileSystem; const cache = compilation.getCache("webpack.HttpUriPlugin"); const logger = compilation.getLogger("webpack.HttpUriPlugin"); + /** @type {string} */ const lockfileLocation = this._lockfileLocation || join( @@ -146540,6 +153544,7 @@ class HttpUriPlugin { ? `${toSafePath(compiler.name)}.webpack.lock` : "webpack.lock" ); + /** @type {string | false} */ const cacheLocation = this._cacheLocation !== undefined ? this._cacheLocation @@ -146553,6 +153558,7 @@ class HttpUriPlugin { let warnedAboutEol = false; + /** @type {Map} */ const cacheKeyCache = new Map(); /** * @param {string} url the url @@ -146636,6 +153642,12 @@ class HttpUriPlugin { /** @type {Map | undefined} */ let lockfileUpdates = undefined; + + /** + * @param {Lockfile} lockfile lockfile instance + * @param {string} url url to store + * @param {LockfileEntry | "ignore" | "no-cache"} entry lockfile entry + */ const storeLockEntry = (lockfile, url, entry) => { const oldEntry = lockfile.entries.get(url); if (lockfileUpdates === undefined) lockfileUpdates = new Map(); @@ -147309,7 +154321,7 @@ module.exports = HttpUriPlugin; /***/ }), -/***/ 73934: +/***/ 49807: /***/ (function(module) { "use strict"; @@ -147319,16 +154331,32 @@ module.exports = HttpUriPlugin; +/** @typedef {import("./ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */ +/** @typedef {import("./ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */ + class ArraySerializer { - serialize(array, { write }) { - write(array.length); - for (const item of array) write(item); + /** + * @template T + * @param {T[]} array array + * @param {ObjectSerializerContext} context context + */ + serialize(array, context) { + context.write(array.length); + for (const item of array) context.write(item); } - deserialize({ read }) { - const length = read(); + + /** + * @template T + * @param {ObjectDeserializerContext} context context + * @returns {T[]} array + */ + deserialize(context) { + /** @type {number} */ + const length = context.read(); + /** @type {T[]} */ const array = []; for (let i = 0; i < length; i++) { - array.push(read()); + array.push(context.read()); } return array; } @@ -147339,7 +154367,7 @@ module.exports = ArraySerializer; /***/ }), -/***/ 90497: +/***/ 61312: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -147349,8 +154377,8 @@ module.exports = ArraySerializer; -const memoize = __webpack_require__(27319); -const SerializerMiddleware = __webpack_require__(80021); +const memoize = __webpack_require__(62377); +const SerializerMiddleware = __webpack_require__(41565); /** @typedef {import("./types").BufferSerializableType} BufferSerializableType */ /** @typedef {import("./types").PrimitiveSerializableType} PrimitiveSerializableType */ @@ -147366,6 +154394,9 @@ Section -> NullsSection | I32NumbersSection | I8NumbersSection | ShortStringSection | + BigIntSection | + I32BigIntSection | + I8BigIntSection StringSection | BufferSection | NopSection @@ -147384,6 +154415,9 @@ ShortStringSection -> ShortStringSectionHeaderByte ascii-byte* StringSection -> StringSectionHeaderByte i32:length utf8-byte* BufferSection -> BufferSectionHeaderByte i32:length byte* NopSection --> NopSectionHeaderByte +BigIntSection -> BigIntSectionHeaderByte i32:length ascii-byte* +I32BigIntSection -> I32BigIntSectionHeaderByte i32 +I8BigIntSection -> I8BigIntSectionHeaderByte i8 ShortStringSectionHeaderByte -> 0b1nnn_nnnn (n:length) @@ -147403,6 +154437,9 @@ BooleansCountAndBitsByte -> StringSectionHeaderByte -> 0b0000_1110 BufferSectionHeaderByte -> 0b0000_1111 NopSectionHeaderByte -> 0b0000_1011 +BigIntSectionHeaderByte -> 0b0001_1010 +I32BigIntSectionHeaderByte -> 0b0001_1100 +I8BigIntSectionHeaderByte -> 0b0001_1011 FalseHeaderByte -> 0b0000_1100 TrueHeaderByte -> 0b0000_1101 @@ -147423,6 +154460,9 @@ const NULL_AND_I8_HEADER = 0x15; const NULL_AND_I32_HEADER = 0x16; const NULL_AND_TRUE_HEADER = 0x17; const NULL_AND_FALSE_HEADER = 0x18; +const BIGINT_HEADER = 0x1a; +const BIGINT_I8_HEADER = 0x1b; +const BIGINT_I32_HEADER = 0x1c; const STRING_HEADER = 0x1e; const BUFFER_HEADER = 0x1f; const I8_HEADER = 0x60; @@ -147431,7 +154471,7 @@ const F64_HEADER = 0x20; const SHORT_STRING_HEADER = 0x80; /** Uplift high-order bits */ -const NUMBERS_HEADER_MASK = 0xe0; +const NUMBERS_HEADER_MASK = 0xe0; // 0b1010_0000 const NUMBERS_COUNT_MASK = 0x1f; // 0b0001_1111 const SHORT_STRING_LENGTH_MASK = 0x7f; // 0b0111_1111 @@ -147446,6 +154486,10 @@ const MEASURE_END_OPERATION = Symbol("MEASURE_END_OPERATION"); /** @typedef {typeof MEASURE_START_OPERATION} MEASURE_START_OPERATION_TYPE */ /** @typedef {typeof MEASURE_END_OPERATION} MEASURE_END_OPERATION_TYPE */ +/** + * @param {number} n number + * @returns {0 | 1 | 2} type of number for serialization + */ const identifyNumber = n => { if (n === (n | 0)) { if (n <= 127 && n >= -128) return 0; @@ -147454,6 +154498,16 @@ const identifyNumber = n => { return 2; }; +/** + * @param {bigint} n bigint + * @returns {0 | 1 | 2} type of bigint for serialization + */ +const identifyBigInt = n => { + if (n <= BigInt(127) && n >= BigInt(-128)) return 0; + if (n <= BigInt(2147483647) && n >= BigInt(-2147483648)) return 1; + return 2; +}; + /** * @typedef {PrimitiveSerializableType[]} DeserializedType * @typedef {BufferSerializableType[]} SerializedType @@ -147548,17 +154602,27 @@ class BinaryMiddleware extends SerializerMiddleware { currentPosition = 0; } }; + /** + * @param {number} byte byte + */ const writeU8 = byte => { currentBuffer.writeUInt8(byte, currentPosition++); }; + /** + * @param {number} ui32 ui32 + */ const writeU32 = ui32 => { currentBuffer.writeUInt32LE(ui32, currentPosition); currentPosition += 4; }; + /** @type {number[]} */ const measureStack = []; const measureStart = () => { measureStack.push(buffers.length, currentPosition); }; + /** + * @returns {number} size + */ const measureEnd = () => { const oldPos = measureStack.pop(); const buffersIndex = measureStack.pop(); @@ -147603,6 +154667,7 @@ class BinaryMiddleware extends SerializerMiddleware { break; } } + /** @type {number[]} */ const lengths = []; for (const item of serializedData) { let last; @@ -147661,6 +154726,62 @@ class BinaryMiddleware extends SerializerMiddleware { } break; } + case "bigint": { + const type = identifyBigInt(thing); + if (type === 0 && thing >= 0 && thing <= BigInt(10)) { + // shortcut for very small bigints + allocate(HEADER_SIZE + I8_SIZE); + writeU8(BIGINT_I8_HEADER); + writeU8(Number(thing)); + break; + } + + switch (type) { + case 0: { + let n = 1; + allocate(HEADER_SIZE + I8_SIZE * n); + writeU8(BIGINT_I8_HEADER | (n - 1)); + while (n > 0) { + currentBuffer.writeInt8( + Number(/** @type {bigint} */ (data[i])), + currentPosition + ); + currentPosition += I8_SIZE; + n--; + i++; + } + i--; + break; + } + case 1: { + let n = 1; + allocate(HEADER_SIZE + I32_SIZE * n); + writeU8(BIGINT_I32_HEADER | (n - 1)); + while (n > 0) { + currentBuffer.writeInt32LE( + Number(/** @type {bigint} */ (data[i])), + currentPosition + ); + currentPosition += I32_SIZE; + n--; + i++; + } + i--; + break; + } + default: { + const value = thing.toString(); + const len = Buffer.byteLength(value); + allocate(len + HEADER_SIZE + I32_SIZE); + writeU8(BIGINT_HEADER); + writeU32(len); + currentBuffer.write(value, currentPosition); + currentPosition += len; + break; + } + } + break; + } case "number": { const type = identifyNumber(thing); if (type === 0 && thing >= 0 && thing <= 10) { @@ -147985,6 +155106,9 @@ class BinaryMiddleware extends SerializerMiddleware { checkOverflow(); return res; }; + /** + * @returns {number} U8 + */ const readU8 = () => { ensureBuffer(); /** @@ -147998,6 +155122,9 @@ class BinaryMiddleware extends SerializerMiddleware { checkOverflow(); return byte; }; + /** + * @returns {number} U32 + */ const readU32 = () => { return read(I32_SIZE).readUInt32LE(0); }; @@ -148171,6 +155298,70 @@ class BinaryMiddleware extends SerializerMiddleware { result.push(read(1).readInt8(0)); } }; + case BIGINT_I8_HEADER: { + const len = 1; + return () => { + const need = I8_SIZE * len; + + if (isInCurrentBuffer(need)) { + for (let i = 0; i < len; i++) { + const value = + /** @type {Buffer} */ + (currentBuffer).readInt8(currentPosition); + result.push(BigInt(value)); + currentPosition += I8_SIZE; + } + checkOverflow(); + } else { + const buf = read(need); + for (let i = 0; i < len; i++) { + const value = buf.readInt8(i * I8_SIZE); + result.push(BigInt(value)); + } + } + }; + } + case BIGINT_I32_HEADER: { + const len = 1; + return () => { + const need = I32_SIZE * len; + if (isInCurrentBuffer(need)) { + for (let i = 0; i < len; i++) { + const value = /** @type {Buffer} */ (currentBuffer).readInt32LE( + currentPosition + ); + result.push(BigInt(value)); + currentPosition += I32_SIZE; + } + checkOverflow(); + } else { + const buf = read(need); + for (let i = 0; i < len; i++) { + const value = buf.readInt32LE(i * I32_SIZE); + result.push(BigInt(value)); + } + } + }; + } + case BIGINT_HEADER: { + return () => { + const len = readU32(); + if (isInCurrentBuffer(len) && currentPosition + len < 0x7fffffff) { + const value = currentBuffer.toString( + undefined, + currentPosition, + currentPosition + len + ); + + result.push(BigInt(value)); + currentPosition += len; + checkOverflow(); + } else { + const value = read(len).toString(); + result.push(BigInt(value)); + } + }; + } default: if (header <= 10) { return () => result.push(header); @@ -148297,7 +155488,7 @@ module.exports.MEASURE_END_OPERATION = MEASURE_END_OPERATION; /***/ }), -/***/ 759: +/***/ 44081: /***/ (function(module) { "use strict"; @@ -148307,12 +155498,23 @@ module.exports.MEASURE_END_OPERATION = MEASURE_END_OPERATION; +/** @typedef {import("./ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */ +/** @typedef {import("./ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */ + class DateObjectSerializer { - serialize(obj, { write }) { - write(obj.getTime()); + /** + * @param {Date} obj date + * @param {ObjectSerializerContext} context context + */ + serialize(obj, context) { + context.write(obj.getTime()); } - deserialize({ read }) { - return new Date(read()); + /** + * @param {ObjectDeserializerContext} context context + * @returns {Date} date + */ + deserialize(context) { + return new Date(context.read()); } } @@ -148321,7 +155523,7 @@ module.exports = DateObjectSerializer; /***/ }), -/***/ 56129: +/***/ 32576: /***/ (function(module) { "use strict"; @@ -148331,21 +155533,36 @@ module.exports = DateObjectSerializer; +/** @typedef {import("./ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */ +/** @typedef {import("./ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */ + class ErrorObjectSerializer { + /** + * @param {ErrorConstructor | EvalErrorConstructor | RangeErrorConstructor | ReferenceErrorConstructor | SyntaxErrorConstructor | TypeErrorConstructor} Type error type + */ constructor(Type) { this.Type = Type; } - - serialize(obj, { write }) { - write(obj.message); - write(obj.stack); + /** + * @param {Error | EvalError | RangeError | ReferenceError | SyntaxError | TypeError} obj error + * @param {ObjectSerializerContext} context context + */ + serialize(obj, context) { + context.write(obj.message); + context.write(obj.stack); + context.write(/** @type {Error & { cause: "unknown" }} */ (obj).cause); } - - deserialize({ read }) { + /** + * @param {ObjectDeserializerContext} context context + * @returns {Error | EvalError | RangeError | ReferenceError | SyntaxError | TypeError} error + */ + deserialize(context) { const err = new this.Type(); - err.message = read(); - err.stack = read(); + err.message = context.read(); + err.stack = context.read(); + /** @type {Error & { cause: "unknown" }} */ + (err).cause = context.read(); return err; } @@ -148356,7 +155573,7 @@ module.exports = ErrorObjectSerializer; /***/ }), -/***/ 21885: +/***/ 44003: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -148375,10 +155592,10 @@ const { createGunzip, constants: zConstants } = __webpack_require__(59796); -const createHash = __webpack_require__(94624); -const { dirname, join, mkdirp } = __webpack_require__(33139); -const memoize = __webpack_require__(27319); -const SerializerMiddleware = __webpack_require__(80021); +const createHash = __webpack_require__(31147); +const { dirname, join, mkdirp } = __webpack_require__(96220); +const memoize = __webpack_require__(62377); +const SerializerMiddleware = __webpack_require__(41565); /** @typedef {typeof import("../util/Hash")} Hash */ /** @typedef {import("../util/fs").IntermediateFileSystem} IntermediateFileSystem */ @@ -148543,6 +155760,7 @@ const serialize = async ( SerializerMiddleware.setLazySerializedValue(lazy, buf); return buf; }); + /** @type {number[]} */ const lengths = []; for (const item of resolvedData) { if (Array.isArray(item)) { @@ -148565,6 +155783,7 @@ const serialize = async ( for (let i = 0; i < lengths.length; i++) { header.writeInt32LE(lengths[i], 8 + i * 4); } + /** @type {Buffer[]} */ const buf = [header]; for (const item of resolvedData) { if (Array.isArray(item)) { @@ -148609,6 +155828,9 @@ const deserialize = async (middleware, name, readFile) => { contentItemLength = contentItem.length; contentPosition = 0; }; + /** + * @param {number} n number of bytes to ensure + */ const ensureData = n => { if (contentPosition === contentItemLength) { nextContent(); @@ -148636,18 +155858,28 @@ const deserialize = async (middleware, name, readFile) => { contentPosition = 0; } }; + /** + * @returns {number} value value + */ const readUInt32LE = () => { ensureData(4); const value = contentItem.readUInt32LE(contentPosition); contentPosition += 4; return value; }; + /** + * @returns {number} value value + */ const readInt32LE = () => { ensureData(4); const value = contentItem.readInt32LE(contentPosition); contentPosition += 4; return value; }; + /** + * @param {number} l length + * @returns {Buffer} buffer + */ const readSlice = l => { ensureData(l); if (contentPosition === 0 && contentItemLength === l) { @@ -148918,7 +156150,9 @@ class FileMiddleware extends SerializerMiddleware { return; } let remaining = /** @type {number} */ (stats.size); + /** @type {Buffer | undefined} */ let currentBuffer; + /** @type {number | undefined} */ let currentBufferUsed; const buf = []; let decompression; @@ -149029,7 +156263,7 @@ module.exports = FileMiddleware; /***/ }), -/***/ 56291: +/***/ 41205: /***/ (function(module) { "use strict"; @@ -149039,25 +156273,41 @@ module.exports = FileMiddleware; +/** @typedef {import("./ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */ +/** @typedef {import("./ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */ + class MapObjectSerializer { - serialize(obj, { write }) { - write(obj.size); + /** + * @template K, V + * @param {Map} obj map + * @param {ObjectSerializerContext} context context + */ + serialize(obj, context) { + context.write(obj.size); for (const key of obj.keys()) { - write(key); + context.write(key); } for (const value of obj.values()) { - write(value); + context.write(value); } } - deserialize({ read }) { - let size = read(); + /** + * @template K, V + * @param {ObjectDeserializerContext} context context + * @returns {Map} map + */ + deserialize(context) { + /** @type {number} */ + let size = context.read(); + /** @type {Map} */ const map = new Map(); + /** @type {K[]} */ const keys = []; for (let i = 0; i < size; i++) { - keys.push(read()); + keys.push(context.read()); } for (let i = 0; i < size; i++) { - map.set(keys[i], read()); + map.set(keys[i], context.read()); } return map; } @@ -149068,7 +156318,7 @@ module.exports = MapObjectSerializer; /***/ }), -/***/ 24206: +/***/ 95285: /***/ (function(module) { "use strict"; @@ -149078,27 +156328,44 @@ module.exports = MapObjectSerializer; +/** @typedef {import("./ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */ +/** @typedef {import("./ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */ + class NullPrototypeObjectSerializer { - serialize(obj, { write }) { + /** + * @template {Object} T + * @param {T} obj null object + * @param {ObjectSerializerContext} context context + */ + serialize(obj, context) { + /** @type {string[]} */ const keys = Object.keys(obj); for (const key of keys) { - write(key); + context.write(key); } - write(null); + context.write(null); for (const key of keys) { - write(obj[key]); + context.write(obj[key]); } } - deserialize({ read }) { + /** + * @template {Object} T + * @param {ObjectDeserializerContext} context context + * @returns {T} null object + */ + deserialize(context) { + /** @type {T} */ const obj = Object.create(null); + /** @type {string[]} */ const keys = []; - let key = read(); + /** @type {string | null} */ + let key = context.read(); while (key !== null) { keys.push(key); - key = read(); + key = context.read(); } for (const key of keys) { - obj[key] = read(); + obj[key] = context.read(); } return obj; } @@ -149109,7 +156376,7 @@ module.exports = NullPrototypeObjectSerializer; /***/ }), -/***/ 31559: +/***/ 74722: /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -149119,16 +156386,16 @@ module.exports = NullPrototypeObjectSerializer; -const createHash = __webpack_require__(94624); -const ArraySerializer = __webpack_require__(73934); -const DateObjectSerializer = __webpack_require__(759); -const ErrorObjectSerializer = __webpack_require__(56129); -const MapObjectSerializer = __webpack_require__(56291); -const NullPrototypeObjectSerializer = __webpack_require__(24206); -const PlainObjectSerializer = __webpack_require__(87704); -const RegExpObjectSerializer = __webpack_require__(16483); -const SerializerMiddleware = __webpack_require__(80021); -const SetObjectSerializer = __webpack_require__(48031); +const createHash = __webpack_require__(31147); +const ArraySerializer = __webpack_require__(49807); +const DateObjectSerializer = __webpack_require__(44081); +const ErrorObjectSerializer = __webpack_require__(32576); +const MapObjectSerializer = __webpack_require__(41205); +const NullPrototypeObjectSerializer = __webpack_require__(95285); +const PlainObjectSerializer = __webpack_require__(36534); +const RegExpObjectSerializer = __webpack_require__(4175); +const SerializerMiddleware = __webpack_require__(41565); +const SetObjectSerializer = __webpack_require__(10445); /** @typedef {typeof import("../util/Hash")} Hash */ /** @typedef {import("./types").ComplexSerializableType} ComplexSerializableType */ @@ -149161,11 +156428,13 @@ Technically any value can be used. /** * @typedef {Object} ObjectSerializerContext * @property {function(any): void} write + * @property {function(any): void} setCircularReference */ /** * @typedef {Object} ObjectDeserializerContext * @property {function(): any} read + * @property {function(any): void} setCircularReference */ /** @@ -149174,6 +156443,11 @@ Technically any value can be used. * @property {function(ObjectDeserializerContext): any} deserialize */ +/** + * @template T + * @param {Set} set set + * @param {number} size count of items to keep + */ const setSetSize = (set, size) => { let i = 0; for (const item of set) { @@ -149183,6 +156457,11 @@ const setSetSize = (set, size) => { } }; +/** + * @template K, X + * @param {Map} map map + * @param {number} size count of items to keep + */ const setMapSize = (map, size) => { let i = 0; for (const item of map.keys()) { @@ -149210,9 +156489,12 @@ const ESCAPE_UNDEFINED = false; const CURRENT_VERSION = 2; +/** @type {Map} */ const serializers = new Map(); +/** @type {Map} */ const serializerInversed = new Map(); +/** @type {Set} */ const loadedRequests = new Set(); const NOT_SERIALIZABLE = {}; @@ -149258,7 +156540,10 @@ if (exports.constructor !== Object) { } for (const { request, name, serializer } of serializers.values()) { - serializerInversed.set(`${request}/${name}`, serializer); + serializerInversed.set( + `${request}/${name}`, + /** @type {ObjectSerializer} */ (serializer) + ); } /** @type {Map boolean>} */ @@ -149291,7 +156576,7 @@ class ObjectMiddleware extends SerializerMiddleware { /** * @param {Constructor} Constructor the constructor * @param {string} request the request which will be required when deserializing - * @param {string} name the name to make multiple serializer unique when sharing a request + * @param {string | null} name the name to make multiple serializer unique when sharing a request * @param {ObjectSerializer} serializer the serializer * @returns {void} */ @@ -149355,6 +156640,11 @@ class ObjectMiddleware extends SerializerMiddleware { return config; } + /** + * @param {string} request request + * @param {TODO} name name + * @returns {ObjectSerializer} serializer + */ static getDeserializerFor(request, name) { const key = request + "/" + name; const serializer = serializerInversed.get(key); @@ -149366,6 +156656,11 @@ class ObjectMiddleware extends SerializerMiddleware { return serializer; } + /** + * @param {string} request request + * @param {TODO} name name + * @returns {ObjectSerializer} serializer + */ static _getDeserializerForWithoutError(request, name) { const key = request + "/" + name; const serializer = serializerInversed.get(key); @@ -149487,6 +156782,9 @@ class ObjectMiddleware extends SerializerMiddleware { ", " )} }`; } + if (typeof item === "bigint") { + return `BigInt ${item}n`; + } try { return `${item}`; } catch (e) { @@ -149851,7 +157149,7 @@ module.exports.NOT_SERIALIZABLE = NOT_SERIALIZABLE; /***/ }), -/***/ 87704: +/***/ 36534: /***/ (function(module) { "use strict"; @@ -149861,6 +157159,9 @@ module.exports.NOT_SERIALIZABLE = NOT_SERIALIZABLE; +/** @typedef {import("./ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */ +/** @typedef {import("./ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */ + const cache = new WeakMap(); class ObjectStructure { @@ -149898,37 +157199,45 @@ const getCachedKeys = (keys, cacheAssoc) => { }; class PlainObjectSerializer { - serialize(obj, { write }) { + /** + * @param {Object} obj plain object + * @param {ObjectSerializerContext} context context + */ + serialize(obj, context) { const keys = Object.keys(obj); if (keys.length > 128) { // Objects with so many keys are unlikely to share structure // with other objects - write(keys); + context.write(keys); for (const key of keys) { - write(obj[key]); + context.write(obj[key]); } } else if (keys.length > 1) { - write(getCachedKeys(keys, write)); + context.write(getCachedKeys(keys, context.write)); for (const key of keys) { - write(obj[key]); + context.write(obj[key]); } } else if (keys.length === 1) { const key = keys[0]; - write(key); - write(obj[key]); + context.write(key); + context.write(obj[key]); } else { - write(null); + context.write(null); } } - deserialize({ read }) { - const keys = read(); + /** + * @param {ObjectDeserializerContext} context context + * @returns {Object} plain object + */ + deserialize(context) { + const keys = context.read(); const obj = {}; if (Array.isArray(keys)) { for (const key of keys) { - obj[key] = read(); + obj[key] = context.read(); } } else if (keys !== null) { - obj[keys] = read(); + obj[keys] = context.read(); } return obj; } @@ -149939,7 +157248,7 @@ module.exports = PlainObjectSerializer; /***/ }), -/***/ 16483: +/***/ 4175: /***/ (function(module) { "use strict"; @@ -149949,13 +157258,24 @@ module.exports = PlainObjectSerializer; +/** @typedef {import("./ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */ +/** @typedef {import("./ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */ + class RegExpObjectSerializer { - serialize(obj, { write }) { - write(obj.source); - write(obj.flags); + /** + * @param {RegExp} obj regexp + * @param {ObjectSerializerContext} context context + */ + serialize(obj, context) { + context.write(obj.source); + context.write(obj.flags); } - deserialize({ read }) { - return new RegExp(read(), read()); + /** + * @param {ObjectDeserializerContext} context context + * @returns {RegExp} regexp + */ + deserialize(context) { + return new RegExp(context.read(), context.read()); } } @@ -149964,7 +157284,7 @@ module.exports = RegExpObjectSerializer; /***/ }), -/***/ 60139: +/***/ 75612: /***/ (function(module) { "use strict"; @@ -150018,7 +157338,7 @@ module.exports = Serializer; /***/ }), -/***/ 80021: +/***/ 41565: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -150028,7 +157348,7 @@ module.exports = Serializer; -const memoize = __webpack_require__(27319); +const memoize = __webpack_require__(62377); const LAZY_TARGET = Symbol("lazy serialization target"); const LAZY_SERIALIZED_VALUE = Symbol("lazy serialization data"); @@ -150046,7 +157366,7 @@ class SerializerMiddleware { * @returns {SerializedType|Promise} serialized data */ serialize(data, context) { - const AbstractMethodError = __webpack_require__(26907); + const AbstractMethodError = __webpack_require__(9906); throw new AbstractMethodError(); } @@ -150058,7 +157378,7 @@ class SerializerMiddleware { * @returns {DeserializedType|Promise} deserialized data */ deserialize(data, context) { - const AbstractMethodError = __webpack_require__(26907); + const AbstractMethodError = __webpack_require__(9906); throw new AbstractMethodError(); } @@ -150179,7 +157499,7 @@ module.exports = SerializerMiddleware; /***/ }), -/***/ 48031: +/***/ 10445: /***/ (function(module) { "use strict"; @@ -150189,18 +157509,33 @@ module.exports = SerializerMiddleware; +/** @typedef {import("./ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */ +/** @typedef {import("./ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */ + class SetObjectSerializer { - serialize(obj, { write }) { - write(obj.size); + /** + * @template T + * @param {Set} obj set + * @param {ObjectSerializerContext} context context + */ + serialize(obj, context) { + context.write(obj.size); for (const value of obj) { - write(value); + context.write(value); } } - deserialize({ read }) { - let size = read(); + /** + * @template T + * @param {ObjectDeserializerContext} context context + * @returns {Set} date + */ + deserialize(context) { + /** @type {number} */ + let size = context.read(); + /** @type {Set} */ const set = new Set(); for (let i = 0; i < size; i++) { - set.add(read()); + set.add(context.read()); } return set; } @@ -150211,7 +157546,7 @@ module.exports = SetObjectSerializer; /***/ }), -/***/ 42094: +/***/ 67206: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -150221,7 +157556,7 @@ module.exports = SetObjectSerializer; -const SerializerMiddleware = __webpack_require__(80021); +const SerializerMiddleware = __webpack_require__(41565); /** * @typedef {any} DeserializedType @@ -150253,7 +157588,7 @@ module.exports = SingleItemMiddleware; /***/ }), -/***/ 30046: +/***/ 9294: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -150264,10 +157599,13 @@ module.exports = SingleItemMiddleware; -const ModuleDependency = __webpack_require__(22994); -const makeSerializable = __webpack_require__(23827); +const ModuleDependency = __webpack_require__(10931); +const makeSerializable = __webpack_require__(83626); class ConsumeSharedFallbackDependency extends ModuleDependency { + /** + * @param {string} request the request + */ constructor(request) { super(request); } @@ -150291,7 +157629,7 @@ module.exports = ConsumeSharedFallbackDependency; /***/ }), -/***/ 92640: +/***/ 3535: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -150303,12 +157641,15 @@ module.exports = ConsumeSharedFallbackDependency; const { RawSource } = __webpack_require__(59728); -const AsyncDependenciesBlock = __webpack_require__(54823); -const Module = __webpack_require__(96040); -const RuntimeGlobals = __webpack_require__(34623); -const makeSerializable = __webpack_require__(23827); -const { rangeToString, stringifyHoley } = __webpack_require__(83213); -const ConsumeSharedFallbackDependency = __webpack_require__(30046); +const AsyncDependenciesBlock = __webpack_require__(27973); +const Module = __webpack_require__(6309); +const { + WEBPACK_MODULE_TYPE_CONSUME_SHARED_MODULE +} = __webpack_require__(92891); +const RuntimeGlobals = __webpack_require__(61539); +const makeSerializable = __webpack_require__(83626); +const { rangeToString, stringifyHoley } = __webpack_require__(14758); +const ConsumeSharedFallbackDependency = __webpack_require__(9294); /** @typedef {import("../../declarations/WebpackOptions").WebpackOptionsNormalized} WebpackOptions */ /** @typedef {import("../ChunkGraph")} ChunkGraph */ @@ -150322,6 +157663,8 @@ const ConsumeSharedFallbackDependency = __webpack_require__(30046); /** @typedef {import("../RequestShortener")} RequestShortener */ /** @typedef {import("../ResolverFactory").ResolverWithOptions} ResolverWithOptions */ /** @typedef {import("../WebpackError")} WebpackError */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */ /** @typedef {import("../util/Hash")} Hash */ /** @typedef {import("../util/fs").InputFileSystem} InputFileSystem */ /** @typedef {import("../util/semver").SemVerRange} SemVerRange */ @@ -150347,7 +157690,7 @@ class ConsumeSharedModule extends Module { * @param {ConsumeOptions} options consume options */ constructor(context, options) { - super("consume-shared-module", context); + super(WEBPACK_MODULE_TYPE_CONSUME_SHARED_MODULE, context); this.options = options; } @@ -150364,7 +157707,7 @@ class ConsumeSharedModule extends Module { singleton, eager } = this.options; - return `consume-shared-module|${shareScope}|${shareKey}|${ + return `${WEBPACK_MODULE_TYPE_CONSUME_SHARED_MODULE}|${shareScope}|${shareKey}|${ requiredVersion && rangeToString(requiredVersion) }|${strictVersion}|${importResolved}|${singleton}|${eager}`; } @@ -150527,12 +157870,18 @@ class ConsumeSharedModule extends Module { }; } + /** + * @param {ObjectSerializerContext} context context + */ serialize(context) { const { write } = context; write(this.options); super.serialize(context); } + /** + * @param {ObjectDeserializerContext} context context + */ deserialize(context) { const { read } = context; this.options = read(); @@ -150550,7 +157899,7 @@ module.exports = ConsumeSharedModule; /***/ }), -/***/ 81179: +/***/ 50556: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -150561,23 +157910,23 @@ module.exports = ConsumeSharedModule; -const ModuleNotFoundError = __webpack_require__(79150); -const RuntimeGlobals = __webpack_require__(34623); -const WebpackError = __webpack_require__(10841); -const { parseOptions } = __webpack_require__(14846); -const LazySet = __webpack_require__(66205); -const createSchemaValidation = __webpack_require__(94091); -const { parseRange } = __webpack_require__(83213); -const ConsumeSharedFallbackDependency = __webpack_require__(30046); -const ConsumeSharedModule = __webpack_require__(92640); -const ConsumeSharedRuntimeModule = __webpack_require__(88469); -const ProvideForSharedDependency = __webpack_require__(28276); -const { resolveMatchedConfigs } = __webpack_require__(91466); +const ModuleNotFoundError = __webpack_require__(32569); +const RuntimeGlobals = __webpack_require__(61539); +const WebpackError = __webpack_require__(49999); +const { parseOptions } = __webpack_require__(4584); +const LazySet = __webpack_require__(57876); +const createSchemaValidation = __webpack_require__(45488); +const { parseRange } = __webpack_require__(14758); +const ConsumeSharedFallbackDependency = __webpack_require__(9294); +const ConsumeSharedModule = __webpack_require__(3535); +const ConsumeSharedRuntimeModule = __webpack_require__(35835); +const ProvideForSharedDependency = __webpack_require__(63544); +const { resolveMatchedConfigs } = __webpack_require__(96023); const { isRequiredVersion, getDescriptionFile, getRequiredVersionFromDescriptionFile -} = __webpack_require__(78381); +} = __webpack_require__(5706); /** @typedef {import("../../declarations/plugins/sharing/ConsumeSharedPlugin").ConsumeSharedPluginOptions} ConsumeSharedPluginOptions */ /** @typedef {import("../../declarations/plugins/sharing/ConsumeSharedPlugin").ConsumesConfig} ConsumesConfig */ @@ -150586,8 +157935,8 @@ const { /** @typedef {import("./ConsumeSharedModule").ConsumeOptions} ConsumeOptions */ const validate = createSchemaValidation( - __webpack_require__(99689), - () => __webpack_require__(64223), + __webpack_require__(29973), + () => __webpack_require__(22139), { name: "Consume Shared Plugin", baseDataPath: "options" @@ -150780,6 +158129,10 @@ class ConsumeSharedPlugin { ); return resolve(); } + if (data.name === packageName) { + // Package self-referencing + return resolve(); + } const requiredVersion = getRequiredVersionFromDescriptionFile( data, packageName @@ -150877,7 +158230,7 @@ module.exports = ConsumeSharedPlugin; /***/ }), -/***/ 88469: +/***/ 35835: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -150888,36 +158241,43 @@ module.exports = ConsumeSharedPlugin; -const RuntimeGlobals = __webpack_require__(34623); -const RuntimeModule = __webpack_require__(81196); -const Template = __webpack_require__(88070); +const RuntimeGlobals = __webpack_require__(61539); +const RuntimeModule = __webpack_require__(21296); +const Template = __webpack_require__(88835); const { parseVersionRuntimeCode, versionLtRuntimeCode, rangeToStringRuntimeCode, satisfyRuntimeCode -} = __webpack_require__(83213); +} = __webpack_require__(14758); /** @typedef {import("webpack-sources").Source} Source */ /** @typedef {import("../Chunk")} Chunk */ +/** @typedef {import("../ChunkGraph")} ChunkGraph */ +/** @typedef {import("../Compilation")} Compilation */ /** @typedef {import("../Module")} Module */ /** @typedef {import("./ConsumeSharedModule")} ConsumeSharedModule */ class ConsumeSharedRuntimeModule extends RuntimeModule { + /** + * @param {ReadonlySet} runtimeRequirements runtime requirements + */ constructor(runtimeRequirements) { super("consumes", RuntimeModule.STAGE_ATTACH); this._runtimeRequirements = runtimeRequirements; } /** - * @returns {string} runtime code + * @returns {string | null} runtime code */ generate() { - const { compilation, chunkGraph } = this; + const compilation = /** @type {Compilation} */ (this.compilation); + const chunkGraph = /** @type {ChunkGraph} */ (this.chunkGraph); const { runtimeTemplate, codeGenerationResults } = compilation; const chunkToModuleMapping = {}; /** @type {Map} */ const moduleIdToSourceMapping = new Map(); + /** @type {(string | number)[]} */ const initialConsumes = []; /** * @@ -150940,7 +158300,7 @@ class ConsumeSharedRuntimeModule extends RuntimeModule { ); } }; - for (const chunk of this.chunk.getAllAsyncChunks()) { + for (const chunk of /** @type {Chunk} */ (this.chunk).getAllAsyncChunks()) { const modules = chunkGraph.getChunkModulesIterableBySourceType( chunk, "consume-shared" @@ -150948,7 +158308,9 @@ class ConsumeSharedRuntimeModule extends RuntimeModule { if (!modules) continue; addModules(modules, chunk, (chunkToModuleMapping[chunk.id] = [])); } - for (const chunk of this.chunk.getAllInitialChunks()) { + for (const chunk of /** @type {Chunk} */ ( + this.chunk + ).getAllInitialChunks()) { const modules = chunkGraph.getChunkModulesIterableBySourceType( chunk, "consume-shared" @@ -151002,8 +158364,7 @@ class ConsumeSharedRuntimeModule extends RuntimeModule { "scope, scopeName, key, requiredVersion", [ "var version = findSingletonVersionKey(scope, key);", - "if (!satisfy(requiredVersion, version)) " + - 'typeof console !== "undefined" && console.warn && console.warn(getInvalidSingletonVersionMessage(scope, key, version, requiredVersion));', + "if (!satisfy(requiredVersion, version)) warn(getInvalidSingletonVersionMessage(scope, key, version, requiredVersion));", "return get(scope[key][version]);" ] )};`, @@ -151049,10 +158410,17 @@ class ConsumeSharedRuntimeModule extends RuntimeModule { "throw new Error(getInvalidVersionMessage(scope, scopeName, key, requiredVersion));" ] )};`, + `var warn = ${ + compilation.outputOptions.ignoreBrowserWarnings + ? runtimeTemplate.basicFunction("", "") + : runtimeTemplate.basicFunction("msg", [ + 'if (typeof console !== "undefined" && console.warn) console.warn(msg);' + ]) + };`, `var warnInvalidVersion = ${runtimeTemplate.basicFunction( "scope, scopeName, key, requiredVersion", [ - 'typeof console !== "undefined" && console.warn && console.warn(getInvalidVersionMessage(scope, scopeName, key, requiredVersion));' + "warn(getInvalidVersionMessage(scope, scopeName, key, requiredVersion));" ] )};`, `var get = ${runtimeTemplate.basicFunction("entry", [ @@ -151245,7 +158613,7 @@ module.exports = ConsumeSharedRuntimeModule; /***/ }), -/***/ 28276: +/***/ 63544: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -151256,8 +158624,8 @@ module.exports = ConsumeSharedRuntimeModule; -const ModuleDependency = __webpack_require__(22994); -const makeSerializable = __webpack_require__(23827); +const ModuleDependency = __webpack_require__(10931); +const makeSerializable = __webpack_require__(83626); class ProvideForSharedDependency extends ModuleDependency { /** @@ -151287,7 +158655,7 @@ module.exports = ProvideForSharedDependency; /***/ }), -/***/ 35088: +/***/ 31843: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -151298,10 +158666,20 @@ module.exports = ProvideForSharedDependency; -const Dependency = __webpack_require__(68242); -const makeSerializable = __webpack_require__(23827); +const Dependency = __webpack_require__(504); +const makeSerializable = __webpack_require__(83626); + +/** @typedef {import("../serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */ class ProvideSharedDependency extends Dependency { + /** + * @param {string} shareScope share scope + * @param {string} name module name + * @param {string | false} version version + * @param {string} request request + * @param {boolean} eager true, if this is an eager dependency + */ constructor(shareScope, name, version, request, eager) { super(); this.shareScope = shareScope; @@ -151324,6 +158702,9 @@ class ProvideSharedDependency extends Dependency { } @ ${this.version}${this.eager ? " (eager)" : ""}`; } + /** + * @param {ObjectSerializerContext} context context + */ serialize(context) { context.write(this.shareScope); context.write(this.name); @@ -151333,6 +158714,10 @@ class ProvideSharedDependency extends Dependency { super.serialize(context); } + /** + * @param {ObjectDeserializerContext} context context + * @returns {ProvideSharedDependency} deserialize fallback dependency + */ static deserialize(context) { const { read } = context; const obj = new ProvideSharedDependency( @@ -151358,7 +158743,7 @@ module.exports = ProvideSharedDependency; /***/ }), -/***/ 49203: +/***/ 19589: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -151369,11 +158754,12 @@ module.exports = ProvideSharedDependency; -const AsyncDependenciesBlock = __webpack_require__(54823); -const Module = __webpack_require__(96040); -const RuntimeGlobals = __webpack_require__(34623); -const makeSerializable = __webpack_require__(23827); -const ProvideForSharedDependency = __webpack_require__(28276); +const AsyncDependenciesBlock = __webpack_require__(27973); +const Module = __webpack_require__(6309); +const { WEBPACK_MODULE_TYPE_PROVIDE } = __webpack_require__(92891); +const RuntimeGlobals = __webpack_require__(61539); +const makeSerializable = __webpack_require__(83626); +const ProvideForSharedDependency = __webpack_require__(63544); /** @typedef {import("../../declarations/WebpackOptions").WebpackOptionsNormalized} WebpackOptions */ /** @typedef {import("../Chunk")} Chunk */ @@ -151387,6 +158773,8 @@ const ProvideForSharedDependency = __webpack_require__(28276); /** @typedef {import("../RequestShortener")} RequestShortener */ /** @typedef {import("../ResolverFactory").ResolverWithOptions} ResolverWithOptions */ /** @typedef {import("../WebpackError")} WebpackError */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */ /** @typedef {import("../util/Hash")} Hash */ /** @typedef {import("../util/fs").InputFileSystem} InputFileSystem */ @@ -151401,7 +158789,7 @@ class ProvideSharedModule extends Module { * @param {boolean} eager include the module in sync way */ constructor(shareScope, name, version, request, eager) { - super("provide-module"); + super(WEBPACK_MODULE_TYPE_PROVIDE); this._shareScope = shareScope; this._name = name; this._version = version; @@ -151522,6 +158910,9 @@ class ProvideSharedModule extends Module { return { sources, data, runtimeRequirements }; } + /** + * @param {ObjectSerializerContext} context context + */ serialize(context) { const { write } = context; write(this._shareScope); @@ -151532,6 +158923,10 @@ class ProvideSharedModule extends Module { super.serialize(context); } + /** + * @param {ObjectDeserializerContext} context context + * @returns {ProvideSharedModule} deserialize fallback dependency + */ static deserialize(context) { const { read } = context; const obj = new ProvideSharedModule(read(), read(), read(), read(), read()); @@ -151550,7 +158945,7 @@ module.exports = ProvideSharedModule; /***/ }), -/***/ 17093: +/***/ 15978: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -151561,8 +158956,8 @@ module.exports = ProvideSharedModule; -const ModuleFactory = __webpack_require__(10149); -const ProvideSharedModule = __webpack_require__(49203); +const ModuleFactory = __webpack_require__(60667); +const ProvideSharedModule = __webpack_require__(19589); /** @typedef {import("../ModuleFactory").ModuleFactoryCreateData} ModuleFactoryCreateData */ /** @typedef {import("../ModuleFactory").ModuleFactoryResult} ModuleFactoryResult */ @@ -151571,7 +158966,7 @@ const ProvideSharedModule = __webpack_require__(49203); class ProvideSharedModuleFactory extends ModuleFactory { /** * @param {ModuleFactoryCreateData} data data object - * @param {function(Error=, ModuleFactoryResult=): void} callback callback + * @param {function((Error | null)=, ModuleFactoryResult=): void} callback callback * @returns {void} */ create(data, callback) { @@ -151593,7 +158988,7 @@ module.exports = ProvideSharedModuleFactory; /***/ }), -/***/ 71070: +/***/ 76953: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -151604,20 +158999,20 @@ module.exports = ProvideSharedModuleFactory; -const WebpackError = __webpack_require__(10841); -const { parseOptions } = __webpack_require__(14846); -const createSchemaValidation = __webpack_require__(94091); -const ProvideForSharedDependency = __webpack_require__(28276); -const ProvideSharedDependency = __webpack_require__(35088); -const ProvideSharedModuleFactory = __webpack_require__(17093); +const WebpackError = __webpack_require__(49999); +const { parseOptions } = __webpack_require__(4584); +const createSchemaValidation = __webpack_require__(45488); +const ProvideForSharedDependency = __webpack_require__(63544); +const ProvideSharedDependency = __webpack_require__(31843); +const ProvideSharedModuleFactory = __webpack_require__(15978); /** @typedef {import("../../declarations/plugins/sharing/ProvideSharedPlugin").ProvideSharedPluginOptions} ProvideSharedPluginOptions */ /** @typedef {import("../Compilation")} Compilation */ /** @typedef {import("../Compiler")} Compiler */ const validate = createSchemaValidation( - __webpack_require__(30184), - () => __webpack_require__(64939), + __webpack_require__(47943), + () => __webpack_require__(99244), { name: "Provide Shared Plugin", baseDataPath: "options" @@ -151641,27 +159036,28 @@ class ProvideSharedPlugin { constructor(options) { validate(options); - /** @type {[string, ProvideOptions][]} */ - this._provides = parseOptions( - options.provides, - item => { - if (Array.isArray(item)) - throw new Error("Unexpected array of provides"); - /** @type {ProvideOptions} */ - const result = { - shareKey: item, - version: undefined, - shareScope: options.shareScope || "default", - eager: false - }; - return result; - }, - item => ({ - shareKey: item.shareKey, - version: item.version, - shareScope: item.shareScope || options.shareScope || "default", - eager: !!item.eager - }) + this._provides = /** @type {[string, ProvideOptions][]} */ ( + parseOptions( + options.provides, + item => { + if (Array.isArray(item)) + throw new Error("Unexpected array of provides"); + /** @type {ProvideOptions} */ + const result = { + shareKey: item, + version: undefined, + shareScope: options.shareScope || "default", + eager: false + }; + return result; + }, + item => ({ + shareKey: item.shareKey, + version: item.version, + shareScope: item.shareScope || options.shareScope || "default", + eager: !!item.eager + }) + ) ); this._provides.sort(([a], [b]) => { if (a < b) return -1; @@ -151837,7 +159233,7 @@ module.exports = ProvideSharedPlugin; /***/ }), -/***/ 7833: +/***/ 80584: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -151848,10 +159244,10 @@ module.exports = ProvideSharedPlugin; -const { parseOptions } = __webpack_require__(14846); -const ConsumeSharedPlugin = __webpack_require__(81179); -const ProvideSharedPlugin = __webpack_require__(71070); -const { isRequiredVersion } = __webpack_require__(78381); +const { parseOptions } = __webpack_require__(4584); +const ConsumeSharedPlugin = __webpack_require__(50556); +const ProvideSharedPlugin = __webpack_require__(76953); +const { isRequiredVersion } = __webpack_require__(5706); /** @typedef {import("../../declarations/plugins/sharing/ConsumeSharedPlugin").ConsumeSharedPluginOptions} ConsumeSharedPluginOptions */ /** @typedef {import("../../declarations/plugins/sharing/ConsumeSharedPlugin").ConsumesConfig} ConsumesConfig */ @@ -151937,7 +159333,7 @@ module.exports = SharePlugin; /***/ }), -/***/ 90182: +/***/ 71488: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -151948,13 +159344,17 @@ module.exports = SharePlugin; -const RuntimeGlobals = __webpack_require__(34623); -const RuntimeModule = __webpack_require__(81196); -const Template = __webpack_require__(88070); +const RuntimeGlobals = __webpack_require__(61539); +const RuntimeModule = __webpack_require__(21296); +const Template = __webpack_require__(88835); const { compareModulesByIdentifier, compareStrings -} = __webpack_require__(29355); +} = __webpack_require__(95978); + +/** @typedef {import("../Chunk")} Chunk */ +/** @typedef {import("../ChunkGraph")} ChunkGraph */ +/** @typedef {import("../Compilation")} Compilation */ class ShareRuntimeModule extends RuntimeModule { constructor() { @@ -151962,18 +159362,21 @@ class ShareRuntimeModule extends RuntimeModule { } /** - * @returns {string} runtime code + * @returns {string | null} runtime code */ generate() { - const { compilation, chunkGraph } = this; + const compilation = /** @type {Compilation} */ (this.compilation); const { runtimeTemplate, codeGenerationResults, - outputOptions: { uniqueName } + outputOptions: { uniqueName, ignoreBrowserWarnings } } = compilation; + const chunkGraph = /** @type {ChunkGraph} */ (this.chunkGraph); /** @type {Map>>} */ const initCodePerScope = new Map(); - for (const chunk of this.chunk.getAllReferencedChunks()) { + for (const chunk of /** @type {Chunk} */ ( + this.chunk + ).getAllReferencedChunks()) { const modules = chunkGraph.getOrderedChunkModulesIterableBySourceType( chunk, "share-init", @@ -152020,10 +159423,13 @@ class ShareRuntimeModule extends RuntimeModule { `if(!${RuntimeGlobals.hasOwnProperty}(${RuntimeGlobals.shareScopeMap}, name)) ${RuntimeGlobals.shareScopeMap}[name] = {};`, "// runs all init snippets from all modules reachable", `var scope = ${RuntimeGlobals.shareScopeMap}[name];`, - `var warn = ${runtimeTemplate.returningFunction( - 'typeof console !== "undefined" && console.warn && console.warn(msg)', - "msg" - )};`, + `var warn = ${ + ignoreBrowserWarnings + ? runtimeTemplate.basicFunction("", "") + : runtimeTemplate.basicFunction("msg", [ + 'if (typeof console !== "undefined" && console.warn) console.warn(msg);' + ]) + };`, `var uniqueName = ${JSON.stringify(uniqueName || undefined)};`, `var register = ${runtimeTemplate.basicFunction( "name, version, factory, eager", @@ -152040,7 +159446,7 @@ class ShareRuntimeModule extends RuntimeModule { )};`, "try {", Template.indent([ - "var module = __webpack_require__(id);", + `var module = ${RuntimeGlobals.require}(id);`, "if(!module) return;", `var initFn = ${runtimeTemplate.returningFunction( `module && module.init && module.init(${RuntimeGlobals.shareScopeMap}[name], initScope)`, @@ -152086,7 +159492,7 @@ module.exports = ShareRuntimeModule; /***/ }), -/***/ 91466: +/***/ 96023: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; @@ -152097,8 +159503,8 @@ module.exports = ShareRuntimeModule; -const ModuleNotFoundError = __webpack_require__(79150); -const LazySet = __webpack_require__(66205); +const ModuleNotFoundError = __webpack_require__(32569); +const LazySet = __webpack_require__(57876); /** @typedef {import("../Compilation")} Compilation */ /** @typedef {import("../ResolverFactory").ResolveOptionsWithDependencyType} ResolveOptionsWithDependencyType */ @@ -152158,7 +159564,7 @@ exports.resolveMatchedConfigs = (compilation, configs) => { ); return resolve(); } - resolved.set(result, config); + resolved.set(/** @type {string} */ (result), config); resolve(); } ); @@ -152185,7 +159591,7 @@ exports.resolveMatchedConfigs = (compilation, configs) => { /***/ }), -/***/ 78381: +/***/ 5706: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; @@ -152196,17 +159602,330 @@ exports.resolveMatchedConfigs = (compilation, configs) => { -const { join, dirname, readJson } = __webpack_require__(33139); +const { join, dirname, readJson } = __webpack_require__(96220); /** @typedef {import("../util/fs").InputFileSystem} InputFileSystem */ +// Extreme shorthand only for github. eg: foo/bar +const RE_URL_GITHUB_EXTREME_SHORT = /^[^/@:.\s][^/@:\s]*\/[^@:\s]*[^/@:\s]#\S+/; + +// Short url with specific protocol. eg: github:foo/bar +const RE_GIT_URL_SHORT = /^(github|gitlab|bitbucket|gist):\/?[^/.]+\/?/i; + +// Currently supported protocols +const RE_PROTOCOL = + /^((git\+)?(ssh|https?|file)|git|github|gitlab|bitbucket|gist):$/i; + +// Has custom protocol +const RE_CUSTOM_PROTOCOL = /^((git\+)?(ssh|https?|file)|git):\/\//i; + +// Valid hash format for npm / yarn ... +const RE_URL_HASH_VERSION = /#(?:semver:)?(.+)/; + +// Simple hostname validate +const RE_HOSTNAME = /^(?:[^/.]+(\.[^/]+)+|localhost)$/; + +// For hostname with colon. eg: ssh://user@github.com:foo/bar +const RE_HOSTNAME_WITH_COLON = + /([^/@#:.]+(?:\.[^/@#:.]+)+|localhost):([^#/0-9]+)/; + +// Reg for url without protocol +const RE_NO_PROTOCOL = /^([^/@#:.]+(?:\.[^/@#:.]+)+)/; + +// RegExp for version string +const VERSION_PATTERN_REGEXP = /^([\d^=v<>~]|[*xX]$)/; + +// Specific protocol for short url without normal hostname +const PROTOCOLS_FOR_SHORT = [ + "github:", + "gitlab:", + "bitbucket:", + "gist:", + "file:" +]; + +// Default protocol for git url +const DEF_GIT_PROTOCOL = "git+ssh://"; + +// thanks to https://github.com/npm/hosted-git-info/blob/latest/git-host-info.js +const extractCommithashByDomain = { + /** + * @param {string} pathname pathname + * @param {string} hash hash + * @returns {string | undefined} hash + */ + "github.com": (pathname, hash) => { + let [, user, project, type, commithash] = pathname.split("/", 5); + if (type && type !== "tree") { + return; + } + + if (!type) { + commithash = hash; + } else { + commithash = "#" + commithash; + } + + if (project && project.endsWith(".git")) { + project = project.slice(0, -4); + } + + if (!user || !project) { + return; + } + + return commithash; + }, + /** + * @param {string} pathname pathname + * @param {string} hash hash + * @returns {string | undefined} hash + */ + "gitlab.com": (pathname, hash) => { + const path = pathname.slice(1); + if (path.includes("/-/") || path.includes("/archive.tar.gz")) { + return; + } + + const segments = path.split("/"); + let project = /** @type {string} */ (segments.pop()); + if (project.endsWith(".git")) { + project = project.slice(0, -4); + } + + const user = segments.join("/"); + if (!user || !project) { + return; + } + + return hash; + }, + /** + * @param {string} pathname pathname + * @param {string} hash hash + * @returns {string | undefined} hash + */ + "bitbucket.org": (pathname, hash) => { + let [, user, project, aux] = pathname.split("/", 4); + if (["get"].includes(aux)) { + return; + } + + if (project && project.endsWith(".git")) { + project = project.slice(0, -4); + } + + if (!user || !project) { + return; + } + + return hash; + }, + /** + * @param {string} pathname pathname + * @param {string} hash hash + * @returns {string | undefined} hash + */ + "gist.github.com": (pathname, hash) => { + let [, user, project, aux] = pathname.split("/", 4); + if (aux === "raw") { + return; + } + + if (!project) { + if (!user) { + return; + } + + project = user; + } + + if (project.endsWith(".git")) { + project = project.slice(0, -4); + } + + return hash; + } +}; + +/** + * extract commit hash from parsed url + * + * @inner + * @param {URL} urlParsed parsed url + * @returns {string} commithash + */ +function getCommithash(urlParsed) { + let { hostname, pathname, hash } = urlParsed; + hostname = hostname.replace(/^www\./, ""); + + try { + hash = decodeURIComponent(hash); + // eslint-disable-next-line no-empty + } catch (e) {} + + if ( + extractCommithashByDomain[ + /** @type {keyof extractCommithashByDomain} */ (hostname) + ] + ) { + return ( + extractCommithashByDomain[ + /** @type {keyof extractCommithashByDomain} */ (hostname) + ](pathname, hash) || "" + ); + } + + return hash; +} + +/** + * make url right for URL parse + * + * @inner + * @param {string} gitUrl git url + * @returns {string} fixed url + */ +function correctUrl(gitUrl) { + // like: + // proto://hostname.com:user/repo -> proto://hostname.com/user/repo + return gitUrl.replace(RE_HOSTNAME_WITH_COLON, "$1/$2"); +} + +/** + * make url protocol right for URL parse + * + * @inner + * @param {string} gitUrl git url + * @returns {string} fixed url + */ +function correctProtocol(gitUrl) { + // eg: github:foo/bar#v1.0. Should not add double slash, in case of error parsed `pathname` + if (RE_GIT_URL_SHORT.test(gitUrl)) { + return gitUrl; + } + + // eg: user@github.com:foo/bar + if (!RE_CUSTOM_PROTOCOL.test(gitUrl)) { + return `${DEF_GIT_PROTOCOL}${gitUrl}`; + } + + return gitUrl; +} + +/** + * extract git dep version from hash + * + * @inner + * @param {string} hash hash + * @returns {string} git dep version + */ +function getVersionFromHash(hash) { + const matched = hash.match(RE_URL_HASH_VERSION); + + return (matched && matched[1]) || ""; +} + +/** + * if string can be decoded + * + * @inner + * @param {string} str str to be checked + * @returns {boolean} if can be decoded + */ +function canBeDecoded(str) { + try { + decodeURIComponent(str); + } catch (e) { + return false; + } + + return true; +} + +/** + * get right dep version from git url + * + * @inner + * @param {string} gitUrl git url + * @returns {string} dep version + */ +function getGitUrlVersion(gitUrl) { + let oriGitUrl = gitUrl; + // github extreme shorthand + if (RE_URL_GITHUB_EXTREME_SHORT.test(gitUrl)) { + gitUrl = "github:" + gitUrl; + } else { + gitUrl = correctProtocol(gitUrl); + } + + gitUrl = correctUrl(gitUrl); + + let parsed; + try { + parsed = new URL(gitUrl); + // eslint-disable-next-line no-empty + } catch (e) {} + + if (!parsed) { + return ""; + } + + const { protocol, hostname, pathname, username, password } = parsed; + if (!RE_PROTOCOL.test(protocol)) { + return ""; + } + + // pathname shouldn't be empty or URL malformed + if (!pathname || !canBeDecoded(pathname)) { + return ""; + } + + // without protocol, there should have auth info + if (RE_NO_PROTOCOL.test(oriGitUrl) && !username && !password) { + return ""; + } + + if (!PROTOCOLS_FOR_SHORT.includes(protocol.toLowerCase())) { + if (!RE_HOSTNAME.test(hostname)) { + return ""; + } + + const commithash = getCommithash(parsed); + return getVersionFromHash(commithash) || commithash; + } + + // for protocol short + return getVersionFromHash(gitUrl); +} + /** * @param {string} str maybe required version * @returns {boolean} true, if it looks like a version */ -exports.isRequiredVersion = str => { - return /^([\d^=v<>~]|[*xX]$)/.test(str); -}; +function isRequiredVersion(str) { + return VERSION_PATTERN_REGEXP.test(str); +} + +exports.isRequiredVersion = isRequiredVersion; + +/** + * @see https://docs.npmjs.com/cli/v7/configuring-npm/package-json#urls-as-dependencies + * @param {string} versionDesc version to be normalized + * @returns {string} normalized version + */ +function normalizeVersion(versionDesc) { + versionDesc = (versionDesc && versionDesc.trim()) || ""; + + if (isRequiredVersion(versionDesc)) { + return versionDesc; + } + + // add handle for URL Dependencies + return getGitUrlVersion(versionDesc.toLowerCase()); +} + +exports.normalizeVersion = normalizeVersion; /** * @@ -152255,35 +159974,35 @@ exports.getRequiredVersionFromDescriptionFile = (data, packageName) => { typeof data.optionalDependencies === "object" && packageName in data.optionalDependencies ) { - return data.optionalDependencies[packageName]; + return normalizeVersion(data.optionalDependencies[packageName]); } if ( data.dependencies && typeof data.dependencies === "object" && packageName in data.dependencies ) { - return data.dependencies[packageName]; + return normalizeVersion(data.dependencies[packageName]); } if ( data.peerDependencies && typeof data.peerDependencies === "object" && packageName in data.peerDependencies ) { - return data.peerDependencies[packageName]; + return normalizeVersion(data.peerDependencies[packageName]); } if ( data.devDependencies && typeof data.devDependencies === "object" && packageName in data.devDependencies ) { - return data.devDependencies[packageName]; + return normalizeVersion(data.devDependencies[packageName]); } }; /***/ }), -/***/ 90010: +/***/ 80355: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -152295,12 +160014,13 @@ exports.getRequiredVersionFromDescriptionFile = (data, packageName) => { const util = __webpack_require__(73837); -const ModuleDependency = __webpack_require__(22994); -const formatLocation = __webpack_require__(49064); -const { LogType } = __webpack_require__(10689); -const AggressiveSplittingPlugin = __webpack_require__(51361); -const SizeLimitsPlugin = __webpack_require__(256); -const { countIterable } = __webpack_require__(99958); +const { WEBPACK_MODULE_TYPE_RUNTIME } = __webpack_require__(92891); +const ModuleDependency = __webpack_require__(10931); +const formatLocation = __webpack_require__(60246); +const { LogType } = __webpack_require__(52249); +const AggressiveSplittingPlugin = __webpack_require__(58561); +const SizeLimitsPlugin = __webpack_require__(80028); +const { countIterable } = __webpack_require__(12281); const { compareLocations, compareChunksById, @@ -152309,8 +160029,8 @@ const { concatComparators, compareSelect, compareModulesByIdentifier -} = __webpack_require__(29355); -const { makePathsRelative, parseResource } = __webpack_require__(63146); +} = __webpack_require__(95978); +const { makePathsRelative, parseResource } = __webpack_require__(97451); /** @typedef {import("webpack-sources").Source} Source */ /** @typedef {import("../Chunk")} Chunk */ @@ -152927,7 +160647,7 @@ const SIMPLE_EXTRACTORS = { object.hash = compilation.hash; }, version: object => { - object.version = (__webpack_require__(3104)/* .version */ .i8); + object.version = (__webpack_require__(73284)/* .version */ .i8); }, env: (object, compilation, context, { _env }) => { object.env = _env; @@ -153100,11 +160820,32 @@ const SIMPLE_EXTRACTORS = { }, errors: (object, compilation, context, options, factory) => { const { type, cachedGetErrors } = context; - object.errors = factory.create( + const rawErrors = cachedGetErrors(compilation); + const factorizedErrors = factory.create( `${type}.errors`, cachedGetErrors(compilation), context ); + let filtered = 0; + if (options.errorDetails === "auto" && rawErrors.length >= 3) { + filtered = rawErrors + .map(e => typeof e !== "string" && e.details) + .filter(Boolean).length; + } + if ( + options.errorDetails === true || + !Number.isFinite(options.errorsSpace) + ) { + object.errors = factorizedErrors; + if (filtered) object.filteredErrorDetailsCount = filtered; + return; + } + const [errors, filteredBySpace] = errorsSpaceLimit( + factorizedErrors, + options.errorsSpace + ); + object.filteredErrorDetailsCount = filtered + filteredBySpace; + object.errors = errors; }, errorsCount: (object, compilation, { cachedGetErrors }) => { object.errorsCount = countWithChildren(compilation, c => @@ -153113,11 +160854,31 @@ const SIMPLE_EXTRACTORS = { }, warnings: (object, compilation, context, options, factory) => { const { type, cachedGetWarnings } = context; - object.warnings = factory.create( + const rawWarnings = factory.create( `${type}.warnings`, cachedGetWarnings(compilation), context ); + let filtered = 0; + if (options.errorDetails === "auto") { + filtered = cachedGetWarnings(compilation) + .map(e => typeof e !== "string" && e.details) + .filter(Boolean).length; + } + if ( + options.errorDetails === true || + !Number.isFinite(options.warningsSpace) + ) { + object.warnings = rawWarnings; + if (filtered) object.filteredWarningDetailsCount = filtered; + return; + } + const [warnings, filteredBySpace] = errorsSpaceLimit( + rawWarnings, + options.warningsSpace + ); + object.filteredWarningDetailsCount = filtered + filteredBySpace; + object.warnings = warnings; }, warningsCount: ( object, @@ -153142,29 +160903,6 @@ const SIMPLE_EXTRACTORS = { }); }); }, - errorDetails: ( - object, - compilation, - { cachedGetErrors, cachedGetWarnings }, - { errorDetails, errors, warnings } - ) => { - if (errorDetails === "auto") { - if (warnings) { - const warnings = cachedGetWarnings(compilation); - object.filteredWarningDetailsCount = warnings - .map(e => typeof e !== "string" && e.details) - .filter(Boolean).length; - } - if (errors) { - const errors = cachedGetErrors(compilation); - if (errors.length >= 3) { - object.filteredErrorDetailsCount = errors - .map(e => typeof e !== "string" && e.details) - .filter(Boolean).length; - } - } - } - }, children: (object, compilation, context, options, factory) => { const { type } = context; object.children = factory.create( @@ -154068,6 +161806,61 @@ const spaceLimited = ( }; }; +const errorsSpaceLimit = (errors, max) => { + let filtered = 0; + // Can not fit into limit + // print only messages + if (errors.length + 1 >= max) + return [ + errors.map(error => { + if (typeof error === "string" || !error.details) return error; + filtered++; + return { ...error, details: "" }; + }), + filtered + ]; + let fullLength = errors.length; + let result = errors; + + let i = 0; + for (; i < errors.length; i++) { + const error = errors[i]; + if (typeof error !== "string" && error.details) { + const splitted = error.details.split("\n"); + const len = splitted.length; + fullLength += len; + if (fullLength > max) { + result = i > 0 ? errors.slice(0, i) : []; + const overLimit = fullLength - max + 1; + const error = errors[i++]; + result.push({ + ...error, + details: error.details.split("\n").slice(0, -overLimit).join("\n"), + filteredDetails: overLimit + }); + filtered = errors.length - i; + for (; i < errors.length; i++) { + const error = errors[i]; + if (typeof error === "string" || !error.details) result.push(error); + result.push({ ...error, details: "" }); + } + break; + } else if (fullLength === max) { + result = errors.slice(0, ++i); + filtered = errors.length - i; + for (; i < errors.length; i++) { + const error = errors[i]; + if (typeof error === "string" || !error.details) result.push(error); + result.push({ ...error, details: "" }); + } + break; + } + } + } + + return [result, filtered]; +}; + const assetGroup = (children, assets) => { let size = 0; for (const asset of children) { @@ -154309,19 +162102,21 @@ const MODULES_GROUPERS = type => ({ if (!module.moduleType) return; if (groupModulesByType) { return [module.moduleType.split("/", 1)[0]]; - } else if (module.moduleType === "runtime") { - return ["runtime"]; + } else if (module.moduleType === WEBPACK_MODULE_TYPE_RUNTIME) { + return [WEBPACK_MODULE_TYPE_RUNTIME]; } }, getOptions: key => { - const exclude = key === "runtime" && !options.runtimeModules; + const exclude = + key === WEBPACK_MODULE_TYPE_RUNTIME && !options.runtimeModules; return { groupChildren: !exclude, force: exclude }; }, createGroup: (key, children, modules) => { - const exclude = key === "runtime" && !options.runtimeModules; + const exclude = + key === WEBPACK_MODULE_TYPE_RUNTIME && !options.runtimeModules; return { type: `${key} modules`, moduleType: key, @@ -154689,7 +162484,7 @@ module.exports = DefaultStatsFactoryPlugin; /***/ }), -/***/ 89279: +/***/ 76453: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -154700,7 +162495,7 @@ module.exports = DefaultStatsFactoryPlugin; -const RequestShortener = __webpack_require__(89692); +const RequestShortener = __webpack_require__(25931); /** @typedef {import("../../declarations/WebpackOptions").StatsOptions} StatsOptions */ /** @typedef {import("../Compilation")} Compilation */ @@ -154742,6 +162537,8 @@ const NAMED_PRESETS = { orphanModules: true, runtimeModules: true, exclude: false, + errorsSpace: Infinity, + warningsSpace: Infinity, modulesSpace: Infinity, chunkModulesSpace: Infinity, assetsSpace: Infinity, @@ -154768,6 +162565,8 @@ const NAMED_PRESETS = { logging: true, runtimeModules: true, exclude: false, + errorsSpace: 1000, + warningsSpace: 1000, modulesSpace: 1000, assetsSpace: 1000, reasonsSpace: 1000 @@ -154777,6 +162576,8 @@ const NAMED_PRESETS = { version: true, timings: true, modules: true, + errorsSpace: 0, + warningsSpace: 0, modulesSpace: 0, assets: true, assetsSpace: 0, @@ -154790,6 +162591,7 @@ const NAMED_PRESETS = { all: false, errors: true, errorsCount: true, + errorsSpace: Infinity, moduleTrace: true, logging: "error" }, @@ -154797,8 +162599,10 @@ const NAMED_PRESETS = { all: false, errors: true, errorsCount: true, + errorsSpace: Infinity, warnings: true, warningsCount: true, + warningsSpace: Infinity, logging: "warn" }, summary: { @@ -155023,7 +162827,7 @@ module.exports = DefaultStatsPresetPlugin; /***/ }), -/***/ 84840: +/***/ 13770: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -155039,7 +162843,14 @@ module.exports = DefaultStatsPresetPlugin; /** @typedef {import("./StatsPrinter").StatsPrinterContext} StatsPrinterContext */ const DATA_URI_CONTENT_LENGTH = 16; +const MAX_MODULE_IDENTIFIER_LENGTH = 80; +/** + * @param {number} n a number + * @param {string} singular singular + * @param {string} plural plural + * @returns {string} if n is 1, singular, else plural + */ const plural = (n, singular, plural) => (n === 1 ? singular : plural); /** @@ -155057,6 +162868,10 @@ const printSizes = (sizes, { formatSize = n => `${n}` }) => { } }; +/** + * @param {string} resource resource + * @returns {string} resource name for display + */ const getResourceName = resource => { const dataUrl = /^data:[^,]+,/.exec(resource); if (!dataUrl) return resource; @@ -155069,11 +162884,33 @@ const getResourceName = resource => { )}..`; }; +/** + * @param {string} name module name + * @returns {[string,string]} prefix and module name + */ const getModuleName = name => { const [, prefix, resource] = /^(.*!)?([^!]*)$/.exec(name); + + if (resource.length > MAX_MODULE_IDENTIFIER_LENGTH) { + const truncatedResource = `${resource.slice( + 0, + Math.min( + resource.length - /* '...(truncated)'.length */ 14, + MAX_MODULE_IDENTIFIER_LENGTH + ) + )}...(truncated)`; + + return [prefix, getResourceName(truncatedResource)]; + } + return [prefix, getResourceName(resource)]; }; +/** + * @param {string} str string + * @param {function(string): string} fn function to apply to each line + * @returns {string} joined string + */ const mapLines = (str, fn) => str.split("\n").map(fn).join("\n"); /** @@ -155086,6 +162923,12 @@ const isValidId = id => { return typeof id === "number" || id; }; +/** + * @template T + * @param {Array} list of items + * @param {number} count number of items to show + * @returns {string} string representation of list + */ const moreCount = (list, count) => { return list && list.length > 0 ? `+ ${count}` : `${count}`; }; @@ -155618,6 +163461,8 @@ const SIMPLE_PRINTERS = { "error.message": (message, { bold, formatError }) => message.includes("\u001b[") ? message : bold(formatError(message)), "error.details": (details, { formatError }) => formatError(details), + "error.filteredDetails": filteredDetails => + filteredDetails ? `+ ${filteredDetails} hidden lines` : undefined, "error.stack": stack => stack, "error.moduleTrace": moduleTrace => undefined, "error.separator!": () => "\n", @@ -155718,6 +163563,8 @@ const ERROR_PREFERRED_ORDER = [ "separator!", "details", "separator!", + "filteredDetails", + "separator!", "stack", "separator!", "missing", @@ -156214,7 +164061,7 @@ const AVAILABLE_FORMATS = { (oversize ? yellow : green)(filename), formatFlag: flag => `[${flag}]`, formatLayer: layer => `(in ${layer})`, - formatSize: (__webpack_require__(53592).formatSize), + formatSize: (__webpack_require__(73273).formatSize), formatDateTime: (dateTime, { bold }) => { const d = new Date(dateTime); const x = twoDigit; @@ -156411,7 +164258,7 @@ module.exports = DefaultStatsPrinterPlugin; /***/ }), -/***/ 24195: +/***/ 9147: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -156423,8 +164270,8 @@ module.exports = DefaultStatsPrinterPlugin; const { HookMap, SyncBailHook, SyncWaterfallHook } = __webpack_require__(70793); -const { concatComparators, keepOriginalOrder } = __webpack_require__(29355); -const smartGrouping = __webpack_require__(35947); +const { concatComparators, keepOriginalOrder } = __webpack_require__(95978); +const smartGrouping = __webpack_require__(54372); /** @typedef {import("../Chunk")} Chunk */ /** @typedef {import("../Compilation")} Compilation */ @@ -156711,7 +164558,7 @@ module.exports = StatsFactory; /***/ }), -/***/ 91180: +/***/ 40979: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -156968,7 +164815,7 @@ module.exports = StatsPrinter; /***/ }), -/***/ 91696: +/***/ 22150: /***/ (function(__unused_webpack_module, exports) { "use strict"; @@ -157020,7 +164867,7 @@ exports.groupBy = (arr = [], fn) => { /***/ }), -/***/ 45596: +/***/ 49425: /***/ (function(module) { "use strict"; @@ -157139,7 +164986,7 @@ module.exports = ArrayQueue; /***/ }), -/***/ 94975: +/***/ 19422: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -157151,9 +164998,9 @@ module.exports = ArrayQueue; const { SyncHook, AsyncSeriesHook } = __webpack_require__(70793); -const { makeWebpackError } = __webpack_require__(88608); -const WebpackError = __webpack_require__(10841); -const ArrayQueue = __webpack_require__(45596); +const { makeWebpackError } = __webpack_require__(39319); +const WebpackError = __webpack_require__(49999); +const ArrayQueue = __webpack_require__(49425); const QUEUED_STATE = 0; const PROCESSING_STATE = 1; @@ -157215,7 +165062,7 @@ class AsyncQueue { this._entries = new Map(); /** @type {ArrayQueue>} */ this._queued = new ArrayQueue(); - /** @type {AsyncQueue[]} */ + /** @type {AsyncQueue[] | undefined} */ this._children = undefined; this._activeTasks = 0; this._willEnsureProcessing = false; @@ -157304,7 +165151,9 @@ class AsyncQueue { */ invalidate(item) { const key = this._getKey(item); - const entry = this._entries.get(key); + const entry = + /** @type {AsyncQueueEntry} */ + (this._entries.get(key)); this._entries.delete(key); if (entry.state === QUEUED_STATE) { this._queued.delete(entry); @@ -157520,7 +165369,7 @@ module.exports = AsyncQueue; /***/ }), -/***/ 30739: +/***/ 51079: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -157541,7 +165390,7 @@ class Hash { * @returns {this} updated hash */ update(data, inputEncoding) { - const AbstractMethodError = __webpack_require__(26907); + const AbstractMethodError = __webpack_require__(9906); throw new AbstractMethodError(); } @@ -157553,7 +165402,7 @@ class Hash { * @returns {string|Buffer} digest */ digest(encoding) { - const AbstractMethodError = __webpack_require__(26907); + const AbstractMethodError = __webpack_require__(9906); throw new AbstractMethodError(); } } @@ -157563,7 +165412,7 @@ module.exports = Hash; /***/ }), -/***/ 99958: +/***/ 12281: /***/ (function(__unused_webpack_module, exports) { "use strict"; @@ -157617,7 +165466,7 @@ exports.countIterable = countIterable; /***/ }), -/***/ 73474: +/***/ 9636: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -157628,8 +165477,8 @@ exports.countIterable = countIterable; -const { first } = __webpack_require__(97045); -const SortableSet = __webpack_require__(98203); +const { first } = __webpack_require__(24352); +const SortableSet = __webpack_require__(94845); /** * Multi layer bucket sorted set: @@ -157861,7 +165710,7 @@ module.exports = LazyBucketSortedSet; /***/ }), -/***/ 66205: +/***/ 57876: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -157872,7 +165721,7 @@ module.exports = LazyBucketSortedSet; -const makeSerializable = __webpack_require__(23827); +const makeSerializable = __webpack_require__(83626); /** * @template T @@ -157954,7 +165803,7 @@ class LazySet { /** * @param {T} item an item - * @returns {this} itself + * @returns {LazySet} itself */ add(item) { this._set.add(item); @@ -157963,7 +165812,7 @@ class LazySet { /** * @param {Iterable | LazySet} iterable a immutable iterable or another immutable LazySet which will eventually be merged into the Set - * @returns {this} itself + * @returns {LazySet} itself */ addAll(iterable) { if (this._deopt) { @@ -158054,12 +165903,20 @@ class LazySet { return "LazySet"; } + /** + * @param {import("../serialization/ObjectMiddleware").ObjectSerializerContext} context context + */ serialize({ write }) { if (this._needMerge) this._merge(); write(this._set.size); for (const item of this._set) write(item); } + /** + * @template T + * @param {import("../serialization/ObjectMiddleware").ObjectDeserializerContext} context context + * @returns {LazySet} lazy set + */ static deserialize({ read }) { const count = read(); const items = []; @@ -158077,7 +165934,7 @@ module.exports = LazySet; /***/ }), -/***/ 79262: +/***/ 76790: /***/ (function(__unused_webpack_module, exports) { "use strict"; @@ -158089,16 +165946,30 @@ module.exports = LazySet; /** + * getOrInsert is a helper function for maps that allows you to get a value + * from a map if it exists, or insert a new value if it doesn't. If it value doesn't + * exist, it will be computed by the provided function. + * * @template K * @template V - * @param {Map} map a map - * @param {K} key the key - * @param {function(): V} computer compute value - * @returns {V} value - */ -exports.provide = (map, key, computer) => { + * @param {Map} map The map object to check + * @param {K} key The key to check + * @param {function(): V} computer function which will compute the value if it doesn't exist + * @returns {V} The value from the map, or the computed value + * + * @example + * ```js + * const map = new Map(); + * const value = getOrInsert(map, "key", () => "value"); + * console.log(value); // "value" + * ``` + */ +exports.getOrInsert = (map, key, computer) => { + // Grab key from map const value = map.get(key); + // If the value already exists, return it if (value !== undefined) return value; + // Otherwise compute the value, set it in the map, and return it const newValue = computer(); map.set(key, newValue); return newValue; @@ -158107,7 +165978,7 @@ exports.provide = (map, key, computer) => { /***/ }), -/***/ 44320: +/***/ 58816: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -158118,14 +165989,24 @@ exports.provide = (map, key, computer) => { -const binarySearchBounds = __webpack_require__(59718); +const binarySearchBounds = __webpack_require__(6871); + +/** @typedef {function(number): void} Callback */ class ParallelismFactorCalculator { constructor() { + /** @type {number[]} */ this._rangePoints = []; + /** @type {Callback[]} */ this._rangeCallbacks = []; } + /** + * @param {number} start range start + * @param {number} end range end + * @param {Callback} callback callback + * @returns {void} + */ range(start, end, callback) { if (start === end) return callback(1); this._rangePoints.push(start); @@ -158174,7 +166055,7 @@ module.exports = ParallelismFactorCalculator; /***/ }), -/***/ 5004: +/***/ 67755: /***/ (function(module) { "use strict"; @@ -158233,7 +166114,7 @@ module.exports = Queue; /***/ }), -/***/ 97045: +/***/ 24352: /***/ (function(__unused_webpack_module, exports) { "use strict"; @@ -158335,7 +166216,7 @@ exports.combine = combine; /***/ }), -/***/ 98203: +/***/ 94845: /***/ (function(module) { "use strict"; @@ -158503,7 +166384,7 @@ module.exports = SortableSet; /***/ }), -/***/ 60142: +/***/ 64490: /***/ (function(module) { "use strict"; @@ -158528,7 +166409,7 @@ class StackedCacheMap { /** * @param {ReadonlyMap} map map to add - * @param {boolean} immutable if 'map' is immutable and StackedCacheMap can keep referencing it + * @param {boolean=} immutable if 'map' is immutable and StackedCacheMap can keep referencing it */ addAll(map, immutable) { if (immutable) { @@ -158592,6 +166473,9 @@ class StackedCacheMap { this.map.clear(); } + /** + * @returns {number} size of the map + */ get size() { let size = this.map.size; for (const map of this.stack) { @@ -158600,6 +166484,9 @@ class StackedCacheMap { return size; } + /** + * @returns {Iterator<[K, V]>} iterator + */ [Symbol.iterator]() { const iterators = this.stack.map(map => map[Symbol.iterator]()); let current = this.map[Symbol.iterator](); @@ -158621,7 +166508,7 @@ module.exports = StackedCacheMap; /***/ }), -/***/ 61463: +/***/ 88781: /***/ (function(module) { "use strict"; @@ -158795,7 +166682,7 @@ module.exports = StackedMap; /***/ }), -/***/ 78565: +/***/ 81650: /***/ (function(module) { "use strict"; @@ -158806,12 +166693,46 @@ module.exports = StackedMap; +/** @typedef {import("../util/Hash")} Hash */ + +/** + * StringXor class provides methods for performing + * [XOR operations](https://en.wikipedia.org/wiki/Exclusive_or) on strings. In this context + * we operating on the character codes of two strings, which are represented as + * [Buffer](https://nodejs.org/api/buffer.html) objects. + * + * We use [StringXor in webpack](https://github.com/webpack/webpack/commit/41a8e2ea483a544c4ccd3e6217bdfb80daffca39) + * to create a hash of the current state of the compilation. By XOR'ing the Module hashes, it + * doesn't matter if the Module hashes are sorted or not. This is useful because it allows us to avoid sorting the + * Module hashes. + * + * @example + * ```js + * const xor = new StringXor(); + * xor.add('hello'); + * xor.add('world'); + * console.log(xor.toString()); + * ``` + * + * @example + * ```js + * const xor = new StringXor(); + * xor.add('foo'); + * xor.add('bar'); + * const hash = createHash('sha256'); + * hash.update(xor.toString()); + * console.log(hash.digest('hex')); + * ``` + */ class StringXor { constructor() { + /** @type {Buffer|undefined} */ this._value = undefined; } /** + * Adds a string to the current StringXor object. + * * @param {string} str string * @returns {void} */ @@ -158819,6 +166740,10 @@ class StringXor { const len = str.length; const value = this._value; if (value === undefined) { + /** + * We are choosing to use Buffer.allocUnsafe() because it is often faster than Buffer.alloc() because + * it allocates a new buffer of the specified size without initializing the memory. + */ const newValue = (this._value = Buffer.allocUnsafe(len)); for (let i = 0; i < len; i++) { newValue[i] = str.charCodeAt(i); @@ -158842,11 +166767,24 @@ class StringXor { } } + /** + * Returns a string that represents the current state of the StringXor object. We chose to use "latin1" encoding + * here because "latin1" encoding is a single-byte encoding that can represent all characters in the + * [ISO-8859-1 character set](https://en.wikipedia.org/wiki/ISO/IEC_8859-1). This is useful when working + * with binary data that needs to be represented as a string. + * + * @returns {string} Returns a string that represents the current state of the StringXor object. + */ toString() { const value = this._value; return value === undefined ? "" : value.toString("latin1"); } + /** + * Updates the hash with the current state of the StringXor object. + * + * @param {Hash} hash Hash instance + */ updateHash(hash) { const value = this._value; if (value !== undefined) hash.update(value); @@ -158858,7 +166796,7 @@ module.exports = StringXor; /***/ }), -/***/ 27134: +/***/ 85379: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -158869,7 +166807,7 @@ module.exports = StringXor; -const TupleSet = __webpack_require__(97638); +const TupleSet = __webpack_require__(14223); /** * @template {any[]} T @@ -158927,7 +166865,7 @@ module.exports = TupleQueue; /***/ }), -/***/ 97638: +/***/ 14223: /***/ (function(module) { "use strict"; @@ -159085,7 +167023,7 @@ module.exports = TupleSet; /***/ }), -/***/ 22169: +/***/ 65598: /***/ (function(__unused_webpack_module, exports) { "use strict"; @@ -159167,7 +167105,7 @@ function getScheme(specifier) { /** * @param {string} specifier specifier - * @returns {string|null} protocol if absolute URL specifier provided + * @returns {string | null | undefined} protocol if absolute URL specifier provided */ function getProtocol(specifier) { const scheme = getScheme(specifier); @@ -159180,7 +167118,7 @@ exports.getProtocol = getProtocol; /***/ }), -/***/ 63887: +/***/ 22435: /***/ (function(module) { "use strict"; @@ -159359,7 +167297,7 @@ module.exports = WeakTupleMap; /***/ }), -/***/ 59718: +/***/ 6871: /***/ (function(module) { "use strict"; @@ -159373,6 +167311,28 @@ module.exports = WeakTupleMap; /* cspell:disable-next-line */ // Refactor: Peter Somogyvari @petermetz +/** @typedef {">=" | "<=" | "<" | ">" | "-" } BinarySearchPredicate */ +/** @typedef {"GE" | "GT" | "LT" | "LE" | "EQ" } SearchPredicateSuffix */ + +/** + * Helper function for compiling binary search functions. + * + * The generated code uses a while loop to repeatedly divide the search interval + * in half until the desired element is found, or the search interval is empty. + * + * The following is an example of a generated function for calling `compileSearch("P", "c(x,y)<=0", true, ["y", "c"], false)`: + * + * ```js + * function P(a,l,h,y,c){var i=l-1;while(l<=h){var m=(l+h)>>>1,x=a[m];if(c(x,y)<=0){i=m;l=m+1}else{h=m-1}}return i}; + * ``` + * + * @param {string} funcName The name of the function to be compiled. + * @param {string} predicate The predicate / comparison operator to be used in the binary search. + * @param {boolean} reversed Whether the search should be reversed. + * @param {string[]} extraArgs Extra arguments to be passed to the function. + * @param {boolean=} earlyOut Whether the search should return as soon as a match is found. + * @returns {string} The compiled binary search function. + */ const compileSearch = (funcName, predicate, reversed, extraArgs, earlyOut) => { const code = [ "function ", @@ -159408,6 +167368,18 @@ const compileSearch = (funcName, predicate, reversed, extraArgs, earlyOut) => { return code.join(""); }; +/** + * This helper functions generate code for two binary search functions: + * A(): Performs a binary search on an array using the comparison operator specified. + * P(): Performs a binary search on an array using a _custom comparison function_ + * `c(x,y)` **and** comparison operator specified by `predicate`. + * + * @param {BinarySearchPredicate} predicate The predicate / comparison operator to be used in the binary search. + * @param {boolean} reversed Whether the search should be reversed. + * @param {SearchPredicateSuffix} suffix The suffix to be used in the function name. + * @param {boolean=} earlyOut Whether the search should return as soon as a match is found. + * @returns {function} The compiled binary search function. + */ const compileBoundsSearch = (predicate, reversed, suffix, earlyOut) => { const arg1 = compileSearch( "A", @@ -159442,6 +167414,21 @@ return dispatchBinarySearch"; return result(); }; +/** + * These functions are used to perform binary searches on arrays. + * + * @example + * ```js + * const { gt, le} = require("./binarySearchBounds"); + * const arr = [1, 2, 3, 4, 5, 6, 7, 8, 9]; + * + * // Find the index of the first element greater than 5 + * const index1 = gt(arr, 5); // index1 === 3 + * + * // Find the index of the first element less than or equal to 5 + * const index2 = le(arr, 5); // index2 === 4 + * ``` + */ module.exports = { ge: compileBoundsSearch(">=", false, "GE"), gt: compileBoundsSearch(">", false, "GT"), @@ -159453,7 +167440,7 @@ module.exports = { /***/ }), -/***/ 31074: +/***/ 44639: /***/ (function(__unused_webpack_module, exports) { "use strict"; @@ -160029,7 +168016,7 @@ exports.DELETE = DELETE; /***/ }), -/***/ 29355: +/***/ 95978: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; @@ -160040,7 +168027,7 @@ exports.DELETE = DELETE; -const { compareRuntime } = __webpack_require__(55693); +const { compareRuntime } = __webpack_require__(69965); /** @typedef {import("../Chunk")} Chunk */ /** @typedef {import("../ChunkGraph")} ChunkGraph */ @@ -160496,7 +168483,7 @@ exports.compareLocations = (a, b) => { /***/ }), -/***/ 25526: +/***/ 1258: /***/ (function(module) { "use strict"; @@ -160507,10 +168494,18 @@ exports.compareLocations = (a, b) => { +/** + * @param {string} str string + * @returns {string} quoted meta + */ const quoteMeta = str => { return str.replace(/[-[\]\\/{}()*+?.^$|]/g, "\\$&"); }; +/** + * @param {string} str string + * @returns {string} string + */ const toSimpleString = str => { if (`${+str}` === str) { return str; @@ -160551,19 +168546,28 @@ const compileBooleanMatcherFromLists = (positiveItems, negativeItems) => { } }; +/** + * @param {Set} itemsSet items set + * @param {(str: string) => string | false} getKey get key function + * @param {(str: Array) => boolean} condition condition + * @returns {Array>} list of common items + */ const popCommonItems = (itemsSet, getKey, condition) => { + /** @type {Map>} */ const map = new Map(); for (const item of itemsSet) { const key = getKey(item); if (key) { let list = map.get(key); if (list === undefined) { + /** @type {Array} */ list = []; map.set(key, list); } list.push(item); } } + /** @type {Array>} */ const result = []; for (const list of map.values()) { if (condition(list)) { @@ -160576,6 +168580,10 @@ const popCommonItems = (itemsSet, getKey, condition) => { return result; }; +/** + * @param {Array} items items + * @returns {string} common prefix + */ const getCommonPrefix = items => { let prefix = items[0]; for (let i = 1; i < items.length; i++) { @@ -160590,6 +168598,10 @@ const getCommonPrefix = items => { return prefix; }; +/** + * @param {Array} items items + * @returns {string} common suffix + */ const getCommonSuffix = items => { let suffix = items[0]; for (let i = 1; i < items.length; i++) { @@ -160604,10 +168616,15 @@ const getCommonSuffix = items => { return suffix; }; +/** + * @param {Array} itemsArr array of items + * @returns {string} regexp + */ const itemsToRegexp = itemsArr => { if (itemsArr.length === 1) { return quoteMeta(itemsArr[0]); } + /** @type {Array} */ const finishedItems = []; // merge single char items: (a|b|c|d|ef) => ([abcd]|ef) @@ -160648,6 +168665,7 @@ const itemsToRegexp = itemsArr => { // special case for 2 items with common suffix if (finishedItems.length === 0 && items.size === 2) { + /** @type {Iterator} */ const it = items[Symbol.iterator](); const a = it.next().value; const b = it.next().value; @@ -160710,7 +168728,7 @@ module.exports = compileBooleanMatcher; /***/ }), -/***/ 94091: +/***/ 45488: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -160721,9 +168739,9 @@ module.exports = compileBooleanMatcher; -const memoize = __webpack_require__(27319); +const memoize = __webpack_require__(62377); -const getValidate = memoize(() => (__webpack_require__(1489).validate)); +const getValidate = memoize(() => (__webpack_require__(16633).validate)); const createSchemaValidation = (check, getSchema, options) => { getSchema = memoize(getSchema); @@ -160746,7 +168764,7 @@ module.exports = createSchemaValidation; /***/ }), -/***/ 94624: +/***/ 31147: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -160757,17 +168775,20 @@ module.exports = createSchemaValidation; -const Hash = __webpack_require__(30739); +const Hash = __webpack_require__(51079); const BULK_SIZE = 2000; // We are using an object instead of a Map as this will stay static during the runtime // so access to it can be optimized by v8 +/** @type {Object>} */ const digestCaches = {}; +/** @typedef {function(): Hash} HashFactory */ + class BulkUpdateDecorator extends Hash { /** - * @param {Hash | function(): Hash} hashOrFactory function to create a hash + * @param {Hash | HashFactory} hashOrFactory function to create a hash * @param {string=} hashKey key for caching */ constructor(hashOrFactory, hashKey) { @@ -160795,7 +168816,8 @@ class BulkUpdateDecorator extends Hash { typeof data !== "string" || data.length > BULK_SIZE ) { - if (this.hash === undefined) this.hash = this.hashFactory(); + if (this.hash === undefined) + this.hash = /** @type {HashFactory} */ (this.hashFactory)(); if (this.buffer.length > 0) { this.hash.update(this.buffer); this.buffer = ""; @@ -160804,7 +168826,8 @@ class BulkUpdateDecorator extends Hash { } else { this.buffer += data; if (this.buffer.length > BULK_SIZE) { - if (this.hash === undefined) this.hash = this.hashFactory(); + if (this.hash === undefined) + this.hash = /** @type {HashFactory} */ (this.hashFactory)(); this.hash.update(this.buffer); this.buffer = ""; } @@ -160829,7 +168852,7 @@ class BulkUpdateDecorator extends Hash { } const cacheEntry = digestCache.get(buffer); if (cacheEntry !== undefined) return cacheEntry; - this.hash = this.hashFactory(); + this.hash = /** @type {HashFactory} */ (this.hashFactory)(); } if (buffer.length > 0) { this.hash.update(buffer); @@ -160859,10 +168882,13 @@ class DebugHash extends Hash { */ update(data, inputEncoding) { if (typeof data !== "string") data = data.toString("utf-8"); - if (data.startsWith("debug-digest-")) { - data = Buffer.from(data.slice("debug-digest-".length), "hex").toString(); + const prefix = Buffer.from("@webpack-debug-digest@").toString("hex"); + if (data.startsWith(prefix)) { + data = Buffer.from(data.slice(prefix.length), "hex").toString(); } - this.string += `[${data}](${new Error().stack.split("\n", 3)[2]})\n`; + this.string += `[${data}](${ + /** @type {string} */ (new Error().stack).split("\n", 3)[2] + })\n`; return this; } @@ -160872,18 +168898,22 @@ class DebugHash extends Hash { * @returns {string|Buffer} digest */ digest(encoding) { - return "debug-digest-" + Buffer.from(this.string).toString("hex"); + return Buffer.from("@webpack-debug-digest@" + this.string).toString("hex"); } } +/** @type {typeof import("crypto") | undefined} */ let crypto = undefined; +/** @type {typeof import("./hash/xxhash64") | undefined} */ let createXXHash64 = undefined; +/** @type {typeof import("./hash/md4") | undefined} */ let createMd4 = undefined; +/** @type {typeof import("./hash/BatchedHash") | undefined} */ let BatchedHash = undefined; /** * Creates a hash by name or function - * @param {string | typeof Hash} algorithm the algorithm name or a constructor creating a hash + * @param {string | typeof Hash | undefined} algorithm the algorithm name or a constructor creating a hash * @returns {Hash} the hash */ module.exports = algorithm => { @@ -160896,27 +168926,37 @@ module.exports = algorithm => { return new DebugHash(); case "xxhash64": if (createXXHash64 === undefined) { - createXXHash64 = __webpack_require__(30665); + createXXHash64 = __webpack_require__(78275); if (BatchedHash === undefined) { - BatchedHash = __webpack_require__(4968); + BatchedHash = __webpack_require__(22199); } } - return new BatchedHash(createXXHash64()); + return new /** @type {typeof import("./hash/BatchedHash")} */ ( + BatchedHash + )(createXXHash64()); case "md4": if (createMd4 === undefined) { - createMd4 = __webpack_require__(52488); + createMd4 = __webpack_require__(58863); if (BatchedHash === undefined) { - BatchedHash = __webpack_require__(4968); + BatchedHash = __webpack_require__(22199); } } - return new BatchedHash(createMd4()); + return new /** @type {typeof import("./hash/BatchedHash")} */ ( + BatchedHash + )(createMd4()); case "native-md4": if (crypto === undefined) crypto = __webpack_require__(6113); - return new BulkUpdateDecorator(() => crypto.createHash("md4"), "md4"); + return new BulkUpdateDecorator( + () => /** @type {typeof import("crypto")} */ (crypto).createHash("md4"), + "md4" + ); default: if (crypto === undefined) crypto = __webpack_require__(6113); return new BulkUpdateDecorator( - () => crypto.createHash(algorithm), + () => + /** @type {typeof import("crypto")} */ (crypto).createHash( + /** @type {string} */ (algorithm) + ), algorithm ); } @@ -160925,7 +168965,7 @@ module.exports = algorithm => { /***/ }), -/***/ 47762: +/***/ 40630: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; @@ -161009,7 +169049,7 @@ exports.arrayToSetDeprecation = (set, name) => { ); /** * @deprecated - * @this {Set} + * @this {Set} * @returns {number} count */ set[method] = function () { @@ -161032,7 +169072,7 @@ exports.arrayToSetDeprecation = (set, name) => { ); /** * @deprecated - * @this {Set} + * @this {Set} * @returns {number} count */ set.push = function () { @@ -161050,9 +169090,13 @@ exports.arrayToSetDeprecation = (set, name) => { ); }; } + /** + * @param {number} index index + * @returns {any} value + */ const createIndexGetter = index => { /** - * @this {Set} a Set + * @this {Set} a Set * @returns {any} the value at this location */ const fn = function () { @@ -161065,6 +169109,9 @@ exports.arrayToSetDeprecation = (set, name) => { }; return fn; }; + /** + * @param {number} index index + */ const defineIndexGetter = index => { Object.defineProperty(set, index, { get: createIndexGetter(index), @@ -161109,6 +169156,14 @@ exports.createArrayToSetDeprecationSet = name => { return SetDeprecatedArray; }; +/** + * @template T + * @param {Object} obj object + * @param {string} name property name + * @param {string} code deprecation code + * @param {string} note additional note + * @returns {Object} frozen object with deprecation when modifying + */ exports.soonFrozenObjectDeprecation = (obj, name, code, note = "") => { const message = `${name} will be frozen in future, all modifications are deprecated.${ note && `\n${note}` @@ -161197,7 +169252,7 @@ exports.createFakeHook = (fakeHook, message, code) => { /***/ }), -/***/ 482: +/***/ 2096: /***/ (function(module) { "use strict"; @@ -161297,7 +169352,8 @@ const subtractSizeFrom = (total, size) => { }; /** - * @param {Iterable} nodes some nodes + * @template T + * @param {Iterable>} nodes some nodes * @returns {Record} total size */ const sumSize = nodes => { @@ -161308,6 +169364,11 @@ const sumSize = nodes => { return sum; }; +/** + * @param {Record} size size + * @param {Record} maxSize minimum size + * @returns {boolean} true, when size is too big + */ const isTooBig = (size, maxSize) => { for (const key of Object.keys(size)) { const s = size[key]; @@ -161320,6 +169381,11 @@ const isTooBig = (size, maxSize) => { return false; }; +/** + * @param {Record} size size + * @param {Record} minSize minimum size + * @returns {boolean} true, when size is too small + */ const isTooSmall = (size, minSize) => { for (const key of Object.keys(size)) { const s = size[key]; @@ -161332,6 +169398,11 @@ const isTooSmall = (size, minSize) => { return false; }; +/** + * @param {Record} size size + * @param {Record} minSize minimum size + * @returns {Set} set of types that are too small + */ const getTooSmallTypes = (size, minSize) => { const types = new Set(); for (const key of Object.keys(size)) { @@ -161345,6 +169416,12 @@ const getTooSmallTypes = (size, minSize) => { return types; }; +/** + * @template T + * @param {TODO} size size + * @param {Set} types types + * @returns {number} number of matching size types + */ const getNumberOfMatchingSizeTypes = (size, types) => { let i = 0; for (const key of Object.keys(size)) { @@ -161353,6 +169430,11 @@ const getNumberOfMatchingSizeTypes = (size, types) => { return i; }; +/** + * @param {Record} size size + * @param {Set} types types + * @returns {number} selective size sum + */ const selectiveSizeSum = (size, types) => { let sum = 0; for (const key of Object.keys(size)) { @@ -161383,20 +169465,20 @@ class Node { class Group { /** * @param {Node[]} nodes nodes - * @param {number[]} similarities similarities between the nodes (length = nodes.length - 1) + * @param {number[] | null} similarities similarities between the nodes (length = nodes.length - 1) * @param {Record=} size size of the group */ constructor(nodes, similarities, size) { this.nodes = nodes; this.similarities = similarities; this.size = size || sumSize(nodes); - /** @type {string} */ + /** @type {string | undefined} */ this.key = undefined; } /** - * @param {function(Node): boolean} filter filter function - * @returns {Node[]} removed nodes + * @param {function(Node): boolean} filter filter function + * @returns {Node[] | undefined} removed nodes */ popNodes(filter) { const newNodes = []; @@ -161411,7 +169493,7 @@ class Group { if (newNodes.length > 0) { newSimilarities.push( lastNode === this.nodes[i - 1] - ? this.similarities[i - 1] + ? /** @type {number[]} */ (this.similarities)[i - 1] : similarity(lastNode.key, node.key) ); } @@ -161428,7 +169510,8 @@ class Group { } /** - * @param {Iterable} nodes nodes + * @template T + * @param {Iterable>} nodes nodes * @returns {number[]} similarities */ const getSimilarities = nodes => { @@ -161500,6 +169583,11 @@ module.exports = ({ maxSize, minSize, items, getSize, getKey }) => { if (initialNodes.length > 0) { const initialGroup = new Group(initialNodes, getSimilarities(initialNodes)); + /** + * @param {Group} group group + * @param {Record} consideredSize size of the group to consider + * @returns {boolean} true, if the group was modified + */ const removeProblematicNodes = (group, consideredSize = group.size) => { const problemTypes = getTooSmallTypes(consideredSize, minSize); if (problemTypes.size > 0) { @@ -161550,7 +169638,7 @@ module.exports = ({ maxSize, minSize, items, getSize, getKey }) => { const queue = [initialGroup]; while (queue.length) { - const group = queue.pop(); + const group = /** @type {Group} */ (queue.pop()); // only groups bigger than maxSize need to be splitted if (!isTooBig(group.size, maxSize)) { result.push(group); @@ -161631,7 +169719,9 @@ module.exports = ({ maxSize, minSize, items, getSize, getKey }) => { // rightSize ^^^^^^^^^^^^^^^ while (pos <= right + 1) { - const similarity = group.similarities[pos - 1]; + const similarity = /** @type {number[]} */ (group.similarities)[ + pos - 1 + ]; if ( similarity < bestSimilarity && !isTooSmall(leftSize, minSize) && @@ -161661,7 +169751,9 @@ module.exports = ({ maxSize, minSize, items, getSize, getKey }) => { /** @type {number[]} */ const rightSimilarities = []; for (let i = right + 2; i < group.nodes.length; i++) { - rightSimilarities.push(group.similarities[i - 1]); + rightSimilarities.push( + /** @type {number[]} */ (group.similarities)[i - 1] + ); rightNodes.push(group.nodes[i]); } queue.push(new Group(rightNodes, rightSimilarities)); @@ -161670,7 +169762,9 @@ module.exports = ({ maxSize, minSize, items, getSize, getKey }) => { /** @type {number[]} */ const leftSimilarities = []; for (let i = 1; i < left; i++) { - leftSimilarities.push(group.similarities[i - 1]); + leftSimilarities.push( + /** @type {number[]} */ (group.similarities)[i - 1] + ); leftNodes.push(group.nodes[i]); } queue.push(new Group(leftNodes, leftSimilarities)); @@ -161713,7 +169807,7 @@ module.exports = ({ maxSize, minSize, items, getSize, getKey }) => { /***/ }), -/***/ 67627: +/***/ 30147: /***/ (function(module) { "use strict"; @@ -161739,7 +169833,7 @@ module.exports = function extractUrlAndGlobal(urlAndGlobal) { /***/ }), -/***/ 90196: +/***/ 60830: /***/ (function(module) { "use strict"; @@ -161854,7 +169948,9 @@ module.exports = (items, getDependencies) => { // Are there still edges unprocessed in the current node? if (topOfStack.openEdges.length > 0) { // Process one dependency - const dependency = topOfStack.openEdges.pop(); + const dependency = + /** @type {Node} */ + (topOfStack.openEdges.pop()); switch (dependency.marker) { case NO_MARKER: // dependency has not be visited yet @@ -161914,7 +170010,7 @@ module.exports = (items, getDependencies) => { // so it's not really a root cycle // remove the cycle from the root cycles // and convert it to a normal node - rootCycles.delete(dependency.cycle); + rootCycles.delete(/** @type {Cycle} */ (dependency.cycle)); dependency.marker = DONE_MARKER; break; // DONE_MARKER: nothing to do, don't recurse into dependencies @@ -161976,7 +170072,7 @@ module.exports = (items, getDependencies) => { /***/ }), -/***/ 33139: +/***/ 96220: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; @@ -162321,7 +170417,7 @@ exports.lstatReadlinkAbsolute = lstatReadlinkAbsolute; /***/ }), -/***/ 4968: +/***/ 22199: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -162332,8 +170428,8 @@ exports.lstatReadlinkAbsolute = lstatReadlinkAbsolute; -const Hash = __webpack_require__(30739); -const MAX_SHORT_STRING = (__webpack_require__(16964).MAX_SHORT_STRING); +const Hash = __webpack_require__(51079); +const MAX_SHORT_STRING = (__webpack_require__(82879).MAX_SHORT_STRING); class BatchedHash extends Hash { constructor(hash) { @@ -162397,7 +170493,7 @@ module.exports = BatchedHash; /***/ }), -/***/ 52488: +/***/ 58863: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -162408,13 +170504,13 @@ module.exports = BatchedHash; -const create = __webpack_require__(16964); +const create = __webpack_require__(82879); //#region wasm code: md4 (../../../assembly/hash/md4.asm.ts) --initialMemory 1 const md4 = new WebAssembly.Module( Buffer.from( - // 2156 bytes - "AGFzbQEAAAABCAJgAX8AYAAAAwUEAQAAAAUDAQABBhoFfwFBAAt/AUEAC38BQQALfwFBAAt/AUEACwciBARpbml0AAAGdXBkYXRlAAIFZmluYWwAAwZtZW1vcnkCAAqLEAQmAEGBxpS6BiQBQYnXtv5+JAJB/rnrxXkkA0H2qMmBASQEQQAkAAvSCgEZfyMBIQUjAiECIwMhAyMEIQQDQCAAIAFLBEAgASgCJCISIAEoAiAiEyABKAIcIgkgASgCGCIIIAEoAhQiByABKAIQIg4gASgCDCIGIAEoAggiDyABKAIEIhAgASgCACIRIAMgBHMgAnEgBHMgBWpqQQN3IgogAiADc3EgA3MgBGpqQQd3IgsgAiAKc3EgAnMgA2pqQQt3IgwgCiALc3EgCnMgAmpqQRN3Ig0gCyAMc3EgC3MgCmpqQQN3IgogDCANc3EgDHMgC2pqQQd3IgsgCiANc3EgDXMgDGpqQQt3IgwgCiALc3EgCnMgDWpqQRN3Ig0gCyAMc3EgC3MgCmpqQQN3IhQgDCANc3EgDHMgC2pqQQd3IRUgASgCLCILIAEoAigiCiAMIA0gDSAUcyAVcXNqakELdyIWIBQgFXNxIBRzIA1qakETdyEXIAEoAjQiGCABKAIwIhkgFSAWcyAXcSAVcyAUampBA3ciFCAWIBdzcSAWcyAVampBB3chFSABKAI8Ig0gASgCOCIMIBQgF3MgFXEgF3MgFmpqQQt3IhYgFCAVc3EgFHMgF2pqQRN3IRcgEyAOIBEgFCAVIBZyIBdxIBUgFnFyampBmfOJ1AVqQQN3IhQgFiAXcnEgFiAXcXIgFWpqQZnzidQFakEFdyIVIBQgF3JxIBQgF3FyIBZqakGZ84nUBWpBCXchFiAPIBggEiAWIAcgFSAQIBQgGSAUIBVyIBZxIBQgFXFyIBdqakGZ84nUBWpBDXciFCAVIBZycSAVIBZxcmpqQZnzidQFakEDdyIVIBQgFnJxIBQgFnFyampBmfOJ1AVqQQV3IhcgFCAVcnEgFCAVcXJqakGZ84nUBWpBCXciFiAVIBdycSAVIBdxciAUampBmfOJ1AVqQQ13IhQgFiAXcnEgFiAXcXIgFWpqQZnzidQFakEDdyEVIBEgBiAVIAwgFCAKIBYgCCAUIBZyIBVxIBQgFnFyIBdqakGZ84nUBWpBBXciFyAUIBVycSAUIBVxcmpqQZnzidQFakEJdyIWIBUgF3JxIBUgF3FyampBmfOJ1AVqQQ13IhQgFiAXcnEgFiAXcXJqakGZ84nUBWpBA3ciFSALIBYgCSAUIBZyIBVxIBQgFnFyIBdqakGZ84nUBWpBBXciFiAUIBVycSAUIBVxcmpqQZnzidQFakEJdyIXIA0gFSAWciAXcSAVIBZxciAUampBmfOJ1AVqQQ13IhRzIBZzampBodfn9gZqQQN3IREgByAIIA4gFCARIBcgESAUc3MgFmogE2pBodfn9gZqQQl3IhNzcyAXampBodfn9gZqQQt3Ig4gDyARIBMgDiARIA4gE3NzIBRqIBlqQaHX5/YGakEPdyIRc3NqakGh1+f2BmpBA3ciDyAOIA8gEXNzIBNqIApqQaHX5/YGakEJdyIKcyARc2pqQaHX5/YGakELdyIIIBAgDyAKIAggDCAPIAggCnNzIBFqakGh1+f2BmpBD3ciDHNzampBodfn9gZqQQN3Ig4gEiAIIAwgDnNzIApqakGh1+f2BmpBCXciCHMgDHNqakGh1+f2BmpBC3chByAFIAYgCCAHIBggDiAHIAhzcyAMampBodfn9gZqQQ93IgpzcyAOampBodfn9gZqQQN3IgZqIQUgDSAGIAkgByAGIAsgByAGIApzcyAIampBodfn9gZqQQl3IgdzIApzampBodfn9gZqQQt3IgYgB3NzIApqakGh1+f2BmpBD3cgAmohAiADIAZqIQMgBCAHaiEEIAFBQGshAQwBCwsgBSQBIAIkAiADJAMgBCQECw0AIAAQASAAIwBqJAAL/wQCA38BfiAAIwBqrUIDhiEEIABByABqQUBxIgJBCGshAyAAIgFBAWohACABQYABOgAAA0AgACACSUEAIABBB3EbBEAgAEEAOgAAIABBAWohAAwBCwsDQCAAIAJJBEAgAEIANwMAIABBCGohAAwBCwsgAyAENwMAIAIQAUEAIwGtIgRC//8DgyAEQoCA/P8Pg0IQhoQiBEL/gYCA8B+DIARCgP6DgIDgP4NCCIaEIgRCj4C8gPCBwAeDQgiGIARC8IHAh4CegPgAg0IEiIQiBEKGjJiw4MCBgwZ8QgSIQoGChIiQoMCAAYNCJ34gBEKw4MCBg4aMmDCEfDcDAEEIIwKtIgRC//8DgyAEQoCA/P8Pg0IQhoQiBEL/gYCA8B+DIARCgP6DgIDgP4NCCIaEIgRCj4C8gPCBwAeDQgiGIARC8IHAh4CegPgAg0IEiIQiBEKGjJiw4MCBgwZ8QgSIQoGChIiQoMCAAYNCJ34gBEKw4MCBg4aMmDCEfDcDAEEQIwOtIgRC//8DgyAEQoCA/P8Pg0IQhoQiBEL/gYCA8B+DIARCgP6DgIDgP4NCCIaEIgRCj4C8gPCBwAeDQgiGIARC8IHAh4CegPgAg0IEiIQiBEKGjJiw4MCBgwZ8QgSIQoGChIiQoMCAAYNCJ34gBEKw4MCBg4aMmDCEfDcDAEEYIwStIgRC//8DgyAEQoCA/P8Pg0IQhoQiBEL/gYCA8B+DIARCgP6DgIDgP4NCCIaEIgRCj4C8gPCBwAeDQgiGIARC8IHAh4CegPgAg0IEiIQiBEKGjJiw4MCBgwZ8QgSIQoGChIiQoMCAAYNCJ34gBEKw4MCBg4aMmDCEfDcDAAs=", + // 2154 bytes + "AGFzbQEAAAABCAJgAX8AYAAAAwUEAQAAAAUDAQABBhoFfwFBAAt/AUEAC38BQQALfwFBAAt/AUEACwciBARpbml0AAAGdXBkYXRlAAIFZmluYWwAAwZtZW1vcnkCAAqJEAQmAEGBxpS6BiQBQYnXtv5+JAJB/rnrxXkkA0H2qMmBASQEQQAkAAvQCgEZfyMBIQUjAiECIwMhAyMEIQQDQCAAIAFLBEAgASgCBCIOIAQgAyABKAIAIg8gBSAEIAIgAyAEc3FzampBA3ciCCACIANzcXNqakEHdyEJIAEoAgwiBiACIAggASgCCCIQIAMgAiAJIAIgCHNxc2pqQQt3IgogCCAJc3FzampBE3chCyABKAIUIgcgCSAKIAEoAhAiESAIIAkgCyAJIApzcXNqakEDdyIMIAogC3Nxc2pqQQd3IQ0gASgCHCIJIAsgDCABKAIYIgggCiALIA0gCyAMc3FzampBC3ciEiAMIA1zcXNqakETdyETIAEoAiQiFCANIBIgASgCICIVIAwgDSATIA0gEnNxc2pqQQN3IgwgEiATc3FzampBB3chDSABKAIsIgsgEyAMIAEoAigiCiASIBMgDSAMIBNzcXNqakELdyISIAwgDXNxc2pqQRN3IRMgASgCNCIWIA0gEiABKAIwIhcgDCANIBMgDSASc3FzampBA3ciGCASIBNzcXNqakEHdyEZIBggASgCPCINIBMgGCABKAI4IgwgEiATIBkgEyAYc3FzampBC3ciEiAYIBlzcXNqakETdyITIBIgGXJxIBIgGXFyaiAPakGZ84nUBWpBA3ciGCATIBIgGSAYIBIgE3JxIBIgE3FyaiARakGZ84nUBWpBBXciEiATIBhycSATIBhxcmogFWpBmfOJ1AVqQQl3IhMgEiAYcnEgEiAYcXJqIBdqQZnzidQFakENdyIYIBIgE3JxIBIgE3FyaiAOakGZ84nUBWpBA3ciGSAYIBMgEiAZIBMgGHJxIBMgGHFyaiAHakGZ84nUBWpBBXciEiAYIBlycSAYIBlxcmogFGpBmfOJ1AVqQQl3IhMgEiAZcnEgEiAZcXJqIBZqQZnzidQFakENdyIYIBIgE3JxIBIgE3FyaiAQakGZ84nUBWpBA3ciGSAYIBMgEiAZIBMgGHJxIBMgGHFyaiAIakGZ84nUBWpBBXciEiAYIBlycSAYIBlxcmogCmpBmfOJ1AVqQQl3IhMgEiAZcnEgEiAZcXJqIAxqQZnzidQFakENdyIYIBIgE3JxIBIgE3FyaiAGakGZ84nUBWpBA3ciGSAYIBMgEiAZIBMgGHJxIBMgGHFyaiAJakGZ84nUBWpBBXciEiAYIBlycSAYIBlxcmogC2pBmfOJ1AVqQQl3IhMgEiAZcnEgEiAZcXJqIA1qQZnzidQFakENdyIYIBNzIBJzaiAPakGh1+f2BmpBA3ciDyAYIBMgEiAPIBhzIBNzaiAVakGh1+f2BmpBCXciEiAPcyAYc2ogEWpBodfn9gZqQQt3IhEgEnMgD3NqIBdqQaHX5/YGakEPdyIPIBFzIBJzaiAQakGh1+f2BmpBA3ciECAPIBEgEiAPIBBzIBFzaiAKakGh1+f2BmpBCXciCiAQcyAPc2ogCGpBodfn9gZqQQt3IgggCnMgEHNqIAxqQaHX5/YGakEPdyIMIAhzIApzaiAOakGh1+f2BmpBA3ciDiAMIAggCiAMIA5zIAhzaiAUakGh1+f2BmpBCXciCCAOcyAMc2ogB2pBodfn9gZqQQt3IgcgCHMgDnNqIBZqQaHX5/YGakEPdyIKIAdzIAhzaiAGakGh1+f2BmpBA3ciBiAFaiEFIAIgCiAHIAggBiAKcyAHc2ogC2pBodfn9gZqQQl3IgcgBnMgCnNqIAlqQaHX5/YGakELdyIIIAdzIAZzaiANakGh1+f2BmpBD3dqIQIgAyAIaiEDIAQgB2ohBCABQUBrIQEMAQsLIAUkASACJAIgAyQDIAQkBAsNACAAEAEjACAAaiQAC/8EAgN/AX4jACAAaq1CA4YhBCAAQcgAakFAcSICQQhrIQMgACIBQQFqIQAgAUGAAToAAANAIAAgAklBACAAQQdxGwRAIABBADoAACAAQQFqIQAMAQsLA0AgACACSQRAIABCADcDACAAQQhqIQAMAQsLIAMgBDcDACACEAFBACMBrSIEQv//A4MgBEKAgPz/D4NCEIaEIgRC/4GAgPAfgyAEQoD+g4CA4D+DQgiGhCIEQo+AvIDwgcAHg0IIhiAEQvCBwIeAnoD4AINCBIiEIgRChoyYsODAgYMGfEIEiEKBgoSIkKDAgAGDQid+IARCsODAgYOGjJgwhHw3AwBBCCMCrSIEQv//A4MgBEKAgPz/D4NCEIaEIgRC/4GAgPAfgyAEQoD+g4CA4D+DQgiGhCIEQo+AvIDwgcAHg0IIhiAEQvCBwIeAnoD4AINCBIiEIgRChoyYsODAgYMGfEIEiEKBgoSIkKDAgAGDQid+IARCsODAgYOGjJgwhHw3AwBBECMDrSIEQv//A4MgBEKAgPz/D4NCEIaEIgRC/4GAgPAfgyAEQoD+g4CA4D+DQgiGhCIEQo+AvIDwgcAHg0IIhiAEQvCBwIeAnoD4AINCBIiEIgRChoyYsODAgYMGfEIEiEKBgoSIkKDAgAGDQid+IARCsODAgYOGjJgwhHw3AwBBGCMErSIEQv//A4MgBEKAgPz/D4NCEIaEIgRC/4GAgPAfgyAEQoD+g4CA4D+DQgiGhCIEQo+AvIDwgcAHg0IIhiAEQvCBwIeAnoD4AINCBIiEIgRChoyYsODAgYMGfEIEiEKBgoSIkKDAgAGDQid+IARCsODAgYOGjJgwhHw3AwAL", "base64" ) ); @@ -162425,7 +170521,7 @@ module.exports = create.bind(null, md4, [], 64, 32); /***/ }), -/***/ 16964: +/***/ 82879: /***/ (function(module) { "use strict"; @@ -162596,7 +170692,7 @@ module.exports.MAX_SHORT_STRING = MAX_SHORT_STRING; /***/ }), -/***/ 30665: +/***/ 78275: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -162607,13 +170703,13 @@ module.exports.MAX_SHORT_STRING = MAX_SHORT_STRING; -const create = __webpack_require__(16964); +const create = __webpack_require__(82879); //#region wasm code: xxhash64 (../../../assembly/hash/xxhash64.asm.ts) --initialMemory 1 const xxhash64 = new WebAssembly.Module( Buffer.from( // 1170 bytes - "AGFzbQEAAAABCAJgAX8AYAAAAwQDAQAABQMBAAEGGgV+AUIAC34BQgALfgFCAAt+AUIAC34BQgALByIEBGluaXQAAAZ1cGRhdGUAAQVmaW5hbAACBm1lbW9yeQIACrIIAzAAQtbrgu7q/Yn14AAkAELP1tO+0ser2UIkAUIAJAJC+erQ0OfJoeThACQDQgAkBAvUAQIBfwR+IABFBEAPCyMEIACtfCQEIwAhAiMBIQMjAiEEIwMhBQNAIAIgASkDAELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiECIAMgASkDCELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiEDIAQgASkDEELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiEEIAUgASkDGELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiEFIAAgAUEgaiIBSw0ACyACJAAgAyQBIAQkAiAFJAMLqAYCAX8EfiMEQgBSBH4jACICQgGJIwEiA0IHiXwjAiIEQgyJfCMDIgVCEol8IAJCz9bTvtLHq9lCfkIfiUKHla+vmLbem55/foVCh5Wvr5i23puef35CnaO16oOxjYr6AH0gA0LP1tO+0ser2UJ+Qh+JQoeVr6+Ytt6bnn9+hUKHla+vmLbem55/fkKdo7Xqg7GNivoAfSAEQs/W077Sx6vZQn5CH4lCh5Wvr5i23puef36FQoeVr6+Ytt6bnn9+Qp2jteqDsY2K+gB9IAVCz9bTvtLHq9lCfkIfiUKHla+vmLbem55/foVCh5Wvr5i23puef35CnaO16oOxjYr6AH0FQsXP2bLx5brqJwsjBCAArXx8IQIDQCABQQhqIABNBEAgAiABKQMAQs/W077Sx6vZQn5CH4lCh5Wvr5i23puef36FQhuJQoeVr6+Ytt6bnn9+Qp2jteqDsY2K+gB9IQIgAUEIaiEBDAELCyABQQRqIABNBEAgAiABNQIAQoeVr6+Ytt6bnn9+hUIXiULP1tO+0ser2UJ+Qvnz3fGZ9pmrFnwhAiABQQRqIQELA0AgACABRwRAIAIgATEAAELFz9my8eW66id+hUILiUKHla+vmLbem55/fiECIAFBAWohAQwBCwtBACACIAJCIYiFQs/W077Sx6vZQn4iAkIdiCAChUL5893xmfaZqxZ+IgJCIIggAoUiAkIgiCIDQv//A4NCIIYgA0KAgPz/D4NCEIiEIgNC/4GAgPAfg0IQhiADQoD+g4CA4D+DQgiIhCIDQo+AvIDwgcAHg0IIhiADQvCBwIeAnoD4AINCBIiEIgNChoyYsODAgYMGfEIEiEKBgoSIkKDAgAGDQid+IANCsODAgYOGjJgwhHw3AwBBCCACQv////8PgyICQv//A4NCIIYgAkKAgPz/D4NCEIiEIgJC/4GAgPAfg0IQhiACQoD+g4CA4D+DQgiIhCICQo+AvIDwgcAHg0IIhiACQvCBwIeAnoD4AINCBIiEIgJChoyYsODAgYMGfEIEiEKBgoSIkKDAgAGDQid+IAJCsODAgYOGjJgwhHw3AwAL", + "AGFzbQEAAAABCAJgAX8AYAAAAwQDAQAABQMBAAEGGgV+AUIAC34BQgALfgFCAAt+AUIAC34BQgALByIEBGluaXQAAAZ1cGRhdGUAAQVmaW5hbAACBm1lbW9yeQIACrIIAzAAQtbrgu7q/Yn14AAkAELP1tO+0ser2UIkAUIAJAJC+erQ0OfJoeThACQDQgAkBAvUAQIBfwR+IABFBEAPCyMEIACtfCQEIwAhAiMBIQMjAiEEIwMhBQNAIAIgASkDAELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiECIAMgASkDCELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiEDIAQgASkDEELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiEEIAUgASkDGELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiEFIAFBIGoiASAASQ0ACyACJAAgAyQBIAQkAiAFJAMLqAYCAX8EfiMEQgBSBH4jACICQgGJIwEiA0IHiXwjAiIEQgyJfCMDIgVCEol8IAJCz9bTvtLHq9lCfkIfiUKHla+vmLbem55/foVCh5Wvr5i23puef35CnaO16oOxjYr6AH0gA0LP1tO+0ser2UJ+Qh+JQoeVr6+Ytt6bnn9+hUKHla+vmLbem55/fkKdo7Xqg7GNivoAfSAEQs/W077Sx6vZQn5CH4lCh5Wvr5i23puef36FQoeVr6+Ytt6bnn9+Qp2jteqDsY2K+gB9IAVCz9bTvtLHq9lCfkIfiUKHla+vmLbem55/foVCh5Wvr5i23puef35CnaO16oOxjYr6AH0FQsXP2bLx5brqJwsjBCAArXx8IQIDQCABQQhqIABNBEAgAiABKQMAQs/W077Sx6vZQn5CH4lCh5Wvr5i23puef36FQhuJQoeVr6+Ytt6bnn9+Qp2jteqDsY2K+gB9IQIgAUEIaiEBDAELCyABQQRqIABNBEAgAiABNQIAQoeVr6+Ytt6bnn9+hUIXiULP1tO+0ser2UJ+Qvnz3fGZ9pmrFnwhAiABQQRqIQELA0AgACABRwRAIAIgATEAAELFz9my8eW66id+hUILiUKHla+vmLbem55/fiECIAFBAWohAQwBCwtBACACIAJCIYiFQs/W077Sx6vZQn4iAkIdiCAChUL5893xmfaZqxZ+IgJCIIggAoUiAkIgiCIDQv//A4NCIIYgA0KAgPz/D4NCEIiEIgNC/4GAgPAfg0IQhiADQoD+g4CA4D+DQgiIhCIDQo+AvIDwgcAHg0IIhiADQvCBwIeAnoD4AINCBIiEIgNChoyYsODAgYMGfEIEiEKBgoSIkKDAgAGDQid+IANCsODAgYOGjJgwhHw3AwBBCCACQv////8PgyICQv//A4NCIIYgAkKAgPz/D4NCEIiEIgJC/4GAgPAfg0IQhiACQoD+g4CA4D+DQgiIhCICQo+AvIDwgcAHg0IIhiACQvCBwIeAnoD4AINCBIiEIgJChoyYsODAgYMGfEIEiEKBgoSIkKDAgAGDQid+IAJCsODAgYOGjJgwhHw3AwAL", "base64" ) ); @@ -162624,7 +170720,7 @@ module.exports = create.bind(null, xxhash64, [], 32, 16); /***/ }), -/***/ 63146: +/***/ 97451: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; @@ -162645,6 +170741,10 @@ const WINDOWS_PATH_SEPARATOR_REGEXP = /\\/g; * @property {Map>=} relativePaths */ +/** + * @param {string} relativePath relative path + * @returns {string} request + */ const relativePathToRequest = relativePath => { if (relativePath === "") return "./."; if (relativePath === "..") return "../."; @@ -163009,7 +171109,7 @@ exports.getUndoPath = (filename, outputPath, enforceRelative) => { /***/ }), -/***/ 91881: +/***/ 26071: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -163026,201 +171126,202 @@ exports.getUndoPath = (filename, outputPath, enforceRelative) => { // would include too many modules and not every tool is able // to process this module.exports = { - AsyncDependenciesBlock: () => __webpack_require__(54823), - CommentCompilationWarning: () => __webpack_require__(72190), - ContextModule: () => __webpack_require__(40317), + AsyncDependenciesBlock: () => __webpack_require__(27973), + CommentCompilationWarning: () => __webpack_require__(38011), + ContextModule: () => __webpack_require__(18816), "cache/PackFileCacheStrategy": () => - __webpack_require__(27002), - "cache/ResolverCachePlugin": () => __webpack_require__(28563), + __webpack_require__(98743), + "cache/ResolverCachePlugin": () => __webpack_require__(26133), "container/ContainerEntryDependency": () => - __webpack_require__(76909), + __webpack_require__(94774), "container/ContainerEntryModule": () => - __webpack_require__(85755), + __webpack_require__(59162), "container/ContainerExposedDependency": () => - __webpack_require__(92744), + __webpack_require__(47663), "container/FallbackDependency": () => - __webpack_require__(4391), + __webpack_require__(92962), "container/FallbackItemDependency": () => - __webpack_require__(9482), - "container/FallbackModule": () => __webpack_require__(24148), - "container/RemoteModule": () => __webpack_require__(10982), + __webpack_require__(45866), + "container/FallbackModule": () => __webpack_require__(28513), + "container/RemoteModule": () => __webpack_require__(33545), "container/RemoteToExternalDependency": () => - __webpack_require__(44686), + __webpack_require__(70991), "dependencies/AMDDefineDependency": () => - __webpack_require__(12083), + __webpack_require__(43955), "dependencies/AMDRequireArrayDependency": () => - __webpack_require__(56714), + __webpack_require__(61339), "dependencies/AMDRequireContextDependency": () => - __webpack_require__(40198), + __webpack_require__(6199), "dependencies/AMDRequireDependenciesBlock": () => - __webpack_require__(97032), + __webpack_require__(74287), "dependencies/AMDRequireDependency": () => - __webpack_require__(91281), + __webpack_require__(77178), "dependencies/AMDRequireItemDependency": () => - __webpack_require__(35105), + __webpack_require__(99905), "dependencies/CachedConstDependency": () => - __webpack_require__(12389), + __webpack_require__(346), "dependencies/CreateScriptUrlDependency": () => - __webpack_require__(98626), + __webpack_require__(48723), "dependencies/CommonJsRequireContextDependency": () => - __webpack_require__(89449), + __webpack_require__(75074), "dependencies/CommonJsExportRequireDependency": () => - __webpack_require__(53204), + __webpack_require__(65475), "dependencies/CommonJsExportsDependency": () => - __webpack_require__(50380), + __webpack_require__(74544), "dependencies/CommonJsFullRequireDependency": () => - __webpack_require__(7715), + __webpack_require__(55515), "dependencies/CommonJsRequireDependency": () => - __webpack_require__(76237), + __webpack_require__(65050), "dependencies/CommonJsSelfReferenceDependency": () => - __webpack_require__(53853), + __webpack_require__(86797), "dependencies/ConstDependency": () => - __webpack_require__(78284), + __webpack_require__(67538), "dependencies/ContextDependency": () => - __webpack_require__(45899), + __webpack_require__(64946), "dependencies/ContextElementDependency": () => - __webpack_require__(34286), + __webpack_require__(27054), "dependencies/CriticalDependencyWarning": () => - __webpack_require__(90848), + __webpack_require__(7438), "dependencies/CssImportDependency": () => - __webpack_require__(26282), + __webpack_require__(88587), "dependencies/CssLocalIdentifierDependency": () => - __webpack_require__(13230), + __webpack_require__(90055), "dependencies/CssSelfLocalIdentifierDependency": () => - __webpack_require__(11310), + __webpack_require__(15050), "dependencies/CssExportDependency": () => - __webpack_require__(22201), + __webpack_require__(54990), "dependencies/CssUrlDependency": () => - __webpack_require__(78700), + __webpack_require__(93920), "dependencies/DelegatedSourceDependency": () => - __webpack_require__(16582), + __webpack_require__(99416), "dependencies/DllEntryDependency": () => - __webpack_require__(11377), + __webpack_require__(93970), "dependencies/EntryDependency": () => - __webpack_require__(54511), + __webpack_require__(49787), "dependencies/ExportsInfoDependency": () => - __webpack_require__(38914), + __webpack_require__(624), "dependencies/HarmonyAcceptDependency": () => - __webpack_require__(13071), + __webpack_require__(94610), "dependencies/HarmonyAcceptImportDependency": () => - __webpack_require__(75315), + __webpack_require__(75402), "dependencies/HarmonyCompatibilityDependency": () => - __webpack_require__(66565), + __webpack_require__(695), "dependencies/HarmonyExportExpressionDependency": () => - __webpack_require__(16387), + __webpack_require__(93126), "dependencies/HarmonyExportHeaderDependency": () => - __webpack_require__(90756), + __webpack_require__(57220), "dependencies/HarmonyExportImportedSpecifierDependency": () => - __webpack_require__(49933), + __webpack_require__(75624), "dependencies/HarmonyExportSpecifierDependency": () => - __webpack_require__(88613), + __webpack_require__(59542), "dependencies/HarmonyImportSideEffectDependency": () => - __webpack_require__(75307), + __webpack_require__(73187), "dependencies/HarmonyImportSpecifierDependency": () => - __webpack_require__(13474), + __webpack_require__(72952), "dependencies/HarmonyEvaluatedImportSpecifierDependency": () => - __webpack_require__(61911), + __webpack_require__(28962), "dependencies/ImportContextDependency": () => - __webpack_require__(81819), + __webpack_require__(93330), "dependencies/ImportDependency": () => - __webpack_require__(3605), + __webpack_require__(62378), "dependencies/ImportEagerDependency": () => - __webpack_require__(89830), + __webpack_require__(45716), "dependencies/ImportWeakDependency": () => - __webpack_require__(27008), + __webpack_require__(79576), "dependencies/JsonExportsDependency": () => - __webpack_require__(72610), - "dependencies/LocalModule": () => __webpack_require__(12786), + __webpack_require__(71528), + "dependencies/LocalModule": () => __webpack_require__(51571), "dependencies/LocalModuleDependency": () => - __webpack_require__(86333), + __webpack_require__(32637), "dependencies/ModuleDecoratorDependency": () => - __webpack_require__(15086), + __webpack_require__(746), "dependencies/ModuleHotAcceptDependency": () => - __webpack_require__(92807), + __webpack_require__(19647), "dependencies/ModuleHotDeclineDependency": () => - __webpack_require__(74213), + __webpack_require__(5341), "dependencies/ImportMetaHotAcceptDependency": () => - __webpack_require__(46209), + __webpack_require__(95698), "dependencies/ImportMetaHotDeclineDependency": () => - __webpack_require__(47713), + __webpack_require__(99022), "dependencies/ImportMetaContextDependency": () => - __webpack_require__(79945), + __webpack_require__(95760), "dependencies/ProvidedDependency": () => - __webpack_require__(30927), + __webpack_require__(47468), "dependencies/PureExpressionDependency": () => - __webpack_require__(94535), + __webpack_require__(80510), "dependencies/RequireContextDependency": () => - __webpack_require__(54213), + __webpack_require__(70802), "dependencies/RequireEnsureDependenciesBlock": () => - __webpack_require__(21888), + __webpack_require__(69653), "dependencies/RequireEnsureDependency": () => - __webpack_require__(66813), + __webpack_require__(61639), "dependencies/RequireEnsureItemDependency": () => - __webpack_require__(15406), + __webpack_require__(11798), "dependencies/RequireHeaderDependency": () => - __webpack_require__(46658), + __webpack_require__(91172), "dependencies/RequireIncludeDependency": () => - __webpack_require__(94313), + __webpack_require__(27998), "dependencies/RequireIncludeDependencyParserPlugin": () => - __webpack_require__(42589), + __webpack_require__(50181), "dependencies/RequireResolveContextDependency": () => - __webpack_require__(95219), + __webpack_require__(9973), "dependencies/RequireResolveDependency": () => - __webpack_require__(53711), + __webpack_require__(14694), "dependencies/RequireResolveHeaderDependency": () => - __webpack_require__(95635), + __webpack_require__(58164), "dependencies/RuntimeRequirementsDependency": () => - __webpack_require__(72885), + __webpack_require__(26068), "dependencies/StaticExportsDependency": () => - __webpack_require__(64422), - "dependencies/SystemPlugin": () => __webpack_require__(21835), + __webpack_require__(71444), + "dependencies/SystemPlugin": () => __webpack_require__(89277), "dependencies/UnsupportedDependency": () => - __webpack_require__(72557), - "dependencies/URLDependency": () => __webpack_require__(76440), + __webpack_require__(93761), + "dependencies/URLDependency": () => __webpack_require__(24756), "dependencies/WebAssemblyExportImportedDependency": () => - __webpack_require__(29931), + __webpack_require__(79604), "dependencies/WebAssemblyImportDependency": () => - __webpack_require__(55884), + __webpack_require__(50992), "dependencies/WebpackIsIncludedDependency": () => - __webpack_require__(13470), + __webpack_require__(98343), "dependencies/WorkerDependency": () => - __webpack_require__(51899), - "json/JsonData": () => __webpack_require__(51315), + __webpack_require__(18523), + "json/JsonData": () => __webpack_require__(19049), "optimize/ConcatenatedModule": () => - __webpack_require__(10742), - DelegatedModule: () => __webpack_require__(62387), - DependenciesBlock: () => __webpack_require__(67493), - DllModule: () => __webpack_require__(30618), - ExternalModule: () => __webpack_require__(43308), - FileSystemInfo: () => __webpack_require__(1120), - InitFragment: () => __webpack_require__(53658), + __webpack_require__(22590), + DelegatedModule: () => __webpack_require__(21859), + DependenciesBlock: () => __webpack_require__(99939), + DllModule: () => __webpack_require__(84063), + ExternalModule: () => __webpack_require__(90790), + FileSystemInfo: () => __webpack_require__(18509), + InitFragment: () => __webpack_require__(44508), InvalidDependenciesModuleWarning: () => - __webpack_require__(33869), - Module: () => __webpack_require__(96040), - ModuleBuildError: () => __webpack_require__(88916), - ModuleDependencyWarning: () => __webpack_require__(93492), - ModuleError: () => __webpack_require__(18463), - ModuleGraph: () => __webpack_require__(85215), - ModuleParseError: () => __webpack_require__(73770), - ModuleWarning: () => __webpack_require__(30657), - NormalModule: () => __webpack_require__(55443), - RawDataUrlModule: () => __webpack_require__(90144), - RawModule: () => __webpack_require__(11794), + __webpack_require__(14086), + Module: () => __webpack_require__(6309), + ModuleBuildError: () => __webpack_require__(25055), + ModuleDependencyWarning: () => __webpack_require__(99391), + ModuleError: () => __webpack_require__(82923), + ModuleGraph: () => __webpack_require__(43714), + ModuleParseError: () => __webpack_require__(66190), + ModuleWarning: () => __webpack_require__(65395), + NormalModule: () => __webpack_require__(17318), + CssModule: () => __webpack_require__(46555), + RawDataUrlModule: () => __webpack_require__(69762), + RawModule: () => __webpack_require__(74360), "sharing/ConsumeSharedModule": () => - __webpack_require__(92640), + __webpack_require__(3535), "sharing/ConsumeSharedFallbackDependency": () => - __webpack_require__(30046), + __webpack_require__(9294), "sharing/ProvideSharedModule": () => - __webpack_require__(49203), + __webpack_require__(19589), "sharing/ProvideSharedDependency": () => - __webpack_require__(35088), + __webpack_require__(31843), "sharing/ProvideForSharedDependency": () => - __webpack_require__(28276), - UnsupportedFeatureWarning: () => __webpack_require__(19290), - "util/LazySet": () => __webpack_require__(66205), - UnhandledSchemeError: () => __webpack_require__(29428), - NodeStuffInWebError: () => __webpack_require__(29390), - WebpackError: () => __webpack_require__(10841), + __webpack_require__(63544), + UnsupportedFeatureWarning: () => __webpack_require__(84099), + "util/LazySet": () => __webpack_require__(57876), + UnhandledSchemeError: () => __webpack_require__(86943), + NodeStuffInWebError: () => __webpack_require__(17623), + WebpackError: () => __webpack_require__(49999), "util/registerExternalSerializer": () => { // already registered @@ -163230,7 +171331,7 @@ module.exports = { /***/ }), -/***/ 23827: +/***/ 83626: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -163240,7 +171341,9 @@ module.exports = { -const { register } = __webpack_require__(94965); +const { register } = __webpack_require__(93141); + +/** @typedef {import("../serialization/ObjectMiddleware").Constructor} Constructor */ class ClassSerializer { constructor(Constructor) { @@ -163261,6 +171364,11 @@ class ClassSerializer { } } +/** + * @param {Constructor} Constructor the constructor + * @param {string} request the request which will be required when deserializing + * @param {string | null} [name] the name to make multiple serializer unique when sharing a request + */ module.exports = (Constructor, request, name = null) => { register(Constructor, request, name, new ClassSerializer(Constructor)); }; @@ -163268,7 +171376,7 @@ module.exports = (Constructor, request, name = null) => { /***/ }), -/***/ 27319: +/***/ 62377: /***/ (function(module) { "use strict"; @@ -163287,18 +171395,18 @@ module.exports = (Constructor, request, name = null) => { */ const memoize = fn => { let cache = false; - /** @type {T} */ + /** @type {T | undefined} */ let result = undefined; return () => { if (cache) { - return result; + return /** @type {T} */ (result); } else { result = fn(); cache = true; // Allow to clean up memory for fn // and all dependent resources fn = undefined; - return result; + return /** @type {T} */ (result); } }; }; @@ -163308,7 +171416,7 @@ module.exports = memoize; /***/ }), -/***/ 12993: +/***/ 95162: /***/ (function(module) { "use strict"; @@ -163338,7 +171446,7 @@ module.exports = (hash, hashLength) => { /***/ }), -/***/ 6097: +/***/ 74313: /***/ (function(module) { "use strict"; @@ -163349,41 +171457,95 @@ module.exports = (hash, hashLength) => { +/** + * The maximum safe integer value for 32-bit integers. + * @type {number} + */ const SAFE_LIMIT = 0x80000000; + +/** + * The maximum safe integer value for 32-bit integers minus one. This is used + * in the algorithm to ensure that intermediate hash values do not exceed the + * 32-bit integer limit. + * @type {number} + */ const SAFE_PART = SAFE_LIMIT - 1; + +/** + * The number of 32-bit integers used to store intermediate hash values. + * @type {number} + */ const COUNT = 4; + +/** + * An array used to store intermediate hash values during the calculation. + * @type {number[]} + */ const arr = [0, 0, 0, 0, 0]; + +/** + * An array of prime numbers used in the hash calculation. + * @type {number[]} + */ const primes = [3, 7, 17, 19]; +/** + * Computes a hash value for the given string and range. This hashing algorithm is a modified + * version of the [FNV-1a algorithm](https://en.wikipedia.org/wiki/Fowler%E2%80%93Noll%E2%80%93Vo_hash_function). + * It is optimized for speed and does **not** generate a cryptographic hash value. + * + * We use `numberHash` in `lib/ids/IdHelpers.js` to generate hash values for the module identifier. The generated + * hash is used as a prefix for the module id's to avoid collisions with other modules. + * + * @param {string} str The input string to hash. + * @param {number} range The range of the hash value (0 to range-1). + * @returns {number} - The computed hash value. + * + * @example + * + * ```js + * const numberHash = require("webpack/lib/util/numberHash"); + * numberHash("hello", 1000); // 57 + * numberHash("hello world"); // 990 + * ``` + * + */ module.exports = (str, range) => { + /** + * Initialize the array with zeros before it is used + * to store intermediate hash values. + */ arr.fill(0); + // For each character in the string for (let i = 0; i < str.length; i++) { + // Get the character code. const c = str.charCodeAt(i); - for (let j = 0; j < COUNT; j++) { - const p = (j + COUNT - 1) % COUNT; - arr[j] = (arr[j] + c * primes[j] + arr[p]) & SAFE_PART; - } - for (let j = 0; j < COUNT; j++) { - const q = arr[j] % COUNT; - arr[j] = arr[j] ^ (arr[q] >> 1); - } + + // For each 32-bit integer used to store the hash value + // add the character code to the current hash value and multiply by the prime number and + // add the previous 32-bit integer. + arr[0] = (arr[0] + c * primes[0] + arr[3]) & SAFE_PART; + arr[1] = (arr[1] + c * primes[1] + arr[0]) & SAFE_PART; + arr[2] = (arr[2] + c * primes[2] + arr[1]) & SAFE_PART; + arr[3] = (arr[3] + c * primes[3] + arr[2]) & SAFE_PART; + + // For each 32-bit integer used to store the hash value + // XOR the current hash value with the value of the next 32-bit integer. + arr[0] = arr[0] ^ (arr[arr[0] % COUNT] >> 1); + arr[1] = arr[1] ^ (arr[arr[1] % COUNT] >> 1); + arr[2] = arr[2] ^ (arr[arr[2] % COUNT] >> 1); + arr[3] = arr[3] ^ (arr[arr[3] % COUNT] >> 1); } + if (range <= SAFE_PART) { - let sum = 0; - for (let j = 0; j < COUNT; j++) { - sum = (sum + arr[j]) % range; - } - return sum; + return (arr[0] + arr[1] + arr[2] + arr[3]) % range; } else { - let sum1 = 0; - let sum2 = 0; + // Calculate the range extension. const rangeExt = Math.floor(range / SAFE_LIMIT); - for (let j = 0; j < COUNT; j += 2) { - sum1 = (sum1 + arr[j]) & SAFE_PART; - } - for (let j = 1; j < COUNT; j += 2) { - sum2 = (sum2 + arr[j]) % rangeExt; - } + + const sum1 = (arr[0] + arr[2]) & SAFE_PART; + const sum2 = (arr[0] + arr[2]) % rangeExt; + return (sum2 * SAFE_LIMIT + sum1) % range; } }; @@ -163391,7 +171553,7 @@ module.exports = (str, range) => { /***/ }), -/***/ 65754: +/***/ 18119: /***/ (function(module) { "use strict"; @@ -163418,6 +171580,9 @@ const processAsyncTree = (items, concurrency, processor, callback) => { let finished = false; let processScheduled = true; + /** + * @param {T} item item + */ const push = item => { queue.push(item); if (!processScheduled && processing < concurrency) { @@ -163426,6 +171591,9 @@ const processAsyncTree = (items, concurrency, processor, callback) => { } }; + /** + * @param {E | null | undefined} err error + */ const processorCallback = err => { processing--; if (err && !finished) { @@ -163443,7 +171611,7 @@ const processAsyncTree = (items, concurrency, processor, callback) => { if (finished) return; while (processing < concurrency && queue.length > 0) { processing++; - const item = queue.pop(); + const item = /** @type {T} */ (queue.pop()); processor(item, push, processorCallback); } processScheduled = false; @@ -163461,7 +171629,48 @@ module.exports = processAsyncTree; /***/ }), -/***/ 92884: +/***/ 60305: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +"use strict"; +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + + + +const { + SAFE_IDENTIFIER, + RESERVED_IDENTIFIER +} = __webpack_require__(40234); + +/** + * @param {ArrayLike} properties properties + * @param {number} start start index + * @returns {string} chain of property accesses + */ +const propertyAccess = (properties, start = 0) => { + let str = ""; + for (let i = start; i < properties.length; i++) { + const p = properties[i]; + if (`${+p}` === p) { + str += `[${p}]`; + } else if (SAFE_IDENTIFIER.test(p) && !RESERVED_IDENTIFIER.has(p)) { + str += `.${p}`; + } else { + str += `[${JSON.stringify(p)}]`; + } + } + return str; +}; + +module.exports = propertyAccess; + + +/***/ }), + +/***/ 40234: /***/ (function(module) { "use strict"; @@ -163527,27 +171736,28 @@ const RESERVED_IDENTIFIER = new Set([ "false" ]); -const propertyAccess = (properties, start = 0) => { - let str = ""; - for (let i = start; i < properties.length; i++) { - const p = properties[i]; - if (`${+p}` === p) { - str += `[${p}]`; - } else if (SAFE_IDENTIFIER.test(p) && !RESERVED_IDENTIFIER.has(p)) { - str += `.${p}`; - } else { - str += `[${JSON.stringify(p)}]`; - } +/** + * @summary Returns a valid JS property name for the given property. + * Certain strings like "default", "null", and names with whitespace are not + * valid JS property names, so they are returned as strings. + * + * @param {string} prop property name to analyze + * @returns {string} valid JS property name + */ +const propertyName = prop => { + if (SAFE_IDENTIFIER.test(prop) && !RESERVED_IDENTIFIER.has(prop)) { + return prop; + } else { + return JSON.stringify(prop); } - return str; }; -module.exports = propertyAccess; +module.exports = { SAFE_IDENTIFIER, RESERVED_IDENTIFIER, propertyName }; /***/ }), -/***/ 8128: +/***/ 86089: /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -163558,11 +171768,11 @@ module.exports = propertyAccess; -const { register } = __webpack_require__(94965); +const { register } = __webpack_require__(93141); const Position = /** @type {TODO} */ (__webpack_require__(11460).Position); const SourceLocation = (__webpack_require__(11460).SourceLocation); -const ValidationError = (__webpack_require__(25826)["default"]); +const ValidationError = (__webpack_require__(85879)["default"]); const { CachedSource, ConcatSource, @@ -163579,7 +171789,7 @@ const { /** @typedef {import("./serialization").ObjectDeserializerContext} ObjectDeserializerContext */ /** @typedef {import("./serialization").ObjectSerializerContext} ObjectSerializerContext */ -/** @typedef {ObjectSerializerContext & { writeLazy?: (any) => void }} WebpackObjectSerializerContext */ +/** @typedef {ObjectSerializerContext & { writeLazy?: (value: any) => void }} WebpackObjectSerializerContext */ const CURRENT_MODULE = "webpack/lib/util/registerExternalSerializer"; @@ -163892,7 +172102,7 @@ register( /***/ }), -/***/ 55693: +/***/ 69965: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; @@ -163903,7 +172113,7 @@ register( -const SortableSet = __webpack_require__(98203); +const SortableSet = __webpack_require__(94845); /** @typedef {import("../Compilation")} Compilation */ /** @typedef {import("../Entrypoint").EntryOptions} EntryOptions */ @@ -163951,7 +172161,7 @@ exports.getEntryRuntime = (compilation, name, options) => { /** * @param {RuntimeSpec} runtime runtime - * @param {function(string): void} fn functor + * @param {function(string | undefined): void} fn functor * @param {boolean} deterministicOrder enforce a deterministic order * @returns {void} */ @@ -163968,6 +172178,11 @@ exports.forEachRuntime = (runtime, fn, deterministicOrder = false) => { } }; +/** + * @template T + * @param {SortableSet} set set + * @returns {string} runtime key + */ const getRuntimesKey = set => { set.sort(); return Array.from(set).join("\n"); @@ -163996,6 +172211,11 @@ const keyToRuntime = key => { }; exports.keyToRuntime = keyToRuntime; +/** + * @template T + * @param {SortableSet} set set + * @returns {string} runtime string + */ const getRuntimesString = set => { set.sort(); return Array.from(set).join("+"); @@ -164313,6 +172533,11 @@ exports.filterRuntime = (runtime, filter) => { return result; }; +/** + * @template T + * @typedef {Map} RuntimeSpecMapInnerMap + * */ + /** * @template T */ @@ -164324,15 +172549,15 @@ class RuntimeSpecMap { this._mode = clone ? clone._mode : 0; // 0 = empty, 1 = single entry, 2 = map /** @type {RuntimeSpec} */ this._singleRuntime = clone ? clone._singleRuntime : undefined; - /** @type {T} */ + /** @type {T | undefined} */ this._singleValue = clone ? clone._singleValue : undefined; - /** @type {Map | undefined} */ + /** @type {RuntimeSpecMapInnerMap | undefined} */ this._map = clone && clone._map ? new Map(clone._map) : undefined; } /** * @param {RuntimeSpec} runtime the runtimes - * @returns {T} value + * @returns {T | undefined} value */ get(runtime) { switch (this._mode) { @@ -164343,7 +172568,9 @@ class RuntimeSpecMap { ? this._singleValue : undefined; default: - return this._map.get(getRuntimeKey(runtime)); + return /** @type {RuntimeSpecMapInnerMap} */ (this._map).get( + getRuntimeKey(runtime) + ); } } @@ -164358,10 +172585,16 @@ class RuntimeSpecMap { case 1: return runtimeEqual(this._singleRuntime, runtime); default: - return this._map.has(getRuntimeKey(runtime)); + return /** @type {RuntimeSpecMapInnerMap} */ (this._map).has( + getRuntimeKey(runtime) + ); } } + /** + * @param {RuntimeSpec} runtime the runtimes + * @param {T} value the value + */ set(runtime, value) { switch (this._mode) { case 0: @@ -164376,15 +172609,24 @@ class RuntimeSpecMap { } this._mode = 2; this._map = new Map(); - this._map.set(getRuntimeKey(this._singleRuntime), this._singleValue); + this._map.set( + getRuntimeKey(this._singleRuntime), + /** @type {T} */ (this._singleValue) + ); this._singleRuntime = undefined; this._singleValue = undefined; /* falls through */ default: - this._map.set(getRuntimeKey(runtime), value); + /** @type {RuntimeSpecMapInnerMap} */ + (this._map).set(getRuntimeKey(runtime), value); } } + /** + * @param {RuntimeSpec} runtime the runtimes + * @param {() => TODO} computer function to compute the value + * @returns {TODO} true, when the runtime was deleted + */ provide(runtime, computer) { switch (this._mode) { case 0: @@ -164393,11 +172635,14 @@ class RuntimeSpecMap { return (this._singleValue = computer()); case 1: { if (runtimeEqual(this._singleRuntime, runtime)) { - return this._singleValue; + return /** @type {T} */ (this._singleValue); } this._mode = 2; this._map = new Map(); - this._map.set(getRuntimeKey(this._singleRuntime), this._singleValue); + this._map.set( + getRuntimeKey(this._singleRuntime), + /** @type {T} */ (this._singleValue) + ); this._singleRuntime = undefined; this._singleValue = undefined; const newValue = computer(); @@ -164406,15 +172651,19 @@ class RuntimeSpecMap { } default: { const key = getRuntimeKey(runtime); - const value = this._map.get(key); + const value = /** @type {Map} */ (this._map).get(key); if (value !== undefined) return value; const newValue = computer(); - this._map.set(key, newValue); + /** @type {Map} */ + (this._map).set(key, newValue); return newValue; } } } + /** + * @param {RuntimeSpec} runtime the runtimes + */ delete(runtime) { switch (this._mode) { case 0: @@ -164427,10 +172676,15 @@ class RuntimeSpecMap { } return; default: - this._map.delete(getRuntimeKey(runtime)); + /** @type {RuntimeSpecMapInnerMap} */ + (this._map).delete(getRuntimeKey(runtime)); } } + /** + * @param {RuntimeSpec} runtime the runtimes + * @param {function(T | undefined): T} fn function to update the value + */ update(runtime, fn) { switch (this._mode) { case 0: @@ -164444,7 +172698,10 @@ class RuntimeSpecMap { if (newValue !== undefined) { this._mode = 2; this._map = new Map(); - this._map.set(getRuntimeKey(this._singleRuntime), this._singleValue); + this._map.set( + getRuntimeKey(this._singleRuntime), + /** @type {T} */ (this._singleValue) + ); this._singleRuntime = undefined; this._singleValue = undefined; this._map.set(getRuntimeKey(runtime), newValue); @@ -164453,9 +172710,11 @@ class RuntimeSpecMap { } default: { const key = getRuntimeKey(runtime); - const oldValue = this._map.get(key); + const oldValue = /** @type {Map} */ (this._map).get(key); const newValue = fn(oldValue); - if (newValue !== oldValue) this._map.set(key, newValue); + if (newValue !== oldValue) + /** @type {RuntimeSpecMapInnerMap} */ + (this._map).set(key, newValue); } } } @@ -164467,7 +172726,11 @@ class RuntimeSpecMap { case 1: return [this._singleRuntime]; default: - return Array.from(this._map.keys(), keyToRuntime); + return Array.from( + /** @type {RuntimeSpecMapInnerMap} */ + (this._map).keys(), + keyToRuntime + ); } } @@ -164476,21 +172739,24 @@ class RuntimeSpecMap { case 0: return [][Symbol.iterator](); case 1: - return [this._singleValue][Symbol.iterator](); + return [/** @type {T} */ (this._singleValue)][Symbol.iterator](); default: - return this._map.values(); + return /** @type {Map} */ (this._map).values(); } } get size() { - if (this._mode <= 1) return this._mode; - return this._map.size; + if (/** @type {number} */ (this._mode) <= 1) return this._mode; + return /** @type {Map} */ (this._map).size; } } exports.RuntimeSpecMap = RuntimeSpecMap; class RuntimeSpecSet { + /** + * @param {Iterable=} iterable iterable + */ constructor(iterable) { /** @type {Map} */ this._map = new Map(); @@ -164501,10 +172767,17 @@ class RuntimeSpecSet { } } + /** + * @param {RuntimeSpec} runtime runtime + */ add(runtime) { this._map.set(getRuntimeKey(runtime), runtime); } + /** + * @param {RuntimeSpec} runtime runtime + * @returns {boolean} true, when the runtime exists + */ has(runtime) { return this._map.has(getRuntimeKey(runtime)); } @@ -164523,7 +172796,7 @@ exports.RuntimeSpecSet = RuntimeSpecSet; /***/ }), -/***/ 83213: +/***/ 14758: /***/ (function(__unused_webpack_module, exports) { "use strict"; @@ -164534,6 +172807,7 @@ exports.RuntimeSpecSet = RuntimeSpecSet; +/** @typedef {import("../RuntimeTemplate")} RuntimeTemplate */ /** @typedef {(string|number|undefined|[])[]} SemVerRange */ /** @@ -164817,7 +173091,7 @@ const satisfy = (range, version) => { if (0 in range) { // @ts-expect-error version = parseVersion(version); - var fixCount = range[0]; + var fixCount = /** @type {number} */ (range[0]); // when negated is set it swill set for < instead of >= var negated = fixCount < 0; if (negated) fixCount = -fixCount - 1; @@ -165015,7 +173289,7 @@ exports.satisfyRuntimeCode = runtimeTemplate => /***/ }), -/***/ 94965: +/***/ 93141: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -165025,26 +173299,28 @@ exports.satisfyRuntimeCode = runtimeTemplate => -const memoize = __webpack_require__(27319); +const memoize = __webpack_require__(62377); /** @typedef {import("../serialization/BinaryMiddleware").MEASURE_END_OPERATION_TYPE} MEASURE_END_OPERATION */ /** @typedef {import("../serialization/BinaryMiddleware").MEASURE_START_OPERATION_TYPE} MEASURE_START_OPERATION */ /** @typedef {import("../serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */ /** @typedef {import("../serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */ /** @typedef {import("../serialization/Serializer")} Serializer */ +/** @typedef {typeof import("../util/Hash")} Hash */ +/** @typedef {import("../util/fs").IntermediateFileSystem} IntermediateFileSystem */ const getBinaryMiddleware = memoize(() => - __webpack_require__(90497) + __webpack_require__(61312) ); const getObjectMiddleware = memoize(() => - __webpack_require__(31559) + __webpack_require__(74722) ); const getSingleItemMiddleware = memoize(() => - __webpack_require__(42094) + __webpack_require__(67206) ); -const getSerializer = memoize(() => __webpack_require__(60139)); +const getSerializer = memoize(() => __webpack_require__(75612)); const getSerializerMiddleware = memoize(() => - __webpack_require__(80021) + __webpack_require__(41565) ); const getBinaryMiddlewareInstance = memoize( @@ -165052,11 +173328,11 @@ const getBinaryMiddlewareInstance = memoize( ); const registerSerializers = memoize(() => { - __webpack_require__(8128); + __webpack_require__(86089); // Load internal paths with a relative require // This allows bundling all internal serializers - const internalSerializables = __webpack_require__(91881); + const internalSerializables = __webpack_require__(26071); getObjectMiddleware().registerLoader(/^webpack\/lib\//, req => { const loader = internalSerializables[req.slice("webpack/lib/".length)]; if (loader) { @@ -165093,6 +173369,9 @@ module.exports = { get MEASURE_END_OPERATION() { return getBinaryMiddleware().MEASURE_END_OPERATION; }, + /** + * @returns {Serializer} buffer serializer + */ get buffersSerializer() { if (buffersSerializer !== undefined) return buffersSerializer; registerSerializers(); @@ -165114,10 +173393,15 @@ module.exports = { binaryMiddleware ])); }, + /** + * @param {IntermediateFileSystem} fs filesystem + * @param {string | Hash} hashFunction hash function to use + * @returns {Serializer} file serializer + */ createFileSerializer: (fs, hashFunction) => { registerSerializers(); const Serializer = getSerializer(); - const FileMiddleware = __webpack_require__(21885); + const FileMiddleware = __webpack_require__(44003); const fileMiddleware = new FileMiddleware(fs, hashFunction); const binaryMiddleware = getBinaryMiddlewareInstance(); const SerializerMiddleware = getSerializerMiddleware(); @@ -165151,7 +173435,7 @@ module.exports = { /***/ }), -/***/ 35947: +/***/ 54372: /***/ (function(module) { "use strict"; @@ -165267,7 +173551,7 @@ const smartGrouping = (items, groupConfigs) => { /** @type {(T | R)[]} */ const results = []; for (;;) { - /** @type {Group} */ + /** @type {Group | undefined} */ let bestGroup = undefined; let bestGroupSize = -1; let bestGroupItems = undefined; @@ -165365,7 +173649,7 @@ module.exports = smartGrouping; /***/ }), -/***/ 70475: +/***/ 39946: /***/ (function(__unused_webpack_module, exports) { "use strict"; @@ -165434,7 +173718,7 @@ exports.isSourceEqual = isSourceEqual; /***/ }), -/***/ 60395: +/***/ 97848: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -165445,7 +173729,7 @@ exports.isSourceEqual = isSourceEqual; -const { validate } = __webpack_require__(1489); +const { validate } = __webpack_require__(16633); /* cSpell:disable */ const DID_YOU_MEAN = { @@ -165559,7 +173843,9 @@ const validateSchema = (schema, options, validationConfiguration) => { ) ) { return `${formattedError}\nDid you mean ${ - DID_YOU_MEAN[params.additionalProperty] + DID_YOU_MEAN[ + /** @type {keyof DID_YOU_MEAN} */ (params.additionalProperty) + ] }?`; } @@ -165569,7 +173855,9 @@ const validateSchema = (schema, options, validationConfiguration) => { params.additionalProperty ) ) { - return `${formattedError}\n${REMOVED[params.additionalProperty]}?`; + return `${formattedError}\n${ + REMOVED[/** @type {keyof REMOVED} */ (params.additionalProperty)] + }?`; } if (!error.dataPath) { @@ -165617,7 +173905,7 @@ module.exports = validateSchema; /***/ }), -/***/ 13119: +/***/ 29023: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -165628,11 +173916,23 @@ module.exports = validateSchema; -const RuntimeGlobals = __webpack_require__(34623); -const RuntimeModule = __webpack_require__(81196); -const Template = __webpack_require__(88070); +const RuntimeGlobals = __webpack_require__(61539); +const RuntimeModule = __webpack_require__(21296); +const Template = __webpack_require__(88835); + +/** @typedef {import("../Chunk")} Chunk */ +/** @typedef {import("../Compilation")} Compilation */ + +/** + * @typedef {Object} AsyncWasmLoadingRuntimeModuleOptions + * @property {function(string): string} generateLoadBinaryCode + * @property {boolean} supportsStreaming + */ class AsyncWasmLoadingRuntimeModule extends RuntimeModule { + /** + * @param {AsyncWasmLoadingRuntimeModuleOptions} options options + */ constructor({ generateLoadBinaryCode, supportsStreaming }) { super("wasm loading", RuntimeModule.STAGE_NORMAL); this.generateLoadBinaryCode = generateLoadBinaryCode; @@ -165640,10 +173940,11 @@ class AsyncWasmLoadingRuntimeModule extends RuntimeModule { } /** - * @returns {string} runtime code + * @returns {string | null} runtime code */ generate() { - const { compilation, chunk } = this; + const compilation = /** @type {Compilation} */ (this.compilation); + const chunk = /** @type {Chunk} */ (this.chunk); const { outputOptions, runtimeTemplate } = compilation; const fn = RuntimeGlobals.instantiateWasm; const wasmModuleSrcPath = compilation.getPath( @@ -165703,7 +174004,7 @@ module.exports = AsyncWasmLoadingRuntimeModule; /***/ }), -/***/ 12938: +/***/ 85177: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -165714,7 +174015,7 @@ module.exports = AsyncWasmLoadingRuntimeModule; -const Generator = __webpack_require__(8635); +const Generator = __webpack_require__(58387); /** @typedef {import("webpack-sources").Source} Source */ /** @typedef {import("../Generator").GenerateContext} GenerateContext */ @@ -165722,7 +174023,15 @@ const Generator = __webpack_require__(8635); const TYPES = new Set(["webassembly"]); +/** + * @typedef {Object} AsyncWebAssemblyGeneratorOptions + * @property {boolean} [mangleImports] mangle imports + */ + class AsyncWebAssemblyGenerator extends Generator { + /** + * @param {AsyncWebAssemblyGeneratorOptions} options options + */ constructor(options) { super(); this.options = options; @@ -165755,7 +174064,7 @@ class AsyncWebAssemblyGenerator extends Generator { * @returns {Source} generated code */ generate(module, generateContext) { - return module.originalSource(); + return /** @type {Source} */ (module.originalSource()); } } @@ -165764,7 +174073,7 @@ module.exports = AsyncWebAssemblyGenerator; /***/ }), -/***/ 99735: +/***/ 49811: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -165776,13 +174085,14 @@ module.exports = AsyncWebAssemblyGenerator; const { RawSource } = __webpack_require__(59728); -const Generator = __webpack_require__(8635); -const InitFragment = __webpack_require__(53658); -const RuntimeGlobals = __webpack_require__(34623); -const Template = __webpack_require__(88070); -const WebAssemblyImportDependency = __webpack_require__(55884); +const Generator = __webpack_require__(58387); +const InitFragment = __webpack_require__(44508); +const RuntimeGlobals = __webpack_require__(61539); +const Template = __webpack_require__(88835); +const WebAssemblyImportDependency = __webpack_require__(50992); /** @typedef {import("webpack-sources").Source} Source */ +/** @typedef {import("../../declarations/WebpackOptions").OutputNormalized} OutputOptions */ /** @typedef {import("../DependencyTemplates")} DependencyTemplates */ /** @typedef {import("../Generator").GenerateContext} GenerateContext */ /** @typedef {import("../Module")} Module */ @@ -165791,7 +174101,14 @@ const WebAssemblyImportDependency = __webpack_require__(55884); const TYPES = new Set(["webassembly"]); +/** + * @typedef {{ request: string, importVar: string }} ImportObjRequestItem + */ + class AsyncWebAssemblyJavascriptGenerator extends Generator { + /** + * @param {OutputOptions["webassemblyModuleFilename"]} filenameTemplate template for the WebAssembly module filename + */ constructor(filenameTemplate) { super(); this.filenameTemplate = filenameTemplate; @@ -165831,9 +174148,9 @@ class AsyncWebAssemblyJavascriptGenerator extends Generator { runtimeRequirements.add(RuntimeGlobals.moduleId); runtimeRequirements.add(RuntimeGlobals.exports); runtimeRequirements.add(RuntimeGlobals.instantiateWasm); - /** @type {InitFragment[]} */ + /** @type {InitFragment>[]} */ const initFragments = []; - /** @type {Map} */ + /** @type {Map} */ const depModules = new Map(); /** @type {Map} */ const wasmDepsByRequest = new Map(); @@ -165855,6 +174172,7 @@ class AsyncWebAssemblyJavascriptGenerator extends Generator { } } + /** @type {Array} */ const promises = []; const importStatements = Array.from( @@ -165882,7 +174200,9 @@ class AsyncWebAssemblyJavascriptGenerator extends Generator { ([request, deps]) => { const exportItems = deps.map(dep => { const importedModule = moduleGraph.getModule(dep); - const importVar = depModules.get(importedModule).importVar; + const importVar = + /** @type {ImportObjRequestItem} */ + (depModules.get(importedModule)).importVar; return `${JSON.stringify( dep.name )}: ${runtimeTemplate.exportFromImport({ @@ -165966,7 +174286,7 @@ module.exports = AsyncWebAssemblyJavascriptGenerator; /***/ }), -/***/ 1768: +/***/ 37390: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -165978,14 +174298,16 @@ module.exports = AsyncWebAssemblyJavascriptGenerator; const { SyncWaterfallHook } = __webpack_require__(70793); -const Compilation = __webpack_require__(38292); -const Generator = __webpack_require__(8635); -const { tryRunOrWebpackError } = __webpack_require__(88608); -const WebAssemblyImportDependency = __webpack_require__(55884); -const { compareModulesByIdentifier } = __webpack_require__(29355); -const memoize = __webpack_require__(27319); +const Compilation = __webpack_require__(20417); +const Generator = __webpack_require__(58387); +const { tryRunOrWebpackError } = __webpack_require__(39319); +const { WEBASSEMBLY_MODULE_TYPE_ASYNC } = __webpack_require__(92891); +const WebAssemblyImportDependency = __webpack_require__(50992); +const { compareModulesByIdentifier } = __webpack_require__(95978); +const memoize = __webpack_require__(62377); /** @typedef {import("webpack-sources").Source} Source */ +/** @typedef {import("../../declarations/WebpackOptions").OutputNormalized} OutputOptions */ /** @typedef {import("../Chunk")} Chunk */ /** @typedef {import("../ChunkGraph")} ChunkGraph */ /** @typedef {import("../CodeGenerationResults")} CodeGenerationResults */ @@ -165996,15 +174318,16 @@ const memoize = __webpack_require__(27319); /** @typedef {import("../RuntimeTemplate")} RuntimeTemplate */ /** @typedef {import("../Template").RenderManifestEntry} RenderManifestEntry */ /** @typedef {import("../Template").RenderManifestOptions} RenderManifestOptions */ +/** @typedef {import("../WebpackError")} WebpackError */ const getAsyncWebAssemblyGenerator = memoize(() => - __webpack_require__(12938) + __webpack_require__(85177) ); const getAsyncWebAssemblyJavascriptGenerator = memoize(() => - __webpack_require__(99735) + __webpack_require__(49811) ); const getAsyncWebAssemblyParser = memoize(() => - __webpack_require__(83706) + __webpack_require__(27862) ); /** @@ -166022,9 +174345,16 @@ const getAsyncWebAssemblyParser = memoize(() => * @property {SyncWaterfallHook<[Source, Module, WebAssemblyRenderContext]>} renderModuleContent */ +/** + * @typedef {Object} AsyncWebAssemblyModulesPluginOptions + * @property {boolean} [mangleImports] mangle imports + */ + /** @type {WeakMap} */ const compilationHooksMap = new WeakMap(); +const PLUGIN_NAME = "AsyncWebAssemblyModulesPlugin"; + class AsyncWebAssemblyModulesPlugin { /** * @param {Compilation} compilation the compilation @@ -166050,6 +174380,9 @@ class AsyncWebAssemblyModulesPlugin { return hooks; } + /** + * @param {AsyncWebAssemblyModulesPluginOptions} options options + */ constructor(options) { this.options = options; } @@ -166061,7 +174394,7 @@ class AsyncWebAssemblyModulesPlugin { */ apply(compiler) { compiler.hooks.compilation.tap( - "AsyncWebAssemblyModulesPlugin", + PLUGIN_NAME, (compilation, { normalModuleFactory }) => { const hooks = AsyncWebAssemblyModulesPlugin.getCompilationHooks(compilation); @@ -166071,15 +174404,15 @@ class AsyncWebAssemblyModulesPlugin { ); normalModuleFactory.hooks.createParser - .for("webassembly/async") - .tap("AsyncWebAssemblyModulesPlugin", () => { + .for(WEBASSEMBLY_MODULE_TYPE_ASYNC) + .tap(PLUGIN_NAME, () => { const AsyncWebAssemblyParser = getAsyncWebAssemblyParser(); return new AsyncWebAssemblyParser(); }); normalModuleFactory.hooks.createGenerator - .for("webassembly/async") - .tap("AsyncWebAssemblyModulesPlugin", () => { + .for(WEBASSEMBLY_MODULE_TYPE_ASYNC) + .tap(PLUGIN_NAME, () => { const AsyncWebAssemblyJavascriptGenerator = getAsyncWebAssemblyJavascriptGenerator(); const AsyncWebAssemblyGenerator = getAsyncWebAssemblyGenerator(); @@ -166107,9 +174440,10 @@ class AsyncWebAssemblyModulesPlugin { chunk, compareModulesByIdentifier )) { - if (module.type === "webassembly/async") { + if (module.type === WEBASSEMBLY_MODULE_TYPE_ASYNC) { const filenameTemplate = - outputOptions.webassemblyModuleFilename; + /** @type {NonNullable} */ + (outputOptions.webassemblyModuleFilename); result.push({ render: () => @@ -166147,6 +174481,12 @@ class AsyncWebAssemblyModulesPlugin { ); } + /** + * @param {Module} module the rendered module + * @param {WebAssemblyRenderContext} renderContext options object + * @param {CompilationHooks} hooks hooks + * @returns {Source} the newly generated source from rendering + */ renderModule(module, renderContext, hooks) { const { codeGenerationResults, chunk } = renderContext; try { @@ -166161,7 +174501,7 @@ class AsyncWebAssemblyModulesPlugin { "AsyncWebAssemblyModulesPlugin.getCompilationHooks().renderModuleContent" ); } catch (e) { - e.module = module; + /** @type {WebpackError} */ (e).module = module; throw e; } } @@ -166172,7 +174512,7 @@ module.exports = AsyncWebAssemblyModulesPlugin; /***/ }), -/***/ 83706: +/***/ 27862: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -166183,12 +174523,14 @@ module.exports = AsyncWebAssemblyModulesPlugin; -const t = __webpack_require__(51606); -const { decode } = __webpack_require__(74102); -const Parser = __webpack_require__(66425); -const StaticExportsDependency = __webpack_require__(64422); -const WebAssemblyImportDependency = __webpack_require__(55884); +const t = __webpack_require__(75974); +const { decode } = __webpack_require__(34214); +const Parser = __webpack_require__(76690); +const StaticExportsDependency = __webpack_require__(71444); +const WebAssemblyImportDependency = __webpack_require__(50992); +/** @typedef {import("../Module").BuildInfo} BuildInfo */ +/** @typedef {import("../Module").BuildMeta} BuildMeta */ /** @typedef {import("../Parser").ParserState} ParserState */ /** @typedef {import("../Parser").PreparsedAst} PreparsedAst */ @@ -166201,6 +174543,9 @@ const decoderOpts = { }; class WebAssemblyParser extends Parser { + /** + * @param {{}=} options parser options + */ constructor(options) { super(); this.hooks = Object.freeze({}); @@ -166218,14 +174563,16 @@ class WebAssemblyParser extends Parser { } // flag it as async module - state.module.buildInfo.strict = true; - state.module.buildMeta.exportsType = "namespace"; - state.module.buildMeta.async = true; + const buildInfo = /** @type {BuildInfo} */ (state.module.buildInfo); + buildInfo.strict = true; + const BuildMeta = /** @type {BuildMeta} */ (state.module.buildMeta); + BuildMeta.exportsType = "namespace"; + BuildMeta.async = true; // parse it const program = decode(source, decoderOpts); const module = program.body[0]; - + /** @type {Array} */ const exports = []; t.traverse(module, { ModuleExport({ node }) { @@ -166255,7 +174602,7 @@ module.exports = WebAssemblyParser; /***/ }), -/***/ 6275: +/***/ 16399: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -166265,7 +174612,7 @@ module.exports = WebAssemblyParser; -const WebpackError = __webpack_require__(10841); +const WebpackError = __webpack_require__(49999); module.exports = class UnsupportedWebAssemblyFeatureError extends WebpackError { /** @param {string} message Error message */ @@ -166279,7 +174626,7 @@ module.exports = class UnsupportedWebAssemblyFeatureError extends WebpackError { /***/ }), -/***/ 10726: +/***/ 91214: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -166289,20 +174636,29 @@ module.exports = class UnsupportedWebAssemblyFeatureError extends WebpackError { -const RuntimeGlobals = __webpack_require__(34623); -const RuntimeModule = __webpack_require__(81196); -const Template = __webpack_require__(88070); -const { compareModulesByIdentifier } = __webpack_require__(29355); -const WebAssemblyUtils = __webpack_require__(46119); +const RuntimeGlobals = __webpack_require__(61539); +const RuntimeModule = __webpack_require__(21296); +const Template = __webpack_require__(88835); +const { compareModulesByIdentifier } = __webpack_require__(95978); +const WebAssemblyUtils = __webpack_require__(11558); +/** @typedef {import("@webassemblyjs/ast").Signature} Signature */ +/** @typedef {import("../Chunk")} Chunk */ /** @typedef {import("../ChunkGraph")} ChunkGraph */ /** @typedef {import("../Compilation")} Compilation */ /** @typedef {import("../Module")} Module */ +/** @typedef {import("../ModuleGraph")} ModuleGraph */ /** @typedef {import("../util/runtime").RuntimeSpec} RuntimeSpec */ // TODO webpack 6 remove the whole folder // Get all wasm modules +/** + * @param {ModuleGraph} moduleGraph the module graph + * @param {ChunkGraph} chunkGraph the chunk graph + * @param {Chunk} chunk the chunk + * @returns {Module[]} all wasm modules + */ const getAllWasmModules = (moduleGraph, chunkGraph, chunk) => { const wasmModules = chunk.getAllAsyncChunks(); const array = []; @@ -166324,7 +174680,7 @@ const getAllWasmModules = (moduleGraph, chunkGraph, chunk) => { * generates the import object function for a module * @param {ChunkGraph} chunkGraph the chunk graph * @param {Module} module the module - * @param {boolean} mangle mangle imports + * @param {boolean | undefined} mangle mangle imports * @param {string[]} declarations array where declarations are pushed to * @param {RuntimeSpec} runtime the runtime * @returns {string} source code @@ -166368,9 +174724,11 @@ const generateImportObject = ( value: `${instanceVar}[${JSON.stringify(usedName)}]` }); } else { - const params = description.signature.params.map( - (param, k) => "p" + k + param.valtype - ); + const params = + /** @type {Signature} */ + (description.signature).params.map( + (param, k) => "p" + k + param.valtype + ); const mod = `${RuntimeGlobals.moduleCache}[${JSON.stringify( chunkGraph.getModuleId(importedModule) @@ -166407,6 +174765,7 @@ const generateImportObject = ( "};" ]; } else { + /** @type {Map>} */ const propertiesByModule = new Map(); for (const p of properties) { let list = propertiesByModule.get(p.module); @@ -166473,7 +174832,18 @@ const generateImportObject = ( } }; +/** + * @typedef {Object} WasmChunkLoadingRuntimeModuleOptions + * @property {(path: string) => string} generateLoadBinaryCode + * @property {boolean} [supportsStreaming] + * @property {boolean} [mangleImports] + * @property {Set} runtimeRequirements + */ + class WasmChunkLoadingRuntimeModule extends RuntimeModule { + /** + * @param {WasmChunkLoadingRuntimeModuleOptions} options options + */ constructor({ generateLoadBinaryCode, supportsStreaming, @@ -166488,22 +174858,26 @@ class WasmChunkLoadingRuntimeModule extends RuntimeModule { } /** - * @returns {string} runtime code + * @returns {string | null} runtime code */ generate() { - const { chunkGraph, compilation, chunk, mangleImports } = this; - const { moduleGraph, outputOptions } = compilation; const fn = RuntimeGlobals.ensureChunkHandlers; const withHmr = this._runtimeRequirements.has( RuntimeGlobals.hmrDownloadUpdateHandlers ); + const compilation = /** @type {Compilation} */ (this.compilation); + const { moduleGraph, outputOptions } = compilation; + const chunkGraph = /** @type {ChunkGraph} */ (this.chunkGraph); + const chunk = /** @type {Chunk} */ (this.chunk); const wasmModules = getAllWasmModules(moduleGraph, chunkGraph, chunk); + const { mangleImports } = this; + /** @type {string[]} */ const declarations = []; const importObjects = wasmModules.map(module => { return generateImportObject( chunkGraph, module, - this.mangleImports, + mangleImports, declarations, chunk.runtime ); @@ -166511,6 +174885,10 @@ class WasmChunkLoadingRuntimeModule extends RuntimeModule { const chunkModuleIdMap = chunkGraph.getChunkModuleIdMap(chunk, m => m.type.startsWith("webassembly") ); + /** + * @param {string} content content + * @returns {string} created import object + */ const createImportObject = content => mangleImports ? `{ ${JSON.stringify(WebAssemblyUtils.MANGLED_MODULE)}: ${content} }` @@ -166659,7 +175037,7 @@ module.exports = WasmChunkLoadingRuntimeModule; /***/ }), -/***/ 29874: +/***/ 56508: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -166670,10 +175048,13 @@ module.exports = WasmChunkLoadingRuntimeModule; -const formatLocation = __webpack_require__(49064); -const UnsupportedWebAssemblyFeatureError = __webpack_require__(6275); +const formatLocation = __webpack_require__(60246); +const UnsupportedWebAssemblyFeatureError = __webpack_require__(16399); /** @typedef {import("../Compiler")} Compiler */ +/** @typedef {import("../Dependency")} Dependency */ +/** @typedef {import("../Module")} Module */ +/** @typedef {import("../Module").BuildMeta} BuildMeta */ class WasmFinalizeExportsPlugin { /** @@ -166690,7 +175071,8 @@ class WasmFinalizeExportsPlugin { // 1. if a WebAssembly module if (module.type.startsWith("webassembly") === true) { const jsIncompatibleExports = - module.buildMeta.jsIncompatibleExports; + /** @type {BuildMeta} */ + (module.buildMeta).jsIncompatibleExports; if (jsIncompatibleExports === undefined) { continue; @@ -166702,12 +175084,13 @@ class WasmFinalizeExportsPlugin { // 2. is active and referenced by a non-WebAssembly module if ( connection.isTargetActive(undefined) && - connection.originModule.type.startsWith("webassembly") === + /** @type {Module} */ + (connection.originModule).type.startsWith("webassembly") === false ) { const referencedExports = compilation.getDependencyReferencedExports( - connection.dependency, + /** @type {Dependency} */ (connection.dependency), undefined ); @@ -166726,9 +175109,15 @@ class WasmFinalizeExportsPlugin { // 4. error const error = new UnsupportedWebAssemblyFeatureError( `Export "${name}" with ${jsIncompatibleExports[name]} can only be used for direct wasm to wasm dependencies\n` + - `It's used from ${connection.originModule.readableIdentifier( - compilation.requestShortener - )} at ${formatLocation(connection.dependency.loc)}.` + `It's used from ${ + /** @type {Module} */ + (connection.originModule).readableIdentifier( + compilation.requestShortener + ) + } at ${formatLocation( + /** @type {Dependency} */ (connection.dependency) + .loc + )}.` ); error.module = module; compilation.errors.push(error); @@ -166749,7 +175138,7 @@ module.exports = WasmFinalizeExportsPlugin; /***/ }), -/***/ 32158: +/***/ 82404: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -166761,15 +175150,15 @@ module.exports = WasmFinalizeExportsPlugin; const { RawSource } = __webpack_require__(59728); -const Generator = __webpack_require__(8635); -const WebAssemblyUtils = __webpack_require__(46119); +const Generator = __webpack_require__(58387); +const WebAssemblyUtils = __webpack_require__(11558); -const t = __webpack_require__(51606); -const { moduleContextFromModuleAST } = __webpack_require__(51606); -const { editWithAST, addWithAST } = __webpack_require__(43089); -const { decode } = __webpack_require__(74102); +const t = __webpack_require__(75974); +const { moduleContextFromModuleAST } = __webpack_require__(75974); +const { editWithAST, addWithAST } = __webpack_require__(78069); +const { decode } = __webpack_require__(34214); -const WebAssemblyExportImportedDependency = __webpack_require__(29931); +const WebAssemblyExportImportedDependency = __webpack_require__(79604); /** @typedef {import("webpack-sources").Source} Source */ /** @typedef {import("../DependencyTemplates")} DependencyTemplates */ @@ -166782,7 +175171,7 @@ const WebAssemblyExportImportedDependency = __webpack_require__(29931); /** @typedef {import("./WebAssemblyUtils").UsedWasmDependency} UsedWasmDependency */ /** - * @typedef {(ArrayBuffer) => ArrayBuffer} ArrayBufferTransform + * @typedef {(buf: ArrayBuffer) => ArrayBuffer} ArrayBufferTransform */ /** @@ -166817,9 +175206,10 @@ const removeStartFunc = state => bin => { * Get imported globals * * @param {Object} ast Module's AST - * @returns {Array} - nodes + * @returns {t.ModuleImport[]} - nodes */ const getImportedGlobals = ast => { + /** @type {t.ModuleImport[]} */ const importedGlobals = []; t.traverse(ast, { @@ -166928,6 +175318,7 @@ const createDefaultInitForGlobal = globalType => { */ const rewriteImportedGlobals = state => bin => { const additionalInitCode = state.additionalInitCode; + /** @type {Array} */ const newGlobals = []; bin = editWithAST(state.ast, bin, { @@ -167073,7 +175464,10 @@ const addInitFunction = `${importedGlobal.module}.${importedGlobal.name}` ); - return t.funcParam(importedGlobal.descr.valtype, id); + return t.funcParam( + /** @type {string} */ (importedGlobal.descr.valtype), + id + ); }); const funcBody = []; @@ -167099,6 +175493,7 @@ const addInitFunction = funcBody.push(t.instruction("end")); + /** @type {string[]} */ const funcResults = []; // Code section @@ -167124,7 +175519,7 @@ const addInitFunction = * Extract mangle mappings from module * @param {ModuleGraph} moduleGraph module graph * @param {Module} module current module - * @param {boolean} mangle mangle imports + * @param {boolean | undefined} mangle mangle imports * @returns {Map} mappings to mangled names */ const getUsedDependencyMap = (moduleGraph, module, mangle) => { @@ -167145,7 +175540,15 @@ const getUsedDependencyMap = (moduleGraph, module, mangle) => { const TYPES = new Set(["webassembly"]); +/** + * @typedef {Object} WebAssemblyGeneratorOptions + * @property {boolean} [mangleImports] mangle imports + */ + class WebAssemblyGenerator extends Generator { + /** + * @param {WebAssemblyGeneratorOptions} options options + */ constructor(options) { super(); this.options = options; @@ -167178,7 +175581,7 @@ class WebAssemblyGenerator extends Generator { * @returns {Source} generated code */ generate(module, { moduleGraph, runtime }) { - const bin = module.originalSource().source(); + const bin = /** @type {Source} */ (module.originalSource()).source(); const initFuncId = t.identifier(""); @@ -167258,7 +175661,7 @@ module.exports = WebAssemblyGenerator; /***/ }), -/***/ 46496: +/***/ 51697: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -167268,7 +175671,7 @@ module.exports = WebAssemblyGenerator; -const WebpackError = __webpack_require__(10841); +const WebpackError = __webpack_require__(49999); /** @typedef {import("../ChunkGraph")} ChunkGraph */ /** @typedef {import("../Module")} Module */ @@ -167372,7 +175775,7 @@ ${moduleChains.map(s => `* ${s}`).join("\n")}`; /***/ }), -/***/ 66612: +/***/ 67775: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -167384,14 +175787,14 @@ ${moduleChains.map(s => `* ${s}`).join("\n")}`; const { RawSource } = __webpack_require__(59728); -const { UsageState } = __webpack_require__(1723); -const Generator = __webpack_require__(8635); -const InitFragment = __webpack_require__(53658); -const RuntimeGlobals = __webpack_require__(34623); -const Template = __webpack_require__(88070); -const ModuleDependency = __webpack_require__(22994); -const WebAssemblyExportImportedDependency = __webpack_require__(29931); -const WebAssemblyImportDependency = __webpack_require__(55884); +const { UsageState } = __webpack_require__(14768); +const Generator = __webpack_require__(58387); +const InitFragment = __webpack_require__(44508); +const RuntimeGlobals = __webpack_require__(61539); +const Template = __webpack_require__(88835); +const ModuleDependency = __webpack_require__(10931); +const WebAssemblyExportImportedDependency = __webpack_require__(79604); +const WebAssemblyImportDependency = __webpack_require__(50992); /** @typedef {import("webpack-sources").Source} Source */ /** @typedef {import("../Dependency")} Dependency */ @@ -167433,7 +175836,7 @@ class WebAssemblyJavascriptGenerator extends Generator { runtimeRequirements, runtime } = generateContext; - /** @type {InitFragment[]} */ + /** @type {InitFragment>[]} */ const initFragments = []; const exportsInfo = moduleGraph.getExportsInfo(module); @@ -167596,7 +175999,7 @@ module.exports = WebAssemblyJavascriptGenerator; /***/ }), -/***/ 798: +/***/ 57253: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -167607,28 +176010,40 @@ module.exports = WebAssemblyJavascriptGenerator; -const Generator = __webpack_require__(8635); -const WebAssemblyExportImportedDependency = __webpack_require__(29931); -const WebAssemblyImportDependency = __webpack_require__(55884); -const { compareModulesByIdentifier } = __webpack_require__(29355); -const memoize = __webpack_require__(27319); -const WebAssemblyInInitialChunkError = __webpack_require__(46496); +const Generator = __webpack_require__(58387); +const { WEBASSEMBLY_MODULE_TYPE_SYNC } = __webpack_require__(92891); +const WebAssemblyExportImportedDependency = __webpack_require__(79604); +const WebAssemblyImportDependency = __webpack_require__(50992); +const { compareModulesByIdentifier } = __webpack_require__(95978); +const memoize = __webpack_require__(62377); +const WebAssemblyInInitialChunkError = __webpack_require__(51697); /** @typedef {import("webpack-sources").Source} Source */ +/** @typedef {import("../../declarations/WebpackOptions").OutputNormalized} OutputOptions */ /** @typedef {import("../Compiler")} Compiler */ /** @typedef {import("../Module")} Module */ /** @typedef {import("../ModuleTemplate")} ModuleTemplate */ /** @typedef {import("../javascript/JavascriptModulesPlugin").RenderContext} RenderContext */ const getWebAssemblyGenerator = memoize(() => - __webpack_require__(32158) + __webpack_require__(82404) ); const getWebAssemblyJavascriptGenerator = memoize(() => - __webpack_require__(66612) + __webpack_require__(67775) ); -const getWebAssemblyParser = memoize(() => __webpack_require__(81119)); +const getWebAssemblyParser = memoize(() => __webpack_require__(33584)); + +const PLUGIN_NAME = "WebAssemblyModulesPlugin"; + +/** + * @typedef {Object} WebAssemblyModulesPluginOptions + * @property {boolean} [mangleImports] mangle imports + */ class WebAssemblyModulesPlugin { + /** + * @param {WebAssemblyModulesPluginOptions} options options + */ constructor(options) { this.options = options; } @@ -167640,7 +176055,7 @@ class WebAssemblyModulesPlugin { */ apply(compiler) { compiler.hooks.compilation.tap( - "WebAssemblyModulesPlugin", + PLUGIN_NAME, (compilation, { normalModuleFactory }) => { compilation.dependencyFactories.set( WebAssemblyImportDependency, @@ -167653,16 +176068,16 @@ class WebAssemblyModulesPlugin { ); normalModuleFactory.hooks.createParser - .for("webassembly/sync") - .tap("WebAssemblyModulesPlugin", () => { + .for(WEBASSEMBLY_MODULE_TYPE_SYNC) + .tap(PLUGIN_NAME, () => { const WebAssemblyParser = getWebAssemblyParser(); return new WebAssemblyParser(); }); normalModuleFactory.hooks.createGenerator - .for("webassembly/sync") - .tap("WebAssemblyModulesPlugin", () => { + .for(WEBASSEMBLY_MODULE_TYPE_SYNC) + .tap(PLUGIN_NAME, () => { const WebAssemblyJavascriptGenerator = getWebAssemblyJavascriptGenerator(); const WebAssemblyGenerator = getWebAssemblyGenerator(); @@ -167673,53 +176088,51 @@ class WebAssemblyModulesPlugin { }); }); - compilation.hooks.renderManifest.tap( - "WebAssemblyModulesPlugin", - (result, options) => { - const { chunkGraph } = compilation; - const { chunk, outputOptions, codeGenerationResults } = options; - - for (const module of chunkGraph.getOrderedChunkModulesIterable( - chunk, - compareModulesByIdentifier - )) { - if (module.type === "webassembly/sync") { - const filenameTemplate = - outputOptions.webassemblyModuleFilename; + compilation.hooks.renderManifest.tap(PLUGIN_NAME, (result, options) => { + const { chunkGraph } = compilation; + const { chunk, outputOptions, codeGenerationResults } = options; - result.push({ - render: () => - codeGenerationResults.getSource( - module, - chunk.runtime, - "webassembly" - ), - filenameTemplate, - pathOptions: { + for (const module of chunkGraph.getOrderedChunkModulesIterable( + chunk, + compareModulesByIdentifier + )) { + if (module.type === WEBASSEMBLY_MODULE_TYPE_SYNC) { + const filenameTemplate = + /** @type {NonNullable} */ + (outputOptions.webassemblyModuleFilename); + + result.push({ + render: () => + codeGenerationResults.getSource( module, - runtime: chunk.runtime, - chunkGraph - }, - auxiliary: true, - identifier: `webassemblyModule${chunkGraph.getModuleId( - module - )}`, - hash: chunkGraph.getModuleHash(module, chunk.runtime) - }); - } + chunk.runtime, + "webassembly" + ), + filenameTemplate, + pathOptions: { + module, + runtime: chunk.runtime, + chunkGraph + }, + auxiliary: true, + identifier: `webassemblyModule${chunkGraph.getModuleId( + module + )}`, + hash: chunkGraph.getModuleHash(module, chunk.runtime) + }); } - - return result; } - ); - compilation.hooks.afterChunks.tap("WebAssemblyModulesPlugin", () => { + return result; + }); + + compilation.hooks.afterChunks.tap(PLUGIN_NAME, () => { const chunkGraph = compilation.chunkGraph; const initialWasmModules = new Set(); for (const chunk of compilation.chunks) { if (chunk.canBeInitial()) { for (const module of chunkGraph.getChunkModulesIterable(chunk)) { - if (module.type === "webassembly/sync") { + if (module.type === WEBASSEMBLY_MODULE_TYPE_SYNC) { initialWasmModules.add(module); } } @@ -167746,7 +176159,7 @@ module.exports = WebAssemblyModulesPlugin; /***/ }), -/***/ 81119: +/***/ 33584: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -167757,15 +176170,17 @@ module.exports = WebAssemblyModulesPlugin; -const t = __webpack_require__(51606); -const { moduleContextFromModuleAST } = __webpack_require__(51606); -const { decode } = __webpack_require__(74102); -const Parser = __webpack_require__(66425); -const StaticExportsDependency = __webpack_require__(64422); -const WebAssemblyExportImportedDependency = __webpack_require__(29931); -const WebAssemblyImportDependency = __webpack_require__(55884); +const t = __webpack_require__(75974); +const { moduleContextFromModuleAST } = __webpack_require__(75974); +const { decode } = __webpack_require__(34214); +const Parser = __webpack_require__(76690); +const StaticExportsDependency = __webpack_require__(71444); +const WebAssemblyExportImportedDependency = __webpack_require__(79604); +const WebAssemblyImportDependency = __webpack_require__(50992); /** @typedef {import("../Module")} Module */ +/** @typedef {import("../Module").BuildInfo} BuildInfo */ +/** @typedef {import("../Module").BuildMeta} BuildMeta */ /** @typedef {import("../Parser").ParserState} ParserState */ /** @typedef {import("../Parser").PreparsedAst} PreparsedAst */ @@ -167813,6 +176228,9 @@ const decoderOpts = { }; class WebAssemblyParser extends Parser { + /** + * @param {{}=} options parser options + */ constructor(options) { super(); this.hooks = Object.freeze({}); @@ -167830,8 +176248,10 @@ class WebAssemblyParser extends Parser { } // flag it as ESM - state.module.buildInfo.strict = true; - state.module.buildMeta.exportsType = "namespace"; + /** @type {BuildInfo} */ + (state.module.buildInfo).strict = true; + /** @type {BuildMeta} */ + (state.module.buildMeta).exportsType = "namespace"; // parse it const program = decode(source, decoderOpts); @@ -167840,10 +176260,12 @@ class WebAssemblyParser extends Parser { const moduleContext = moduleContextFromModuleAST(module); // extract imports and exports + /** @type {string[]} */ const exports = []; let jsIncompatibleExports = (state.module.buildMeta.jsIncompatibleExports = undefined); + /** @type {TODO[]} */ const importedGlobals = []; t.traverse(module, { ModuleExport({ node }) { @@ -167909,12 +176331,14 @@ class WebAssemblyParser extends Parser { } else if (t.isTable(node.descr) === true) { onlyDirectImport = "Table"; } else if (t.isFuncImportDescr(node.descr) === true) { - const incompatibleType = getJsIncompatibleType(node.descr.signature); + const incompatibleType = getJsIncompatibleType( + /** @type {t.Signature} */ (node.descr.signature) + ); if (incompatibleType) { onlyDirectImport = `Non-JS-compatible Func Signature (${incompatibleType})`; } } else if (t.isGlobalType(node.descr) === true) { - const type = node.descr.valtype; + const type = /** @type {string} */ (node.descr.valtype); if (!JS_COMPAT_TYPES.has(type)) { onlyDirectImport = `Non-JS-compatible Global Type (${type})`; } @@ -167946,7 +176370,7 @@ module.exports = WebAssemblyParser; /***/ }), -/***/ 46119: +/***/ 11558: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; @@ -167957,8 +176381,8 @@ module.exports = WebAssemblyParser; -const Template = __webpack_require__(88070); -const WebAssemblyImportDependency = __webpack_require__(55884); +const Template = __webpack_require__(88835); +const WebAssemblyImportDependency = __webpack_require__(50992); /** @typedef {import("../Module")} Module */ /** @typedef {import("../ModuleGraph")} ModuleGraph */ @@ -167974,7 +176398,7 @@ const MANGLED_MODULE = "a"; /** * @param {ModuleGraph} moduleGraph the module graph * @param {Module} module the module - * @param {boolean} mangle mangle module and export names + * @param {boolean | undefined} mangle mangle module and export names * @returns {UsedWasmDependency[]} used dependencies and (mangled) name */ const getUsedDependencies = (moduleGraph, module, mangle) => { @@ -168019,7 +176443,7 @@ exports.MANGLED_MODULE = MANGLED_MODULE; /***/ }), -/***/ 15102: +/***/ 25240: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -168037,6 +176461,10 @@ exports.MANGLED_MODULE = MANGLED_MODULE; /** @type {WeakMap>} */ const enabledTypes = new WeakMap(); +/** + * @param {Compiler} compiler compiler instance + * @returns {Set} enabled types + */ const getEnabledTypes = compiler => { let set = enabledTypes.get(compiler); if (set === undefined) { @@ -168098,8 +176526,8 @@ class EnableWasmLoadingPlugin { switch (type) { case "fetch": { // TODO webpack 6 remove FetchCompileWasmPlugin - const FetchCompileWasmPlugin = __webpack_require__(23056); - const FetchCompileAsyncWasmPlugin = __webpack_require__(40968); + const FetchCompileWasmPlugin = __webpack_require__(24728); + const FetchCompileAsyncWasmPlugin = __webpack_require__(28862); new FetchCompileWasmPlugin({ mangleImports: compiler.options.optimization.mangleWasmImports }).apply(compiler); @@ -168108,9 +176536,9 @@ class EnableWasmLoadingPlugin { } case "async-node": { // TODO webpack 6 remove ReadFileCompileWasmPlugin - const ReadFileCompileWasmPlugin = __webpack_require__(67792); + const ReadFileCompileWasmPlugin = __webpack_require__(13843); // @ts-expect-error typescript bug for duplicate require - const ReadFileCompileAsyncWasmPlugin = __webpack_require__(80266); + const ReadFileCompileAsyncWasmPlugin = __webpack_require__(39382); new ReadFileCompileWasmPlugin({ mangleImports: compiler.options.optimization.mangleWasmImports }).apply(compiler); @@ -168119,7 +176547,7 @@ class EnableWasmLoadingPlugin { } case "async-node-module": { // @ts-expect-error typescript bug for duplicate require - const ReadFileCompileAsyncWasmPlugin = __webpack_require__(80266); + const ReadFileCompileAsyncWasmPlugin = __webpack_require__(39382); new ReadFileCompileAsyncWasmPlugin({ type, import: true }).apply( compiler ); @@ -168145,7 +176573,7 @@ module.exports = EnableWasmLoadingPlugin; /***/ }), -/***/ 40968: +/***/ 28862: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -168156,9 +176584,11 @@ module.exports = EnableWasmLoadingPlugin; -const RuntimeGlobals = __webpack_require__(34623); -const AsyncWasmLoadingRuntimeModule = __webpack_require__(13119); +const { WEBASSEMBLY_MODULE_TYPE_ASYNC } = __webpack_require__(92891); +const RuntimeGlobals = __webpack_require__(61539); +const AsyncWasmLoadingRuntimeModule = __webpack_require__(29023); +/** @typedef {import("../Chunk")} Chunk */ /** @typedef {import("../Compiler")} Compiler */ class FetchCompileAsyncWasmPlugin { @@ -168172,6 +176602,10 @@ class FetchCompileAsyncWasmPlugin { "FetchCompileAsyncWasmPlugin", compilation => { const globalWasmLoading = compilation.outputOptions.wasmLoading; + /** + * @param {Chunk} chunk chunk + * @returns {boolean} true, if wasm loading is enabled for the chunk + */ const isEnabledForChunk = chunk => { const options = chunk.getEntryOptions(); const wasmLoading = @@ -168180,6 +176614,10 @@ class FetchCompileAsyncWasmPlugin { : globalWasmLoading; return wasmLoading === "fetch"; }; + /** + * @param {string} path path to the wasm file + * @returns {string} code to load the wasm file + */ const generateLoadBinaryCode = path => `fetch(${RuntimeGlobals.publicPath} + ${path})`; @@ -168191,7 +176629,7 @@ class FetchCompileAsyncWasmPlugin { if ( !chunkGraph.hasModuleInGraph( chunk, - m => m.type === "webassembly/async" + m => m.type === WEBASSEMBLY_MODULE_TYPE_ASYNC ) ) { return; @@ -168215,7 +176653,7 @@ module.exports = FetchCompileAsyncWasmPlugin; /***/ }), -/***/ 23056: +/***/ 24728: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -168226,16 +176664,28 @@ module.exports = FetchCompileAsyncWasmPlugin; -const RuntimeGlobals = __webpack_require__(34623); -const WasmChunkLoadingRuntimeModule = __webpack_require__(10726); +const { WEBASSEMBLY_MODULE_TYPE_SYNC } = __webpack_require__(92891); +const RuntimeGlobals = __webpack_require__(61539); +const WasmChunkLoadingRuntimeModule = __webpack_require__(91214); +/** @typedef {import("../Chunk")} Chunk */ /** @typedef {import("../Compiler")} Compiler */ // TODO webpack 6 remove +const PLUGIN_NAME = "FetchCompileWasmPlugin"; + +/** + * @typedef {Object} FetchCompileWasmPluginOptions + * @property {boolean} [mangleImports] mangle imports + */ + class FetchCompileWasmPlugin { - constructor(options) { - this.options = options || {}; + /** + * @param {FetchCompileWasmPluginOptions} [options] options + */ + constructor(options = {}) { + this.options = options; } /** @@ -168244,48 +176694,53 @@ class FetchCompileWasmPlugin { * @returns {void} */ apply(compiler) { - compiler.hooks.thisCompilation.tap( - "FetchCompileWasmPlugin", - compilation => { - const globalWasmLoading = compilation.outputOptions.wasmLoading; - const isEnabledForChunk = chunk => { - const options = chunk.getEntryOptions(); - const wasmLoading = - options && options.wasmLoading !== undefined - ? options.wasmLoading - : globalWasmLoading; - return wasmLoading === "fetch"; - }; - const generateLoadBinaryCode = path => - `fetch(${RuntimeGlobals.publicPath} + ${path})`; + compiler.hooks.thisCompilation.tap(PLUGIN_NAME, compilation => { + const globalWasmLoading = compilation.outputOptions.wasmLoading; + /** + * @param {Chunk} chunk chunk + * @returns {boolean} true, if wasm loading is enabled for the chunk + */ + const isEnabledForChunk = chunk => { + const options = chunk.getEntryOptions(); + const wasmLoading = + options && options.wasmLoading !== undefined + ? options.wasmLoading + : globalWasmLoading; + return wasmLoading === "fetch"; + }; + /** + * @param {string} path path to the wasm file + * @returns {string} code to load the wasm file + */ + const generateLoadBinaryCode = path => + `fetch(${RuntimeGlobals.publicPath} + ${path})`; - compilation.hooks.runtimeRequirementInTree - .for(RuntimeGlobals.ensureChunkHandlers) - .tap("FetchCompileWasmPlugin", (chunk, set) => { - if (!isEnabledForChunk(chunk)) return; - const chunkGraph = compilation.chunkGraph; - if ( - !chunkGraph.hasModuleInGraph( - chunk, - m => m.type === "webassembly/sync" - ) - ) { - return; - } - set.add(RuntimeGlobals.moduleCache); - set.add(RuntimeGlobals.publicPath); - compilation.addRuntimeModule( + compilation.hooks.runtimeRequirementInTree + .for(RuntimeGlobals.ensureChunkHandlers) + .tap(PLUGIN_NAME, (chunk, set) => { + if (!isEnabledForChunk(chunk)) return; + const chunkGraph = compilation.chunkGraph; + if ( + !chunkGraph.hasModuleInGraph( chunk, - new WasmChunkLoadingRuntimeModule({ - generateLoadBinaryCode, - supportsStreaming: true, - mangleImports: this.options.mangleImports, - runtimeRequirements: set - }) - ); - }); - } - ); + m => m.type === WEBASSEMBLY_MODULE_TYPE_SYNC + ) + ) { + return; + } + set.add(RuntimeGlobals.moduleCache); + set.add(RuntimeGlobals.publicPath); + compilation.addRuntimeModule( + chunk, + new WasmChunkLoadingRuntimeModule({ + generateLoadBinaryCode, + supportsStreaming: true, + mangleImports: this.options.mangleImports, + runtimeRequirements: set + }) + ); + }); + }); } } @@ -168294,7 +176749,7 @@ module.exports = FetchCompileWasmPlugin; /***/ }), -/***/ 34633: +/***/ 51916: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -168305,9 +176760,10 @@ module.exports = FetchCompileWasmPlugin; -const RuntimeGlobals = __webpack_require__(34623); -const JsonpChunkLoadingRuntimeModule = __webpack_require__(93611); +const RuntimeGlobals = __webpack_require__(61539); +const JsonpChunkLoadingRuntimeModule = __webpack_require__(13229); +/** @typedef {import("../Chunk")} Chunk */ /** @typedef {import("../Compiler")} Compiler */ class JsonpChunkLoadingPlugin { @@ -168321,6 +176777,10 @@ class JsonpChunkLoadingPlugin { "JsonpChunkLoadingPlugin", compilation => { const globalChunkLoading = compilation.outputOptions.chunkLoading; + /** + * @param {Chunk} chunk chunk + * @returns {boolean} true, if wasm loading is enabled for the chunk + */ const isEnabledForChunk = chunk => { const options = chunk.getEntryOptions(); const chunkLoading = @@ -168330,6 +176790,10 @@ class JsonpChunkLoadingPlugin { return chunkLoading === "jsonp"; }; const onceForChunkSet = new WeakSet(); + /** + * @param {Chunk} chunk chunk + * @param {Set} set runtime requirements + */ const handler = (chunk, set) => { if (onceForChunkSet.has(chunk)) return; onceForChunkSet.add(chunk); @@ -168393,7 +176857,7 @@ module.exports = JsonpChunkLoadingPlugin; /***/ }), -/***/ 93611: +/***/ 13229: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -168404,15 +176868,16 @@ module.exports = JsonpChunkLoadingPlugin; const { SyncWaterfallHook } = __webpack_require__(70793); -const Compilation = __webpack_require__(38292); -const RuntimeGlobals = __webpack_require__(34623); -const RuntimeModule = __webpack_require__(81196); -const Template = __webpack_require__(88070); -const chunkHasJs = (__webpack_require__(96230).chunkHasJs); -const { getInitialChunkIds } = __webpack_require__(67164); -const compileBooleanMatcher = __webpack_require__(25526); +const Compilation = __webpack_require__(20417); +const RuntimeGlobals = __webpack_require__(61539); +const RuntimeModule = __webpack_require__(21296); +const Template = __webpack_require__(88835); +const chunkHasJs = (__webpack_require__(70061).chunkHasJs); +const { getInitialChunkIds } = __webpack_require__(61554); +const compileBooleanMatcher = __webpack_require__(1258); /** @typedef {import("../Chunk")} Chunk */ +/** @typedef {import("../ChunkGraph")} ChunkGraph */ /** * @typedef {Object} JsonpCompilationPluginHooks @@ -168445,6 +176910,9 @@ class JsonpChunkLoadingRuntimeModule extends RuntimeModule { return hooks; } + /** + * @param {Set} runtimeRequirements runtime requirements + */ constructor(runtimeRequirements) { super("jsonp chunk loading", RuntimeModule.STAGE_ATTACH); this._runtimeRequirements = runtimeRequirements; @@ -168465,10 +176933,10 @@ class JsonpChunkLoadingRuntimeModule extends RuntimeModule { } /** - * @returns {string} runtime code + * @returns {string | null} runtime code */ generate() { - const { chunkGraph, compilation, chunk } = this; + const compilation = /** @type {Compilation} */ (this.compilation); const { runtimeTemplate, outputOptions: { @@ -168504,9 +176972,14 @@ class JsonpChunkLoadingRuntimeModule extends RuntimeModule { const withPreload = this._runtimeRequirements.has( RuntimeGlobals.preloadChunkHandlers ); + const withFetchPriority = this._runtimeRequirements.has( + RuntimeGlobals.hasFetchPriority + ); const chunkLoadingGlobalExpr = `${globalObject}[${JSON.stringify( chunkLoadingGlobal )}]`; + const chunkGraph = /** @type {ChunkGraph} */ (this.chunkGraph); + const chunk = /** @type {Chunk} */ (this.chunk); const conditionMap = chunkGraph.getChunkConditionMap(chunk, chunkHasJs); const hasJsMatcher = compileBooleanMatcher(conditionMap); const initialChunkIds = getInitialChunkIds(chunk, chunkGraph, chunkHasJs); @@ -168534,7 +177007,7 @@ class JsonpChunkLoadingRuntimeModule extends RuntimeModule { withLoading ? Template.asString([ `${fn}.j = ${runtimeTemplate.basicFunction( - "chunkId, promises", + `chunkId, promises${withFetchPriority ? ", fetchPriority" : ""}`, hasJsMatcher !== false ? Template.indent([ "// JSONP chunk loading for javascript", @@ -168586,9 +177059,15 @@ class JsonpChunkLoadingRuntimeModule extends RuntimeModule { "}" ] )};`, - `${RuntimeGlobals.loadScript}(url, loadingEnded, "chunk-" + chunkId, chunkId);` + `${ + RuntimeGlobals.loadScript + }(url, loadingEnded, "chunk-" + chunkId, chunkId${ + withFetchPriority ? ", fetchPriority" : "" + });` ]), - "} else installedChunks[chunkId] = 0;" + hasJsMatcher === true + ? "}" + : "} else installedChunks[chunkId] = 0;" ]), "}" ]), @@ -168649,7 +177128,7 @@ class JsonpChunkLoadingRuntimeModule extends RuntimeModule { linkPreload.call( Template.asString([ "var link = document.createElement('link');", - scriptType + scriptType && scriptType !== "module" ? `link.type = ${JSON.stringify(scriptType)};` : "", "link.charset = 'utf-8';", @@ -168658,8 +177137,10 @@ class JsonpChunkLoadingRuntimeModule extends RuntimeModule { `link.setAttribute("nonce", ${RuntimeGlobals.scriptNonce});` ), "}", - 'link.rel = "preload";', - 'link.as = "script";', + scriptType === "module" + ? 'link.rel = "modulepreload";' + : 'link.rel = "preload";', + scriptType === "module" ? "" : 'link.as = "script";', `link.href = ${RuntimeGlobals.publicPath} + ${RuntimeGlobals.getChunkScriptFilename}(chunkId);`, crossOriginLoading ? crossOriginLoading === "use-credentials" @@ -168821,7 +177302,7 @@ class JsonpChunkLoadingRuntimeModule extends RuntimeModule { "}" ]), "}", - "if(runtime) var result = runtime(__webpack_require__);" + `if(runtime) var result = runtime(${RuntimeGlobals.require});` ]), "}", "if(parentChunkLoadingFunction) parentChunkLoadingFunction(data);", @@ -168854,7 +177335,7 @@ module.exports = JsonpChunkLoadingRuntimeModule; /***/ }), -/***/ 93225: +/***/ 21185: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -168865,9 +177346,9 @@ module.exports = JsonpChunkLoadingRuntimeModule; -const ArrayPushCallbackChunkFormatPlugin = __webpack_require__(15006); -const EnableChunkLoadingPlugin = __webpack_require__(14622); -const JsonpChunkLoadingRuntimeModule = __webpack_require__(93611); +const ArrayPushCallbackChunkFormatPlugin = __webpack_require__(44717); +const EnableChunkLoadingPlugin = __webpack_require__(51050); +const JsonpChunkLoadingRuntimeModule = __webpack_require__(13229); /** @typedef {import("../Chunk")} Chunk */ /** @typedef {import("../Compilation")} Compilation */ @@ -168900,7 +177381,7 @@ module.exports = JsonpTemplatePlugin; /***/ }), -/***/ 20133: +/***/ 44728: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -168912,18 +177393,18 @@ module.exports = JsonpTemplatePlugin; const util = __webpack_require__(73837); -const webpackOptionsSchemaCheck = __webpack_require__(14509); -const webpackOptionsSchema = __webpack_require__(9183); -const Compiler = __webpack_require__(27551); -const MultiCompiler = __webpack_require__(25939); -const WebpackOptionsApply = __webpack_require__(77815); +const webpackOptionsSchemaCheck = __webpack_require__(19366); +const webpackOptionsSchema = __webpack_require__(40138); +const Compiler = __webpack_require__(18771); +const MultiCompiler = __webpack_require__(85694); +const WebpackOptionsApply = __webpack_require__(62721); const { applyWebpackOptionsDefaults, applyWebpackOptionsBaseDefaults -} = __webpack_require__(62484); -const { getNormalizedWebpackOptions } = __webpack_require__(22941); -const NodeEnvironmentPlugin = __webpack_require__(49896); -const memoize = __webpack_require__(27319); +} = __webpack_require__(36569); +const { getNormalizedWebpackOptions } = __webpack_require__(69645); +const NodeEnvironmentPlugin = __webpack_require__(98084); +const memoize = __webpack_require__(62377); /** @typedef {import("../declarations/WebpackOptions").WebpackOptions} WebpackOptions */ /** @typedef {import("./Compiler").WatchOptions} WatchOptions */ @@ -168931,7 +177412,7 @@ const memoize = __webpack_require__(27319); /** @typedef {import("./MultiStats")} MultiStats */ /** @typedef {import("./Stats")} Stats */ -const getValidateSchema = memoize(() => __webpack_require__(60395)); +const getValidateSchema = memoize(() => __webpack_require__(97848)); /** * @template T @@ -168967,7 +177448,10 @@ const createMultiCompiler = (childOptions, options) => { const createCompiler = rawOptions => { const options = getNormalizedWebpackOptions(rawOptions); applyWebpackOptionsBaseDefaults(options); - const compiler = new Compiler(options.context, options); + const compiler = new Compiler( + /** @type {string} */ (options.context), + options + ); new NodeEnvironmentPlugin({ infrastructureLogging: options.infrastructureLogging }).apply(compiler); @@ -168975,7 +177459,7 @@ const createCompiler = rawOptions => { for (const plugin of options.plugins) { if (typeof plugin === "function") { plugin.call(compiler, compiler); - } else { + } else if (plugin) { plugin.apply(compiler); } } @@ -169002,6 +177486,11 @@ const createCompiler = rawOptions => { * @returns {MultiCompiler} the multi compiler object */ +/** + * @template T + * @param {Array | T} options options + * @returns {Array} array of options + */ const asArray = options => Array.isArray(options) ? Array.from(options) : [options]; @@ -169009,7 +177498,7 @@ const webpack = /** @type {WebpackFunctionSingle & WebpackFunctionMulti} */ ( /** * @param {WebpackOptions | (ReadonlyArray & MultiCompilerOptions)} options options * @param {Callback & Callback=} callback callback - * @returns {Compiler | MultiCompiler} + * @returns {Compiler | MultiCompiler} Compiler or MultiCompiler */ (options, callback) => { const create = () => { @@ -169023,6 +177512,7 @@ const webpack = /** @type {WebpackFunctionSingle & WebpackFunctionMulti} */ ( } /** @type {MultiCompiler|Compiler} */ let compiler; + /** @type {boolean | undefined} */ let watch = false; /** @type {WatchOptions|WatchOptions[]} */ let watchOptions; @@ -169079,7 +177569,7 @@ module.exports = webpack; /***/ }), -/***/ 97970: +/***/ 32405: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -169090,10 +177580,11 @@ module.exports = webpack; -const RuntimeGlobals = __webpack_require__(34623); -const StartupChunkDependenciesPlugin = __webpack_require__(13824); -const ImportScriptsChunkLoadingRuntimeModule = __webpack_require__(31157); +const RuntimeGlobals = __webpack_require__(61539); +const StartupChunkDependenciesPlugin = __webpack_require__(81459); +const ImportScriptsChunkLoadingRuntimeModule = __webpack_require__(11713); +/** @typedef {import("../Chunk")} Chunk */ /** @typedef {import("../Compiler")} Compiler */ class ImportScriptsChunkLoadingPlugin { @@ -169111,6 +177602,10 @@ class ImportScriptsChunkLoadingPlugin { "ImportScriptsChunkLoadingPlugin", compilation => { const globalChunkLoading = compilation.outputOptions.chunkLoading; + /** + * @param {Chunk} chunk chunk + * @returns {boolean} true, if wasm loading is enabled for the chunk + */ const isEnabledForChunk = chunk => { const options = chunk.getEntryOptions(); const chunkLoading = @@ -169120,6 +177615,10 @@ class ImportScriptsChunkLoadingPlugin { return chunkLoading === "import-scripts"; }; const onceForChunkSet = new WeakSet(); + /** + * @param {Chunk} chunk chunk + * @param {Set} set runtime requirements + */ const handler = (chunk, set) => { if (onceForChunkSet.has(chunk)) return; onceForChunkSet.add(chunk); @@ -169181,7 +177680,7 @@ module.exports = ImportScriptsChunkLoadingPlugin; /***/ }), -/***/ 31157: +/***/ 11713: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -169191,20 +177690,26 @@ module.exports = ImportScriptsChunkLoadingPlugin; -const RuntimeGlobals = __webpack_require__(34623); -const RuntimeModule = __webpack_require__(81196); -const Template = __webpack_require__(88070); +const RuntimeGlobals = __webpack_require__(61539); +const RuntimeModule = __webpack_require__(21296); +const Template = __webpack_require__(88835); const { getChunkFilenameTemplate, chunkHasJs -} = __webpack_require__(96230); -const { getInitialChunkIds } = __webpack_require__(67164); -const compileBooleanMatcher = __webpack_require__(25526); -const { getUndoPath } = __webpack_require__(63146); +} = __webpack_require__(70061); +const { getInitialChunkIds } = __webpack_require__(61554); +const compileBooleanMatcher = __webpack_require__(1258); +const { getUndoPath } = __webpack_require__(97451); /** @typedef {import("../Chunk")} Chunk */ +/** @typedef {import("../ChunkGraph")} ChunkGraph */ +/** @typedef {import("../Compilation")} Compilation */ class ImportScriptsChunkLoadingRuntimeModule extends RuntimeModule { + /** + * @param {Set} runtimeRequirements runtime requirements + * @param {boolean} withCreateScriptUrl with createScriptUrl support + */ constructor(runtimeRequirements, withCreateScriptUrl) { super("importScripts chunk loading", RuntimeModule.STAGE_ATTACH); this.runtimeRequirements = runtimeRequirements; @@ -169221,8 +177726,9 @@ class ImportScriptsChunkLoadingRuntimeModule extends RuntimeModule { if (options && options.baseUri) { return `${RuntimeGlobals.baseURI} = ${JSON.stringify(options.baseUri)};`; } - const outputName = this.compilation.getPath( - getChunkFilenameTemplate(chunk, this.compilation.outputOptions), + const compilation = /** @type {Compilation} */ (this.compilation); + const outputName = compilation.getPath( + getChunkFilenameTemplate(chunk, compilation.outputOptions), { chunk, contentHashType: "javascript" @@ -169230,7 +177736,7 @@ class ImportScriptsChunkLoadingRuntimeModule extends RuntimeModule { ); const rootOutputDir = getUndoPath( outputName, - this.compilation.outputOptions.path, + /** @type {string} */ (compilation.outputOptions.path), false ); return `${RuntimeGlobals.baseURI} = self.location + ${JSON.stringify( @@ -169239,19 +177745,10 @@ class ImportScriptsChunkLoadingRuntimeModule extends RuntimeModule { } /** - * @returns {string} runtime code + * @returns {string | null} runtime code */ generate() { - const { - chunk, - chunkGraph, - compilation: { - runtimeTemplate, - outputOptions: { chunkLoadingGlobal, hotUpdateGlobal } - }, - _withCreateScriptUrl: withCreateScriptUrl - } = this; - const globalObject = runtimeTemplate.globalObject; + const compilation = /** @type {Compilation} */ (this.compilation); const fn = RuntimeGlobals.ensureChunkHandlers; const withBaseURI = this.runtimeRequirements.has(RuntimeGlobals.baseURI); const withLoading = this.runtimeRequirements.has( @@ -169263,9 +177760,12 @@ class ImportScriptsChunkLoadingRuntimeModule extends RuntimeModule { const withHmrManifest = this.runtimeRequirements.has( RuntimeGlobals.hmrDownloadManifest ); + const globalObject = compilation.runtimeTemplate.globalObject; const chunkLoadingGlobalExpr = `${globalObject}[${JSON.stringify( - chunkLoadingGlobal + compilation.outputOptions.chunkLoadingGlobal )}]`; + const chunkGraph = /** @type {ChunkGraph} */ (this.chunkGraph); + const chunk = /** @type {Chunk} */ (this.chunk); const hasJsMatcher = compileBooleanMatcher( chunkGraph.getChunkConditionMap(chunk, chunkHasJs) ); @@ -169274,6 +177774,8 @@ class ImportScriptsChunkLoadingRuntimeModule extends RuntimeModule { const stateExpression = withHmr ? `${RuntimeGlobals.hmrRuntimeStatePrefix}_importScripts` : undefined; + const runtimeTemplate = compilation.runtimeTemplate; + const { _withCreateScriptUrl: withCreateScriptUrl } = this; return Template.asString([ withBaseURI ? this._generateBaseUri(chunk) : "// no baseURI", @@ -169307,7 +177809,7 @@ class ImportScriptsChunkLoadingRuntimeModule extends RuntimeModule { "}" ]), "}", - "if(runtime) runtime(__webpack_require__);", + `if(runtime) runtime(${RuntimeGlobals.require});`, "while(chunkIds.length)", Template.indent("installedChunks[chunkIds.pop()] = 1;"), "parentChunkLoadingFunction(data);" @@ -169352,7 +177854,7 @@ class ImportScriptsChunkLoadingRuntimeModule extends RuntimeModule { Template.indent([ "var success = false;", `${globalObject}[${JSON.stringify( - hotUpdateGlobal + compilation.outputOptions.hotUpdateGlobal )}] = ${runtimeTemplate.basicFunction("_, moreModules, runtime", [ "for(var moduleId in moreModules) {", Template.indent([ @@ -169427,7 +177929,7 @@ module.exports = ImportScriptsChunkLoadingRuntimeModule; /***/ }), -/***/ 71270: +/***/ 75919: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -169438,8 +177940,8 @@ module.exports = ImportScriptsChunkLoadingRuntimeModule; -const ArrayPushCallbackChunkFormatPlugin = __webpack_require__(15006); -const EnableChunkLoadingPlugin = __webpack_require__(14622); +const ArrayPushCallbackChunkFormatPlugin = __webpack_require__(44717); +const EnableChunkLoadingPlugin = __webpack_require__(51050); /** @typedef {import("../Compiler")} Compiler */ @@ -169460,7 +177962,7 @@ module.exports = WebWorkerTemplatePlugin; /***/ }), -/***/ 14509: +/***/ 19366: /***/ (function(module) { /* @@ -169468,11 +177970,11 @@ module.exports = WebWorkerTemplatePlugin; * DO NOT MODIFY BY HAND. * Run `yarn special-lint-fix` to update */ -const e=/^(?:[A-Za-z]:[\\/]|\\\\|\/)/;module.exports=we,module.exports["default"]=we;const t={amd:{$ref:"#/definitions/Amd"},bail:{$ref:"#/definitions/Bail"},cache:{$ref:"#/definitions/CacheOptions"},context:{$ref:"#/definitions/Context"},dependencies:{$ref:"#/definitions/Dependencies"},devServer:{$ref:"#/definitions/DevServer"},devtool:{$ref:"#/definitions/DevTool"},entry:{$ref:"#/definitions/Entry"},experiments:{$ref:"#/definitions/Experiments"},externals:{$ref:"#/definitions/Externals"},externalsPresets:{$ref:"#/definitions/ExternalsPresets"},externalsType:{$ref:"#/definitions/ExternalsType"},ignoreWarnings:{$ref:"#/definitions/IgnoreWarnings"},infrastructureLogging:{$ref:"#/definitions/InfrastructureLogging"},loader:{$ref:"#/definitions/Loader"},mode:{$ref:"#/definitions/Mode"},module:{$ref:"#/definitions/ModuleOptions"},name:{$ref:"#/definitions/Name"},node:{$ref:"#/definitions/Node"},optimization:{$ref:"#/definitions/Optimization"},output:{$ref:"#/definitions/Output"},parallelism:{$ref:"#/definitions/Parallelism"},performance:{$ref:"#/definitions/Performance"},plugins:{$ref:"#/definitions/Plugins"},profile:{$ref:"#/definitions/Profile"},recordsInputPath:{$ref:"#/definitions/RecordsInputPath"},recordsOutputPath:{$ref:"#/definitions/RecordsOutputPath"},recordsPath:{$ref:"#/definitions/RecordsPath"},resolve:{$ref:"#/definitions/Resolve"},resolveLoader:{$ref:"#/definitions/ResolveLoader"},snapshot:{$ref:"#/definitions/SnapshotOptions"},stats:{$ref:"#/definitions/StatsValue"},target:{$ref:"#/definitions/Target"},watch:{$ref:"#/definitions/Watch"},watchOptions:{$ref:"#/definitions/WatchOptions"}},n=Object.prototype.hasOwnProperty,r={allowCollectingMemory:{type:"boolean"},buildDependencies:{type:"object",additionalProperties:{type:"array",items:{type:"string",minLength:1}}},cacheDirectory:{type:"string",absolutePath:!0},cacheLocation:{type:"string",absolutePath:!0},compression:{enum:[!1,"gzip","brotli"]},hashAlgorithm:{type:"string"},idleTimeout:{type:"number",minimum:0},idleTimeoutAfterLargeChanges:{type:"number",minimum:0},idleTimeoutForInitialStore:{type:"number",minimum:0},immutablePaths:{type:"array",items:{anyOf:[{instanceof:"RegExp"},{type:"string",absolutePath:!0,minLength:1}]}},managedPaths:{type:"array",items:{anyOf:[{instanceof:"RegExp"},{type:"string",absolutePath:!0,minLength:1}]}},maxAge:{type:"number",minimum:0},maxMemoryGenerations:{type:"number",minimum:0},memoryCacheUnaffected:{type:"boolean"},name:{type:"string"},profile:{type:"boolean"},store:{enum:["pack"]},type:{enum:["filesystem"]},version:{type:"string"}};function s(t,{instancePath:o="",parentData:a,parentDataProperty:i,rootData:l=t}={}){let p=null,u=0;const f=u;let c=!1;const m=u;if(!1!==t){const e={params:{}};null===p?p=[e]:p.push(e),u++}var y=m===u;if(c=c||y,!c){const s=u;if(u==u)if(t&&"object"==typeof t&&!Array.isArray(t)){let e;if(void 0===t.type&&(e="type")){const t={params:{missingProperty:e}};null===p?p=[t]:p.push(t),u++}else{const e=u;for(const e in t)if("cacheUnaffected"!==e&&"maxGenerations"!==e&&"type"!==e){const t={params:{additionalProperty:e}};null===p?p=[t]:p.push(t),u++;break}if(e===u){if(void 0!==t.cacheUnaffected){const e=u;if("boolean"!=typeof t.cacheUnaffected){const e={params:{type:"boolean"}};null===p?p=[e]:p.push(e),u++}var h=e===u}else h=!0;if(h){if(void 0!==t.maxGenerations){let e=t.maxGenerations;const n=u;if(u===n)if("number"==typeof e){if(e<1||isNaN(e)){const e={params:{comparison:">=",limit:1}};null===p?p=[e]:p.push(e),u++}}else{const e={params:{type:"number"}};null===p?p=[e]:p.push(e),u++}h=n===u}else h=!0;if(h)if(void 0!==t.type){const e=u;if("memory"!==t.type){const e={params:{}};null===p?p=[e]:p.push(e),u++}h=e===u}else h=!0}}}}else{const e={params:{type:"object"}};null===p?p=[e]:p.push(e),u++}if(y=s===u,c=c||y,!c){const s=u;if(u==u)if(t&&"object"==typeof t&&!Array.isArray(t)){let s;if(void 0===t.type&&(s="type")){const e={params:{missingProperty:s}};null===p?p=[e]:p.push(e),u++}else{const s=u;for(const e in t)if(!n.call(r,e)){const t={params:{additionalProperty:e}};null===p?p=[t]:p.push(t),u++;break}if(s===u){if(void 0!==t.allowCollectingMemory){const e=u;if("boolean"!=typeof t.allowCollectingMemory){const e={params:{type:"boolean"}};null===p?p=[e]:p.push(e),u++}var d=e===u}else d=!0;if(d){if(void 0!==t.buildDependencies){let e=t.buildDependencies;const n=u;if(u===n)if(e&&"object"==typeof e&&!Array.isArray(e))for(const t in e){let n=e[t];const r=u;if(u===r)if(Array.isArray(n)){const e=n.length;for(let t=0;t=",limit:0}};null===p?p=[e]:p.push(e),u++}}else{const e={params:{type:"number"}};null===p?p=[e]:p.push(e),u++}d=n===u}else d=!0;if(d){if(void 0!==t.idleTimeoutAfterLargeChanges){let e=t.idleTimeoutAfterLargeChanges;const n=u;if(u===n)if("number"==typeof e){if(e<0||isNaN(e)){const e={params:{comparison:">=",limit:0}};null===p?p=[e]:p.push(e),u++}}else{const e={params:{type:"number"}};null===p?p=[e]:p.push(e),u++}d=n===u}else d=!0;if(d){if(void 0!==t.idleTimeoutForInitialStore){let e=t.idleTimeoutForInitialStore;const n=u;if(u===n)if("number"==typeof e){if(e<0||isNaN(e)){const e={params:{comparison:">=",limit:0}};null===p?p=[e]:p.push(e),u++}}else{const e={params:{type:"number"}};null===p?p=[e]:p.push(e),u++}d=n===u}else d=!0;if(d){if(void 0!==t.immutablePaths){let n=t.immutablePaths;const r=u;if(u===r)if(Array.isArray(n)){const t=n.length;for(let r=0;r=",limit:0}};null===p?p=[e]:p.push(e),u++}}else{const e={params:{type:"number"}};null===p?p=[e]:p.push(e),u++}d=n===u}else d=!0;if(d){if(void 0!==t.maxMemoryGenerations){let e=t.maxMemoryGenerations;const n=u;if(u===n)if("number"==typeof e){if(e<0||isNaN(e)){const e={params:{comparison:">=",limit:0}};null===p?p=[e]:p.push(e),u++}}else{const e={params:{type:"number"}};null===p?p=[e]:p.push(e),u++}d=n===u}else d=!0;if(d){if(void 0!==t.memoryCacheUnaffected){const e=u;if("boolean"!=typeof t.memoryCacheUnaffected){const e={params:{type:"boolean"}};null===p?p=[e]:p.push(e),u++}d=e===u}else d=!0;if(d){if(void 0!==t.name){const e=u;if("string"!=typeof t.name){const e={params:{type:"string"}};null===p?p=[e]:p.push(e),u++}d=e===u}else d=!0;if(d){if(void 0!==t.profile){const e=u;if("boolean"!=typeof t.profile){const e={params:{type:"boolean"}};null===p?p=[e]:p.push(e),u++}d=e===u}else d=!0;if(d){if(void 0!==t.store){const e=u;if("pack"!==t.store){const e={params:{}};null===p?p=[e]:p.push(e),u++}d=e===u}else d=!0;if(d){if(void 0!==t.type){const e=u;if("filesystem"!==t.type){const e={params:{}};null===p?p=[e]:p.push(e),u++}d=e===u}else d=!0;if(d)if(void 0!==t.version){const e=u;if("string"!=typeof t.version){const e={params:{type:"string"}};null===p?p=[e]:p.push(e),u++}d=e===u}else d=!0}}}}}}}}}}}}}}}}}}}}else{const e={params:{type:"object"}};null===p?p=[e]:p.push(e),u++}y=s===u,c=c||y}}if(!c){const e={params:{}};return null===p?p=[e]:p.push(e),u++,s.errors=p,!1}return u=f,null!==p&&(f?p.length=f:p=null),s.errors=p,0===u}function o(e,{instancePath:t="",parentData:n,parentDataProperty:r,rootData:a=e}={}){let i=null,l=0;const p=l;let u=!1;const f=l;if(!0!==e){const e={params:{}};null===i?i=[e]:i.push(e),l++}var c=f===l;if(u=u||c,!u){const o=l;s(e,{instancePath:t,parentData:n,parentDataProperty:r,rootData:a})||(i=null===i?s.errors:i.concat(s.errors),l=i.length),c=o===l,u=u||c}if(!u){const e={params:{}};return null===i?i=[e]:i.push(e),l++,o.errors=i,!1}return l=p,null!==i&&(p?i.length=p:i=null),o.errors=i,0===l}const a={asyncChunks:{type:"boolean"},baseUri:{type:"string"},chunkLoading:{$ref:"#/definitions/ChunkLoading"},dependOn:{anyOf:[{type:"array",items:{type:"string",minLength:1},minItems:1,uniqueItems:!0},{type:"string",minLength:1}]},filename:{$ref:"#/definitions/EntryFilename"},import:{$ref:"#/definitions/EntryItem"},layer:{$ref:"#/definitions/Layer"},library:{$ref:"#/definitions/LibraryOptions"},publicPath:{$ref:"#/definitions/PublicPath"},runtime:{$ref:"#/definitions/EntryRuntime"},wasmLoading:{$ref:"#/definitions/WasmLoading"}};function i(e,{instancePath:t="",parentData:n,parentDataProperty:r,rootData:s=e}={}){let o=null,a=0;const l=a;let p=!1;const u=a;if(!1!==e){const e={params:{}};null===o?o=[e]:o.push(e),a++}var f=u===a;if(p=p||f,!p){const t=a,n=a;let r=!1;const s=a;if("jsonp"!==e&&"import-scripts"!==e&&"require"!==e&&"async-node"!==e&&"import"!==e){const e={params:{}};null===o?o=[e]:o.push(e),a++}var c=s===a;if(r=r||c,!r){const t=a;if("string"!=typeof e){const e={params:{type:"string"}};null===o?o=[e]:o.push(e),a++}c=t===a,r=r||c}if(r)a=n,null!==o&&(n?o.length=n:o=null);else{const e={params:{}};null===o?o=[e]:o.push(e),a++}f=t===a,p=p||f}if(!p){const e={params:{}};return null===o?o=[e]:o.push(e),a++,i.errors=o,!1}return a=l,null!==o&&(l?o.length=l:o=null),i.errors=o,0===a}function l(t,{instancePath:n="",parentData:r,parentDataProperty:s,rootData:o=t}={}){let a=null,i=0;const p=i;let u=!1,f=null;const c=i,m=i;let y=!1;const h=i;if(i===h)if("string"==typeof t){if(t.includes("!")||!1!==e.test(t)){const e={params:{}};null===a?a=[e]:a.push(e),i++}else if(t.length<1){const e={params:{}};null===a?a=[e]:a.push(e),i++}}else{const e={params:{type:"string"}};null===a?a=[e]:a.push(e),i++}var d=h===i;if(y=y||d,!y){const e=i;if(!(t instanceof Function)){const e={params:{}};null===a?a=[e]:a.push(e),i++}d=e===i,y=y||d}if(y)i=m,null!==a&&(m?a.length=m:a=null);else{const e={params:{}};null===a?a=[e]:a.push(e),i++}if(c===i&&(u=!0,f=0),!u){const e={params:{passingSchemas:f}};return null===a?a=[e]:a.push(e),i++,l.errors=a,!1}return i=p,null!==a&&(p?a.length=p:a=null),l.errors=a,0===i}function p(e,{instancePath:t="",parentData:n,parentDataProperty:r,rootData:s=e}={}){let o=null,a=0;const i=a;let l=!1;const u=a;if("string"!=typeof e){const e={params:{type:"string"}};null===o?o=[e]:o.push(e),a++}var f=u===a;if(l=l||f,!l){const t=a;if(a==a)if(e&&"object"==typeof e&&!Array.isArray(e)){const t=a;for(const t in e)if("amd"!==t&&"commonjs"!==t&&"commonjs2"!==t&&"root"!==t){const e={params:{additionalProperty:t}};null===o?o=[e]:o.push(e),a++;break}if(t===a){if(void 0!==e.amd){const t=a;if("string"!=typeof e.amd){const e={params:{type:"string"}};null===o?o=[e]:o.push(e),a++}var c=t===a}else c=!0;if(c){if(void 0!==e.commonjs){const t=a;if("string"!=typeof e.commonjs){const e={params:{type:"string"}};null===o?o=[e]:o.push(e),a++}c=t===a}else c=!0;if(c){if(void 0!==e.commonjs2){const t=a;if("string"!=typeof e.commonjs2){const e={params:{type:"string"}};null===o?o=[e]:o.push(e),a++}c=t===a}else c=!0;if(c)if(void 0!==e.root){const t=a;if("string"!=typeof e.root){const e={params:{type:"string"}};null===o?o=[e]:o.push(e),a++}c=t===a}else c=!0}}}}else{const e={params:{type:"object"}};null===o?o=[e]:o.push(e),a++}f=t===a,l=l||f}if(!l){const e={params:{}};return null===o?o=[e]:o.push(e),a++,p.errors=o,!1}return a=i,null!==o&&(i?o.length=i:o=null),p.errors=o,0===a}function u(e,{instancePath:t="",parentData:n,parentDataProperty:r,rootData:s=e}={}){let o=null,a=0;const i=a;let l=!1;const p=a;if(a===p)if(Array.isArray(e))if(e.length<1){const e={params:{limit:1}};null===o?o=[e]:o.push(e),a++}else{const t=e.length;for(let n=0;n1){const r={};for(;n--;){let s=t[n];if("string"==typeof s){if("number"==typeof r[s]){e=r[s];const t={params:{i:n,j:e}};null===p?p=[t]:p.push(t),u++;break}r[s]=n}}}}}else{const e={params:{type:"array"}};null===p?p=[e]:p.push(e),u++}var g=o===u;if(s=s||g,!s){const e=u;if(u===e)if("string"==typeof t){if(t.length<1){const e={params:{}};null===p?p=[e]:p.push(e),u++}}else{const e={params:{type:"string"}};null===p?p=[e]:p.push(e),u++}g=e===u,s=s||g}if(!s){const e={params:{}};return null===p?p=[e]:p.push(e),u++,y.errors=p,!1}u=r,null!==p&&(r?p.length=r:p=null),h=n===u}else h=!0;if(h){if(void 0!==e.filename){const n=u;l(e.filename,{instancePath:t+"/filename",parentData:e,parentDataProperty:"filename",rootData:o})||(p=null===p?l.errors:p.concat(l.errors),u=p.length),h=n===u}else h=!0;if(h){if(void 0!==e.import){let t=e.import;const n=u,r=u;let s=!1;const o=u;if(u===o)if(Array.isArray(t))if(t.length<1){const e={params:{limit:1}};null===p?p=[e]:p.push(e),u++}else{var b=!0;const e=t.length;for(let n=0;n1){const r={};for(;n--;){let s=t[n];if("string"==typeof s){if("number"==typeof r[s]){e=r[s];const t={params:{i:n,j:e}};null===p?p=[t]:p.push(t),u++;break}r[s]=n}}}}}else{const e={params:{type:"array"}};null===p?p=[e]:p.push(e),u++}var v=o===u;if(s=s||v,!s){const e=u;if(u===e)if("string"==typeof t){if(t.length<1){const e={params:{}};null===p?p=[e]:p.push(e),u++}}else{const e={params:{type:"string"}};null===p?p=[e]:p.push(e),u++}v=e===u,s=s||v}if(!s){const e={params:{}};return null===p?p=[e]:p.push(e),u++,y.errors=p,!1}u=r,null!==p&&(r?p.length=r:p=null),h=n===u}else h=!0;if(h){if(void 0!==e.layer){let t=e.layer;const n=u,r=u;let s=!1;const o=u;if(null!==t){const e={params:{}};null===p?p=[e]:p.push(e),u++}var D=o===u;if(s=s||D,!s){const e=u;if(u===e)if("string"==typeof t){if(t.length<1){const e={params:{}};null===p?p=[e]:p.push(e),u++}}else{const e={params:{type:"string"}};null===p?p=[e]:p.push(e),u++}D=e===u,s=s||D}if(!s){const e={params:{}};return null===p?p=[e]:p.push(e),u++,y.errors=p,!1}u=r,null!==p&&(r?p.length=r:p=null),h=n===u}else h=!0;if(h){if(void 0!==e.library){const n=u;f(e.library,{instancePath:t+"/library",parentData:e,parentDataProperty:"library",rootData:o})||(p=null===p?f.errors:p.concat(f.errors),u=p.length),h=n===u}else h=!0;if(h){if(void 0!==e.publicPath){const n=u;c(e.publicPath,{instancePath:t+"/publicPath",parentData:e,parentDataProperty:"publicPath",rootData:o})||(p=null===p?c.errors:p.concat(c.errors),u=p.length),h=n===u}else h=!0;if(h){if(void 0!==e.runtime){let t=e.runtime;const n=u,r=u;let s=!1;const o=u;if(!1!==t){const e={params:{}};null===p?p=[e]:p.push(e),u++}var P=o===u;if(s=s||P,!s){const e=u;if(u===e)if("string"==typeof t){if(t.length<1){const e={params:{}};null===p?p=[e]:p.push(e),u++}}else{const e={params:{type:"string"}};null===p?p=[e]:p.push(e),u++}P=e===u,s=s||P}if(!s){const e={params:{}};return null===p?p=[e]:p.push(e),u++,y.errors=p,!1}u=r,null!==p&&(r?p.length=r:p=null),h=n===u}else h=!0;if(h)if(void 0!==e.wasmLoading){const n=u;m(e.wasmLoading,{instancePath:t+"/wasmLoading",parentData:e,parentDataProperty:"wasmLoading",rootData:o})||(p=null===p?m.errors:p.concat(m.errors),u=p.length),h=n===u}else h=!0}}}}}}}}}}}}}return y.errors=p,0===u}function h(e,{instancePath:t="",parentData:n,parentDataProperty:r,rootData:s=e}={}){let o=null,a=0;if(0===a){if(!e||"object"!=typeof e||Array.isArray(e))return h.errors=[{params:{type:"object"}}],!1;for(const n in e){let r=e[n];const u=a,f=a;let c=!1;const m=a,d=a;let g=!1;const b=a;if(a===b)if(Array.isArray(r))if(r.length<1){const e={params:{limit:1}};null===o?o=[e]:o.push(e),a++}else{var i=!0;const e=r.length;for(let t=0;t1){const n={};for(;t--;){let s=r[t];if("string"==typeof s){if("number"==typeof n[s]){e=n[s];const r={params:{i:t,j:e}};null===o?o=[r]:o.push(r),a++;break}n[s]=t}}}}}else{const e={params:{type:"array"}};null===o?o=[e]:o.push(e),a++}var l=b===a;if(g=g||l,!g){const e=a;if(a===e)if("string"==typeof r){if(r.length<1){const e={params:{}};null===o?o=[e]:o.push(e),a++}}else{const e={params:{type:"string"}};null===o?o=[e]:o.push(e),a++}l=e===a,g=g||l}if(g)a=d,null!==o&&(d?o.length=d:o=null);else{const e={params:{}};null===o?o=[e]:o.push(e),a++}var p=m===a;if(c=c||p,!c){const i=a;y(r,{instancePath:t+"/"+n.replace(/~/g,"~0").replace(/\//g,"~1"),parentData:e,parentDataProperty:n,rootData:s})||(o=null===o?y.errors:o.concat(y.errors),a=o.length),p=i===a,c=c||p}if(!c){const e={params:{}};return null===o?o=[e]:o.push(e),a++,h.errors=o,!1}if(a=f,null!==o&&(f?o.length=f:o=null),u!==a)break}}return h.errors=o,0===a}function d(e,{instancePath:t="",parentData:n,parentDataProperty:r,rootData:s=e}={}){let o=null,a=0;const i=a;let l=!1,p=null;const u=a,f=a;let c=!1;const m=a;if(a===m)if(Array.isArray(e))if(e.length<1){const e={params:{limit:1}};null===o?o=[e]:o.push(e),a++}else{var y=!0;const t=e.length;for(let n=0;n1){const r={};for(;n--;){let s=e[n];if("string"==typeof s){if("number"==typeof r[s]){t=r[s];const e={params:{i:n,j:t}};null===o?o=[e]:o.push(e),a++;break}r[s]=n}}}}}else{const e={params:{type:"array"}};null===o?o=[e]:o.push(e),a++}var h=m===a;if(c=c||h,!c){const t=a;if(a===t)if("string"==typeof e){if(e.length<1){const e={params:{}};null===o?o=[e]:o.push(e),a++}}else{const e={params:{type:"string"}};null===o?o=[e]:o.push(e),a++}h=t===a,c=c||h}if(c)a=f,null!==o&&(f?o.length=f:o=null);else{const e={params:{}};null===o?o=[e]:o.push(e),a++}if(u===a&&(l=!0,p=0),!l){const e={params:{passingSchemas:p}};return null===o?o=[e]:o.push(e),a++,d.errors=o,!1}return a=i,null!==o&&(i?o.length=i:o=null),d.errors=o,0===a}function g(e,{instancePath:t="",parentData:n,parentDataProperty:r,rootData:s=e}={}){let o=null,a=0;const i=a;let l=!1;const p=a;h(e,{instancePath:t,parentData:n,parentDataProperty:r,rootData:s})||(o=null===o?h.errors:o.concat(h.errors),a=o.length);var u=p===a;if(l=l||u,!l){const i=a;d(e,{instancePath:t,parentData:n,parentDataProperty:r,rootData:s})||(o=null===o?d.errors:o.concat(d.errors),a=o.length),u=i===a,l=l||u}if(!l){const e={params:{}};return null===o?o=[e]:o.push(e),a++,g.errors=o,!1}return a=i,null!==o&&(i?o.length=i:o=null),g.errors=o,0===a}function b(e,{instancePath:t="",parentData:n,parentDataProperty:r,rootData:s=e}={}){let o=null,a=0;const i=a;let l=!1;const p=a;if(!(e instanceof Function)){const e={params:{}};null===o?o=[e]:o.push(e),a++}var u=p===a;if(l=l||u,!l){const i=a;g(e,{instancePath:t,parentData:n,parentDataProperty:r,rootData:s})||(o=null===o?g.errors:o.concat(g.errors),a=o.length),u=i===a,l=l||u}if(!l){const e={params:{}};return null===o?o=[e]:o.push(e),a++,b.errors=o,!1}return a=i,null!==o&&(i?o.length=i:o=null),b.errors=o,0===a}const v={asyncWebAssembly:{type:"boolean"},backCompat:{type:"boolean"},buildHttp:{anyOf:[{$ref:"#/definitions/HttpUriAllowedUris"},{$ref:"#/definitions/HttpUriOptions"}]},cacheUnaffected:{type:"boolean"},css:{anyOf:[{type:"boolean"},{$ref:"#/definitions/CssExperimentOptions"}]},futureDefaults:{type:"boolean"},layers:{type:"boolean"},lazyCompilation:{anyOf:[{type:"boolean"},{$ref:"#/definitions/LazyCompilationOptions"}]},outputModule:{type:"boolean"},syncWebAssembly:{type:"boolean"},topLevelAwait:{type:"boolean"}},D=new RegExp("^https?://","u");function P(e,{instancePath:t="",parentData:n,parentDataProperty:r,rootData:s=e}={}){let o=null,a=0;const i=a;let l=!1,p=null;const u=a;if(a==a)if(Array.isArray(e)){const t=e.length;for(let n=0;n=",limit:0}};null===i?i=[e]:i.push(e),l++}}else{const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}var f=m===l;if(c=c||f,!c){const t=l;if(l===t)if(e&&"object"==typeof e&&!Array.isArray(e))for(const t in e){const n=l;if("number"!=typeof e[t]){const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}if(n!==l)break}else{const e={params:{type:"object"}};null===i?i=[e]:i.push(e),l++}f=t===l,c=c||f}if(c)l=u,null!==i&&(u?i.length=u:i=null);else{const e={params:{}};null===i?i=[e]:i.push(e),l++}if(a===l&&(s=!0,o=0),!s){const e={params:{passingSchemas:o}};return null===i?i=[e]:i.push(e),l++,pe.errors=i,!1}l=r,null!==i&&(r?i.length=r:i=null),p=n===l}else p=!0;if(p){if(void 0!==t.filename){let n=t.filename;const r=l,s=l;let o=!1;const a=l;if(l===a)if("string"==typeof n){if(n.includes("!")||!1!==e.test(n)){const e={params:{}};null===i?i=[e]:i.push(e),l++}else if(n.length<1){const e={params:{}};null===i?i=[e]:i.push(e),l++}}else{const e={params:{type:"string"}};null===i?i=[e]:i.push(e),l++}var c=a===l;if(o=o||c,!o){const e=l;if(!(n instanceof Function)){const e={params:{}};null===i?i=[e]:i.push(e),l++}c=e===l,o=o||c}if(!o){const e={params:{}};return null===i?i=[e]:i.push(e),l++,pe.errors=i,!1}l=s,null!==i&&(s?i.length=s:i=null),p=r===l}else p=!0;if(p){if(void 0!==t.idHint){const e=l;if("string"!=typeof t.idHint)return pe.errors=[{params:{type:"string"}}],!1;p=e===l}else p=!0;if(p){if(void 0!==t.layer){let e=t.layer;const n=l,r=l;let s=!1;const o=l;if(!(e instanceof RegExp)){const e={params:{}};null===i?i=[e]:i.push(e),l++}var m=o===l;if(s=s||m,!s){const t=l;if("string"!=typeof e){const e={params:{type:"string"}};null===i?i=[e]:i.push(e),l++}if(m=t===l,s=s||m,!s){const t=l;if(!(e instanceof Function)){const e={params:{}};null===i?i=[e]:i.push(e),l++}m=t===l,s=s||m}}if(!s){const e={params:{}};return null===i?i=[e]:i.push(e),l++,pe.errors=i,!1}l=r,null!==i&&(r?i.length=r:i=null),p=n===l}else p=!0;if(p){if(void 0!==t.maxAsyncRequests){let e=t.maxAsyncRequests;const n=l;if(l===n){if("number"!=typeof e)return pe.errors=[{params:{type:"number"}}],!1;if(e<1||isNaN(e))return pe.errors=[{params:{comparison:">=",limit:1}}],!1}p=n===l}else p=!0;if(p){if(void 0!==t.maxAsyncSize){let e=t.maxAsyncSize;const n=l,r=l;let s=!1,o=null;const a=l,u=l;let f=!1;const c=l;if(l===c)if("number"==typeof e){if(e<0||isNaN(e)){const e={params:{comparison:">=",limit:0}};null===i?i=[e]:i.push(e),l++}}else{const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}var y=c===l;if(f=f||y,!f){const t=l;if(l===t)if(e&&"object"==typeof e&&!Array.isArray(e))for(const t in e){const n=l;if("number"!=typeof e[t]){const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}if(n!==l)break}else{const e={params:{type:"object"}};null===i?i=[e]:i.push(e),l++}y=t===l,f=f||y}if(f)l=u,null!==i&&(u?i.length=u:i=null);else{const e={params:{}};null===i?i=[e]:i.push(e),l++}if(a===l&&(s=!0,o=0),!s){const e={params:{passingSchemas:o}};return null===i?i=[e]:i.push(e),l++,pe.errors=i,!1}l=r,null!==i&&(r?i.length=r:i=null),p=n===l}else p=!0;if(p){if(void 0!==t.maxInitialRequests){let e=t.maxInitialRequests;const n=l;if(l===n){if("number"!=typeof e)return pe.errors=[{params:{type:"number"}}],!1;if(e<1||isNaN(e))return pe.errors=[{params:{comparison:">=",limit:1}}],!1}p=n===l}else p=!0;if(p){if(void 0!==t.maxInitialSize){let e=t.maxInitialSize;const n=l,r=l;let s=!1,o=null;const a=l,u=l;let f=!1;const c=l;if(l===c)if("number"==typeof e){if(e<0||isNaN(e)){const e={params:{comparison:">=",limit:0}};null===i?i=[e]:i.push(e),l++}}else{const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}var h=c===l;if(f=f||h,!f){const t=l;if(l===t)if(e&&"object"==typeof e&&!Array.isArray(e))for(const t in e){const n=l;if("number"!=typeof e[t]){const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}if(n!==l)break}else{const e={params:{type:"object"}};null===i?i=[e]:i.push(e),l++}h=t===l,f=f||h}if(f)l=u,null!==i&&(u?i.length=u:i=null);else{const e={params:{}};null===i?i=[e]:i.push(e),l++}if(a===l&&(s=!0,o=0),!s){const e={params:{passingSchemas:o}};return null===i?i=[e]:i.push(e),l++,pe.errors=i,!1}l=r,null!==i&&(r?i.length=r:i=null),p=n===l}else p=!0;if(p){if(void 0!==t.maxSize){let e=t.maxSize;const n=l,r=l;let s=!1,o=null;const a=l,u=l;let f=!1;const c=l;if(l===c)if("number"==typeof e){if(e<0||isNaN(e)){const e={params:{comparison:">=",limit:0}};null===i?i=[e]:i.push(e),l++}}else{const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}var d=c===l;if(f=f||d,!f){const t=l;if(l===t)if(e&&"object"==typeof e&&!Array.isArray(e))for(const t in e){const n=l;if("number"!=typeof e[t]){const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}if(n!==l)break}else{const e={params:{type:"object"}};null===i?i=[e]:i.push(e),l++}d=t===l,f=f||d}if(f)l=u,null!==i&&(u?i.length=u:i=null);else{const e={params:{}};null===i?i=[e]:i.push(e),l++}if(a===l&&(s=!0,o=0),!s){const e={params:{passingSchemas:o}};return null===i?i=[e]:i.push(e),l++,pe.errors=i,!1}l=r,null!==i&&(r?i.length=r:i=null),p=n===l}else p=!0;if(p){if(void 0!==t.minChunks){let e=t.minChunks;const n=l;if(l===n){if("number"!=typeof e)return pe.errors=[{params:{type:"number"}}],!1;if(e<1||isNaN(e))return pe.errors=[{params:{comparison:">=",limit:1}}],!1}p=n===l}else p=!0;if(p){if(void 0!==t.minRemainingSize){let e=t.minRemainingSize;const n=l,r=l;let s=!1,o=null;const a=l,u=l;let f=!1;const c=l;if(l===c)if("number"==typeof e){if(e<0||isNaN(e)){const e={params:{comparison:">=",limit:0}};null===i?i=[e]:i.push(e),l++}}else{const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}var g=c===l;if(f=f||g,!f){const t=l;if(l===t)if(e&&"object"==typeof e&&!Array.isArray(e))for(const t in e){const n=l;if("number"!=typeof e[t]){const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}if(n!==l)break}else{const e={params:{type:"object"}};null===i?i=[e]:i.push(e),l++}g=t===l,f=f||g}if(f)l=u,null!==i&&(u?i.length=u:i=null);else{const e={params:{}};null===i?i=[e]:i.push(e),l++}if(a===l&&(s=!0,o=0),!s){const e={params:{passingSchemas:o}};return null===i?i=[e]:i.push(e),l++,pe.errors=i,!1}l=r,null!==i&&(r?i.length=r:i=null),p=n===l}else p=!0;if(p){if(void 0!==t.minSize){let e=t.minSize;const n=l,r=l;let s=!1,o=null;const a=l,u=l;let f=!1;const c=l;if(l===c)if("number"==typeof e){if(e<0||isNaN(e)){const e={params:{comparison:">=",limit:0}};null===i?i=[e]:i.push(e),l++}}else{const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}var b=c===l;if(f=f||b,!f){const t=l;if(l===t)if(e&&"object"==typeof e&&!Array.isArray(e))for(const t in e){const n=l;if("number"!=typeof e[t]){const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}if(n!==l)break}else{const e={params:{type:"object"}};null===i?i=[e]:i.push(e),l++}b=t===l,f=f||b}if(f)l=u,null!==i&&(u?i.length=u:i=null);else{const e={params:{}};null===i?i=[e]:i.push(e),l++}if(a===l&&(s=!0,o=0),!s){const e={params:{passingSchemas:o}};return null===i?i=[e]:i.push(e),l++,pe.errors=i,!1}l=r,null!==i&&(r?i.length=r:i=null),p=n===l}else p=!0;if(p){if(void 0!==t.minSizeReduction){let e=t.minSizeReduction;const n=l,r=l;let s=!1,o=null;const a=l,u=l;let f=!1;const c=l;if(l===c)if("number"==typeof e){if(e<0||isNaN(e)){const e={params:{comparison:">=",limit:0}};null===i?i=[e]:i.push(e),l++}}else{const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}var v=c===l;if(f=f||v,!f){const t=l;if(l===t)if(e&&"object"==typeof e&&!Array.isArray(e))for(const t in e){const n=l;if("number"!=typeof e[t]){const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}if(n!==l)break}else{const e={params:{type:"object"}};null===i?i=[e]:i.push(e),l++}v=t===l,f=f||v}if(f)l=u,null!==i&&(u?i.length=u:i=null);else{const e={params:{}};null===i?i=[e]:i.push(e),l++}if(a===l&&(s=!0,o=0),!s){const e={params:{passingSchemas:o}};return null===i?i=[e]:i.push(e),l++,pe.errors=i,!1}l=r,null!==i&&(r?i.length=r:i=null),p=n===l}else p=!0;if(p){if(void 0!==t.name){let e=t.name;const n=l,r=l;let s=!1;const o=l;if(!1!==e){const e={params:{}};null===i?i=[e]:i.push(e),l++}var D=o===l;if(s=s||D,!s){const t=l;if("string"!=typeof e){const e={params:{type:"string"}};null===i?i=[e]:i.push(e),l++}if(D=t===l,s=s||D,!s){const t=l;if(!(e instanceof Function)){const e={params:{}};null===i?i=[e]:i.push(e),l++}D=t===l,s=s||D}}if(!s){const e={params:{}};return null===i?i=[e]:i.push(e),l++,pe.errors=i,!1}l=r,null!==i&&(r?i.length=r:i=null),p=n===l}else p=!0;if(p){if(void 0!==t.priority){const e=l;if("number"!=typeof t.priority)return pe.errors=[{params:{type:"number"}}],!1;p=e===l}else p=!0;if(p){if(void 0!==t.reuseExistingChunk){const e=l;if("boolean"!=typeof t.reuseExistingChunk)return pe.errors=[{params:{type:"boolean"}}],!1;p=e===l}else p=!0;if(p){if(void 0!==t.test){let e=t.test;const n=l,r=l;let s=!1;const o=l;if(!(e instanceof RegExp)){const e={params:{}};null===i?i=[e]:i.push(e),l++}var P=o===l;if(s=s||P,!s){const t=l;if("string"!=typeof e){const e={params:{type:"string"}};null===i?i=[e]:i.push(e),l++}if(P=t===l,s=s||P,!s){const t=l;if(!(e instanceof Function)){const e={params:{}};null===i?i=[e]:i.push(e),l++}P=t===l,s=s||P}}if(!s){const e={params:{}};return null===i?i=[e]:i.push(e),l++,pe.errors=i,!1}l=r,null!==i&&(r?i.length=r:i=null),p=n===l}else p=!0;if(p){if(void 0!==t.type){let e=t.type;const n=l,r=l;let s=!1;const o=l;if(!(e instanceof RegExp)){const e={params:{}};null===i?i=[e]:i.push(e),l++}var A=o===l;if(s=s||A,!s){const t=l;if("string"!=typeof e){const e={params:{type:"string"}};null===i?i=[e]:i.push(e),l++}if(A=t===l,s=s||A,!s){const t=l;if(!(e instanceof Function)){const e={params:{}};null===i?i=[e]:i.push(e),l++}A=t===l,s=s||A}}if(!s){const e={params:{}};return null===i?i=[e]:i.push(e),l++,pe.errors=i,!1}l=r,null!==i&&(r?i.length=r:i=null),p=n===l}else p=!0;if(p)if(void 0!==t.usedExports){const e=l;if("boolean"!=typeof t.usedExports)return pe.errors=[{params:{type:"boolean"}}],!1;p=e===l}else p=!0}}}}}}}}}}}}}}}}}}}}}}}return pe.errors=i,0===l}function ue(t,{instancePath:r="",parentData:s,parentDataProperty:o,rootData:a=t}={}){let i=null,l=0;if(0===l){if(!t||"object"!=typeof t||Array.isArray(t))return ue.errors=[{params:{type:"object"}}],!1;{const s=l;for(const e in t)if(!n.call(ie,e))return ue.errors=[{params:{additionalProperty:e}}],!1;if(s===l){if(void 0!==t.automaticNameDelimiter){let e=t.automaticNameDelimiter;const n=l;if(l===n){if("string"!=typeof e)return ue.errors=[{params:{type:"string"}}],!1;if(e.length<1)return ue.errors=[{params:{}}],!1}var p=n===l}else p=!0;if(p){if(void 0!==t.cacheGroups){let e=t.cacheGroups;const n=l,s=l,o=l;if(l===o)if(e&&"object"==typeof e&&!Array.isArray(e)){let t;if(void 0===e.test&&(t="test")){const e={};null===i?i=[e]:i.push(e),l++}else if(void 0!==e.test){let t=e.test;const n=l;let r=!1;const s=l;if(!(t instanceof RegExp)){const e={};null===i?i=[e]:i.push(e),l++}var u=s===l;if(r=r||u,!r){const e=l;if("string"!=typeof t){const e={};null===i?i=[e]:i.push(e),l++}if(u=e===l,r=r||u,!r){const e=l;if(!(t instanceof Function)){const e={};null===i?i=[e]:i.push(e),l++}u=e===l,r=r||u}}if(r)l=n,null!==i&&(n?i.length=n:i=null);else{const e={};null===i?i=[e]:i.push(e),l++}}}else{const e={};null===i?i=[e]:i.push(e),l++}if(o===l)return ue.errors=[{params:{}}],!1;if(l=s,null!==i&&(s?i.length=s:i=null),l===n){if(!e||"object"!=typeof e||Array.isArray(e))return ue.errors=[{params:{type:"object"}}],!1;for(const t in e){let n=e[t];const s=l,o=l;let p=!1;const u=l;if(!1!==n){const e={params:{}};null===i?i=[e]:i.push(e),l++}var f=u===l;if(p=p||f,!p){const s=l;if(!(n instanceof RegExp)){const e={params:{}};null===i?i=[e]:i.push(e),l++}if(f=s===l,p=p||f,!p){const s=l;if("string"!=typeof n){const e={params:{type:"string"}};null===i?i=[e]:i.push(e),l++}if(f=s===l,p=p||f,!p){const s=l;if(!(n instanceof Function)){const e={params:{}};null===i?i=[e]:i.push(e),l++}if(f=s===l,p=p||f,!p){const s=l;pe(n,{instancePath:r+"/cacheGroups/"+t.replace(/~/g,"~0").replace(/\//g,"~1"),parentData:e,parentDataProperty:t,rootData:a})||(i=null===i?pe.errors:i.concat(pe.errors),l=i.length),f=s===l,p=p||f}}}}if(!p){const e={params:{}};return null===i?i=[e]:i.push(e),l++,ue.errors=i,!1}if(l=o,null!==i&&(o?i.length=o:i=null),s!==l)break}}p=n===l}else p=!0;if(p){if(void 0!==t.chunks){let e=t.chunks;const n=l,r=l;let s=!1;const o=l;if("initial"!==e&&"async"!==e&&"all"!==e){const e={params:{}};null===i?i=[e]:i.push(e),l++}var c=o===l;if(s=s||c,!s){const t=l;if(!(e instanceof Function)){const e={params:{}};null===i?i=[e]:i.push(e),l++}c=t===l,s=s||c}if(!s){const e={params:{}};return null===i?i=[e]:i.push(e),l++,ue.errors=i,!1}l=r,null!==i&&(r?i.length=r:i=null),p=n===l}else p=!0;if(p){if(void 0!==t.defaultSizeTypes){let e=t.defaultSizeTypes;const n=l;if(l===n){if(!Array.isArray(e))return ue.errors=[{params:{type:"array"}}],!1;if(e.length<1)return ue.errors=[{params:{limit:1}}],!1;{const t=e.length;for(let n=0;n=",limit:0}};null===i?i=[e]:i.push(e),l++}}else{const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}var m=c===l;if(f=f||m,!f){const t=l;if(l===t)if(e&&"object"==typeof e&&!Array.isArray(e))for(const t in e){const n=l;if("number"!=typeof e[t]){const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}if(n!==l)break}else{const e={params:{type:"object"}};null===i?i=[e]:i.push(e),l++}m=t===l,f=f||m}if(f)l=u,null!==i&&(u?i.length=u:i=null);else{const e={params:{}};null===i?i=[e]:i.push(e),l++}if(a===l&&(s=!0,o=0),!s){const e={params:{passingSchemas:o}};return null===i?i=[e]:i.push(e),l++,ue.errors=i,!1}l=r,null!==i&&(r?i.length=r:i=null),p=n===l}else p=!0;if(p){if(void 0!==t.fallbackCacheGroup){let e=t.fallbackCacheGroup;const n=l;if(l===n){if(!e||"object"!=typeof e||Array.isArray(e))return ue.errors=[{params:{type:"object"}}],!1;{const t=l;for(const t in e)if("automaticNameDelimiter"!==t&&"chunks"!==t&&"maxAsyncSize"!==t&&"maxInitialSize"!==t&&"maxSize"!==t&&"minSize"!==t&&"minSizeReduction"!==t)return ue.errors=[{params:{additionalProperty:t}}],!1;if(t===l){if(void 0!==e.automaticNameDelimiter){let t=e.automaticNameDelimiter;const n=l;if(l===n){if("string"!=typeof t)return ue.errors=[{params:{type:"string"}}],!1;if(t.length<1)return ue.errors=[{params:{}}],!1}var y=n===l}else y=!0;if(y){if(void 0!==e.chunks){let t=e.chunks;const n=l,r=l;let s=!1;const o=l;if("initial"!==t&&"async"!==t&&"all"!==t){const e={params:{}};null===i?i=[e]:i.push(e),l++}var h=o===l;if(s=s||h,!s){const e=l;if(!(t instanceof Function)){const e={params:{}};null===i?i=[e]:i.push(e),l++}h=e===l,s=s||h}if(!s){const e={params:{}};return null===i?i=[e]:i.push(e),l++,ue.errors=i,!1}l=r,null!==i&&(r?i.length=r:i=null),y=n===l}else y=!0;if(y){if(void 0!==e.maxAsyncSize){let t=e.maxAsyncSize;const n=l,r=l;let s=!1,o=null;const a=l,p=l;let u=!1;const f=l;if(l===f)if("number"==typeof t){if(t<0||isNaN(t)){const e={params:{comparison:">=",limit:0}};null===i?i=[e]:i.push(e),l++}}else{const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}var d=f===l;if(u=u||d,!u){const e=l;if(l===e)if(t&&"object"==typeof t&&!Array.isArray(t))for(const e in t){const n=l;if("number"!=typeof t[e]){const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}if(n!==l)break}else{const e={params:{type:"object"}};null===i?i=[e]:i.push(e),l++}d=e===l,u=u||d}if(u)l=p,null!==i&&(p?i.length=p:i=null);else{const e={params:{}};null===i?i=[e]:i.push(e),l++}if(a===l&&(s=!0,o=0),!s){const e={params:{passingSchemas:o}};return null===i?i=[e]:i.push(e),l++,ue.errors=i,!1}l=r,null!==i&&(r?i.length=r:i=null),y=n===l}else y=!0;if(y){if(void 0!==e.maxInitialSize){let t=e.maxInitialSize;const n=l,r=l;let s=!1,o=null;const a=l,p=l;let u=!1;const f=l;if(l===f)if("number"==typeof t){if(t<0||isNaN(t)){const e={params:{comparison:">=",limit:0}};null===i?i=[e]:i.push(e),l++}}else{const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}var g=f===l;if(u=u||g,!u){const e=l;if(l===e)if(t&&"object"==typeof t&&!Array.isArray(t))for(const e in t){const n=l;if("number"!=typeof t[e]){const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}if(n!==l)break}else{const e={params:{type:"object"}};null===i?i=[e]:i.push(e),l++}g=e===l,u=u||g}if(u)l=p,null!==i&&(p?i.length=p:i=null);else{const e={params:{}};null===i?i=[e]:i.push(e),l++}if(a===l&&(s=!0,o=0),!s){const e={params:{passingSchemas:o}};return null===i?i=[e]:i.push(e),l++,ue.errors=i,!1}l=r,null!==i&&(r?i.length=r:i=null),y=n===l}else y=!0;if(y){if(void 0!==e.maxSize){let t=e.maxSize;const n=l,r=l;let s=!1,o=null;const a=l,p=l;let u=!1;const f=l;if(l===f)if("number"==typeof t){if(t<0||isNaN(t)){const e={params:{comparison:">=",limit:0}};null===i?i=[e]:i.push(e),l++}}else{const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}var b=f===l;if(u=u||b,!u){const e=l;if(l===e)if(t&&"object"==typeof t&&!Array.isArray(t))for(const e in t){const n=l;if("number"!=typeof t[e]){const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}if(n!==l)break}else{const e={params:{type:"object"}};null===i?i=[e]:i.push(e),l++}b=e===l,u=u||b}if(u)l=p,null!==i&&(p?i.length=p:i=null);else{const e={params:{}};null===i?i=[e]:i.push(e),l++}if(a===l&&(s=!0,o=0),!s){const e={params:{passingSchemas:o}};return null===i?i=[e]:i.push(e),l++,ue.errors=i,!1}l=r,null!==i&&(r?i.length=r:i=null),y=n===l}else y=!0;if(y){if(void 0!==e.minSize){let t=e.minSize;const n=l,r=l;let s=!1,o=null;const a=l,p=l;let u=!1;const f=l;if(l===f)if("number"==typeof t){if(t<0||isNaN(t)){const e={params:{comparison:">=",limit:0}};null===i?i=[e]:i.push(e),l++}}else{const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}var v=f===l;if(u=u||v,!u){const e=l;if(l===e)if(t&&"object"==typeof t&&!Array.isArray(t))for(const e in t){const n=l;if("number"!=typeof t[e]){const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}if(n!==l)break}else{const e={params:{type:"object"}};null===i?i=[e]:i.push(e),l++}v=e===l,u=u||v}if(u)l=p,null!==i&&(p?i.length=p:i=null);else{const e={params:{}};null===i?i=[e]:i.push(e),l++}if(a===l&&(s=!0,o=0),!s){const e={params:{passingSchemas:o}};return null===i?i=[e]:i.push(e),l++,ue.errors=i,!1}l=r,null!==i&&(r?i.length=r:i=null),y=n===l}else y=!0;if(y)if(void 0!==e.minSizeReduction){let t=e.minSizeReduction;const n=l,r=l;let s=!1,o=null;const a=l,p=l;let u=!1;const f=l;if(l===f)if("number"==typeof t){if(t<0||isNaN(t)){const e={params:{comparison:">=",limit:0}};null===i?i=[e]:i.push(e),l++}}else{const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}var D=f===l;if(u=u||D,!u){const e=l;if(l===e)if(t&&"object"==typeof t&&!Array.isArray(t))for(const e in t){const n=l;if("number"!=typeof t[e]){const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}if(n!==l)break}else{const e={params:{type:"object"}};null===i?i=[e]:i.push(e),l++}D=e===l,u=u||D}if(u)l=p,null!==i&&(p?i.length=p:i=null);else{const e={params:{}};null===i?i=[e]:i.push(e),l++}if(a===l&&(s=!0,o=0),!s){const e={params:{passingSchemas:o}};return null===i?i=[e]:i.push(e),l++,ue.errors=i,!1}l=r,null!==i&&(r?i.length=r:i=null),y=n===l}else y=!0}}}}}}}}p=n===l}else p=!0;if(p){if(void 0!==t.filename){let n=t.filename;const r=l,s=l;let o=!1;const a=l;if(l===a)if("string"==typeof n){if(n.includes("!")||!1!==e.test(n)){const e={params:{}};null===i?i=[e]:i.push(e),l++}else if(n.length<1){const e={params:{}};null===i?i=[e]:i.push(e),l++}}else{const e={params:{type:"string"}};null===i?i=[e]:i.push(e),l++}var P=a===l;if(o=o||P,!o){const e=l;if(!(n instanceof Function)){const e={params:{}};null===i?i=[e]:i.push(e),l++}P=e===l,o=o||P}if(!o){const e={params:{}};return null===i?i=[e]:i.push(e),l++,ue.errors=i,!1}l=s,null!==i&&(s?i.length=s:i=null),p=r===l}else p=!0;if(p){if(void 0!==t.hidePathInfo){const e=l;if("boolean"!=typeof t.hidePathInfo)return ue.errors=[{params:{type:"boolean"}}],!1;p=e===l}else p=!0;if(p){if(void 0!==t.maxAsyncRequests){let e=t.maxAsyncRequests;const n=l;if(l===n){if("number"!=typeof e)return ue.errors=[{params:{type:"number"}}],!1;if(e<1||isNaN(e))return ue.errors=[{params:{comparison:">=",limit:1}}],!1}p=n===l}else p=!0;if(p){if(void 0!==t.maxAsyncSize){let e=t.maxAsyncSize;const n=l,r=l;let s=!1,o=null;const a=l,u=l;let f=!1;const c=l;if(l===c)if("number"==typeof e){if(e<0||isNaN(e)){const e={params:{comparison:">=",limit:0}};null===i?i=[e]:i.push(e),l++}}else{const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}var A=c===l;if(f=f||A,!f){const t=l;if(l===t)if(e&&"object"==typeof e&&!Array.isArray(e))for(const t in e){const n=l;if("number"!=typeof e[t]){const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}if(n!==l)break}else{const e={params:{type:"object"}};null===i?i=[e]:i.push(e),l++}A=t===l,f=f||A}if(f)l=u,null!==i&&(u?i.length=u:i=null);else{const e={params:{}};null===i?i=[e]:i.push(e),l++}if(a===l&&(s=!0,o=0),!s){const e={params:{passingSchemas:o}};return null===i?i=[e]:i.push(e),l++,ue.errors=i,!1}l=r,null!==i&&(r?i.length=r:i=null),p=n===l}else p=!0;if(p){if(void 0!==t.maxInitialRequests){let e=t.maxInitialRequests;const n=l;if(l===n){if("number"!=typeof e)return ue.errors=[{params:{type:"number"}}],!1;if(e<1||isNaN(e))return ue.errors=[{params:{comparison:">=",limit:1}}],!1}p=n===l}else p=!0;if(p){if(void 0!==t.maxInitialSize){let e=t.maxInitialSize;const n=l,r=l;let s=!1,o=null;const a=l,u=l;let f=!1;const c=l;if(l===c)if("number"==typeof e){if(e<0||isNaN(e)){const e={params:{comparison:">=",limit:0}};null===i?i=[e]:i.push(e),l++}}else{const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}var x=c===l;if(f=f||x,!f){const t=l;if(l===t)if(e&&"object"==typeof e&&!Array.isArray(e))for(const t in e){const n=l;if("number"!=typeof e[t]){const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}if(n!==l)break}else{const e={params:{type:"object"}};null===i?i=[e]:i.push(e),l++}x=t===l,f=f||x}if(f)l=u,null!==i&&(u?i.length=u:i=null);else{const e={params:{}};null===i?i=[e]:i.push(e),l++}if(a===l&&(s=!0,o=0),!s){const e={params:{passingSchemas:o}};return null===i?i=[e]:i.push(e),l++,ue.errors=i,!1}l=r,null!==i&&(r?i.length=r:i=null),p=n===l}else p=!0;if(p){if(void 0!==t.maxSize){let e=t.maxSize;const n=l,r=l;let s=!1,o=null;const a=l,u=l;let f=!1;const c=l;if(l===c)if("number"==typeof e){if(e<0||isNaN(e)){const e={params:{comparison:">=",limit:0}};null===i?i=[e]:i.push(e),l++}}else{const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}var k=c===l;if(f=f||k,!f){const t=l;if(l===t)if(e&&"object"==typeof e&&!Array.isArray(e))for(const t in e){const n=l;if("number"!=typeof e[t]){const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}if(n!==l)break}else{const e={params:{type:"object"}};null===i?i=[e]:i.push(e),l++}k=t===l,f=f||k}if(f)l=u,null!==i&&(u?i.length=u:i=null);else{const e={params:{}};null===i?i=[e]:i.push(e),l++}if(a===l&&(s=!0,o=0),!s){const e={params:{passingSchemas:o}};return null===i?i=[e]:i.push(e),l++,ue.errors=i,!1}l=r,null!==i&&(r?i.length=r:i=null),p=n===l}else p=!0;if(p){if(void 0!==t.minChunks){let e=t.minChunks;const n=l;if(l===n){if("number"!=typeof e)return ue.errors=[{params:{type:"number"}}],!1;if(e<1||isNaN(e))return ue.errors=[{params:{comparison:">=",limit:1}}],!1}p=n===l}else p=!0;if(p){if(void 0!==t.minRemainingSize){let e=t.minRemainingSize;const n=l,r=l;let s=!1,o=null;const a=l,u=l;let f=!1;const c=l;if(l===c)if("number"==typeof e){if(e<0||isNaN(e)){const e={params:{comparison:">=",limit:0}};null===i?i=[e]:i.push(e),l++}}else{const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}var j=c===l;if(f=f||j,!f){const t=l;if(l===t)if(e&&"object"==typeof e&&!Array.isArray(e))for(const t in e){const n=l;if("number"!=typeof e[t]){const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}if(n!==l)break}else{const e={params:{type:"object"}};null===i?i=[e]:i.push(e),l++}j=t===l,f=f||j}if(f)l=u,null!==i&&(u?i.length=u:i=null);else{const e={params:{}};null===i?i=[e]:i.push(e),l++}if(a===l&&(s=!0,o=0),!s){const e={params:{passingSchemas:o}};return null===i?i=[e]:i.push(e),l++,ue.errors=i,!1}l=r,null!==i&&(r?i.length=r:i=null),p=n===l}else p=!0;if(p){if(void 0!==t.minSize){let e=t.minSize;const n=l,r=l;let s=!1,o=null;const a=l,u=l;let f=!1;const c=l;if(l===c)if("number"==typeof e){if(e<0||isNaN(e)){const e={params:{comparison:">=",limit:0}};null===i?i=[e]:i.push(e),l++}}else{const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}var S=c===l;if(f=f||S,!f){const t=l;if(l===t)if(e&&"object"==typeof e&&!Array.isArray(e))for(const t in e){const n=l;if("number"!=typeof e[t]){const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}if(n!==l)break}else{const e={params:{type:"object"}};null===i?i=[e]:i.push(e),l++}S=t===l,f=f||S}if(f)l=u,null!==i&&(u?i.length=u:i=null);else{const e={params:{}};null===i?i=[e]:i.push(e),l++}if(a===l&&(s=!0,o=0),!s){const e={params:{passingSchemas:o}};return null===i?i=[e]:i.push(e),l++,ue.errors=i,!1}l=r,null!==i&&(r?i.length=r:i=null),p=n===l}else p=!0;if(p){if(void 0!==t.minSizeReduction){let e=t.minSizeReduction;const n=l,r=l;let s=!1,o=null;const a=l,u=l;let f=!1;const c=l;if(l===c)if("number"==typeof e){if(e<0||isNaN(e)){const e={params:{comparison:">=",limit:0}};null===i?i=[e]:i.push(e),l++}}else{const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}var C=c===l;if(f=f||C,!f){const t=l;if(l===t)if(e&&"object"==typeof e&&!Array.isArray(e))for(const t in e){const n=l;if("number"!=typeof e[t]){const e={params:{type:"number"}};null===i?i=[e]:i.push(e),l++}if(n!==l)break}else{const e={params:{type:"object"}};null===i?i=[e]:i.push(e),l++}C=t===l,f=f||C}if(f)l=u,null!==i&&(u?i.length=u:i=null);else{const e={params:{}};null===i?i=[e]:i.push(e),l++}if(a===l&&(s=!0,o=0),!s){const e={params:{passingSchemas:o}};return null===i?i=[e]:i.push(e),l++,ue.errors=i,!1}l=r,null!==i&&(r?i.length=r:i=null),p=n===l}else p=!0;if(p){if(void 0!==t.name){let e=t.name;const n=l,r=l;let s=!1;const o=l;if(!1!==e){const e={params:{}};null===i?i=[e]:i.push(e),l++}var O=o===l;if(s=s||O,!s){const t=l;if("string"!=typeof e){const e={params:{type:"string"}};null===i?i=[e]:i.push(e),l++}if(O=t===l,s=s||O,!s){const t=l;if(!(e instanceof Function)){const e={params:{}};null===i?i=[e]:i.push(e),l++}O=t===l,s=s||O}}if(!s){const e={params:{}};return null===i?i=[e]:i.push(e),l++,ue.errors=i,!1}l=r,null!==i&&(r?i.length=r:i=null),p=n===l}else p=!0;if(p)if(void 0!==t.usedExports){const e=l;if("boolean"!=typeof t.usedExports)return ue.errors=[{params:{type:"boolean"}}],!1;p=e===l}else p=!0}}}}}}}}}}}}}}}}}}}}return ue.errors=i,0===l}function fe(e,{instancePath:t="",parentData:r,parentDataProperty:s,rootData:o=e}={}){let a=null,i=0;if(0===i){if(!e||"object"!=typeof e||Array.isArray(e))return fe.errors=[{params:{type:"object"}}],!1;{const r=i;for(const t in e)if(!n.call(ae,t))return fe.errors=[{params:{additionalProperty:t}}],!1;if(r===i){if(void 0!==e.checkWasmTypes){const t=i;if("boolean"!=typeof e.checkWasmTypes)return fe.errors=[{params:{type:"boolean"}}],!1;var l=t===i}else l=!0;if(l){if(void 0!==e.chunkIds){let t=e.chunkIds;const n=i;if("natural"!==t&&"named"!==t&&"deterministic"!==t&&"size"!==t&&"total-size"!==t&&!1!==t)return fe.errors=[{params:{}}],!1;l=n===i}else l=!0;if(l){if(void 0!==e.concatenateModules){const t=i;if("boolean"!=typeof e.concatenateModules)return fe.errors=[{params:{type:"boolean"}}],!1;l=t===i}else l=!0;if(l){if(void 0!==e.emitOnErrors){const t=i;if("boolean"!=typeof e.emitOnErrors)return fe.errors=[{params:{type:"boolean"}}],!1;l=t===i}else l=!0;if(l){if(void 0!==e.flagIncludedChunks){const t=i;if("boolean"!=typeof e.flagIncludedChunks)return fe.errors=[{params:{type:"boolean"}}],!1;l=t===i}else l=!0;if(l){if(void 0!==e.innerGraph){const t=i;if("boolean"!=typeof e.innerGraph)return fe.errors=[{params:{type:"boolean"}}],!1;l=t===i}else l=!0;if(l){if(void 0!==e.mangleExports){let t=e.mangleExports;const n=i,r=i;let s=!1;const o=i;if("size"!==t&&"deterministic"!==t){const e={params:{}};null===a?a=[e]:a.push(e),i++}var p=o===i;if(s=s||p,!s){const e=i;if("boolean"!=typeof t){const e={params:{type:"boolean"}};null===a?a=[e]:a.push(e),i++}p=e===i,s=s||p}if(!s){const e={params:{}};return null===a?a=[e]:a.push(e),i++,fe.errors=a,!1}i=r,null!==a&&(r?a.length=r:a=null),l=n===i}else l=!0;if(l){if(void 0!==e.mangleWasmImports){const t=i;if("boolean"!=typeof e.mangleWasmImports)return fe.errors=[{params:{type:"boolean"}}],!1;l=t===i}else l=!0;if(l){if(void 0!==e.mergeDuplicateChunks){const t=i;if("boolean"!=typeof e.mergeDuplicateChunks)return fe.errors=[{params:{type:"boolean"}}],!1;l=t===i}else l=!0;if(l){if(void 0!==e.minimize){const t=i;if("boolean"!=typeof e.minimize)return fe.errors=[{params:{type:"boolean"}}],!1;l=t===i}else l=!0;if(l){if(void 0!==e.minimizer){let t=e.minimizer;const n=i;if(i===n){if(!Array.isArray(t))return fe.errors=[{params:{type:"array"}}],!1;{const e=t.length;for(let n=0;n=",limit:1}}],!1}y=n===u}else y=!0;if(y){if(void 0!==t.hashFunction){let e=t.hashFunction;const n=u,r=u;let s=!1;const o=u;if(u===o)if("string"==typeof e){if(e.length<1){const e={params:{}};null===l?l=[e]:l.push(e),u++}}else{const e={params:{type:"string"}};null===l?l=[e]:l.push(e),u++}var v=o===u;if(s=s||v,!s){const t=u;if(!(e instanceof Function)){const e={params:{}};null===l?l=[e]:l.push(e),u++}v=t===u,s=s||v}if(!s){const e={params:{}};return null===l?l=[e]:l.push(e),u++,xe.errors=l,!1}u=r,null!==l&&(r?l.length=r:l=null),y=n===u}else y=!0;if(y){if(void 0!==t.hashSalt){let e=t.hashSalt;const n=u;if(u==u){if("string"!=typeof e)return xe.errors=[{params:{type:"string"}}],!1;if(e.length<1)return xe.errors=[{params:{}}],!1}y=n===u}else y=!0;if(y){if(void 0!==t.hotUpdateChunkFilename){let n=t.hotUpdateChunkFilename;const r=u;if(u==u){if("string"!=typeof n)return xe.errors=[{params:{type:"string"}}],!1;if(n.includes("!")||!1!==e.test(n))return xe.errors=[{params:{}}],!1}y=r===u}else y=!0;if(y){if(void 0!==t.hotUpdateGlobal){const e=u;if("string"!=typeof t.hotUpdateGlobal)return xe.errors=[{params:{type:"string"}}],!1;y=e===u}else y=!0;if(y){if(void 0!==t.hotUpdateMainFilename){let n=t.hotUpdateMainFilename;const r=u;if(u==u){if("string"!=typeof n)return xe.errors=[{params:{type:"string"}}],!1;if(n.includes("!")||!1!==e.test(n))return xe.errors=[{params:{}}],!1}y=r===u}else y=!0;if(y){if(void 0!==t.iife){const e=u;if("boolean"!=typeof t.iife)return xe.errors=[{params:{type:"boolean"}}],!1;y=e===u}else y=!0;if(y){if(void 0!==t.importFunctionName){const e=u;if("string"!=typeof t.importFunctionName)return xe.errors=[{params:{type:"string"}}],!1;y=e===u}else y=!0;if(y){if(void 0!==t.importMetaName){const e=u;if("string"!=typeof t.importMetaName)return xe.errors=[{params:{type:"string"}}],!1;y=e===u}else y=!0;if(y){if(void 0!==t.library){const e=u;Ae(t.library,{instancePath:r+"/library",parentData:t,parentDataProperty:"library",rootData:a})||(l=null===l?Ae.errors:l.concat(Ae.errors),u=l.length),y=e===u}else y=!0;if(y){if(void 0!==t.libraryExport){let e=t.libraryExport;const n=u,r=u;let s=!1,o=null;const a=u,i=u;let p=!1;const f=u;if(u===f)if(Array.isArray(e)){const t=e.length;for(let n=0;n=",limit:1}}],!1}c=t===u}else c=!0;if(c){if(void 0!==r.performance){const e=u;ke(r.performance,{instancePath:s+"/performance",parentData:r,parentDataProperty:"performance",rootData:l})||(p=null===p?ke.errors:p.concat(ke.errors),u=p.length),c=e===u}else c=!0;if(c){if(void 0!==r.plugins){const e=u;je(r.plugins,{instancePath:s+"/plugins",parentData:r,parentDataProperty:"plugins",rootData:l})||(p=null===p?je.errors:p.concat(je.errors),u=p.length),c=e===u}else c=!0;if(c){if(void 0!==r.profile){const e=u;if("boolean"!=typeof r.profile)return we.errors=[{params:{type:"boolean"}}],!1;c=e===u}else c=!0;if(c){if(void 0!==r.recordsInputPath){let t=r.recordsInputPath;const n=u,s=u;let o=!1;const a=u;if(!1!==t){const e={params:{}};null===p?p=[e]:p.push(e),u++}var g=a===u;if(o=o||g,!o){const n=u;if(u===n)if("string"==typeof t){if(t.includes("!")||!0!==e.test(t)){const e={params:{}};null===p?p=[e]:p.push(e),u++}}else{const e={params:{type:"string"}};null===p?p=[e]:p.push(e),u++}g=n===u,o=o||g}if(!o){const e={params:{}};return null===p?p=[e]:p.push(e),u++,we.errors=p,!1}u=s,null!==p&&(s?p.length=s:p=null),c=n===u}else c=!0;if(c){if(void 0!==r.recordsOutputPath){let t=r.recordsOutputPath;const n=u,s=u;let o=!1;const a=u;if(!1!==t){const e={params:{}};null===p?p=[e]:p.push(e),u++}var v=a===u;if(o=o||v,!o){const n=u;if(u===n)if("string"==typeof t){if(t.includes("!")||!0!==e.test(t)){const e={params:{}};null===p?p=[e]:p.push(e),u++}}else{const e={params:{type:"string"}};null===p?p=[e]:p.push(e),u++}v=n===u,o=o||v}if(!o){const e={params:{}};return null===p?p=[e]:p.push(e),u++,we.errors=p,!1}u=s,null!==p&&(s?p.length=s:p=null),c=n===u}else c=!0;if(c){if(void 0!==r.recordsPath){let t=r.recordsPath;const n=u,s=u;let o=!1;const a=u;if(!1!==t){const e={params:{}};null===p?p=[e]:p.push(e),u++}var D=a===u;if(o=o||D,!o){const n=u;if(u===n)if("string"==typeof t){if(t.includes("!")||!0!==e.test(t)){const e={params:{}};null===p?p=[e]:p.push(e),u++}}else{const e={params:{type:"string"}};null===p?p=[e]:p.push(e),u++}D=n===u,o=o||D}if(!o){const e={params:{}};return null===p?p=[e]:p.push(e),u++,we.errors=p,!1}u=s,null!==p&&(s?p.length=s:p=null),c=n===u}else c=!0;if(c){if(void 0!==r.resolve){const e=u;Se(r.resolve,{instancePath:s+"/resolve",parentData:r,parentDataProperty:"resolve",rootData:l})||(p=null===p?Se.errors:p.concat(Se.errors),u=p.length),c=e===u}else c=!0;if(c){if(void 0!==r.resolveLoader){const e=u;Ce(r.resolveLoader,{instancePath:s+"/resolveLoader",parentData:r,parentDataProperty:"resolveLoader",rootData:l})||(p=null===p?Ce.errors:p.concat(Ce.errors),u=p.length),c=e===u}else c=!0;if(c){if(void 0!==r.snapshot){let t=r.snapshot;const n=u;if(u==u){if(!t||"object"!=typeof t||Array.isArray(t))return we.errors=[{params:{type:"object"}}],!1;{const n=u;for(const e in t)if("buildDependencies"!==e&&"immutablePaths"!==e&&"managedPaths"!==e&&"module"!==e&&"resolve"!==e&&"resolveBuildDependencies"!==e)return we.errors=[{params:{additionalProperty:e}}],!1;if(n===u){if(void 0!==t.buildDependencies){let e=t.buildDependencies;const n=u;if(u===n){if(!e||"object"!=typeof e||Array.isArray(e))return we.errors=[{params:{type:"object"}}],!1;{const t=u;for(const t in e)if("hash"!==t&&"timestamp"!==t)return we.errors=[{params:{additionalProperty:t}}],!1;if(t===u){if(void 0!==e.hash){const t=u;if("boolean"!=typeof e.hash)return we.errors=[{params:{type:"boolean"}}],!1;var P=t===u}else P=!0;if(P)if(void 0!==e.timestamp){const t=u;if("boolean"!=typeof e.timestamp)return we.errors=[{params:{type:"boolean"}}],!1;P=t===u}else P=!0}}}var A=n===u}else A=!0;if(A){if(void 0!==t.immutablePaths){let n=t.immutablePaths;const r=u;if(u===r){if(!Array.isArray(n))return we.errors=[{params:{type:"array"}}],!1;{const t=n.length;for(let r=0;r=",limit:1}};null===p?p=[e]:p.push(e),f++}}else{const e={params:{type:"number"}};null===p?p=[e]:p.push(e),f++}d=n===f}else d=!0;if(d)if(void 0!==t.type){const e=f;if("memory"!==t.type){const e={params:{}};null===p?p=[e]:p.push(e),f++}d=e===f}else d=!0}}}}else{const e={params:{type:"object"}};null===p?p=[e]:p.push(e),f++}if(m=o===f,c=c||m,!c){const o=f;if(f==f)if(t&&"object"==typeof t&&!Array.isArray(t)){let o;if(void 0===t.type&&(o="type")){const e={params:{missingProperty:o}};null===p?p=[e]:p.push(e),f++}else{const o=f;for(const e in t)if(!n.call(r.properties,e)){const t={params:{additionalProperty:e}};null===p?p=[t]:p.push(t),f++;break}if(o===f){if(void 0!==t.allowCollectingMemory){const e=f;if("boolean"!=typeof t.allowCollectingMemory){const e={params:{type:"boolean"}};null===p?p=[e]:p.push(e),f++}var h=e===f}else h=!0;if(h){if(void 0!==t.buildDependencies){let e=t.buildDependencies;const n=f;if(f===n)if(e&&"object"==typeof e&&!Array.isArray(e))for(const t in e){let n=e[t];const r=f;if(f===r)if(Array.isArray(n)){const e=n.length;for(let t=0;t=",limit:0}};null===p?p=[e]:p.push(e),f++}}else{const e={params:{type:"number"}};null===p?p=[e]:p.push(e),f++}h=n===f}else h=!0;if(h){if(void 0!==t.idleTimeoutAfterLargeChanges){let e=t.idleTimeoutAfterLargeChanges;const n=f;if(f===n)if("number"==typeof e){if(e<0||isNaN(e)){const e={params:{comparison:">=",limit:0}};null===p?p=[e]:p.push(e),f++}}else{const e={params:{type:"number"}};null===p?p=[e]:p.push(e),f++}h=n===f}else h=!0;if(h){if(void 0!==t.idleTimeoutForInitialStore){let e=t.idleTimeoutForInitialStore;const n=f;if(f===n)if("number"==typeof e){if(e<0||isNaN(e)){const e={params:{comparison:">=",limit:0}};null===p?p=[e]:p.push(e),f++}}else{const e={params:{type:"number"}};null===p?p=[e]:p.push(e),f++}h=n===f}else h=!0;if(h){if(void 0!==t.immutablePaths){let n=t.immutablePaths;const r=f;if(f===r)if(Array.isArray(n)){const t=n.length;for(let r=0;r=",limit:0}};null===p?p=[e]:p.push(e),f++}}else{const e={params:{type:"number"}};null===p?p=[e]:p.push(e),f++}h=n===f}else h=!0;if(h){if(void 0!==t.maxMemoryGenerations){let e=t.maxMemoryGenerations;const n=f;if(f===n)if("number"==typeof e){if(e<0||isNaN(e)){const e={params:{comparison:">=",limit:0}};null===p?p=[e]:p.push(e),f++}}else{const e={params:{type:"number"}};null===p?p=[e]:p.push(e),f++}h=n===f}else h=!0;if(h){if(void 0!==t.memoryCacheUnaffected){const e=f;if("boolean"!=typeof t.memoryCacheUnaffected){const e={params:{type:"boolean"}};null===p?p=[e]:p.push(e),f++}h=e===f}else h=!0;if(h){if(void 0!==t.name){const e=f;if("string"!=typeof t.name){const e={params:{type:"string"}};null===p?p=[e]:p.push(e),f++}h=e===f}else h=!0;if(h){if(void 0!==t.profile){const e=f;if("boolean"!=typeof t.profile){const e={params:{type:"boolean"}};null===p?p=[e]:p.push(e),f++}h=e===f}else h=!0;if(h){if(void 0!==t.readonly){const e=f;if("boolean"!=typeof t.readonly){const e={params:{type:"boolean"}};null===p?p=[e]:p.push(e),f++}h=e===f}else h=!0;if(h){if(void 0!==t.store){const e=f;if("pack"!==t.store){const e={params:{}};null===p?p=[e]:p.push(e),f++}h=e===f}else h=!0;if(h){if(void 0!==t.type){const e=f;if("filesystem"!==t.type){const e={params:{}};null===p?p=[e]:p.push(e),f++}h=e===f}else h=!0;if(h)if(void 0!==t.version){const e=f;if("string"!=typeof t.version){const e={params:{type:"string"}};null===p?p=[e]:p.push(e),f++}h=e===f}else h=!0}}}}}}}}}}}}}}}}}}}}}else{const e={params:{type:"object"}};null===p?p=[e]:p.push(e),f++}m=o===f,c=c||m}}if(!c){const e={params:{}};return null===p?p=[e]:p.push(e),f++,o.errors=p,!1}return f=u,null!==p&&(u?p.length=u:p=null),o.errors=p,0===f}function s(e,{instancePath:t="",parentData:n,parentDataProperty:r,rootData:i=e}={}){let a=null,l=0;const p=l;let f=!1;const u=l;if(!0!==e){const e={params:{}};null===a?a=[e]:a.push(e),l++}var c=u===l;if(f=f||c,!f){const s=l;o(e,{instancePath:t,parentData:n,parentDataProperty:r,rootData:i})||(a=null===a?o.errors:a.concat(o.errors),l=a.length),c=s===l,f=f||c}if(!f){const e={params:{}};return null===a?a=[e]:a.push(e),l++,s.errors=a,!1}return l=p,null!==a&&(p?a.length=p:a=null),s.errors=a,0===l}const i={type:"object",additionalProperties:!1,properties:{asyncChunks:{type:"boolean"},baseUri:{type:"string"},chunkLoading:{$ref:"#/definitions/ChunkLoading"},dependOn:{anyOf:[{type:"array",items:{type:"string",minLength:1},minItems:1,uniqueItems:!0},{type:"string",minLength:1}]},filename:{$ref:"#/definitions/EntryFilename"},import:{$ref:"#/definitions/EntryItem"},layer:{$ref:"#/definitions/Layer"},library:{$ref:"#/definitions/LibraryOptions"},publicPath:{$ref:"#/definitions/PublicPath"},runtime:{$ref:"#/definitions/EntryRuntime"},wasmLoading:{$ref:"#/definitions/WasmLoading"}},required:["import"]};function a(e,{instancePath:t="",parentData:n,parentDataProperty:r,rootData:o=e}={}){let s=null,i=0;const l=i;let p=!1;const f=i;if(!1!==e){const e={params:{}};null===s?s=[e]:s.push(e),i++}var u=f===i;if(p=p||u,!p){const t=i,n=i;let r=!1;const o=i;if("jsonp"!==e&&"import-scripts"!==e&&"require"!==e&&"async-node"!==e&&"import"!==e){const e={params:{}};null===s?s=[e]:s.push(e),i++}var c=o===i;if(r=r||c,!r){const t=i;if("string"!=typeof e){const e={params:{type:"string"}};null===s?s=[e]:s.push(e),i++}c=t===i,r=r||c}if(r)i=n,null!==s&&(n?s.length=n:s=null);else{const e={params:{}};null===s?s=[e]:s.push(e),i++}u=t===i,p=p||u}if(!p){const e={params:{}};return null===s?s=[e]:s.push(e),i++,a.errors=s,!1}return i=l,null!==s&&(l?s.length=l:s=null),a.errors=s,0===i}function l(t,{instancePath:n="",parentData:r,parentDataProperty:o,rootData:s=t}={}){let i=null,a=0;const p=a;let f=!1,u=null;const c=a,y=a;let m=!1;const d=a;if(a===d)if("string"==typeof t){if(t.includes("!")||!1!==e.test(t)){const e={params:{}};null===i?i=[e]:i.push(e),a++}else if(t.length<1){const e={params:{}};null===i?i=[e]:i.push(e),a++}}else{const e={params:{type:"string"}};null===i?i=[e]:i.push(e),a++}var h=d===a;if(m=m||h,!m){const e=a;if(!(t instanceof Function)){const e={params:{}};null===i?i=[e]:i.push(e),a++}h=e===a,m=m||h}if(m)a=y,null!==i&&(y?i.length=y:i=null);else{const e={params:{}};null===i?i=[e]:i.push(e),a++}if(c===a&&(f=!0,u=0),!f){const e={params:{passingSchemas:u}};return null===i?i=[e]:i.push(e),a++,l.errors=i,!1}return a=p,null!==i&&(p?i.length=p:i=null),l.errors=i,0===a}function p(e,{instancePath:t="",parentData:n,parentDataProperty:r,rootData:o=e}={}){let s=null,i=0;const a=i;let l=!1;const f=i;if("string"!=typeof e){const e={params:{type:"string"}};null===s?s=[e]:s.push(e),i++}var u=f===i;if(l=l||u,!l){const t=i;if(i==i)if(e&&"object"==typeof e&&!Array.isArray(e)){const t=i;for(const t in e)if("amd"!==t&&"commonjs"!==t&&"commonjs2"!==t&&"root"!==t){const e={params:{additionalProperty:t}};null===s?s=[e]:s.push(e),i++;break}if(t===i){if(void 0!==e.amd){const t=i;if("string"!=typeof e.amd){const e={params:{type:"string"}};null===s?s=[e]:s.push(e),i++}var c=t===i}else c=!0;if(c){if(void 0!==e.commonjs){const t=i;if("string"!=typeof e.commonjs){const e={params:{type:"string"}};null===s?s=[e]:s.push(e),i++}c=t===i}else c=!0;if(c){if(void 0!==e.commonjs2){const t=i;if("string"!=typeof e.commonjs2){const e={params:{type:"string"}};null===s?s=[e]:s.push(e),i++}c=t===i}else c=!0;if(c)if(void 0!==e.root){const t=i;if("string"!=typeof e.root){const e={params:{type:"string"}};null===s?s=[e]:s.push(e),i++}c=t===i}else c=!0}}}}else{const e={params:{type:"object"}};null===s?s=[e]:s.push(e),i++}u=t===i,l=l||u}if(!l){const e={params:{}};return null===s?s=[e]:s.push(e),i++,p.errors=s,!1}return i=a,null!==s&&(a?s.length=a:s=null),p.errors=s,0===i}function f(e,{instancePath:t="",parentData:n,parentDataProperty:r,rootData:o=e}={}){let s=null,i=0;const a=i;let l=!1;const p=i;if(i===p)if(Array.isArray(e))if(e.length<1){const e={params:{limit:1}};null===s?s=[e]:s.push(e),i++}else{const t=e.length;for(let n=0;n1){const r={};for(;n--;){let o=t[n];if("string"==typeof o){if("number"==typeof r[o]){e=r[o];const t={params:{i:n,j:e}};null===p?p=[t]:p.push(t),f++;break}r[o]=n}}}}}else{const e={params:{type:"array"}};null===p?p=[e]:p.push(e),f++}var g=s===f;if(o=o||g,!o){const e=f;if(f===e)if("string"==typeof t){if(t.length<1){const e={params:{}};null===p?p=[e]:p.push(e),f++}}else{const e={params:{type:"string"}};null===p?p=[e]:p.push(e),f++}g=e===f,o=o||g}if(!o){const e={params:{}};return null===p?p=[e]:p.push(e),f++,m.errors=p,!1}f=r,null!==p&&(r?p.length=r:p=null),d=n===f}else d=!0;if(d){if(void 0!==e.filename){const n=f;l(e.filename,{instancePath:t+"/filename",parentData:e,parentDataProperty:"filename",rootData:s})||(p=null===p?l.errors:p.concat(l.errors),f=p.length),d=n===f}else d=!0;if(d){if(void 0!==e.import){let t=e.import;const n=f,r=f;let o=!1;const s=f;if(f===s)if(Array.isArray(t))if(t.length<1){const e={params:{limit:1}};null===p?p=[e]:p.push(e),f++}else{var b=!0;const e=t.length;for(let n=0;n1){const r={};for(;n--;){let o=t[n];if("string"==typeof o){if("number"==typeof r[o]){e=r[o];const t={params:{i:n,j:e}};null===p?p=[t]:p.push(t),f++;break}r[o]=n}}}}}else{const e={params:{type:"array"}};null===p?p=[e]:p.push(e),f++}var v=s===f;if(o=o||v,!o){const e=f;if(f===e)if("string"==typeof t){if(t.length<1){const e={params:{}};null===p?p=[e]:p.push(e),f++}}else{const e={params:{type:"string"}};null===p?p=[e]:p.push(e),f++}v=e===f,o=o||v}if(!o){const e={params:{}};return null===p?p=[e]:p.push(e),f++,m.errors=p,!1}f=r,null!==p&&(r?p.length=r:p=null),d=n===f}else d=!0;if(d){if(void 0!==e.layer){let t=e.layer;const n=f,r=f;let o=!1;const s=f;if(null!==t){const e={params:{}};null===p?p=[e]:p.push(e),f++}var P=s===f;if(o=o||P,!o){const e=f;if(f===e)if("string"==typeof t){if(t.length<1){const e={params:{}};null===p?p=[e]:p.push(e),f++}}else{const e={params:{type:"string"}};null===p?p=[e]:p.push(e),f++}P=e===f,o=o||P}if(!o){const e={params:{}};return null===p?p=[e]:p.push(e),f++,m.errors=p,!1}f=r,null!==p&&(r?p.length=r:p=null),d=n===f}else d=!0;if(d){if(void 0!==e.library){const n=f;u(e.library,{instancePath:t+"/library",parentData:e,parentDataProperty:"library",rootData:s})||(p=null===p?u.errors:p.concat(u.errors),f=p.length),d=n===f}else d=!0;if(d){if(void 0!==e.publicPath){const n=f;c(e.publicPath,{instancePath:t+"/publicPath",parentData:e,parentDataProperty:"publicPath",rootData:s})||(p=null===p?c.errors:p.concat(c.errors),f=p.length),d=n===f}else d=!0;if(d){if(void 0!==e.runtime){let t=e.runtime;const n=f,r=f;let o=!1;const s=f;if(!1!==t){const e={params:{}};null===p?p=[e]:p.push(e),f++}var D=s===f;if(o=o||D,!o){const e=f;if(f===e)if("string"==typeof t){if(t.length<1){const e={params:{}};null===p?p=[e]:p.push(e),f++}}else{const e={params:{type:"string"}};null===p?p=[e]:p.push(e),f++}D=e===f,o=o||D}if(!o){const e={params:{}};return null===p?p=[e]:p.push(e),f++,m.errors=p,!1}f=r,null!==p&&(r?p.length=r:p=null),d=n===f}else d=!0;if(d)if(void 0!==e.wasmLoading){const n=f;y(e.wasmLoading,{instancePath:t+"/wasmLoading",parentData:e,parentDataProperty:"wasmLoading",rootData:s})||(p=null===p?y.errors:p.concat(y.errors),f=p.length),d=n===f}else d=!0}}}}}}}}}}}}}return m.errors=p,0===f}function d(e,{instancePath:t="",parentData:n,parentDataProperty:r,rootData:o=e}={}){let s=null,i=0;if(0===i){if(!e||"object"!=typeof e||Array.isArray(e))return d.errors=[{params:{type:"object"}}],!1;for(const n in e){let r=e[n];const f=i,u=i;let c=!1;const y=i,h=i;let g=!1;const b=i;if(i===b)if(Array.isArray(r))if(r.length<1){const e={params:{limit:1}};null===s?s=[e]:s.push(e),i++}else{var a=!0;const e=r.length;for(let t=0;t1){const n={};for(;t--;){let o=r[t];if("string"==typeof o){if("number"==typeof n[o]){e=n[o];const r={params:{i:t,j:e}};null===s?s=[r]:s.push(r),i++;break}n[o]=t}}}}}else{const e={params:{type:"array"}};null===s?s=[e]:s.push(e),i++}var l=b===i;if(g=g||l,!g){const e=i;if(i===e)if("string"==typeof r){if(r.length<1){const e={params:{}};null===s?s=[e]:s.push(e),i++}}else{const e={params:{type:"string"}};null===s?s=[e]:s.push(e),i++}l=e===i,g=g||l}if(g)i=h,null!==s&&(h?s.length=h:s=null);else{const e={params:{}};null===s?s=[e]:s.push(e),i++}var p=y===i;if(c=c||p,!c){const a=i;m(r,{instancePath:t+"/"+n.replace(/~/g,"~0").replace(/\//g,"~1"),parentData:e,parentDataProperty:n,rootData:o})||(s=null===s?m.errors:s.concat(m.errors),i=s.length),p=a===i,c=c||p}if(!c){const e={params:{}};return null===s?s=[e]:s.push(e),i++,d.errors=s,!1}if(i=u,null!==s&&(u?s.length=u:s=null),f!==i)break}}return d.errors=s,0===i}function h(e,{instancePath:t="",parentData:n,parentDataProperty:r,rootData:o=e}={}){let s=null,i=0;const a=i;let l=!1,p=null;const f=i,u=i;let c=!1;const y=i;if(i===y)if(Array.isArray(e))if(e.length<1){const e={params:{limit:1}};null===s?s=[e]:s.push(e),i++}else{var m=!0;const t=e.length;for(let n=0;n1){const r={};for(;n--;){let o=e[n];if("string"==typeof o){if("number"==typeof r[o]){t=r[o];const e={params:{i:n,j:t}};null===s?s=[e]:s.push(e),i++;break}r[o]=n}}}}}else{const e={params:{type:"array"}};null===s?s=[e]:s.push(e),i++}var d=y===i;if(c=c||d,!c){const t=i;if(i===t)if("string"==typeof e){if(e.length<1){const e={params:{}};null===s?s=[e]:s.push(e),i++}}else{const e={params:{type:"string"}};null===s?s=[e]:s.push(e),i++}d=t===i,c=c||d}if(c)i=u,null!==s&&(u?s.length=u:s=null);else{const e={params:{}};null===s?s=[e]:s.push(e),i++}if(f===i&&(l=!0,p=0),!l){const e={params:{passingSchemas:p}};return null===s?s=[e]:s.push(e),i++,h.errors=s,!1}return i=a,null!==s&&(a?s.length=a:s=null),h.errors=s,0===i}function g(e,{instancePath:t="",parentData:n,parentDataProperty:r,rootData:o=e}={}){let s=null,i=0;const a=i;let l=!1;const p=i;d(e,{instancePath:t,parentData:n,parentDataProperty:r,rootData:o})||(s=null===s?d.errors:s.concat(d.errors),i=s.length);var f=p===i;if(l=l||f,!l){const a=i;h(e,{instancePath:t,parentData:n,parentDataProperty:r,rootData:o})||(s=null===s?h.errors:s.concat(h.errors),i=s.length),f=a===i,l=l||f}if(!l){const e={params:{}};return null===s?s=[e]:s.push(e),i++,g.errors=s,!1}return i=a,null!==s&&(a?s.length=a:s=null),g.errors=s,0===i}function b(e,{instancePath:t="",parentData:n,parentDataProperty:r,rootData:o=e}={}){let s=null,i=0;const a=i;let l=!1;const p=i;if(!(e instanceof Function)){const e={params:{}};null===s?s=[e]:s.push(e),i++}var f=p===i;if(l=l||f,!l){const a=i;g(e,{instancePath:t,parentData:n,parentDataProperty:r,rootData:o})||(s=null===s?g.errors:s.concat(g.errors),i=s.length),f=a===i,l=l||f}if(!l){const e={params:{}};return null===s?s=[e]:s.push(e),i++,b.errors=s,!1}return i=a,null!==s&&(a?s.length=a:s=null),b.errors=s,0===i}const v={type:"object",additionalProperties:!1,properties:{asyncWebAssembly:{type:"boolean"},backCompat:{type:"boolean"},buildHttp:{anyOf:[{$ref:"#/definitions/HttpUriAllowedUris"},{$ref:"#/definitions/HttpUriOptions"}]},cacheUnaffected:{type:"boolean"},css:{anyOf:[{type:"boolean"},{$ref:"#/definitions/CssExperimentOptions"}]},futureDefaults:{type:"boolean"},layers:{type:"boolean"},lazyCompilation:{anyOf:[{type:"boolean"},{$ref:"#/definitions/LazyCompilationOptions"}]},outputModule:{type:"boolean"},syncWebAssembly:{type:"boolean"},topLevelAwait:{type:"boolean"}}},P=new RegExp("^https?://","u");function D(e,{instancePath:t="",parentData:n,parentDataProperty:r,rootData:o=e}={}){let s=null,i=0;const a=i;let l=!1,p=null;const f=i;if(i==i)if(Array.isArray(e)){const t=e.length;for(let n=0;n=",limit:0}};null===a?a=[e]:a.push(e),l++}}else{const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}var u=y===l;if(c=c||u,!c){const t=l;if(l===t)if(e&&"object"==typeof e&&!Array.isArray(e))for(const t in e){const n=l;if("number"!=typeof e[t]){const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}if(n!==l)break}else{const e={params:{type:"object"}};null===a?a=[e]:a.push(e),l++}u=t===l,c=c||u}if(c)l=f,null!==a&&(f?a.length=f:a=null);else{const e={params:{}};null===a?a=[e]:a.push(e),l++}if(i===l&&(o=!0,s=0),!o){const e={params:{passingSchemas:s}};return null===a?a=[e]:a.push(e),l++,fe.errors=a,!1}l=r,null!==a&&(r?a.length=r:a=null),p=n===l}else p=!0;if(p){if(void 0!==t.filename){let n=t.filename;const r=l,o=l;let s=!1;const i=l;if(l===i)if("string"==typeof n){if(n.includes("!")||!1!==e.test(n)){const e={params:{}};null===a?a=[e]:a.push(e),l++}else if(n.length<1){const e={params:{}};null===a?a=[e]:a.push(e),l++}}else{const e={params:{type:"string"}};null===a?a=[e]:a.push(e),l++}var c=i===l;if(s=s||c,!s){const e=l;if(!(n instanceof Function)){const e={params:{}};null===a?a=[e]:a.push(e),l++}c=e===l,s=s||c}if(!s){const e={params:{}};return null===a?a=[e]:a.push(e),l++,fe.errors=a,!1}l=o,null!==a&&(o?a.length=o:a=null),p=r===l}else p=!0;if(p){if(void 0!==t.idHint){const e=l;if("string"!=typeof t.idHint)return fe.errors=[{params:{type:"string"}}],!1;p=e===l}else p=!0;if(p){if(void 0!==t.layer){let e=t.layer;const n=l,r=l;let o=!1;const s=l;if(!(e instanceof RegExp)){const e={params:{}};null===a?a=[e]:a.push(e),l++}var y=s===l;if(o=o||y,!o){const t=l;if("string"!=typeof e){const e={params:{type:"string"}};null===a?a=[e]:a.push(e),l++}if(y=t===l,o=o||y,!o){const t=l;if(!(e instanceof Function)){const e={params:{}};null===a?a=[e]:a.push(e),l++}y=t===l,o=o||y}}if(!o){const e={params:{}};return null===a?a=[e]:a.push(e),l++,fe.errors=a,!1}l=r,null!==a&&(r?a.length=r:a=null),p=n===l}else p=!0;if(p){if(void 0!==t.maxAsyncRequests){let e=t.maxAsyncRequests;const n=l;if(l===n){if("number"!=typeof e)return fe.errors=[{params:{type:"number"}}],!1;if(e<1||isNaN(e))return fe.errors=[{params:{comparison:">=",limit:1}}],!1}p=n===l}else p=!0;if(p){if(void 0!==t.maxAsyncSize){let e=t.maxAsyncSize;const n=l,r=l;let o=!1,s=null;const i=l,f=l;let u=!1;const c=l;if(l===c)if("number"==typeof e){if(e<0||isNaN(e)){const e={params:{comparison:">=",limit:0}};null===a?a=[e]:a.push(e),l++}}else{const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}var m=c===l;if(u=u||m,!u){const t=l;if(l===t)if(e&&"object"==typeof e&&!Array.isArray(e))for(const t in e){const n=l;if("number"!=typeof e[t]){const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}if(n!==l)break}else{const e={params:{type:"object"}};null===a?a=[e]:a.push(e),l++}m=t===l,u=u||m}if(u)l=f,null!==a&&(f?a.length=f:a=null);else{const e={params:{}};null===a?a=[e]:a.push(e),l++}if(i===l&&(o=!0,s=0),!o){const e={params:{passingSchemas:s}};return null===a?a=[e]:a.push(e),l++,fe.errors=a,!1}l=r,null!==a&&(r?a.length=r:a=null),p=n===l}else p=!0;if(p){if(void 0!==t.maxInitialRequests){let e=t.maxInitialRequests;const n=l;if(l===n){if("number"!=typeof e)return fe.errors=[{params:{type:"number"}}],!1;if(e<1||isNaN(e))return fe.errors=[{params:{comparison:">=",limit:1}}],!1}p=n===l}else p=!0;if(p){if(void 0!==t.maxInitialSize){let e=t.maxInitialSize;const n=l,r=l;let o=!1,s=null;const i=l,f=l;let u=!1;const c=l;if(l===c)if("number"==typeof e){if(e<0||isNaN(e)){const e={params:{comparison:">=",limit:0}};null===a?a=[e]:a.push(e),l++}}else{const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}var d=c===l;if(u=u||d,!u){const t=l;if(l===t)if(e&&"object"==typeof e&&!Array.isArray(e))for(const t in e){const n=l;if("number"!=typeof e[t]){const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}if(n!==l)break}else{const e={params:{type:"object"}};null===a?a=[e]:a.push(e),l++}d=t===l,u=u||d}if(u)l=f,null!==a&&(f?a.length=f:a=null);else{const e={params:{}};null===a?a=[e]:a.push(e),l++}if(i===l&&(o=!0,s=0),!o){const e={params:{passingSchemas:s}};return null===a?a=[e]:a.push(e),l++,fe.errors=a,!1}l=r,null!==a&&(r?a.length=r:a=null),p=n===l}else p=!0;if(p){if(void 0!==t.maxSize){let e=t.maxSize;const n=l,r=l;let o=!1,s=null;const i=l,f=l;let u=!1;const c=l;if(l===c)if("number"==typeof e){if(e<0||isNaN(e)){const e={params:{comparison:">=",limit:0}};null===a?a=[e]:a.push(e),l++}}else{const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}var h=c===l;if(u=u||h,!u){const t=l;if(l===t)if(e&&"object"==typeof e&&!Array.isArray(e))for(const t in e){const n=l;if("number"!=typeof e[t]){const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}if(n!==l)break}else{const e={params:{type:"object"}};null===a?a=[e]:a.push(e),l++}h=t===l,u=u||h}if(u)l=f,null!==a&&(f?a.length=f:a=null);else{const e={params:{}};null===a?a=[e]:a.push(e),l++}if(i===l&&(o=!0,s=0),!o){const e={params:{passingSchemas:s}};return null===a?a=[e]:a.push(e),l++,fe.errors=a,!1}l=r,null!==a&&(r?a.length=r:a=null),p=n===l}else p=!0;if(p){if(void 0!==t.minChunks){let e=t.minChunks;const n=l;if(l===n){if("number"!=typeof e)return fe.errors=[{params:{type:"number"}}],!1;if(e<1||isNaN(e))return fe.errors=[{params:{comparison:">=",limit:1}}],!1}p=n===l}else p=!0;if(p){if(void 0!==t.minRemainingSize){let e=t.minRemainingSize;const n=l,r=l;let o=!1,s=null;const i=l,f=l;let u=!1;const c=l;if(l===c)if("number"==typeof e){if(e<0||isNaN(e)){const e={params:{comparison:">=",limit:0}};null===a?a=[e]:a.push(e),l++}}else{const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}var g=c===l;if(u=u||g,!u){const t=l;if(l===t)if(e&&"object"==typeof e&&!Array.isArray(e))for(const t in e){const n=l;if("number"!=typeof e[t]){const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}if(n!==l)break}else{const e={params:{type:"object"}};null===a?a=[e]:a.push(e),l++}g=t===l,u=u||g}if(u)l=f,null!==a&&(f?a.length=f:a=null);else{const e={params:{}};null===a?a=[e]:a.push(e),l++}if(i===l&&(o=!0,s=0),!o){const e={params:{passingSchemas:s}};return null===a?a=[e]:a.push(e),l++,fe.errors=a,!1}l=r,null!==a&&(r?a.length=r:a=null),p=n===l}else p=!0;if(p){if(void 0!==t.minSize){let e=t.minSize;const n=l,r=l;let o=!1,s=null;const i=l,f=l;let u=!1;const c=l;if(l===c)if("number"==typeof e){if(e<0||isNaN(e)){const e={params:{comparison:">=",limit:0}};null===a?a=[e]:a.push(e),l++}}else{const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}var b=c===l;if(u=u||b,!u){const t=l;if(l===t)if(e&&"object"==typeof e&&!Array.isArray(e))for(const t in e){const n=l;if("number"!=typeof e[t]){const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}if(n!==l)break}else{const e={params:{type:"object"}};null===a?a=[e]:a.push(e),l++}b=t===l,u=u||b}if(u)l=f,null!==a&&(f?a.length=f:a=null);else{const e={params:{}};null===a?a=[e]:a.push(e),l++}if(i===l&&(o=!0,s=0),!o){const e={params:{passingSchemas:s}};return null===a?a=[e]:a.push(e),l++,fe.errors=a,!1}l=r,null!==a&&(r?a.length=r:a=null),p=n===l}else p=!0;if(p){if(void 0!==t.minSizeReduction){let e=t.minSizeReduction;const n=l,r=l;let o=!1,s=null;const i=l,f=l;let u=!1;const c=l;if(l===c)if("number"==typeof e){if(e<0||isNaN(e)){const e={params:{comparison:">=",limit:0}};null===a?a=[e]:a.push(e),l++}}else{const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}var v=c===l;if(u=u||v,!u){const t=l;if(l===t)if(e&&"object"==typeof e&&!Array.isArray(e))for(const t in e){const n=l;if("number"!=typeof e[t]){const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}if(n!==l)break}else{const e={params:{type:"object"}};null===a?a=[e]:a.push(e),l++}v=t===l,u=u||v}if(u)l=f,null!==a&&(f?a.length=f:a=null);else{const e={params:{}};null===a?a=[e]:a.push(e),l++}if(i===l&&(o=!0,s=0),!o){const e={params:{passingSchemas:s}};return null===a?a=[e]:a.push(e),l++,fe.errors=a,!1}l=r,null!==a&&(r?a.length=r:a=null),p=n===l}else p=!0;if(p){if(void 0!==t.name){let e=t.name;const n=l,r=l;let o=!1;const s=l;if(!1!==e){const e={params:{}};null===a?a=[e]:a.push(e),l++}var P=s===l;if(o=o||P,!o){const t=l;if("string"!=typeof e){const e={params:{type:"string"}};null===a?a=[e]:a.push(e),l++}if(P=t===l,o=o||P,!o){const t=l;if(!(e instanceof Function)){const e={params:{}};null===a?a=[e]:a.push(e),l++}P=t===l,o=o||P}}if(!o){const e={params:{}};return null===a?a=[e]:a.push(e),l++,fe.errors=a,!1}l=r,null!==a&&(r?a.length=r:a=null),p=n===l}else p=!0;if(p){if(void 0!==t.priority){const e=l;if("number"!=typeof t.priority)return fe.errors=[{params:{type:"number"}}],!1;p=e===l}else p=!0;if(p){if(void 0!==t.reuseExistingChunk){const e=l;if("boolean"!=typeof t.reuseExistingChunk)return fe.errors=[{params:{type:"boolean"}}],!1;p=e===l}else p=!0;if(p){if(void 0!==t.test){let e=t.test;const n=l,r=l;let o=!1;const s=l;if(!(e instanceof RegExp)){const e={params:{}};null===a?a=[e]:a.push(e),l++}var D=s===l;if(o=o||D,!o){const t=l;if("string"!=typeof e){const e={params:{type:"string"}};null===a?a=[e]:a.push(e),l++}if(D=t===l,o=o||D,!o){const t=l;if(!(e instanceof Function)){const e={params:{}};null===a?a=[e]:a.push(e),l++}D=t===l,o=o||D}}if(!o){const e={params:{}};return null===a?a=[e]:a.push(e),l++,fe.errors=a,!1}l=r,null!==a&&(r?a.length=r:a=null),p=n===l}else p=!0;if(p){if(void 0!==t.type){let e=t.type;const n=l,r=l;let o=!1;const s=l;if(!(e instanceof RegExp)){const e={params:{}};null===a?a=[e]:a.push(e),l++}var O=s===l;if(o=o||O,!o){const t=l;if("string"!=typeof e){const e={params:{type:"string"}};null===a?a=[e]:a.push(e),l++}if(O=t===l,o=o||O,!o){const t=l;if(!(e instanceof Function)){const e={params:{}};null===a?a=[e]:a.push(e),l++}O=t===l,o=o||O}}if(!o){const e={params:{}};return null===a?a=[e]:a.push(e),l++,fe.errors=a,!1}l=r,null!==a&&(r?a.length=r:a=null),p=n===l}else p=!0;if(p)if(void 0!==t.usedExports){const e=l;if("boolean"!=typeof t.usedExports)return fe.errors=[{params:{type:"boolean"}}],!1;p=e===l}else p=!0}}}}}}}}}}}}}}}}}}}}}}}return fe.errors=a,0===l}function ue(t,{instancePath:r="",parentData:o,parentDataProperty:s,rootData:i=t}={}){let a=null,l=0;if(0===l){if(!t||"object"!=typeof t||Array.isArray(t))return ue.errors=[{params:{type:"object"}}],!1;{const o=l;for(const e in t)if(!n.call(le.properties,e))return ue.errors=[{params:{additionalProperty:e}}],!1;if(o===l){if(void 0!==t.automaticNameDelimiter){let e=t.automaticNameDelimiter;const n=l;if(l===n){if("string"!=typeof e)return ue.errors=[{params:{type:"string"}}],!1;if(e.length<1)return ue.errors=[{params:{}}],!1}var p=n===l}else p=!0;if(p){if(void 0!==t.cacheGroups){let e=t.cacheGroups;const n=l,o=l,s=l;if(l===s)if(e&&"object"==typeof e&&!Array.isArray(e)){let t;if(void 0===e.test&&(t="test")){const e={};null===a?a=[e]:a.push(e),l++}else if(void 0!==e.test){let t=e.test;const n=l;let r=!1;const o=l;if(!(t instanceof RegExp)){const e={};null===a?a=[e]:a.push(e),l++}var f=o===l;if(r=r||f,!r){const e=l;if("string"!=typeof t){const e={};null===a?a=[e]:a.push(e),l++}if(f=e===l,r=r||f,!r){const e=l;if(!(t instanceof Function)){const e={};null===a?a=[e]:a.push(e),l++}f=e===l,r=r||f}}if(r)l=n,null!==a&&(n?a.length=n:a=null);else{const e={};null===a?a=[e]:a.push(e),l++}}}else{const e={};null===a?a=[e]:a.push(e),l++}if(s===l)return ue.errors=[{params:{}}],!1;if(l=o,null!==a&&(o?a.length=o:a=null),l===n){if(!e||"object"!=typeof e||Array.isArray(e))return ue.errors=[{params:{type:"object"}}],!1;for(const t in e){let n=e[t];const o=l,s=l;let p=!1;const f=l;if(!1!==n){const e={params:{}};null===a?a=[e]:a.push(e),l++}var u=f===l;if(p=p||u,!p){const o=l;if(!(n instanceof RegExp)){const e={params:{}};null===a?a=[e]:a.push(e),l++}if(u=o===l,p=p||u,!p){const o=l;if("string"!=typeof n){const e={params:{type:"string"}};null===a?a=[e]:a.push(e),l++}if(u=o===l,p=p||u,!p){const o=l;if(!(n instanceof Function)){const e={params:{}};null===a?a=[e]:a.push(e),l++}if(u=o===l,p=p||u,!p){const o=l;fe(n,{instancePath:r+"/cacheGroups/"+t.replace(/~/g,"~0").replace(/\//g,"~1"),parentData:e,parentDataProperty:t,rootData:i})||(a=null===a?fe.errors:a.concat(fe.errors),l=a.length),u=o===l,p=p||u}}}}if(!p){const e={params:{}};return null===a?a=[e]:a.push(e),l++,ue.errors=a,!1}if(l=s,null!==a&&(s?a.length=s:a=null),o!==l)break}}p=n===l}else p=!0;if(p){if(void 0!==t.chunks){let e=t.chunks;const n=l,r=l;let o=!1;const s=l;if("initial"!==e&&"async"!==e&&"all"!==e){const e={params:{}};null===a?a=[e]:a.push(e),l++}var c=s===l;if(o=o||c,!o){const t=l;if(!(e instanceof RegExp)){const e={params:{}};null===a?a=[e]:a.push(e),l++}if(c=t===l,o=o||c,!o){const t=l;if(!(e instanceof Function)){const e={params:{}};null===a?a=[e]:a.push(e),l++}c=t===l,o=o||c}}if(!o){const e={params:{}};return null===a?a=[e]:a.push(e),l++,ue.errors=a,!1}l=r,null!==a&&(r?a.length=r:a=null),p=n===l}else p=!0;if(p){if(void 0!==t.defaultSizeTypes){let e=t.defaultSizeTypes;const n=l;if(l===n){if(!Array.isArray(e))return ue.errors=[{params:{type:"array"}}],!1;if(e.length<1)return ue.errors=[{params:{limit:1}}],!1;{const t=e.length;for(let n=0;n=",limit:0}};null===a?a=[e]:a.push(e),l++}}else{const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}var y=c===l;if(u=u||y,!u){const t=l;if(l===t)if(e&&"object"==typeof e&&!Array.isArray(e))for(const t in e){const n=l;if("number"!=typeof e[t]){const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}if(n!==l)break}else{const e={params:{type:"object"}};null===a?a=[e]:a.push(e),l++}y=t===l,u=u||y}if(u)l=f,null!==a&&(f?a.length=f:a=null);else{const e={params:{}};null===a?a=[e]:a.push(e),l++}if(i===l&&(o=!0,s=0),!o){const e={params:{passingSchemas:s}};return null===a?a=[e]:a.push(e),l++,ue.errors=a,!1}l=r,null!==a&&(r?a.length=r:a=null),p=n===l}else p=!0;if(p){if(void 0!==t.fallbackCacheGroup){let e=t.fallbackCacheGroup;const n=l;if(l===n){if(!e||"object"!=typeof e||Array.isArray(e))return ue.errors=[{params:{type:"object"}}],!1;{const t=l;for(const t in e)if("automaticNameDelimiter"!==t&&"chunks"!==t&&"maxAsyncSize"!==t&&"maxInitialSize"!==t&&"maxSize"!==t&&"minSize"!==t&&"minSizeReduction"!==t)return ue.errors=[{params:{additionalProperty:t}}],!1;if(t===l){if(void 0!==e.automaticNameDelimiter){let t=e.automaticNameDelimiter;const n=l;if(l===n){if("string"!=typeof t)return ue.errors=[{params:{type:"string"}}],!1;if(t.length<1)return ue.errors=[{params:{}}],!1}var m=n===l}else m=!0;if(m){if(void 0!==e.chunks){let t=e.chunks;const n=l,r=l;let o=!1;const s=l;if("initial"!==t&&"async"!==t&&"all"!==t){const e={params:{}};null===a?a=[e]:a.push(e),l++}var d=s===l;if(o=o||d,!o){const e=l;if(!(t instanceof RegExp)){const e={params:{}};null===a?a=[e]:a.push(e),l++}if(d=e===l,o=o||d,!o){const e=l;if(!(t instanceof Function)){const e={params:{}};null===a?a=[e]:a.push(e),l++}d=e===l,o=o||d}}if(!o){const e={params:{}};return null===a?a=[e]:a.push(e),l++,ue.errors=a,!1}l=r,null!==a&&(r?a.length=r:a=null),m=n===l}else m=!0;if(m){if(void 0!==e.maxAsyncSize){let t=e.maxAsyncSize;const n=l,r=l;let o=!1,s=null;const i=l,p=l;let f=!1;const u=l;if(l===u)if("number"==typeof t){if(t<0||isNaN(t)){const e={params:{comparison:">=",limit:0}};null===a?a=[e]:a.push(e),l++}}else{const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}var h=u===l;if(f=f||h,!f){const e=l;if(l===e)if(t&&"object"==typeof t&&!Array.isArray(t))for(const e in t){const n=l;if("number"!=typeof t[e]){const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}if(n!==l)break}else{const e={params:{type:"object"}};null===a?a=[e]:a.push(e),l++}h=e===l,f=f||h}if(f)l=p,null!==a&&(p?a.length=p:a=null);else{const e={params:{}};null===a?a=[e]:a.push(e),l++}if(i===l&&(o=!0,s=0),!o){const e={params:{passingSchemas:s}};return null===a?a=[e]:a.push(e),l++,ue.errors=a,!1}l=r,null!==a&&(r?a.length=r:a=null),m=n===l}else m=!0;if(m){if(void 0!==e.maxInitialSize){let t=e.maxInitialSize;const n=l,r=l;let o=!1,s=null;const i=l,p=l;let f=!1;const u=l;if(l===u)if("number"==typeof t){if(t<0||isNaN(t)){const e={params:{comparison:">=",limit:0}};null===a?a=[e]:a.push(e),l++}}else{const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}var g=u===l;if(f=f||g,!f){const e=l;if(l===e)if(t&&"object"==typeof t&&!Array.isArray(t))for(const e in t){const n=l;if("number"!=typeof t[e]){const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}if(n!==l)break}else{const e={params:{type:"object"}};null===a?a=[e]:a.push(e),l++}g=e===l,f=f||g}if(f)l=p,null!==a&&(p?a.length=p:a=null);else{const e={params:{}};null===a?a=[e]:a.push(e),l++}if(i===l&&(o=!0,s=0),!o){const e={params:{passingSchemas:s}};return null===a?a=[e]:a.push(e),l++,ue.errors=a,!1}l=r,null!==a&&(r?a.length=r:a=null),m=n===l}else m=!0;if(m){if(void 0!==e.maxSize){let t=e.maxSize;const n=l,r=l;let o=!1,s=null;const i=l,p=l;let f=!1;const u=l;if(l===u)if("number"==typeof t){if(t<0||isNaN(t)){const e={params:{comparison:">=",limit:0}};null===a?a=[e]:a.push(e),l++}}else{const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}var b=u===l;if(f=f||b,!f){const e=l;if(l===e)if(t&&"object"==typeof t&&!Array.isArray(t))for(const e in t){const n=l;if("number"!=typeof t[e]){const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}if(n!==l)break}else{const e={params:{type:"object"}};null===a?a=[e]:a.push(e),l++}b=e===l,f=f||b}if(f)l=p,null!==a&&(p?a.length=p:a=null);else{const e={params:{}};null===a?a=[e]:a.push(e),l++}if(i===l&&(o=!0,s=0),!o){const e={params:{passingSchemas:s}};return null===a?a=[e]:a.push(e),l++,ue.errors=a,!1}l=r,null!==a&&(r?a.length=r:a=null),m=n===l}else m=!0;if(m){if(void 0!==e.minSize){let t=e.minSize;const n=l,r=l;let o=!1,s=null;const i=l,p=l;let f=!1;const u=l;if(l===u)if("number"==typeof t){if(t<0||isNaN(t)){const e={params:{comparison:">=",limit:0}};null===a?a=[e]:a.push(e),l++}}else{const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}var v=u===l;if(f=f||v,!f){const e=l;if(l===e)if(t&&"object"==typeof t&&!Array.isArray(t))for(const e in t){const n=l;if("number"!=typeof t[e]){const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}if(n!==l)break}else{const e={params:{type:"object"}};null===a?a=[e]:a.push(e),l++}v=e===l,f=f||v}if(f)l=p,null!==a&&(p?a.length=p:a=null);else{const e={params:{}};null===a?a=[e]:a.push(e),l++}if(i===l&&(o=!0,s=0),!o){const e={params:{passingSchemas:s}};return null===a?a=[e]:a.push(e),l++,ue.errors=a,!1}l=r,null!==a&&(r?a.length=r:a=null),m=n===l}else m=!0;if(m)if(void 0!==e.minSizeReduction){let t=e.minSizeReduction;const n=l,r=l;let o=!1,s=null;const i=l,p=l;let f=!1;const u=l;if(l===u)if("number"==typeof t){if(t<0||isNaN(t)){const e={params:{comparison:">=",limit:0}};null===a?a=[e]:a.push(e),l++}}else{const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}var P=u===l;if(f=f||P,!f){const e=l;if(l===e)if(t&&"object"==typeof t&&!Array.isArray(t))for(const e in t){const n=l;if("number"!=typeof t[e]){const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}if(n!==l)break}else{const e={params:{type:"object"}};null===a?a=[e]:a.push(e),l++}P=e===l,f=f||P}if(f)l=p,null!==a&&(p?a.length=p:a=null);else{const e={params:{}};null===a?a=[e]:a.push(e),l++}if(i===l&&(o=!0,s=0),!o){const e={params:{passingSchemas:s}};return null===a?a=[e]:a.push(e),l++,ue.errors=a,!1}l=r,null!==a&&(r?a.length=r:a=null),m=n===l}else m=!0}}}}}}}}p=n===l}else p=!0;if(p){if(void 0!==t.filename){let n=t.filename;const r=l,o=l;let s=!1;const i=l;if(l===i)if("string"==typeof n){if(n.includes("!")||!1!==e.test(n)){const e={params:{}};null===a?a=[e]:a.push(e),l++}else if(n.length<1){const e={params:{}};null===a?a=[e]:a.push(e),l++}}else{const e={params:{type:"string"}};null===a?a=[e]:a.push(e),l++}var D=i===l;if(s=s||D,!s){const e=l;if(!(n instanceof Function)){const e={params:{}};null===a?a=[e]:a.push(e),l++}D=e===l,s=s||D}if(!s){const e={params:{}};return null===a?a=[e]:a.push(e),l++,ue.errors=a,!1}l=o,null!==a&&(o?a.length=o:a=null),p=r===l}else p=!0;if(p){if(void 0!==t.hidePathInfo){const e=l;if("boolean"!=typeof t.hidePathInfo)return ue.errors=[{params:{type:"boolean"}}],!1;p=e===l}else p=!0;if(p){if(void 0!==t.maxAsyncRequests){let e=t.maxAsyncRequests;const n=l;if(l===n){if("number"!=typeof e)return ue.errors=[{params:{type:"number"}}],!1;if(e<1||isNaN(e))return ue.errors=[{params:{comparison:">=",limit:1}}],!1}p=n===l}else p=!0;if(p){if(void 0!==t.maxAsyncSize){let e=t.maxAsyncSize;const n=l,r=l;let o=!1,s=null;const i=l,f=l;let u=!1;const c=l;if(l===c)if("number"==typeof e){if(e<0||isNaN(e)){const e={params:{comparison:">=",limit:0}};null===a?a=[e]:a.push(e),l++}}else{const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}var O=c===l;if(u=u||O,!u){const t=l;if(l===t)if(e&&"object"==typeof e&&!Array.isArray(e))for(const t in e){const n=l;if("number"!=typeof e[t]){const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}if(n!==l)break}else{const e={params:{type:"object"}};null===a?a=[e]:a.push(e),l++}O=t===l,u=u||O}if(u)l=f,null!==a&&(f?a.length=f:a=null);else{const e={params:{}};null===a?a=[e]:a.push(e),l++}if(i===l&&(o=!0,s=0),!o){const e={params:{passingSchemas:s}};return null===a?a=[e]:a.push(e),l++,ue.errors=a,!1}l=r,null!==a&&(r?a.length=r:a=null),p=n===l}else p=!0;if(p){if(void 0!==t.maxInitialRequests){let e=t.maxInitialRequests;const n=l;if(l===n){if("number"!=typeof e)return ue.errors=[{params:{type:"number"}}],!1;if(e<1||isNaN(e))return ue.errors=[{params:{comparison:">=",limit:1}}],!1}p=n===l}else p=!0;if(p){if(void 0!==t.maxInitialSize){let e=t.maxInitialSize;const n=l,r=l;let o=!1,s=null;const i=l,f=l;let u=!1;const c=l;if(l===c)if("number"==typeof e){if(e<0||isNaN(e)){const e={params:{comparison:">=",limit:0}};null===a?a=[e]:a.push(e),l++}}else{const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}var x=c===l;if(u=u||x,!u){const t=l;if(l===t)if(e&&"object"==typeof e&&!Array.isArray(e))for(const t in e){const n=l;if("number"!=typeof e[t]){const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}if(n!==l)break}else{const e={params:{type:"object"}};null===a?a=[e]:a.push(e),l++}x=t===l,u=u||x}if(u)l=f,null!==a&&(f?a.length=f:a=null);else{const e={params:{}};null===a?a=[e]:a.push(e),l++}if(i===l&&(o=!0,s=0),!o){const e={params:{passingSchemas:s}};return null===a?a=[e]:a.push(e),l++,ue.errors=a,!1}l=r,null!==a&&(r?a.length=r:a=null),p=n===l}else p=!0;if(p){if(void 0!==t.maxSize){let e=t.maxSize;const n=l,r=l;let o=!1,s=null;const i=l,f=l;let u=!1;const c=l;if(l===c)if("number"==typeof e){if(e<0||isNaN(e)){const e={params:{comparison:">=",limit:0}};null===a?a=[e]:a.push(e),l++}}else{const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}var A=c===l;if(u=u||A,!u){const t=l;if(l===t)if(e&&"object"==typeof e&&!Array.isArray(e))for(const t in e){const n=l;if("number"!=typeof e[t]){const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}if(n!==l)break}else{const e={params:{type:"object"}};null===a?a=[e]:a.push(e),l++}A=t===l,u=u||A}if(u)l=f,null!==a&&(f?a.length=f:a=null);else{const e={params:{}};null===a?a=[e]:a.push(e),l++}if(i===l&&(o=!0,s=0),!o){const e={params:{passingSchemas:s}};return null===a?a=[e]:a.push(e),l++,ue.errors=a,!1}l=r,null!==a&&(r?a.length=r:a=null),p=n===l}else p=!0;if(p){if(void 0!==t.minChunks){let e=t.minChunks;const n=l;if(l===n){if("number"!=typeof e)return ue.errors=[{params:{type:"number"}}],!1;if(e<1||isNaN(e))return ue.errors=[{params:{comparison:">=",limit:1}}],!1}p=n===l}else p=!0;if(p){if(void 0!==t.minRemainingSize){let e=t.minRemainingSize;const n=l,r=l;let o=!1,s=null;const i=l,f=l;let u=!1;const c=l;if(l===c)if("number"==typeof e){if(e<0||isNaN(e)){const e={params:{comparison:">=",limit:0}};null===a?a=[e]:a.push(e),l++}}else{const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}var C=c===l;if(u=u||C,!u){const t=l;if(l===t)if(e&&"object"==typeof e&&!Array.isArray(e))for(const t in e){const n=l;if("number"!=typeof e[t]){const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}if(n!==l)break}else{const e={params:{type:"object"}};null===a?a=[e]:a.push(e),l++}C=t===l,u=u||C}if(u)l=f,null!==a&&(f?a.length=f:a=null);else{const e={params:{}};null===a?a=[e]:a.push(e),l++}if(i===l&&(o=!0,s=0),!o){const e={params:{passingSchemas:s}};return null===a?a=[e]:a.push(e),l++,ue.errors=a,!1}l=r,null!==a&&(r?a.length=r:a=null),p=n===l}else p=!0;if(p){if(void 0!==t.minSize){let e=t.minSize;const n=l,r=l;let o=!1,s=null;const i=l,f=l;let u=!1;const c=l;if(l===c)if("number"==typeof e){if(e<0||isNaN(e)){const e={params:{comparison:">=",limit:0}};null===a?a=[e]:a.push(e),l++}}else{const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}var k=c===l;if(u=u||k,!u){const t=l;if(l===t)if(e&&"object"==typeof e&&!Array.isArray(e))for(const t in e){const n=l;if("number"!=typeof e[t]){const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}if(n!==l)break}else{const e={params:{type:"object"}};null===a?a=[e]:a.push(e),l++}k=t===l,u=u||k}if(u)l=f,null!==a&&(f?a.length=f:a=null);else{const e={params:{}};null===a?a=[e]:a.push(e),l++}if(i===l&&(o=!0,s=0),!o){const e={params:{passingSchemas:s}};return null===a?a=[e]:a.push(e),l++,ue.errors=a,!1}l=r,null!==a&&(r?a.length=r:a=null),p=n===l}else p=!0;if(p){if(void 0!==t.minSizeReduction){let e=t.minSizeReduction;const n=l,r=l;let o=!1,s=null;const i=l,f=l;let u=!1;const c=l;if(l===c)if("number"==typeof e){if(e<0||isNaN(e)){const e={params:{comparison:">=",limit:0}};null===a?a=[e]:a.push(e),l++}}else{const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}var $=c===l;if(u=u||$,!u){const t=l;if(l===t)if(e&&"object"==typeof e&&!Array.isArray(e))for(const t in e){const n=l;if("number"!=typeof e[t]){const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}if(n!==l)break}else{const e={params:{type:"object"}};null===a?a=[e]:a.push(e),l++}$=t===l,u=u||$}if(u)l=f,null!==a&&(f?a.length=f:a=null);else{const e={params:{}};null===a?a=[e]:a.push(e),l++}if(i===l&&(o=!0,s=0),!o){const e={params:{passingSchemas:s}};return null===a?a=[e]:a.push(e),l++,ue.errors=a,!1}l=r,null!==a&&(r?a.length=r:a=null),p=n===l}else p=!0;if(p){if(void 0!==t.name){let e=t.name;const n=l,r=l;let o=!1;const s=l;if(!1!==e){const e={params:{}};null===a?a=[e]:a.push(e),l++}var S=s===l;if(o=o||S,!o){const t=l;if("string"!=typeof e){const e={params:{type:"string"}};null===a?a=[e]:a.push(e),l++}if(S=t===l,o=o||S,!o){const t=l;if(!(e instanceof Function)){const e={params:{}};null===a?a=[e]:a.push(e),l++}S=t===l,o=o||S}}if(!o){const e={params:{}};return null===a?a=[e]:a.push(e),l++,ue.errors=a,!1}l=r,null!==a&&(r?a.length=r:a=null),p=n===l}else p=!0;if(p)if(void 0!==t.usedExports){const e=l;if("boolean"!=typeof t.usedExports)return ue.errors=[{params:{type:"boolean"}}],!1;p=e===l}else p=!0}}}}}}}}}}}}}}}}}}}}return ue.errors=a,0===l}function ce(e,{instancePath:t="",parentData:r,parentDataProperty:o,rootData:s=e}={}){let i=null,a=0;if(0===a){if(!e||"object"!=typeof e||Array.isArray(e))return ce.errors=[{params:{type:"object"}}],!1;{const r=a;for(const t in e)if(!n.call(ae.properties,t))return ce.errors=[{params:{additionalProperty:t}}],!1;if(r===a){if(void 0!==e.checkWasmTypes){const t=a;if("boolean"!=typeof e.checkWasmTypes)return ce.errors=[{params:{type:"boolean"}}],!1;var l=t===a}else l=!0;if(l){if(void 0!==e.chunkIds){let t=e.chunkIds;const n=a;if("natural"!==t&&"named"!==t&&"deterministic"!==t&&"size"!==t&&"total-size"!==t&&!1!==t)return ce.errors=[{params:{}}],!1;l=n===a}else l=!0;if(l){if(void 0!==e.concatenateModules){const t=a;if("boolean"!=typeof e.concatenateModules)return ce.errors=[{params:{type:"boolean"}}],!1;l=t===a}else l=!0;if(l){if(void 0!==e.emitOnErrors){const t=a;if("boolean"!=typeof e.emitOnErrors)return ce.errors=[{params:{type:"boolean"}}],!1;l=t===a}else l=!0;if(l){if(void 0!==e.flagIncludedChunks){const t=a;if("boolean"!=typeof e.flagIncludedChunks)return ce.errors=[{params:{type:"boolean"}}],!1;l=t===a}else l=!0;if(l){if(void 0!==e.innerGraph){const t=a;if("boolean"!=typeof e.innerGraph)return ce.errors=[{params:{type:"boolean"}}],!1;l=t===a}else l=!0;if(l){if(void 0!==e.mangleExports){let t=e.mangleExports;const n=a,r=a;let o=!1;const s=a;if("size"!==t&&"deterministic"!==t){const e={params:{}};null===i?i=[e]:i.push(e),a++}var p=s===a;if(o=o||p,!o){const e=a;if("boolean"!=typeof t){const e={params:{type:"boolean"}};null===i?i=[e]:i.push(e),a++}p=e===a,o=o||p}if(!o){const e={params:{}};return null===i?i=[e]:i.push(e),a++,ce.errors=i,!1}a=r,null!==i&&(r?i.length=r:i=null),l=n===a}else l=!0;if(l){if(void 0!==e.mangleWasmImports){const t=a;if("boolean"!=typeof e.mangleWasmImports)return ce.errors=[{params:{type:"boolean"}}],!1;l=t===a}else l=!0;if(l){if(void 0!==e.mergeDuplicateChunks){const t=a;if("boolean"!=typeof e.mergeDuplicateChunks)return ce.errors=[{params:{type:"boolean"}}],!1;l=t===a}else l=!0;if(l){if(void 0!==e.minimize){const t=a;if("boolean"!=typeof e.minimize)return ce.errors=[{params:{type:"boolean"}}],!1;l=t===a}else l=!0;if(l){if(void 0!==e.minimizer){let t=e.minimizer;const n=a;if(a===n){if(!Array.isArray(t))return ce.errors=[{params:{type:"array"}}],!1;{const e=t.length;for(let n=0;n=",limit:1}}],!1}u=n===f}else u=!0;if(u){if(void 0!==t.hashFunction){let e=t.hashFunction;const n=f,r=f;let o=!1;const s=f;if(f===s)if("string"==typeof e){if(e.length<1){const e={params:{}};null===l?l=[e]:l.push(e),f++}}else{const e={params:{type:"string"}};null===l?l=[e]:l.push(e),f++}var v=s===f;if(o=o||v,!o){const t=f;if(!(e instanceof Function)){const e={params:{}};null===l?l=[e]:l.push(e),f++}v=t===f,o=o||v}if(!o){const e={params:{}};return null===l?l=[e]:l.push(e),f++,Ae.errors=l,!1}f=r,null!==l&&(r?l.length=r:l=null),u=n===f}else u=!0;if(u){if(void 0!==t.hashSalt){let e=t.hashSalt;const n=f;if(f==f){if("string"!=typeof e)return Ae.errors=[{params:{type:"string"}}],!1;if(e.length<1)return Ae.errors=[{params:{}}],!1}u=n===f}else u=!0;if(u){if(void 0!==t.hotUpdateChunkFilename){let n=t.hotUpdateChunkFilename;const r=f;if(f==f){if("string"!=typeof n)return Ae.errors=[{params:{type:"string"}}],!1;if(n.includes("!")||!1!==e.test(n))return Ae.errors=[{params:{}}],!1}u=r===f}else u=!0;if(u){if(void 0!==t.hotUpdateGlobal){const e=f;if("string"!=typeof t.hotUpdateGlobal)return Ae.errors=[{params:{type:"string"}}],!1;u=e===f}else u=!0;if(u){if(void 0!==t.hotUpdateMainFilename){let n=t.hotUpdateMainFilename;const r=f;if(f==f){if("string"!=typeof n)return Ae.errors=[{params:{type:"string"}}],!1;if(n.includes("!")||!1!==e.test(n))return Ae.errors=[{params:{}}],!1}u=r===f}else u=!0;if(u){if(void 0!==t.ignoreBrowserWarnings){const e=f;if("boolean"!=typeof t.ignoreBrowserWarnings)return Ae.errors=[{params:{type:"boolean"}}],!1;u=e===f}else u=!0;if(u){if(void 0!==t.iife){const e=f;if("boolean"!=typeof t.iife)return Ae.errors=[{params:{type:"boolean"}}],!1;u=e===f}else u=!0;if(u){if(void 0!==t.importFunctionName){const e=f;if("string"!=typeof t.importFunctionName)return Ae.errors=[{params:{type:"string"}}],!1;u=e===f}else u=!0;if(u){if(void 0!==t.importMetaName){const e=f;if("string"!=typeof t.importMetaName)return Ae.errors=[{params:{type:"string"}}],!1;u=e===f}else u=!0;if(u){if(void 0!==t.library){const e=f;xe(t.library,{instancePath:r+"/library",parentData:t,parentDataProperty:"library",rootData:i})||(l=null===l?xe.errors:l.concat(xe.errors),f=l.length),u=e===f}else u=!0;if(u){if(void 0!==t.libraryExport){let e=t.libraryExport;const n=f,r=f;let o=!1,s=null;const i=f,a=f;let p=!1;const c=f;if(f===c)if(Array.isArray(e)){const t=e.length;for(let n=0;n=",limit:1}}],!1}c=t===f}else c=!0;if(c){if(void 0!==r.performance){const e=f;Ce(r.performance,{instancePath:o+"/performance",parentData:r,parentDataProperty:"performance",rootData:l})||(p=null===p?Ce.errors:p.concat(Ce.errors),f=p.length),c=e===f}else c=!0;if(c){if(void 0!==r.plugins){const e=f;ke(r.plugins,{instancePath:o+"/plugins",parentData:r,parentDataProperty:"plugins",rootData:l})||(p=null===p?ke.errors:p.concat(ke.errors),f=p.length),c=e===f}else c=!0;if(c){if(void 0!==r.profile){const e=f;if("boolean"!=typeof r.profile)return we.errors=[{params:{type:"boolean"}}],!1;c=e===f}else c=!0;if(c){if(void 0!==r.recordsInputPath){let t=r.recordsInputPath;const n=f,o=f;let s=!1;const i=f;if(!1!==t){const e={params:{}};null===p?p=[e]:p.push(e),f++}var g=i===f;if(s=s||g,!s){const n=f;if(f===n)if("string"==typeof t){if(t.includes("!")||!0!==e.test(t)){const e={params:{}};null===p?p=[e]:p.push(e),f++}}else{const e={params:{type:"string"}};null===p?p=[e]:p.push(e),f++}g=n===f,s=s||g}if(!s){const e={params:{}};return null===p?p=[e]:p.push(e),f++,we.errors=p,!1}f=o,null!==p&&(o?p.length=o:p=null),c=n===f}else c=!0;if(c){if(void 0!==r.recordsOutputPath){let t=r.recordsOutputPath;const n=f,o=f;let s=!1;const i=f;if(!1!==t){const e={params:{}};null===p?p=[e]:p.push(e),f++}var v=i===f;if(s=s||v,!s){const n=f;if(f===n)if("string"==typeof t){if(t.includes("!")||!0!==e.test(t)){const e={params:{}};null===p?p=[e]:p.push(e),f++}}else{const e={params:{type:"string"}};null===p?p=[e]:p.push(e),f++}v=n===f,s=s||v}if(!s){const e={params:{}};return null===p?p=[e]:p.push(e),f++,we.errors=p,!1}f=o,null!==p&&(o?p.length=o:p=null),c=n===f}else c=!0;if(c){if(void 0!==r.recordsPath){let t=r.recordsPath;const n=f,o=f;let s=!1;const i=f;if(!1!==t){const e={params:{}};null===p?p=[e]:p.push(e),f++}var P=i===f;if(s=s||P,!s){const n=f;if(f===n)if("string"==typeof t){if(t.includes("!")||!0!==e.test(t)){const e={params:{}};null===p?p=[e]:p.push(e),f++}}else{const e={params:{type:"string"}};null===p?p=[e]:p.push(e),f++}P=n===f,s=s||P}if(!s){const e={params:{}};return null===p?p=[e]:p.push(e),f++,we.errors=p,!1}f=o,null!==p&&(o?p.length=o:p=null),c=n===f}else c=!0;if(c){if(void 0!==r.resolve){const e=f;$e(r.resolve,{instancePath:o+"/resolve",parentData:r,parentDataProperty:"resolve",rootData:l})||(p=null===p?$e.errors:p.concat($e.errors),f=p.length),c=e===f}else c=!0;if(c){if(void 0!==r.resolveLoader){const e=f;Se(r.resolveLoader,{instancePath:o+"/resolveLoader",parentData:r,parentDataProperty:"resolveLoader",rootData:l})||(p=null===p?Se.errors:p.concat(Se.errors),f=p.length),c=e===f}else c=!0;if(c){if(void 0!==r.snapshot){let t=r.snapshot;const n=f;if(f==f){if(!t||"object"!=typeof t||Array.isArray(t))return we.errors=[{params:{type:"object"}}],!1;{const n=f;for(const e in t)if("buildDependencies"!==e&&"immutablePaths"!==e&&"managedPaths"!==e&&"module"!==e&&"resolve"!==e&&"resolveBuildDependencies"!==e)return we.errors=[{params:{additionalProperty:e}}],!1;if(n===f){if(void 0!==t.buildDependencies){let e=t.buildDependencies;const n=f;if(f===n){if(!e||"object"!=typeof e||Array.isArray(e))return we.errors=[{params:{type:"object"}}],!1;{const t=f;for(const t in e)if("hash"!==t&&"timestamp"!==t)return we.errors=[{params:{additionalProperty:t}}],!1;if(t===f){if(void 0!==e.hash){const t=f;if("boolean"!=typeof e.hash)return we.errors=[{params:{type:"boolean"}}],!1;var D=t===f}else D=!0;if(D)if(void 0!==e.timestamp){const t=f;if("boolean"!=typeof e.timestamp)return we.errors=[{params:{type:"boolean"}}],!1;D=t===f}else D=!0}}}var O=n===f}else O=!0;if(O){if(void 0!==t.immutablePaths){let n=t.immutablePaths;const r=f;if(f===r){if(!Array.isArray(n))return we.errors=[{params:{type:"array"}}],!1;{const t=n.length;for(let r=0;r boolean)"}]},"AssetFilterTypes":{"description":"Filtering modules.","cli":{"helper":true},"anyOf":[{"type":"array","items":{"description":"Rule to filter.","cli":{"helper":true},"oneOf":[{"$ref":"#/definitions/AssetFilterItemTypes"}]}},{"$ref":"#/definitions/AssetFilterItemTypes"}]},"AssetGeneratorDataUrl":{"description":"The options for data url generator.","anyOf":[{"$ref":"#/definitions/AssetGeneratorDataUrlOptions"},{"$ref":"#/definitions/AssetGeneratorDataUrlFunction"}]},"AssetGeneratorDataUrlFunction":{"description":"Function that executes for module and should return an DataUrl string. It can have a string as \'ident\' property which contributes to the module hash.","instanceof":"Function","tsType":"((source: string | Buffer, context: { filename: string, module: import(\'../lib/Module\') }) => string)"},"AssetGeneratorDataUrlOptions":{"description":"Options object for data url generation.","type":"object","additionalProperties":false,"properties":{"encoding":{"description":"Asset encoding (defaults to base64).","enum":[false,"base64"]},"mimetype":{"description":"Asset mimetype (getting from file extension by default).","type":"string"}}},"AssetGeneratorOptions":{"description":"Generator options for asset modules.","type":"object","implements":["#/definitions/AssetInlineGeneratorOptions","#/definitions/AssetResourceGeneratorOptions"],"additionalProperties":false,"properties":{"dataUrl":{"$ref":"#/definitions/AssetGeneratorDataUrl"},"emit":{"description":"Emit an output asset from this asset module. This can be set to \'false\' to omit emitting e. g. for SSR.","type":"boolean"},"filename":{"$ref":"#/definitions/FilenameTemplate"},"outputPath":{"$ref":"#/definitions/AssetModuleOutputPath"},"publicPath":{"$ref":"#/definitions/RawPublicPath"}}},"AssetInlineGeneratorOptions":{"description":"Generator options for asset/inline modules.","type":"object","additionalProperties":false,"properties":{"dataUrl":{"$ref":"#/definitions/AssetGeneratorDataUrl"}}},"AssetModuleFilename":{"description":"The filename of asset modules as relative path inside the \'output.path\' directory.","anyOf":[{"type":"string","absolutePath":false},{"instanceof":"Function","tsType":"((pathData: import(\\"../lib/Compilation\\").PathData, assetInfo?: import(\\"../lib/Compilation\\").AssetInfo) => string)"}]},"AssetModuleOutputPath":{"description":"Emit the asset in the specified folder relative to \'output.path\'. This should only be needed when custom \'publicPath\' is specified to match the folder structure there.","anyOf":[{"type":"string","absolutePath":false},{"instanceof":"Function","tsType":"((pathData: import(\\"../lib/Compilation\\").PathData, assetInfo?: import(\\"../lib/Compilation\\").AssetInfo) => string)"}]},"AssetParserDataUrlFunction":{"description":"Function that executes for module and should return whenever asset should be inlined as DataUrl.","instanceof":"Function","tsType":"((source: string | Buffer, context: { filename: string, module: import(\'../lib/Module\') }) => boolean)"},"AssetParserDataUrlOptions":{"description":"Options object for DataUrl condition.","type":"object","additionalProperties":false,"properties":{"maxSize":{"description":"Maximum size of asset that should be inline as modules. Default: 8kb.","type":"number"}}},"AssetParserOptions":{"description":"Parser options for asset modules.","type":"object","additionalProperties":false,"properties":{"dataUrlCondition":{"description":"The condition for inlining the asset as DataUrl.","anyOf":[{"$ref":"#/definitions/AssetParserDataUrlOptions"},{"$ref":"#/definitions/AssetParserDataUrlFunction"}]}}},"AssetResourceGeneratorOptions":{"description":"Generator options for asset/resource modules.","type":"object","additionalProperties":false,"properties":{"emit":{"description":"Emit an output asset from this asset module. This can be set to \'false\' to omit emitting e. g. for SSR.","type":"boolean"},"filename":{"$ref":"#/definitions/FilenameTemplate"},"outputPath":{"$ref":"#/definitions/AssetModuleOutputPath"},"publicPath":{"$ref":"#/definitions/RawPublicPath"}}},"AuxiliaryComment":{"description":"Add a comment in the UMD wrapper.","anyOf":[{"description":"Append the same comment above each import style.","type":"string"},{"$ref":"#/definitions/LibraryCustomUmdCommentObject"}]},"Bail":{"description":"Report the first error as a hard error instead of tolerating it.","type":"boolean"},"CacheOptions":{"description":"Cache generated modules and chunks to improve performance for multiple incremental builds.","anyOf":[{"description":"Enable in memory caching.","enum":[true]},{"$ref":"#/definitions/CacheOptionsNormalized"}]},"CacheOptionsNormalized":{"description":"Cache generated modules and chunks to improve performance for multiple incremental builds.","anyOf":[{"description":"Disable caching.","enum":[false]},{"$ref":"#/definitions/MemoryCacheOptions"},{"$ref":"#/definitions/FileCacheOptions"}]},"Charset":{"description":"Add charset attribute for script tag.","type":"boolean"},"ChunkFilename":{"description":"Specifies the filename template of output files of non-initial chunks on disk. You must **not** specify an absolute path here, but the path may contain folders separated by \'/\'! The specified path is joined with the value of the \'output.path\' option to determine the location on disk.","oneOf":[{"$ref":"#/definitions/FilenameTemplate"}]},"ChunkFormat":{"description":"The format of chunks (formats included by default are \'array-push\' (web/WebWorker), \'commonjs\' (node.js), \'module\' (ESM), but others might be added by plugins).","anyOf":[{"enum":["array-push","commonjs","module",false]},{"type":"string"}]},"ChunkLoadTimeout":{"description":"Number of milliseconds before chunk request expires.","type":"number"},"ChunkLoading":{"description":"The method of loading chunks (methods included by default are \'jsonp\' (web), \'import\' (ESM), \'importScripts\' (WebWorker), \'require\' (sync node.js), \'async-node\' (async node.js), but others might be added by plugins).","anyOf":[{"enum":[false]},{"$ref":"#/definitions/ChunkLoadingType"}]},"ChunkLoadingGlobal":{"description":"The global variable used by webpack for loading of chunks.","type":"string"},"ChunkLoadingType":{"description":"The method of loading chunks (methods included by default are \'jsonp\' (web), \'import\' (ESM), \'importScripts\' (WebWorker), \'require\' (sync node.js), \'async-node\' (async node.js), but others might be added by plugins).","anyOf":[{"enum":["jsonp","import-scripts","require","async-node","import"]},{"type":"string"}]},"Clean":{"description":"Clean the output directory before emit.","anyOf":[{"type":"boolean"},{"$ref":"#/definitions/CleanOptions"}]},"CleanOptions":{"description":"Advanced options for cleaning assets.","type":"object","additionalProperties":false,"properties":{"dry":{"description":"Log the assets that should be removed instead of deleting them.","type":"boolean"},"keep":{"description":"Keep these assets.","anyOf":[{"instanceof":"RegExp","tsType":"RegExp"},{"type":"string","absolutePath":false},{"instanceof":"Function","tsType":"((filename: string) => boolean)"}]}}},"CompareBeforeEmit":{"description":"Check if to be emitted file already exists and have the same content before writing to output filesystem.","type":"boolean"},"Context":{"description":"The base directory (absolute path!) for resolving the `entry` option. If `output.pathinfo` is set, the included pathinfo is shortened to this directory.","type":"string","absolutePath":true},"CrossOriginLoading":{"description":"This option enables cross-origin loading of chunks.","enum":[false,"anonymous","use-credentials"]},"CssChunkFilename":{"description":"Specifies the filename template of non-initial output css files on disk. You must **not** specify an absolute path here, but the path may contain folders separated by \'/\'! The specified path is joined with the value of the \'output.path\' option to determine the location on disk.","oneOf":[{"$ref":"#/definitions/FilenameTemplate"}]},"CssExperimentOptions":{"description":"Options for css handling.","type":"object","additionalProperties":false,"properties":{"exportsOnly":{"description":"Avoid generating and loading a stylesheet and only embed exports from css into output javascript files.","type":"boolean"}}},"CssFilename":{"description":"Specifies the filename template of output css files on disk. You must **not** specify an absolute path here, but the path may contain folders separated by \'/\'! The specified path is joined with the value of the \'output.path\' option to determine the location on disk.","oneOf":[{"$ref":"#/definitions/FilenameTemplate"}]},"CssGeneratorOptions":{"description":"Generator options for css modules.","type":"object","additionalProperties":false,"properties":{}},"CssParserOptions":{"description":"Parser options for css modules.","type":"object","additionalProperties":false,"properties":{}},"Dependencies":{"description":"References to other configurations to depend on.","type":"array","items":{"description":"References to another configuration to depend on.","type":"string"}},"DevServer":{"description":"Options for the webpack-dev-server.","type":"object"},"DevTool":{"description":"A developer tool to enhance debugging (false | eval | [inline-|hidden-|eval-][nosources-][cheap-[module-]]source-map).","anyOf":[{"enum":[false,"eval"]},{"type":"string","pattern":"^(inline-|hidden-|eval-)?(nosources-)?(cheap-(module-)?)?source-map$"}]},"DevtoolFallbackModuleFilenameTemplate":{"description":"Similar to `output.devtoolModuleFilenameTemplate`, but used in the case of duplicate module identifiers.","anyOf":[{"type":"string"},{"instanceof":"Function","tsType":"Function"}]},"DevtoolModuleFilenameTemplate":{"description":"Filename template string of function for the sources array in a generated SourceMap.","anyOf":[{"type":"string"},{"instanceof":"Function","tsType":"Function"}]},"DevtoolNamespace":{"description":"Module namespace to use when interpolating filename template string for the sources array in a generated SourceMap. Defaults to `output.library` if not set. It\'s useful for avoiding runtime collisions in sourcemaps from multiple webpack projects built as libraries.","type":"string"},"EmptyGeneratorOptions":{"description":"No generator options are supported for this module type.","type":"object","additionalProperties":false},"EmptyParserOptions":{"description":"No parser options are supported for this module type.","type":"object","additionalProperties":false},"EnabledChunkLoadingTypes":{"description":"List of chunk loading types enabled for use by entry points.","type":"array","items":{"$ref":"#/definitions/ChunkLoadingType"}},"EnabledLibraryTypes":{"description":"List of library types enabled for use by entry points.","type":"array","items":{"$ref":"#/definitions/LibraryType"}},"EnabledWasmLoadingTypes":{"description":"List of wasm loading types enabled for use by entry points.","type":"array","items":{"$ref":"#/definitions/WasmLoadingType"}},"Entry":{"description":"The entry point(s) of the compilation.","anyOf":[{"$ref":"#/definitions/EntryDynamic"},{"$ref":"#/definitions/EntryStatic"}]},"EntryDescription":{"description":"An object with entry point description.","type":"object","additionalProperties":false,"properties":{"asyncChunks":{"description":"Enable/disable creating async chunks that are loaded on demand.","type":"boolean"},"baseUri":{"description":"Base uri for this entry.","type":"string"},"chunkLoading":{"$ref":"#/definitions/ChunkLoading"},"dependOn":{"description":"The entrypoints that the current entrypoint depend on. They must be loaded when this entrypoint is loaded.","anyOf":[{"description":"The entrypoints that the current entrypoint depend on. They must be loaded when this entrypoint is loaded.","type":"array","items":{"description":"An entrypoint that the current entrypoint depend on. It must be loaded when this entrypoint is loaded.","type":"string","minLength":1},"minItems":1,"uniqueItems":true},{"description":"An entrypoint that the current entrypoint depend on. It must be loaded when this entrypoint is loaded.","type":"string","minLength":1}]},"filename":{"$ref":"#/definitions/EntryFilename"},"import":{"$ref":"#/definitions/EntryItem"},"layer":{"$ref":"#/definitions/Layer"},"library":{"$ref":"#/definitions/LibraryOptions"},"publicPath":{"$ref":"#/definitions/PublicPath"},"runtime":{"$ref":"#/definitions/EntryRuntime"},"wasmLoading":{"$ref":"#/definitions/WasmLoading"}},"required":["import"]},"EntryDescriptionNormalized":{"description":"An object with entry point description.","type":"object","additionalProperties":false,"properties":{"asyncChunks":{"description":"Enable/disable creating async chunks that are loaded on demand.","type":"boolean"},"baseUri":{"description":"Base uri for this entry.","type":"string"},"chunkLoading":{"$ref":"#/definitions/ChunkLoading"},"dependOn":{"description":"The entrypoints that the current entrypoint depend on. They must be loaded when this entrypoint is loaded.","type":"array","items":{"description":"An entrypoint that the current entrypoint depend on. It must be loaded when this entrypoint is loaded.","type":"string","minLength":1},"minItems":1,"uniqueItems":true},"filename":{"$ref":"#/definitions/Filename"},"import":{"description":"Module(s) that are loaded upon startup. The last one is exported.","type":"array","items":{"description":"Module that is loaded upon startup. Only the last one is exported.","type":"string","minLength":1},"minItems":1,"uniqueItems":true},"layer":{"$ref":"#/definitions/Layer"},"library":{"$ref":"#/definitions/LibraryOptions"},"publicPath":{"$ref":"#/definitions/PublicPath"},"runtime":{"$ref":"#/definitions/EntryRuntime"},"wasmLoading":{"$ref":"#/definitions/WasmLoading"}}},"EntryDynamic":{"description":"A Function returning an entry object, an entry string, an entry array or a promise to these things.","instanceof":"Function","tsType":"(() => EntryStatic | Promise)"},"EntryDynamicNormalized":{"description":"A Function returning a Promise resolving to a normalized entry.","instanceof":"Function","tsType":"(() => Promise)"},"EntryFilename":{"description":"Specifies the filename of the output file on disk. You must **not** specify an absolute path here, but the path may contain folders separated by \'/\'! The specified path is joined with the value of the \'output.path\' option to determine the location on disk.","oneOf":[{"$ref":"#/definitions/FilenameTemplate"}]},"EntryItem":{"description":"Module(s) that are loaded upon startup.","anyOf":[{"description":"All modules are loaded upon startup. The last one is exported.","type":"array","items":{"description":"A module that is loaded upon startup. Only the last one is exported.","type":"string","minLength":1},"minItems":1,"uniqueItems":true},{"description":"The string is resolved to a module which is loaded upon startup.","type":"string","minLength":1}]},"EntryNormalized":{"description":"The entry point(s) of the compilation.","anyOf":[{"$ref":"#/definitions/EntryDynamicNormalized"},{"$ref":"#/definitions/EntryStaticNormalized"}]},"EntryObject":{"description":"Multiple entry bundles are created. The key is the entry name. The value can be a string, an array or an entry description object.","type":"object","additionalProperties":{"description":"An entry point with name.","anyOf":[{"$ref":"#/definitions/EntryItem"},{"$ref":"#/definitions/EntryDescription"}]}},"EntryRuntime":{"description":"The name of the runtime chunk. If set a runtime chunk with this name is created or an existing entrypoint is used as runtime.","anyOf":[{"enum":[false]},{"type":"string","minLength":1}]},"EntryStatic":{"description":"A static entry description.","anyOf":[{"$ref":"#/definitions/EntryObject"},{"$ref":"#/definitions/EntryUnnamed"}]},"EntryStaticNormalized":{"description":"Multiple entry bundles are created. The key is the entry name. The value is an entry description object.","type":"object","additionalProperties":{"description":"An object with entry point description.","oneOf":[{"$ref":"#/definitions/EntryDescriptionNormalized"}]}},"EntryUnnamed":{"description":"An entry point without name.","oneOf":[{"$ref":"#/definitions/EntryItem"}]},"Environment":{"description":"The abilities of the environment where the webpack generated code should run.","type":"object","additionalProperties":false,"properties":{"arrowFunction":{"description":"The environment supports arrow functions (\'() => { ... }\').","type":"boolean"},"bigIntLiteral":{"description":"The environment supports BigInt as literal (123n).","type":"boolean"},"const":{"description":"The environment supports const and let for variable declarations.","type":"boolean"},"destructuring":{"description":"The environment supports destructuring (\'{ a, b } = obj\').","type":"boolean"},"dynamicImport":{"description":"The environment supports an async import() function to import EcmaScript modules.","type":"boolean"},"forOf":{"description":"The environment supports \'for of\' iteration (\'for (const x of array) { ... }\').","type":"boolean"},"module":{"description":"The environment supports EcmaScript Module syntax to import EcmaScript modules (import ... from \'...\').","type":"boolean"},"optionalChaining":{"description":"The environment supports optional chaining (\'obj?.a\' or \'obj?.()\').","type":"boolean"},"templateLiteral":{"description":"The environment supports template literals.","type":"boolean"}}},"Experiments":{"description":"Enables/Disables experiments (experimental features with relax SemVer compatibility).","type":"object","implements":["#/definitions/ExperimentsCommon"],"additionalProperties":false,"properties":{"asyncWebAssembly":{"description":"Support WebAssembly as asynchronous EcmaScript Module.","type":"boolean"},"backCompat":{"description":"Enable backward-compat layer with deprecation warnings for many webpack 4 APIs.","type":"boolean"},"buildHttp":{"description":"Build http(s): urls using a lockfile and resource content cache.","anyOf":[{"$ref":"#/definitions/HttpUriAllowedUris"},{"$ref":"#/definitions/HttpUriOptions"}]},"cacheUnaffected":{"description":"Enable additional in memory caching of modules that are unchanged and reference only unchanged modules.","type":"boolean"},"css":{"description":"Enable css support.","anyOf":[{"type":"boolean"},{"$ref":"#/definitions/CssExperimentOptions"}]},"futureDefaults":{"description":"Apply defaults of next major version.","type":"boolean"},"layers":{"description":"Enable module layers.","type":"boolean"},"lazyCompilation":{"description":"Compile entrypoints and import()s only when they are accessed.","anyOf":[{"type":"boolean"},{"$ref":"#/definitions/LazyCompilationOptions"}]},"outputModule":{"description":"Allow output javascript files as module source type.","type":"boolean"},"syncWebAssembly":{"description":"Support WebAssembly as synchronous EcmaScript Module (outdated).","type":"boolean"},"topLevelAwait":{"description":"Allow using top-level-await in EcmaScript Modules.","type":"boolean"}}},"ExperimentsCommon":{"description":"Enables/Disables experiments (experimental features with relax SemVer compatibility).","type":"object","additionalProperties":false,"properties":{"asyncWebAssembly":{"description":"Support WebAssembly as asynchronous EcmaScript Module.","type":"boolean"},"backCompat":{"description":"Enable backward-compat layer with deprecation warnings for many webpack 4 APIs.","type":"boolean"},"cacheUnaffected":{"description":"Enable additional in memory caching of modules that are unchanged and reference only unchanged modules.","type":"boolean"},"futureDefaults":{"description":"Apply defaults of next major version.","type":"boolean"},"layers":{"description":"Enable module layers.","type":"boolean"},"outputModule":{"description":"Allow output javascript files as module source type.","type":"boolean"},"syncWebAssembly":{"description":"Support WebAssembly as synchronous EcmaScript Module (outdated).","type":"boolean"},"topLevelAwait":{"description":"Allow using top-level-await in EcmaScript Modules.","type":"boolean"}}},"ExperimentsNormalized":{"description":"Enables/Disables experiments (experimental features with relax SemVer compatibility).","type":"object","implements":["#/definitions/ExperimentsCommon"],"additionalProperties":false,"properties":{"asyncWebAssembly":{"description":"Support WebAssembly as asynchronous EcmaScript Module.","type":"boolean"},"backCompat":{"description":"Enable backward-compat layer with deprecation warnings for many webpack 4 APIs.","type":"boolean"},"buildHttp":{"description":"Build http(s): urls using a lockfile and resource content cache.","oneOf":[{"$ref":"#/definitions/HttpUriOptions"}]},"cacheUnaffected":{"description":"Enable additional in memory caching of modules that are unchanged and reference only unchanged modules.","type":"boolean"},"css":{"description":"Enable css support.","anyOf":[{"enum":[false]},{"$ref":"#/definitions/CssExperimentOptions"}]},"futureDefaults":{"description":"Apply defaults of next major version.","type":"boolean"},"layers":{"description":"Enable module layers.","type":"boolean"},"lazyCompilation":{"description":"Compile entrypoints and import()s only when they are accessed.","anyOf":[{"enum":[false]},{"$ref":"#/definitions/LazyCompilationOptions"}]},"outputModule":{"description":"Allow output javascript files as module source type.","type":"boolean"},"syncWebAssembly":{"description":"Support WebAssembly as synchronous EcmaScript Module (outdated).","type":"boolean"},"topLevelAwait":{"description":"Allow using top-level-await in EcmaScript Modules.","type":"boolean"}}},"ExternalItem":{"description":"Specify dependency that shouldn\'t be resolved by webpack, but should become dependencies of the resulting bundle. The kind of the dependency depends on `output.libraryTarget`.","anyOf":[{"description":"Every matched dependency becomes external.","instanceof":"RegExp","tsType":"RegExp"},{"description":"An exact matched dependency becomes external. The same string is used as external dependency.","type":"string"},{"description":"If an dependency matches exactly a property of the object, the property value is used as dependency.","type":"object","additionalProperties":{"$ref":"#/definitions/ExternalItemValue"},"properties":{"byLayer":{"description":"Specify externals depending on the layer.","anyOf":[{"type":"object","additionalProperties":{"$ref":"#/definitions/ExternalItem"}},{"instanceof":"Function","tsType":"((layer: string | null) => ExternalItem)"}]}}},{"description":"The function is called on each dependency (`function(context, request, callback(err, result))`).","instanceof":"Function","tsType":"(((data: ExternalItemFunctionData, callback: (err?: Error, result?: ExternalItemValue) => void) => void) | ((data: ExternalItemFunctionData) => Promise))"}]},"ExternalItemFunctionData":{"description":"Data object passed as argument when a function is set for \'externals\'.","type":"object","additionalProperties":false,"properties":{"context":{"description":"The directory in which the request is placed.","type":"string"},"contextInfo":{"description":"Contextual information.","type":"object","tsType":"import(\'../lib/ModuleFactory\').ModuleFactoryCreateDataContextInfo"},"dependencyType":{"description":"The category of the referencing dependencies.","type":"string"},"getResolve":{"description":"Get a resolve function with the current resolver options.","instanceof":"Function","tsType":"((options?: ResolveOptions) => ((context: string, request: string, callback: (err?: Error, result?: string) => void) => void) | ((context: string, request: string) => Promise))"},"request":{"description":"The request as written by the user in the require/import expression/statement.","type":"string"}}},"ExternalItemValue":{"description":"The dependency used for the external.","anyOf":[{"type":"array","items":{"description":"A part of the target of the external.","type":"string","minLength":1}},{"description":"`true`: The dependency name is used as target of the external.","type":"boolean"},{"description":"The target of the external.","type":"string"},{"type":"object"}]},"Externals":{"description":"Specify dependencies that shouldn\'t be resolved by webpack, but should become dependencies of the resulting bundle. The kind of the dependency depends on `output.libraryTarget`.","anyOf":[{"type":"array","items":{"$ref":"#/definitions/ExternalItem"}},{"$ref":"#/definitions/ExternalItem"}]},"ExternalsPresets":{"description":"Enable presets of externals for specific targets.","type":"object","additionalProperties":false,"properties":{"electron":{"description":"Treat common electron built-in modules in main and preload context like \'electron\', \'ipc\' or \'shell\' as external and load them via require() when used.","type":"boolean"},"electronMain":{"description":"Treat electron built-in modules in the main context like \'app\', \'ipc-main\' or \'shell\' as external and load them via require() when used.","type":"boolean"},"electronPreload":{"description":"Treat electron built-in modules in the preload context like \'web-frame\', \'ipc-renderer\' or \'shell\' as external and load them via require() when used.","type":"boolean"},"electronRenderer":{"description":"Treat electron built-in modules in the renderer context like \'web-frame\', \'ipc-renderer\' or \'shell\' as external and load them via require() when used.","type":"boolean"},"node":{"description":"Treat node.js built-in modules like fs, path or vm as external and load them via require() when used.","type":"boolean"},"nwjs":{"description":"Treat NW.js legacy nw.gui module as external and load it via require() when used.","type":"boolean"},"web":{"description":"Treat references to \'http(s)://...\' and \'std:...\' as external and load them via import when used (Note that this changes execution order as externals are executed before any other code in the chunk).","type":"boolean"},"webAsync":{"description":"Treat references to \'http(s)://...\' and \'std:...\' as external and load them via async import() when used (Note that this external type is an async module, which has various effects on the execution).","type":"boolean"}}},"ExternalsType":{"description":"Specifies the default type of externals (\'amd*\', \'umd*\', \'system\' and \'jsonp\' depend on output.libraryTarget set to the same value).","enum":["var","module","assign","this","window","self","global","commonjs","commonjs2","commonjs-module","commonjs-static","amd","amd-require","umd","umd2","jsonp","system","promise","import","script","node-commonjs"]},"FileCacheOptions":{"description":"Options object for persistent file-based caching.","type":"object","additionalProperties":false,"properties":{"allowCollectingMemory":{"description":"Allows to collect unused memory allocated during deserialization. This requires copying data into smaller buffers and has a performance cost.","type":"boolean"},"buildDependencies":{"description":"Dependencies the build depends on (in multiple categories, default categories: \'defaultWebpack\').","type":"object","additionalProperties":{"description":"List of dependencies the build depends on.","type":"array","items":{"description":"Request to a dependency (resolved as directory relative to the context directory).","type":"string","minLength":1}}},"cacheDirectory":{"description":"Base directory for the cache (defaults to node_modules/.cache/webpack).","type":"string","absolutePath":true},"cacheLocation":{"description":"Locations for the cache (defaults to cacheDirectory / name).","type":"string","absolutePath":true},"compression":{"description":"Compression type used for the cache files.","enum":[false,"gzip","brotli"]},"hashAlgorithm":{"description":"Algorithm used for generation the hash (see node.js crypto package).","type":"string"},"idleTimeout":{"description":"Time in ms after which idle period the cache storing should happen.","type":"number","minimum":0},"idleTimeoutAfterLargeChanges":{"description":"Time in ms after which idle period the cache storing should happen when larger changes has been detected (cumulative build time > 2 x avg cache store time).","type":"number","minimum":0},"idleTimeoutForInitialStore":{"description":"Time in ms after which idle period the initial cache storing should happen.","type":"number","minimum":0},"immutablePaths":{"description":"List of paths that are managed by a package manager and contain a version or hash in its path so all files are immutable.","type":"array","items":{"description":"List of paths that are managed by a package manager and contain a version or hash in its path so all files are immutable.","anyOf":[{"description":"A RegExp matching an immutable directory (usually a package manager cache directory, including the tailing slash)","instanceof":"RegExp","tsType":"RegExp"},{"description":"A path to an immutable directory (usually a package manager cache directory).","type":"string","absolutePath":true,"minLength":1}]}},"managedPaths":{"description":"List of paths that are managed by a package manager and can be trusted to not be modified otherwise.","type":"array","items":{"description":"List of paths that are managed by a package manager and can be trusted to not be modified otherwise.","anyOf":[{"description":"A RegExp matching a managed directory (usually a node_modules directory, including the tailing slash)","instanceof":"RegExp","tsType":"RegExp"},{"description":"A path to a managed directory (usually a node_modules directory).","type":"string","absolutePath":true,"minLength":1}]}},"maxAge":{"description":"Time for which unused cache entries stay in the filesystem cache at minimum (in milliseconds).","type":"number","minimum":0},"maxMemoryGenerations":{"description":"Number of generations unused cache entries stay in memory cache at minimum (0 = no memory cache used, 1 = may be removed after unused for a single compilation, ..., Infinity: kept forever). Cache entries will be deserialized from disk when removed from memory cache.","type":"number","minimum":0},"memoryCacheUnaffected":{"description":"Additionally cache computation of modules that are unchanged and reference only unchanged modules in memory.","type":"boolean"},"name":{"description":"Name for the cache. Different names will lead to different coexisting caches.","type":"string"},"profile":{"description":"Track and log detailed timing information for individual cache items.","type":"boolean"},"store":{"description":"When to store data to the filesystem. (pack: Store data when compiler is idle in a single file).","enum":["pack"]},"type":{"description":"Filesystem caching.","enum":["filesystem"]},"version":{"description":"Version of the cache data. Different versions won\'t allow to reuse the cache and override existing content. Update the version when config changed in a way which doesn\'t allow to reuse cache. This will invalidate the cache.","type":"string"}},"required":["type"]},"Filename":{"description":"Specifies the filename of output files on disk. You must **not** specify an absolute path here, but the path may contain folders separated by \'/\'! The specified path is joined with the value of the \'output.path\' option to determine the location on disk.","oneOf":[{"$ref":"#/definitions/FilenameTemplate"}]},"FilenameTemplate":{"description":"Specifies the filename template of output files on disk. You must **not** specify an absolute path here, but the path may contain folders separated by \'/\'! The specified path is joined with the value of the \'output.path\' option to determine the location on disk.","anyOf":[{"type":"string","absolutePath":false,"minLength":1},{"instanceof":"Function","tsType":"((pathData: import(\\"../lib/Compilation\\").PathData, assetInfo?: import(\\"../lib/Compilation\\").AssetInfo) => string)"}]},"FilterItemTypes":{"description":"Filtering value, regexp or function.","cli":{"helper":true},"anyOf":[{"instanceof":"RegExp","tsType":"RegExp"},{"type":"string","absolutePath":false},{"instanceof":"Function","tsType":"((value: string) => boolean)"}]},"FilterTypes":{"description":"Filtering values.","cli":{"helper":true},"anyOf":[{"type":"array","items":{"description":"Rule to filter.","cli":{"helper":true},"oneOf":[{"$ref":"#/definitions/FilterItemTypes"}]}},{"$ref":"#/definitions/FilterItemTypes"}]},"GeneratorOptionsByModuleType":{"description":"Specify options for each generator.","type":"object","additionalProperties":{"description":"Options for generating.","type":"object","additionalProperties":true},"properties":{"asset":{"$ref":"#/definitions/AssetGeneratorOptions"},"asset/inline":{"$ref":"#/definitions/AssetInlineGeneratorOptions"},"asset/resource":{"$ref":"#/definitions/AssetResourceGeneratorOptions"},"javascript":{"$ref":"#/definitions/EmptyGeneratorOptions"},"javascript/auto":{"$ref":"#/definitions/EmptyGeneratorOptions"},"javascript/dynamic":{"$ref":"#/definitions/EmptyGeneratorOptions"},"javascript/esm":{"$ref":"#/definitions/EmptyGeneratorOptions"}}},"GlobalObject":{"description":"An expression which is used to address the global object/scope in runtime code.","type":"string","minLength":1},"HashDigest":{"description":"Digest type used for the hash.","type":"string"},"HashDigestLength":{"description":"Number of chars which are used for the hash.","type":"number","minimum":1},"HashFunction":{"description":"Algorithm used for generation the hash (see node.js crypto package).","anyOf":[{"type":"string","minLength":1},{"instanceof":"Function","tsType":"typeof import(\'../lib/util/Hash\')"}]},"HashSalt":{"description":"Any string which is added to the hash to salt it.","type":"string","minLength":1},"HotUpdateChunkFilename":{"description":"The filename of the Hot Update Chunks. They are inside the output.path directory.","type":"string","absolutePath":false},"HotUpdateGlobal":{"description":"The global variable used by webpack for loading of hot update chunks.","type":"string"},"HotUpdateMainFilename":{"description":"The filename of the Hot Update Main File. It is inside the \'output.path\' directory.","type":"string","absolutePath":false},"HttpUriAllowedUris":{"description":"List of allowed URIs for building http resources.","cli":{"exclude":true},"oneOf":[{"$ref":"#/definitions/HttpUriOptionsAllowedUris"}]},"HttpUriOptions":{"description":"Options for building http resources.","type":"object","additionalProperties":false,"properties":{"allowedUris":{"$ref":"#/definitions/HttpUriOptionsAllowedUris"},"cacheLocation":{"description":"Location where resource content is stored for lockfile entries. It\'s also possible to disable storing by passing false.","anyOf":[{"enum":[false]},{"type":"string","absolutePath":true}]},"frozen":{"description":"When set, anything that would lead to a modification of the lockfile or any resource content, will result in an error.","type":"boolean"},"lockfileLocation":{"description":"Location of the lockfile.","type":"string","absolutePath":true},"proxy":{"description":"Proxy configuration, which can be used to specify a proxy server to use for HTTP requests.","type":"string"},"upgrade":{"description":"When set, resources of existing lockfile entries will be fetched and entries will be upgraded when resource content has changed.","type":"boolean"}},"required":["allowedUris"]},"HttpUriOptionsAllowedUris":{"description":"List of allowed URIs (resp. the beginning of them).","type":"array","items":{"description":"List of allowed URIs (resp. the beginning of them).","anyOf":[{"description":"Allowed URI pattern.","instanceof":"RegExp","tsType":"RegExp"},{"description":"Allowed URI (resp. the beginning of it).","type":"string","pattern":"^https?://"},{"description":"Allowed URI filter function.","instanceof":"Function","tsType":"((uri: string) => boolean)"}]}},"IgnoreWarnings":{"description":"Ignore specific warnings.","type":"array","items":{"description":"Ignore specific warnings.","anyOf":[{"description":"A RegExp to select the warning message.","instanceof":"RegExp","tsType":"RegExp"},{"type":"object","additionalProperties":false,"properties":{"file":{"description":"A RegExp to select the origin file for the warning.","instanceof":"RegExp","tsType":"RegExp"},"message":{"description":"A RegExp to select the warning message.","instanceof":"RegExp","tsType":"RegExp"},"module":{"description":"A RegExp to select the origin module for the warning.","instanceof":"RegExp","tsType":"RegExp"}}},{"description":"A custom function to select warnings based on the raw warning instance.","instanceof":"Function","tsType":"((warning: import(\'../lib/WebpackError\'), compilation: import(\'../lib/Compilation\')) => boolean)"}]}},"IgnoreWarningsNormalized":{"description":"Ignore specific warnings.","type":"array","items":{"description":"A function to select warnings based on the raw warning instance.","instanceof":"Function","tsType":"((warning: import(\'../lib/WebpackError\'), compilation: import(\'../lib/Compilation\')) => boolean)"}},"Iife":{"description":"Wrap javascript code into IIFE\'s to avoid leaking into global scope.","type":"boolean"},"ImportFunctionName":{"description":"The name of the native import() function (can be exchanged for a polyfill).","type":"string"},"ImportMetaName":{"description":"The name of the native import.meta object (can be exchanged for a polyfill).","type":"string"},"InfrastructureLogging":{"description":"Options for infrastructure level logging.","type":"object","additionalProperties":false,"properties":{"appendOnly":{"description":"Only appends lines to the output. Avoids updating existing output e. g. for status messages. This option is only used when no custom console is provided.","type":"boolean"},"colors":{"description":"Enables/Disables colorful output. This option is only used when no custom console is provided.","type":"boolean"},"console":{"description":"Custom console used for logging.","tsType":"Console"},"debug":{"description":"Enable debug logging for specific loggers.","anyOf":[{"description":"Enable/Disable debug logging for all loggers.","type":"boolean"},{"$ref":"#/definitions/FilterTypes"}]},"level":{"description":"Log level.","enum":["none","error","warn","info","log","verbose"]},"stream":{"description":"Stream used for logging output. Defaults to process.stderr. This option is only used when no custom console is provided.","tsType":"NodeJS.WritableStream"}}},"JavascriptParserOptions":{"description":"Parser options for javascript modules.","type":"object","additionalProperties":true,"properties":{"amd":{"$ref":"#/definitions/Amd"},"browserify":{"description":"Enable/disable special handling for browserify bundles.","type":"boolean"},"commonjs":{"description":"Enable/disable parsing of CommonJs syntax.","type":"boolean"},"commonjsMagicComments":{"description":"Enable/disable parsing of magic comments in CommonJs syntax.","type":"boolean"},"createRequire":{"description":"Enable/disable parsing \\"import { createRequire } from \\"module\\"\\" and evaluating createRequire().","anyOf":[{"type":"boolean"},{"type":"string"}]},"dynamicImportMode":{"description":"Specifies global mode for dynamic import.","enum":["eager","weak","lazy","lazy-once"]},"dynamicImportPrefetch":{"description":"Specifies global prefetch for dynamic import.","anyOf":[{"type":"number"},{"type":"boolean"}]},"dynamicImportPreload":{"description":"Specifies global preload for dynamic import.","anyOf":[{"type":"number"},{"type":"boolean"}]},"exportsPresence":{"description":"Specifies the behavior of invalid export names in \\"import ... from ...\\" and \\"export ... from ...\\".","enum":["error","warn","auto",false]},"exprContextCritical":{"description":"Enable warnings for full dynamic dependencies.","type":"boolean"},"exprContextRecursive":{"description":"Enable recursive directory lookup for full dynamic dependencies.","type":"boolean"},"exprContextRegExp":{"description":"Sets the default regular expression for full dynamic dependencies.","anyOf":[{"instanceof":"RegExp","tsType":"RegExp"},{"type":"boolean"}]},"exprContextRequest":{"description":"Set the default request for full dynamic dependencies.","type":"string"},"harmony":{"description":"Enable/disable parsing of EcmaScript Modules syntax.","type":"boolean"},"import":{"description":"Enable/disable parsing of import() syntax.","type":"boolean"},"importExportsPresence":{"description":"Specifies the behavior of invalid export names in \\"import ... from ...\\".","enum":["error","warn","auto",false]},"importMeta":{"description":"Enable/disable evaluating import.meta.","type":"boolean"},"importMetaContext":{"description":"Enable/disable evaluating import.meta.webpackContext.","type":"boolean"},"node":{"$ref":"#/definitions/Node"},"reexportExportsPresence":{"description":"Specifies the behavior of invalid export names in \\"export ... from ...\\". This might be useful to disable during the migration from \\"export ... from ...\\" to \\"export type ... from ...\\" when reexporting types in TypeScript.","enum":["error","warn","auto",false]},"requireContext":{"description":"Enable/disable parsing of require.context syntax.","type":"boolean"},"requireEnsure":{"description":"Enable/disable parsing of require.ensure syntax.","type":"boolean"},"requireInclude":{"description":"Enable/disable parsing of require.include syntax.","type":"boolean"},"requireJs":{"description":"Enable/disable parsing of require.js special syntax like require.config, requirejs.config, require.version and requirejs.onError.","type":"boolean"},"strictExportPresence":{"description":"Deprecated in favor of \\"exportsPresence\\". Emit errors instead of warnings when imported names don\'t exist in imported module.","type":"boolean"},"strictThisContextOnImports":{"description":"Handle the this context correctly according to the spec for namespace objects.","type":"boolean"},"system":{"description":"Enable/disable parsing of System.js special syntax like System.import, System.get, System.set and System.register.","type":"boolean"},"unknownContextCritical":{"description":"Enable warnings when using the require function in a not statically analyse-able way.","type":"boolean"},"unknownContextRecursive":{"description":"Enable recursive directory lookup when using the require function in a not statically analyse-able way.","type":"boolean"},"unknownContextRegExp":{"description":"Sets the regular expression when using the require function in a not statically analyse-able way.","anyOf":[{"instanceof":"RegExp","tsType":"RegExp"},{"type":"boolean"}]},"unknownContextRequest":{"description":"Sets the request when using the require function in a not statically analyse-able way.","type":"string"},"url":{"description":"Enable/disable parsing of new URL() syntax.","anyOf":[{"enum":["relative"]},{"type":"boolean"}]},"worker":{"description":"Disable or configure parsing of WebWorker syntax like new Worker() or navigator.serviceWorker.register().","anyOf":[{"type":"array","items":{"description":"Specify a syntax that should be parsed as WebWorker reference. \'Abc\' handles \'new Abc()\', \'Abc from xyz\' handles \'import { Abc } from \\"xyz\\"; new Abc()\', \'abc()\' handles \'abc()\', and combinations are also possible.","type":"string","minLength":1}},{"type":"boolean"}]},"wrappedContextCritical":{"description":"Enable warnings for partial dynamic dependencies.","type":"boolean"},"wrappedContextRecursive":{"description":"Enable recursive directory lookup for partial dynamic dependencies.","type":"boolean"},"wrappedContextRegExp":{"description":"Set the inner regular expression for partial dynamic dependencies.","instanceof":"RegExp","tsType":"RegExp"}}},"Layer":{"description":"Specifies the layer in which modules of this entrypoint are placed.","anyOf":[{"enum":[null]},{"type":"string","minLength":1}]},"LazyCompilationDefaultBackendOptions":{"description":"Options for the default backend.","type":"object","additionalProperties":false,"properties":{"client":{"description":"A custom client.","type":"string"},"listen":{"description":"Specifies where to listen to from the server.","anyOf":[{"description":"A port.","type":"number"},{"description":"Listen options.","type":"object","additionalProperties":true,"properties":{"host":{"description":"A host.","type":"string"},"port":{"description":"A port.","type":"number"}},"tsType":"import(\\"net\\").ListenOptions"},{"description":"A custom listen function.","instanceof":"Function","tsType":"((server: import(\\"net\\").Server) => void)"}]},"protocol":{"description":"Specifies the protocol the client should use to connect to the server.","enum":["http","https"]},"server":{"description":"Specifies how to create the server handling the EventSource requests.","anyOf":[{"description":"ServerOptions for the http or https createServer call.","type":"object","additionalProperties":true,"properties":{},"tsType":"(import(\\"https\\").ServerOptions | import(\\"http\\").ServerOptions)"},{"description":"A custom create server function.","instanceof":"Function","tsType":"(() => import(\\"net\\").Server)"}]}}},"LazyCompilationOptions":{"description":"Options for compiling entrypoints and import()s only when they are accessed.","type":"object","additionalProperties":false,"properties":{"backend":{"description":"Specifies the backend that should be used for handling client keep alive.","anyOf":[{"description":"A custom backend.","instanceof":"Function","tsType":"(((compiler: import(\'../lib/Compiler\'), callback: (err?: Error, api?: import(\\"../lib/hmr/LazyCompilationPlugin\\").BackendApi) => void) => void) | ((compiler: import(\'../lib/Compiler\')) => Promise))"},{"$ref":"#/definitions/LazyCompilationDefaultBackendOptions"}]},"entries":{"description":"Enable/disable lazy compilation for entries.","type":"boolean"},"imports":{"description":"Enable/disable lazy compilation for import() modules.","type":"boolean"},"test":{"description":"Specify which entrypoints or import()ed modules should be lazily compiled. This is matched with the imported module and not the entrypoint name.","anyOf":[{"instanceof":"RegExp","tsType":"RegExp"},{"type":"string"},{"instanceof":"Function","tsType":"((module: import(\'../lib/Module\')) => boolean)"}]}}},"Library":{"description":"Make the output files a library, exporting the exports of the entry point.","anyOf":[{"$ref":"#/definitions/LibraryName"},{"$ref":"#/definitions/LibraryOptions"}]},"LibraryCustomUmdCommentObject":{"description":"Set explicit comments for `commonjs`, `commonjs2`, `amd`, and `root`.","type":"object","additionalProperties":false,"properties":{"amd":{"description":"Set comment for `amd` section in UMD.","type":"string"},"commonjs":{"description":"Set comment for `commonjs` (exports) section in UMD.","type":"string"},"commonjs2":{"description":"Set comment for `commonjs2` (module.exports) section in UMD.","type":"string"},"root":{"description":"Set comment for `root` (global variable) section in UMD.","type":"string"}}},"LibraryCustomUmdObject":{"description":"Description object for all UMD variants of the library name.","type":"object","additionalProperties":false,"properties":{"amd":{"description":"Name of the exposed AMD library in the UMD.","type":"string","minLength":1},"commonjs":{"description":"Name of the exposed commonjs export in the UMD.","type":"string","minLength":1},"root":{"description":"Name of the property exposed globally by a UMD library.","anyOf":[{"type":"array","items":{"description":"Part of the name of the property exposed globally by a UMD library.","type":"string","minLength":1}},{"type":"string","minLength":1}]}}},"LibraryExport":{"description":"Specify which export should be exposed as library.","anyOf":[{"type":"array","items":{"description":"Part of the export that should be exposed as library.","type":"string","minLength":1}},{"type":"string","minLength":1}]},"LibraryName":{"description":"The name of the library (some types allow unnamed libraries too).","anyOf":[{"type":"array","items":{"description":"A part of the library name.","type":"string","minLength":1},"minItems":1},{"type":"string","minLength":1},{"$ref":"#/definitions/LibraryCustomUmdObject"}]},"LibraryOptions":{"description":"Options for library.","type":"object","additionalProperties":false,"properties":{"auxiliaryComment":{"$ref":"#/definitions/AuxiliaryComment"},"export":{"$ref":"#/definitions/LibraryExport"},"name":{"$ref":"#/definitions/LibraryName"},"type":{"$ref":"#/definitions/LibraryType"},"umdNamedDefine":{"$ref":"#/definitions/UmdNamedDefine"}},"required":["type"]},"LibraryType":{"description":"Type of library (types included by default are \'var\', \'module\', \'assign\', \'assign-properties\', \'this\', \'window\', \'self\', \'global\', \'commonjs\', \'commonjs2\', \'commonjs-module\', \'commonjs-static\', \'amd\', \'amd-require\', \'umd\', \'umd2\', \'jsonp\', \'system\', but others might be added by plugins).","anyOf":[{"enum":["var","module","assign","assign-properties","this","window","self","global","commonjs","commonjs2","commonjs-module","commonjs-static","amd","amd-require","umd","umd2","jsonp","system"]},{"type":"string"}]},"Loader":{"description":"Custom values available in the loader context.","type":"object"},"MemoryCacheOptions":{"description":"Options object for in-memory caching.","type":"object","additionalProperties":false,"properties":{"cacheUnaffected":{"description":"Additionally cache computation of modules that are unchanged and reference only unchanged modules.","type":"boolean"},"maxGenerations":{"description":"Number of generations unused cache entries stay in memory cache at minimum (1 = may be removed after unused for a single compilation, ..., Infinity: kept forever).","type":"number","minimum":1},"type":{"description":"In memory caching.","enum":["memory"]}},"required":["type"]},"Mode":{"description":"Enable production optimizations or development hints.","enum":["development","production","none"]},"ModuleFilterItemTypes":{"description":"Filtering value, regexp or function.","cli":{"helper":true},"anyOf":[{"instanceof":"RegExp","tsType":"RegExp"},{"type":"string","absolutePath":false},{"instanceof":"Function","tsType":"((name: string, module: import(\'../lib/stats/DefaultStatsFactoryPlugin\').StatsModule, type: \'module\' | \'chunk\' | \'root-of-chunk\' | \'nested\') => boolean)"}]},"ModuleFilterTypes":{"description":"Filtering modules.","cli":{"helper":true},"anyOf":[{"type":"array","items":{"description":"Rule to filter.","cli":{"helper":true},"oneOf":[{"$ref":"#/definitions/ModuleFilterItemTypes"}]}},{"$ref":"#/definitions/ModuleFilterItemTypes"}]},"ModuleOptions":{"description":"Options affecting the normal modules (`NormalModuleFactory`).","type":"object","additionalProperties":false,"properties":{"defaultRules":{"description":"An array of rules applied by default for modules.","cli":{"exclude":true},"oneOf":[{"$ref":"#/definitions/RuleSetRules"}]},"exprContextCritical":{"description":"Enable warnings for full dynamic dependencies.","type":"boolean"},"exprContextRecursive":{"description":"Enable recursive directory lookup for full dynamic dependencies. Deprecated: This option has moved to \'module.parser.javascript.exprContextRecursive\'.","type":"boolean"},"exprContextRegExp":{"description":"Sets the default regular expression for full dynamic dependencies. Deprecated: This option has moved to \'module.parser.javascript.exprContextRegExp\'.","anyOf":[{"instanceof":"RegExp","tsType":"RegExp"},{"type":"boolean"}]},"exprContextRequest":{"description":"Set the default request for full dynamic dependencies. Deprecated: This option has moved to \'module.parser.javascript.exprContextRequest\'.","type":"string"},"generator":{"$ref":"#/definitions/GeneratorOptionsByModuleType"},"noParse":{"$ref":"#/definitions/NoParse"},"parser":{"$ref":"#/definitions/ParserOptionsByModuleType"},"rules":{"description":"An array of rules applied for modules.","oneOf":[{"$ref":"#/definitions/RuleSetRules"}]},"strictExportPresence":{"description":"Emit errors instead of warnings when imported names don\'t exist in imported module. Deprecated: This option has moved to \'module.parser.javascript.strictExportPresence\'.","type":"boolean"},"strictThisContextOnImports":{"description":"Handle the this context correctly according to the spec for namespace objects. Deprecated: This option has moved to \'module.parser.javascript.strictThisContextOnImports\'.","type":"boolean"},"unknownContextCritical":{"description":"Enable warnings when using the require function in a not statically analyse-able way. Deprecated: This option has moved to \'module.parser.javascript.unknownContextCritical\'.","type":"boolean"},"unknownContextRecursive":{"description":"Enable recursive directory lookup when using the require function in a not statically analyse-able way. Deprecated: This option has moved to \'module.parser.javascript.unknownContextRecursive\'.","type":"boolean"},"unknownContextRegExp":{"description":"Sets the regular expression when using the require function in a not statically analyse-able way. Deprecated: This option has moved to \'module.parser.javascript.unknownContextRegExp\'.","anyOf":[{"instanceof":"RegExp","tsType":"RegExp"},{"type":"boolean"}]},"unknownContextRequest":{"description":"Sets the request when using the require function in a not statically analyse-able way. Deprecated: This option has moved to \'module.parser.javascript.unknownContextRequest\'.","type":"string"},"unsafeCache":{"description":"Cache the resolving of module requests.","anyOf":[{"type":"boolean"},{"instanceof":"Function","tsType":"Function"}]},"wrappedContextCritical":{"description":"Enable warnings for partial dynamic dependencies. Deprecated: This option has moved to \'module.parser.javascript.wrappedContextCritical\'.","type":"boolean"},"wrappedContextRecursive":{"description":"Enable recursive directory lookup for partial dynamic dependencies. Deprecated: This option has moved to \'module.parser.javascript.wrappedContextRecursive\'.","type":"boolean"},"wrappedContextRegExp":{"description":"Set the inner regular expression for partial dynamic dependencies. Deprecated: This option has moved to \'module.parser.javascript.wrappedContextRegExp\'.","instanceof":"RegExp","tsType":"RegExp"}}},"ModuleOptionsNormalized":{"description":"Options affecting the normal modules (`NormalModuleFactory`).","type":"object","additionalProperties":false,"properties":{"defaultRules":{"description":"An array of rules applied by default for modules.","cli":{"exclude":true},"oneOf":[{"$ref":"#/definitions/RuleSetRules"}]},"generator":{"$ref":"#/definitions/GeneratorOptionsByModuleType"},"noParse":{"$ref":"#/definitions/NoParse"},"parser":{"$ref":"#/definitions/ParserOptionsByModuleType"},"rules":{"description":"An array of rules applied for modules.","oneOf":[{"$ref":"#/definitions/RuleSetRules"}]},"unsafeCache":{"description":"Cache the resolving of module requests.","anyOf":[{"type":"boolean"},{"instanceof":"Function","tsType":"Function"}]}},"required":["defaultRules","generator","parser","rules"]},"Name":{"description":"Name of the configuration. Used when loading multiple configurations.","type":"string"},"NoParse":{"description":"Don\'t parse files matching. It\'s matched against the full resolved request.","anyOf":[{"type":"array","items":{"description":"Don\'t parse files matching. It\'s matched against the full resolved request.","anyOf":[{"description":"A regular expression, when matched the module is not parsed.","instanceof":"RegExp","tsType":"RegExp"},{"description":"An absolute path, when the module starts with this path it is not parsed.","type":"string","absolutePath":true},{"instanceof":"Function","tsType":"Function"}]},"minItems":1},{"description":"A regular expression, when matched the module is not parsed.","instanceof":"RegExp","tsType":"RegExp"},{"description":"An absolute path, when the module starts with this path it is not parsed.","type":"string","absolutePath":true},{"instanceof":"Function","tsType":"Function"}]},"Node":{"description":"Include polyfills or mocks for various node stuff.","anyOf":[{"enum":[false]},{"$ref":"#/definitions/NodeOptions"}]},"NodeOptions":{"description":"Options object for node compatibility features.","type":"object","additionalProperties":false,"properties":{"__dirname":{"description":"Include a polyfill for the \'__dirname\' variable.","enum":[false,true,"warn-mock","mock","eval-only"]},"__filename":{"description":"Include a polyfill for the \'__filename\' variable.","enum":[false,true,"warn-mock","mock","eval-only"]},"global":{"description":"Include a polyfill for the \'global\' variable.","enum":[false,true,"warn"]}}},"Optimization":{"description":"Enables/Disables integrated optimizations.","type":"object","additionalProperties":false,"properties":{"checkWasmTypes":{"description":"Check for incompatible wasm types when importing/exporting from/to ESM.","type":"boolean"},"chunkIds":{"description":"Define the algorithm to choose chunk ids (named: readable ids for better debugging, deterministic: numeric hash ids for better long term caching, size: numeric ids focused on minimal initial download size, total-size: numeric ids focused on minimal total download size, false: no algorithm used, as custom one can be provided via plugin).","enum":["natural","named","deterministic","size","total-size",false]},"concatenateModules":{"description":"Concatenate modules when possible to generate less modules, more efficient code and enable more optimizations by the minimizer.","type":"boolean"},"emitOnErrors":{"description":"Emit assets even when errors occur. Critical errors are emitted into the generated code and will cause errors at runtime.","type":"boolean"},"flagIncludedChunks":{"description":"Also flag chunks as loaded which contain a subset of the modules.","type":"boolean"},"innerGraph":{"description":"Creates a module-internal dependency graph for top level symbols, exports and imports, to improve unused exports detection.","type":"boolean"},"mangleExports":{"description":"Rename exports when possible to generate shorter code (depends on optimization.usedExports and optimization.providedExports, true/\\"deterministic\\": generate short deterministic names optimized for caching, \\"size\\": generate the shortest possible names).","anyOf":[{"enum":["size","deterministic"]},{"type":"boolean"}]},"mangleWasmImports":{"description":"Reduce size of WASM by changing imports to shorter strings.","type":"boolean"},"mergeDuplicateChunks":{"description":"Merge chunks which contain the same modules.","type":"boolean"},"minimize":{"description":"Enable minimizing the output. Uses optimization.minimizer.","type":"boolean"},"minimizer":{"description":"Minimizer(s) to use for minimizing the output.","type":"array","cli":{"exclude":true},"items":{"description":"Plugin of type object or instanceof Function.","anyOf":[{"enum":["..."]},{"$ref":"#/definitions/WebpackPluginInstance"},{"$ref":"#/definitions/WebpackPluginFunction"}]}},"moduleIds":{"description":"Define the algorithm to choose module ids (natural: numeric ids in order of usage, named: readable ids for better debugging, hashed: (deprecated) short hashes as ids for better long term caching, deterministic: numeric hash ids for better long term caching, size: numeric ids focused on minimal initial download size, false: no algorithm used, as custom one can be provided via plugin).","enum":["natural","named","hashed","deterministic","size",false]},"noEmitOnErrors":{"description":"Avoid emitting assets when errors occur (deprecated: use \'emitOnErrors\' instead).","type":"boolean","cli":{"exclude":true}},"nodeEnv":{"description":"Set process.env.NODE_ENV to a specific value.","anyOf":[{"enum":[false]},{"type":"string"}]},"portableRecords":{"description":"Generate records with relative paths to be able to move the context folder.","type":"boolean"},"providedExports":{"description":"Figure out which exports are provided by modules to generate more efficient code.","type":"boolean"},"realContentHash":{"description":"Use real [contenthash] based on final content of the assets.","type":"boolean"},"removeAvailableModules":{"description":"Removes modules from chunks when these modules are already included in all parents.","type":"boolean"},"removeEmptyChunks":{"description":"Remove chunks which are empty.","type":"boolean"},"runtimeChunk":{"$ref":"#/definitions/OptimizationRuntimeChunk"},"sideEffects":{"description":"Skip over modules which contain no side effects when exports are not used (false: disabled, \'flag\': only use manually placed side effects flag, true: also analyse source code for side effects).","anyOf":[{"enum":["flag"]},{"type":"boolean"}]},"splitChunks":{"description":"Optimize duplication and caching by splitting chunks by shared modules and cache group.","anyOf":[{"enum":[false]},{"$ref":"#/definitions/OptimizationSplitChunksOptions"}]},"usedExports":{"description":"Figure out which exports are used by modules to mangle export names, omit unused exports and generate more efficient code (true: analyse used exports for each runtime, \\"global\\": analyse exports globally for all runtimes combined).","anyOf":[{"enum":["global"]},{"type":"boolean"}]}}},"OptimizationRuntimeChunk":{"description":"Create an additional chunk which contains only the webpack runtime and chunk hash maps.","anyOf":[{"enum":["single","multiple"]},{"type":"boolean"},{"type":"object","additionalProperties":false,"properties":{"name":{"description":"The name or name factory for the runtime chunks.","anyOf":[{"type":"string"},{"instanceof":"Function","tsType":"Function"}]}}}]},"OptimizationRuntimeChunkNormalized":{"description":"Create an additional chunk which contains only the webpack runtime and chunk hash maps.","anyOf":[{"enum":[false]},{"type":"object","additionalProperties":false,"properties":{"name":{"description":"The name factory for the runtime chunks.","instanceof":"Function","tsType":"Function"}}}]},"OptimizationSplitChunksCacheGroup":{"description":"Options object for describing behavior of a cache group selecting modules that should be cached together.","type":"object","additionalProperties":false,"properties":{"automaticNameDelimiter":{"description":"Sets the name delimiter for created chunks.","type":"string","minLength":1},"chunks":{"description":"Select chunks for determining cache group content (defaults to \\"initial\\", \\"initial\\" and \\"all\\" requires adding these chunks to the HTML).","anyOf":[{"enum":["initial","async","all"]},{"instanceof":"Function","tsType":"((chunk: import(\'../lib/Chunk\')) => boolean)"}]},"enforce":{"description":"Ignore minimum size, minimum chunks and maximum requests and always create chunks for this cache group.","type":"boolean"},"enforceSizeThreshold":{"description":"Size threshold at which splitting is enforced and other restrictions (minRemainingSize, maxAsyncRequests, maxInitialRequests) are ignored.","oneOf":[{"$ref":"#/definitions/OptimizationSplitChunksSizes"}]},"filename":{"description":"Sets the template for the filename for created chunks.","anyOf":[{"type":"string","absolutePath":false,"minLength":1},{"instanceof":"Function","tsType":"((pathData: import(\\"../lib/Compilation\\").PathData, assetInfo?: import(\\"../lib/Compilation\\").AssetInfo) => string)"}]},"idHint":{"description":"Sets the hint for chunk id.","type":"string"},"layer":{"description":"Assign modules to a cache group by module layer.","anyOf":[{"instanceof":"RegExp","tsType":"RegExp"},{"type":"string"},{"instanceof":"Function","tsType":"Function"}]},"maxAsyncRequests":{"description":"Maximum number of requests which are accepted for on-demand loading.","type":"number","minimum":1},"maxAsyncSize":{"description":"Maximal size hint for the on-demand chunks.","oneOf":[{"$ref":"#/definitions/OptimizationSplitChunksSizes"}]},"maxInitialRequests":{"description":"Maximum number of initial chunks which are accepted for an entry point.","type":"number","minimum":1},"maxInitialSize":{"description":"Maximal size hint for the initial chunks.","oneOf":[{"$ref":"#/definitions/OptimizationSplitChunksSizes"}]},"maxSize":{"description":"Maximal size hint for the created chunks.","oneOf":[{"$ref":"#/definitions/OptimizationSplitChunksSizes"}]},"minChunks":{"description":"Minimum number of times a module has to be duplicated until it\'s considered for splitting.","type":"number","minimum":1},"minRemainingSize":{"description":"Minimal size for the chunks the stay after moving the modules to a new chunk.","oneOf":[{"$ref":"#/definitions/OptimizationSplitChunksSizes"}]},"minSize":{"description":"Minimal size for the created chunk.","oneOf":[{"$ref":"#/definitions/OptimizationSplitChunksSizes"}]},"minSizeReduction":{"description":"Minimum size reduction due to the created chunk.","oneOf":[{"$ref":"#/definitions/OptimizationSplitChunksSizes"}]},"name":{"description":"Give chunks for this cache group a name (chunks with equal name are merged).","anyOf":[{"enum":[false]},{"type":"string"},{"instanceof":"Function","tsType":"Function"}]},"priority":{"description":"Priority of this cache group.","type":"number"},"reuseExistingChunk":{"description":"Try to reuse existing chunk (with name) when it has matching modules.","type":"boolean"},"test":{"description":"Assign modules to a cache group by module name.","anyOf":[{"instanceof":"RegExp","tsType":"RegExp"},{"type":"string"},{"instanceof":"Function","tsType":"Function"}]},"type":{"description":"Assign modules to a cache group by module type.","anyOf":[{"instanceof":"RegExp","tsType":"RegExp"},{"type":"string"},{"instanceof":"Function","tsType":"Function"}]},"usedExports":{"description":"Compare used exports when checking common modules. Modules will only be put in the same chunk when exports are equal.","type":"boolean"}}},"OptimizationSplitChunksGetCacheGroups":{"description":"A function returning cache groups.","instanceof":"Function","tsType":"((module: import(\'../lib/Module\')) => OptimizationSplitChunksCacheGroup | OptimizationSplitChunksCacheGroup[] | void)"},"OptimizationSplitChunksOptions":{"description":"Options object for splitting chunks into smaller chunks.","type":"object","additionalProperties":false,"properties":{"automaticNameDelimiter":{"description":"Sets the name delimiter for created chunks.","type":"string","minLength":1},"cacheGroups":{"description":"Assign modules to a cache group (modules from different cache groups are tried to keep in separate chunks, default categories: \'default\', \'defaultVendors\').","type":"object","additionalProperties":{"description":"Configuration for a cache group.","anyOf":[{"enum":[false]},{"instanceof":"RegExp","tsType":"RegExp"},{"type":"string"},{"instanceof":"Function","tsType":"Function"},{"$ref":"#/definitions/OptimizationSplitChunksCacheGroup"}]},"not":{"description":"Using the cacheGroup shorthand syntax with a cache group named \'test\' is a potential config error\\nDid you intent to define a cache group with a test instead?\\ncacheGroups: {\\n : {\\n test: ...\\n }\\n}.","type":"object","additionalProperties":true,"properties":{"test":{"description":"The test property is a cache group name, but using the test option of the cache group could be intended instead.","anyOf":[{"instanceof":"RegExp","tsType":"RegExp"},{"type":"string"},{"instanceof":"Function","tsType":"Function"}]}},"required":["test"]}},"chunks":{"description":"Select chunks for determining shared modules (defaults to \\"async\\", \\"initial\\" and \\"all\\" requires adding these chunks to the HTML).","anyOf":[{"enum":["initial","async","all"]},{"instanceof":"Function","tsType":"((chunk: import(\'../lib/Chunk\')) => boolean)"}]},"defaultSizeTypes":{"description":"Sets the size types which are used when a number is used for sizes.","type":"array","items":{"description":"Size type, like \'javascript\', \'webassembly\'.","type":"string"},"minItems":1},"enforceSizeThreshold":{"description":"Size threshold at which splitting is enforced and other restrictions (minRemainingSize, maxAsyncRequests, maxInitialRequests) are ignored.","oneOf":[{"$ref":"#/definitions/OptimizationSplitChunksSizes"}]},"fallbackCacheGroup":{"description":"Options for modules not selected by any other cache group.","type":"object","additionalProperties":false,"properties":{"automaticNameDelimiter":{"description":"Sets the name delimiter for created chunks.","type":"string","minLength":1},"chunks":{"description":"Select chunks for determining shared modules (defaults to \\"async\\", \\"initial\\" and \\"all\\" requires adding these chunks to the HTML).","anyOf":[{"enum":["initial","async","all"]},{"instanceof":"Function","tsType":"((chunk: import(\'../lib/Chunk\')) => boolean)"}]},"maxAsyncSize":{"description":"Maximal size hint for the on-demand chunks.","oneOf":[{"$ref":"#/definitions/OptimizationSplitChunksSizes"}]},"maxInitialSize":{"description":"Maximal size hint for the initial chunks.","oneOf":[{"$ref":"#/definitions/OptimizationSplitChunksSizes"}]},"maxSize":{"description":"Maximal size hint for the created chunks.","oneOf":[{"$ref":"#/definitions/OptimizationSplitChunksSizes"}]},"minSize":{"description":"Minimal size for the created chunk.","oneOf":[{"$ref":"#/definitions/OptimizationSplitChunksSizes"}]},"minSizeReduction":{"description":"Minimum size reduction due to the created chunk.","oneOf":[{"$ref":"#/definitions/OptimizationSplitChunksSizes"}]}}},"filename":{"description":"Sets the template for the filename for created chunks.","anyOf":[{"type":"string","absolutePath":false,"minLength":1},{"instanceof":"Function","tsType":"((pathData: import(\\"../lib/Compilation\\").PathData, assetInfo?: import(\\"../lib/Compilation\\").AssetInfo) => string)"}]},"hidePathInfo":{"description":"Prevents exposing path info when creating names for parts splitted by maxSize.","type":"boolean"},"maxAsyncRequests":{"description":"Maximum number of requests which are accepted for on-demand loading.","type":"number","minimum":1},"maxAsyncSize":{"description":"Maximal size hint for the on-demand chunks.","oneOf":[{"$ref":"#/definitions/OptimizationSplitChunksSizes"}]},"maxInitialRequests":{"description":"Maximum number of initial chunks which are accepted for an entry point.","type":"number","minimum":1},"maxInitialSize":{"description":"Maximal size hint for the initial chunks.","oneOf":[{"$ref":"#/definitions/OptimizationSplitChunksSizes"}]},"maxSize":{"description":"Maximal size hint for the created chunks.","oneOf":[{"$ref":"#/definitions/OptimizationSplitChunksSizes"}]},"minChunks":{"description":"Minimum number of times a module has to be duplicated until it\'s considered for splitting.","type":"number","minimum":1},"minRemainingSize":{"description":"Minimal size for the chunks the stay after moving the modules to a new chunk.","oneOf":[{"$ref":"#/definitions/OptimizationSplitChunksSizes"}]},"minSize":{"description":"Minimal size for the created chunks.","oneOf":[{"$ref":"#/definitions/OptimizationSplitChunksSizes"}]},"minSizeReduction":{"description":"Minimum size reduction due to the created chunk.","oneOf":[{"$ref":"#/definitions/OptimizationSplitChunksSizes"}]},"name":{"description":"Give chunks created a name (chunks with equal name are merged).","anyOf":[{"enum":[false]},{"type":"string"},{"instanceof":"Function","tsType":"Function"}]},"usedExports":{"description":"Compare used exports when checking common modules. Modules will only be put in the same chunk when exports are equal.","type":"boolean"}}},"OptimizationSplitChunksSizes":{"description":"Size description for limits.","anyOf":[{"description":"Size of the javascript part of the chunk.","type":"number","minimum":0},{"description":"Specify size limits per size type.","type":"object","additionalProperties":{"description":"Size of the part of the chunk with the type of the key.","type":"number"}}]},"Output":{"description":"Options affecting the output of the compilation. `output` options tell webpack how to write the compiled files to disk.","type":"object","additionalProperties":false,"properties":{"assetModuleFilename":{"$ref":"#/definitions/AssetModuleFilename"},"asyncChunks":{"description":"Enable/disable creating async chunks that are loaded on demand.","type":"boolean"},"auxiliaryComment":{"cli":{"exclude":true},"oneOf":[{"$ref":"#/definitions/AuxiliaryComment"}]},"charset":{"$ref":"#/definitions/Charset"},"chunkFilename":{"$ref":"#/definitions/ChunkFilename"},"chunkFormat":{"$ref":"#/definitions/ChunkFormat"},"chunkLoadTimeout":{"$ref":"#/definitions/ChunkLoadTimeout"},"chunkLoading":{"$ref":"#/definitions/ChunkLoading"},"chunkLoadingGlobal":{"$ref":"#/definitions/ChunkLoadingGlobal"},"clean":{"$ref":"#/definitions/Clean"},"compareBeforeEmit":{"$ref":"#/definitions/CompareBeforeEmit"},"crossOriginLoading":{"$ref":"#/definitions/CrossOriginLoading"},"cssChunkFilename":{"$ref":"#/definitions/CssChunkFilename"},"cssFilename":{"$ref":"#/definitions/CssFilename"},"devtoolFallbackModuleFilenameTemplate":{"$ref":"#/definitions/DevtoolFallbackModuleFilenameTemplate"},"devtoolModuleFilenameTemplate":{"$ref":"#/definitions/DevtoolModuleFilenameTemplate"},"devtoolNamespace":{"$ref":"#/definitions/DevtoolNamespace"},"enabledChunkLoadingTypes":{"$ref":"#/definitions/EnabledChunkLoadingTypes"},"enabledLibraryTypes":{"$ref":"#/definitions/EnabledLibraryTypes"},"enabledWasmLoadingTypes":{"$ref":"#/definitions/EnabledWasmLoadingTypes"},"environment":{"$ref":"#/definitions/Environment"},"filename":{"$ref":"#/definitions/Filename"},"globalObject":{"$ref":"#/definitions/GlobalObject"},"hashDigest":{"$ref":"#/definitions/HashDigest"},"hashDigestLength":{"$ref":"#/definitions/HashDigestLength"},"hashFunction":{"$ref":"#/definitions/HashFunction"},"hashSalt":{"$ref":"#/definitions/HashSalt"},"hotUpdateChunkFilename":{"$ref":"#/definitions/HotUpdateChunkFilename"},"hotUpdateGlobal":{"$ref":"#/definitions/HotUpdateGlobal"},"hotUpdateMainFilename":{"$ref":"#/definitions/HotUpdateMainFilename"},"iife":{"$ref":"#/definitions/Iife"},"importFunctionName":{"$ref":"#/definitions/ImportFunctionName"},"importMetaName":{"$ref":"#/definitions/ImportMetaName"},"library":{"$ref":"#/definitions/Library"},"libraryExport":{"cli":{"exclude":true},"oneOf":[{"$ref":"#/definitions/LibraryExport"}]},"libraryTarget":{"cli":{"exclude":true},"oneOf":[{"$ref":"#/definitions/LibraryType"}]},"module":{"$ref":"#/definitions/OutputModule"},"path":{"$ref":"#/definitions/Path"},"pathinfo":{"$ref":"#/definitions/Pathinfo"},"publicPath":{"$ref":"#/definitions/PublicPath"},"scriptType":{"$ref":"#/definitions/ScriptType"},"sourceMapFilename":{"$ref":"#/definitions/SourceMapFilename"},"sourcePrefix":{"$ref":"#/definitions/SourcePrefix"},"strictModuleErrorHandling":{"$ref":"#/definitions/StrictModuleErrorHandling"},"strictModuleExceptionHandling":{"$ref":"#/definitions/StrictModuleExceptionHandling"},"trustedTypes":{"description":"Use a Trusted Types policy to create urls for chunks. \'output.uniqueName\' is used a default policy name. Passing a string sets a custom policy name.","anyOf":[{"enum":[true]},{"description":"The name of the Trusted Types policy created by webpack to serve bundle chunks.","type":"string","minLength":1},{"$ref":"#/definitions/TrustedTypes"}]},"umdNamedDefine":{"cli":{"exclude":true},"oneOf":[{"$ref":"#/definitions/UmdNamedDefine"}]},"uniqueName":{"$ref":"#/definitions/UniqueName"},"wasmLoading":{"$ref":"#/definitions/WasmLoading"},"webassemblyModuleFilename":{"$ref":"#/definitions/WebassemblyModuleFilename"},"workerChunkLoading":{"$ref":"#/definitions/ChunkLoading"},"workerWasmLoading":{"$ref":"#/definitions/WasmLoading"}}},"OutputModule":{"description":"Output javascript files as module source type.","type":"boolean"},"OutputNormalized":{"description":"Normalized options affecting the output of the compilation. `output` options tell webpack how to write the compiled files to disk.","type":"object","additionalProperties":false,"properties":{"assetModuleFilename":{"$ref":"#/definitions/AssetModuleFilename"},"asyncChunks":{"description":"Enable/disable creating async chunks that are loaded on demand.","type":"boolean"},"charset":{"$ref":"#/definitions/Charset"},"chunkFilename":{"$ref":"#/definitions/ChunkFilename"},"chunkFormat":{"$ref":"#/definitions/ChunkFormat"},"chunkLoadTimeout":{"$ref":"#/definitions/ChunkLoadTimeout"},"chunkLoading":{"$ref":"#/definitions/ChunkLoading"},"chunkLoadingGlobal":{"$ref":"#/definitions/ChunkLoadingGlobal"},"clean":{"$ref":"#/definitions/Clean"},"compareBeforeEmit":{"$ref":"#/definitions/CompareBeforeEmit"},"crossOriginLoading":{"$ref":"#/definitions/CrossOriginLoading"},"cssChunkFilename":{"$ref":"#/definitions/CssChunkFilename"},"cssFilename":{"$ref":"#/definitions/CssFilename"},"devtoolFallbackModuleFilenameTemplate":{"$ref":"#/definitions/DevtoolFallbackModuleFilenameTemplate"},"devtoolModuleFilenameTemplate":{"$ref":"#/definitions/DevtoolModuleFilenameTemplate"},"devtoolNamespace":{"$ref":"#/definitions/DevtoolNamespace"},"enabledChunkLoadingTypes":{"$ref":"#/definitions/EnabledChunkLoadingTypes"},"enabledLibraryTypes":{"$ref":"#/definitions/EnabledLibraryTypes"},"enabledWasmLoadingTypes":{"$ref":"#/definitions/EnabledWasmLoadingTypes"},"environment":{"$ref":"#/definitions/Environment"},"filename":{"$ref":"#/definitions/Filename"},"globalObject":{"$ref":"#/definitions/GlobalObject"},"hashDigest":{"$ref":"#/definitions/HashDigest"},"hashDigestLength":{"$ref":"#/definitions/HashDigestLength"},"hashFunction":{"$ref":"#/definitions/HashFunction"},"hashSalt":{"$ref":"#/definitions/HashSalt"},"hotUpdateChunkFilename":{"$ref":"#/definitions/HotUpdateChunkFilename"},"hotUpdateGlobal":{"$ref":"#/definitions/HotUpdateGlobal"},"hotUpdateMainFilename":{"$ref":"#/definitions/HotUpdateMainFilename"},"iife":{"$ref":"#/definitions/Iife"},"importFunctionName":{"$ref":"#/definitions/ImportFunctionName"},"importMetaName":{"$ref":"#/definitions/ImportMetaName"},"library":{"$ref":"#/definitions/LibraryOptions"},"module":{"$ref":"#/definitions/OutputModule"},"path":{"$ref":"#/definitions/Path"},"pathinfo":{"$ref":"#/definitions/Pathinfo"},"publicPath":{"$ref":"#/definitions/PublicPath"},"scriptType":{"$ref":"#/definitions/ScriptType"},"sourceMapFilename":{"$ref":"#/definitions/SourceMapFilename"},"sourcePrefix":{"$ref":"#/definitions/SourcePrefix"},"strictModuleErrorHandling":{"$ref":"#/definitions/StrictModuleErrorHandling"},"strictModuleExceptionHandling":{"$ref":"#/definitions/StrictModuleExceptionHandling"},"trustedTypes":{"$ref":"#/definitions/TrustedTypes"},"uniqueName":{"$ref":"#/definitions/UniqueName"},"wasmLoading":{"$ref":"#/definitions/WasmLoading"},"webassemblyModuleFilename":{"$ref":"#/definitions/WebassemblyModuleFilename"},"workerChunkLoading":{"$ref":"#/definitions/ChunkLoading"},"workerWasmLoading":{"$ref":"#/definitions/WasmLoading"}}},"Parallelism":{"description":"The number of parallel processed modules in the compilation.","type":"number","minimum":1},"ParserOptionsByModuleType":{"description":"Specify options for each parser.","type":"object","additionalProperties":{"description":"Options for parsing.","type":"object","additionalProperties":true},"properties":{"asset":{"$ref":"#/definitions/AssetParserOptions"},"asset/inline":{"$ref":"#/definitions/EmptyParserOptions"},"asset/resource":{"$ref":"#/definitions/EmptyParserOptions"},"asset/source":{"$ref":"#/definitions/EmptyParserOptions"},"javascript":{"$ref":"#/definitions/JavascriptParserOptions"},"javascript/auto":{"$ref":"#/definitions/JavascriptParserOptions"},"javascript/dynamic":{"$ref":"#/definitions/JavascriptParserOptions"},"javascript/esm":{"$ref":"#/definitions/JavascriptParserOptions"}}},"Path":{"description":"The output directory as **absolute path** (required).","type":"string","absolutePath":true},"Pathinfo":{"description":"Include comments with information about the modules.","anyOf":[{"enum":["verbose"]},{"type":"boolean"}]},"Performance":{"description":"Configuration for web performance recommendations.","anyOf":[{"enum":[false]},{"$ref":"#/definitions/PerformanceOptions"}]},"PerformanceOptions":{"description":"Configuration object for web performance recommendations.","type":"object","additionalProperties":false,"properties":{"assetFilter":{"description":"Filter function to select assets that are checked.","instanceof":"Function","tsType":"Function"},"hints":{"description":"Sets the format of the hints: warnings, errors or nothing at all.","enum":[false,"warning","error"]},"maxAssetSize":{"description":"File size limit (in bytes) when exceeded, that webpack will provide performance hints.","type":"number"},"maxEntrypointSize":{"description":"Total size of an entry point (in bytes).","type":"number"}}},"Plugins":{"description":"Add additional plugins to the compiler.","type":"array","items":{"description":"Plugin of type object or instanceof Function.","anyOf":[{"$ref":"#/definitions/WebpackPluginInstance"},{"$ref":"#/definitions/WebpackPluginFunction"}]}},"Profile":{"description":"Capture timing information for each module.","type":"boolean"},"PublicPath":{"description":"The \'publicPath\' specifies the public URL address of the output files when referenced in a browser.","anyOf":[{"enum":["auto"]},{"$ref":"#/definitions/RawPublicPath"}]},"RawPublicPath":{"description":"The \'publicPath\' specifies the public URL address of the output files when referenced in a browser.","anyOf":[{"type":"string"},{"instanceof":"Function","tsType":"((pathData: import(\\"../lib/Compilation\\").PathData, assetInfo?: import(\\"../lib/Compilation\\").AssetInfo) => string)"}]},"RecordsInputPath":{"description":"Store compiler state to a json file.","anyOf":[{"enum":[false]},{"type":"string","absolutePath":true}]},"RecordsOutputPath":{"description":"Load compiler state from a json file.","anyOf":[{"enum":[false]},{"type":"string","absolutePath":true}]},"RecordsPath":{"description":"Store/Load compiler state from/to a json file. This will result in persistent ids of modules and chunks. An absolute path is expected. `recordsPath` is used for `recordsInputPath` and `recordsOutputPath` if they left undefined.","anyOf":[{"enum":[false]},{"type":"string","absolutePath":true}]},"Resolve":{"description":"Options for the resolver.","oneOf":[{"$ref":"#/definitions/ResolveOptions"}]},"ResolveAlias":{"description":"Redirect module requests.","anyOf":[{"type":"array","items":{"description":"Alias configuration.","type":"object","additionalProperties":false,"properties":{"alias":{"description":"New request.","anyOf":[{"description":"Multiple alternative requests.","type":"array","items":{"description":"One choice of request.","type":"string","minLength":1}},{"description":"Ignore request (replace with empty module).","enum":[false]},{"description":"New request.","type":"string","minLength":1}]},"name":{"description":"Request to be redirected.","type":"string"},"onlyModule":{"description":"Redirect only exact matching request.","type":"boolean"}},"required":["alias","name"]}},{"type":"object","additionalProperties":{"description":"New request.","anyOf":[{"description":"Multiple alternative requests.","type":"array","items":{"description":"One choice of request.","type":"string","minLength":1}},{"description":"Ignore request (replace with empty module).","enum":[false]},{"description":"New request.","type":"string","minLength":1}]}}]},"ResolveLoader":{"description":"Options for the resolver when resolving loaders.","oneOf":[{"$ref":"#/definitions/ResolveOptions"}]},"ResolveOptions":{"description":"Options object for resolving requests.","type":"object","additionalProperties":false,"properties":{"alias":{"$ref":"#/definitions/ResolveAlias"},"aliasFields":{"description":"Fields in the description file (usually package.json) which are used to redirect requests inside the module.","type":"array","items":{"description":"Field in the description file (usually package.json) which are used to redirect requests inside the module.","anyOf":[{"type":"array","items":{"description":"Part of the field path in the description file (usually package.json) which are used to redirect requests inside the module.","type":"string","minLength":1}},{"type":"string","minLength":1}]}},"byDependency":{"description":"Extra resolve options per dependency category. Typical categories are \\"commonjs\\", \\"amd\\", \\"esm\\".","type":"object","additionalProperties":{"description":"Options object for resolving requests.","oneOf":[{"$ref":"#/definitions/ResolveOptions"}]}},"cache":{"description":"Enable caching of successfully resolved requests (cache entries are revalidated).","type":"boolean"},"cachePredicate":{"description":"Predicate function to decide which requests should be cached.","instanceof":"Function","tsType":"((request: import(\'enhanced-resolve\').ResolveRequest) => boolean)"},"cacheWithContext":{"description":"Include the context information in the cache identifier when caching.","type":"boolean"},"conditionNames":{"description":"Condition names for exports field entry point.","type":"array","items":{"description":"Condition names for exports field entry point.","type":"string"}},"descriptionFiles":{"description":"Filenames used to find a description file (like a package.json).","type":"array","items":{"description":"Filename used to find a description file (like a package.json).","type":"string","minLength":1}},"enforceExtension":{"description":"Enforce the resolver to use one of the extensions from the extensions option (User must specify requests without extension).","type":"boolean"},"exportsFields":{"description":"Field names from the description file (usually package.json) which are used to provide entry points of a package.","type":"array","items":{"description":"Field name from the description file (usually package.json) which is used to provide entry points of a package.","type":"string"}},"extensionAlias":{"description":"An object which maps extension to extension aliases.","type":"object","additionalProperties":{"description":"Extension alias.","anyOf":[{"description":"Multiple extensions.","type":"array","items":{"description":"Aliased extension.","type":"string","minLength":1}},{"description":"Aliased extension.","type":"string","minLength":1}]}},"extensions":{"description":"Extensions added to the request when trying to find the file.","type":"array","items":{"description":"Extension added to the request when trying to find the file.","type":"string"}},"fallback":{"description":"Redirect module requests when normal resolving fails.","oneOf":[{"$ref":"#/definitions/ResolveAlias"}]},"fileSystem":{"description":"Filesystem for the resolver.","tsType":"(import(\'../lib/util/fs\').InputFileSystem)"},"fullySpecified":{"description":"Treats the request specified by the user as fully specified, meaning no extensions are added and the mainFiles in directories are not resolved (This doesn\'t affect requests from mainFields, aliasFields or aliases).","type":"boolean"},"importsFields":{"description":"Field names from the description file (usually package.json) which are used to provide internal request of a package (requests starting with # are considered as internal).","type":"array","items":{"description":"Field name from the description file (usually package.json) which is used to provide internal request of a package (requests starting with # are considered as internal).","type":"string"}},"mainFields":{"description":"Field names from the description file (package.json) which are used to find the default entry point.","type":"array","items":{"description":"Field name from the description file (package.json) which are used to find the default entry point.","anyOf":[{"type":"array","items":{"description":"Part of the field path from the description file (package.json) which are used to find the default entry point.","type":"string","minLength":1}},{"type":"string","minLength":1}]}},"mainFiles":{"description":"Filenames used to find the default entry point if there is no description file or main field.","type":"array","items":{"description":"Filename used to find the default entry point if there is no description file or main field.","type":"string","minLength":1}},"modules":{"description":"Folder names or directory paths where to find modules.","type":"array","items":{"description":"Folder name or directory path where to find modules.","type":"string","minLength":1}},"plugins":{"description":"Plugins for the resolver.","type":"array","cli":{"exclude":true},"items":{"description":"Plugin of type object or instanceof Function.","anyOf":[{"enum":["..."]},{"$ref":"#/definitions/ResolvePluginInstance"}]}},"preferAbsolute":{"description":"Prefer to resolve server-relative URLs (starting with \'/\') as absolute paths before falling back to resolve in \'resolve.roots\'.","type":"boolean"},"preferRelative":{"description":"Prefer to resolve module requests as relative request and fallback to resolving as module.","type":"boolean"},"resolver":{"description":"Custom resolver.","tsType":"(import(\'enhanced-resolve\').Resolver)"},"restrictions":{"description":"A list of resolve restrictions. Resolve results must fulfill all of these restrictions to resolve successfully. Other resolve paths are taken when restrictions are not met.","type":"array","items":{"description":"Resolve restriction. Resolve result must fulfill this restriction.","anyOf":[{"instanceof":"RegExp","tsType":"RegExp"},{"type":"string","absolutePath":true,"minLength":1}]}},"roots":{"description":"A list of directories in which requests that are server-relative URLs (starting with \'/\') are resolved.","type":"array","items":{"description":"Directory in which requests that are server-relative URLs (starting with \'/\') are resolved.","type":"string"}},"symlinks":{"description":"Enable resolving symlinks to the original location.","type":"boolean"},"unsafeCache":{"description":"Enable caching of successfully resolved requests (cache entries are not revalidated).","anyOf":[{"type":"boolean"},{"type":"object","additionalProperties":true}]},"useSyncFileSystemCalls":{"description":"Use synchronous filesystem calls for the resolver.","type":"boolean"}}},"ResolvePluginInstance":{"description":"Plugin instance.","type":"object","additionalProperties":true,"properties":{"apply":{"description":"The run point of the plugin, required method.","instanceof":"Function","tsType":"(resolver: import(\'enhanced-resolve\').Resolver) => void"}},"required":["apply"]},"RuleSetCondition":{"description":"A condition matcher.","cli":{"helper":true},"anyOf":[{"instanceof":"RegExp","tsType":"RegExp"},{"type":"string"},{"instanceof":"Function","tsType":"((value: string) => boolean)"},{"$ref":"#/definitions/RuleSetLogicalConditions"},{"$ref":"#/definitions/RuleSetConditions"}]},"RuleSetConditionAbsolute":{"description":"A condition matcher matching an absolute path.","cli":{"helper":true},"anyOf":[{"instanceof":"RegExp","tsType":"RegExp"},{"type":"string","absolutePath":true},{"instanceof":"Function","tsType":"((value: string) => boolean)"},{"$ref":"#/definitions/RuleSetLogicalConditionsAbsolute"},{"$ref":"#/definitions/RuleSetConditionsAbsolute"}]},"RuleSetConditionOrConditions":{"description":"One or multiple rule conditions.","cli":{"helper":true},"anyOf":[{"$ref":"#/definitions/RuleSetCondition"},{"$ref":"#/definitions/RuleSetConditions"}]},"RuleSetConditionOrConditionsAbsolute":{"description":"One or multiple rule conditions matching an absolute path.","cli":{"helper":true},"anyOf":[{"$ref":"#/definitions/RuleSetConditionAbsolute"},{"$ref":"#/definitions/RuleSetConditionsAbsolute"}]},"RuleSetConditions":{"description":"A list of rule conditions.","type":"array","items":{"description":"A rule condition.","oneOf":[{"$ref":"#/definitions/RuleSetCondition"}]}},"RuleSetConditionsAbsolute":{"description":"A list of rule conditions matching an absolute path.","type":"array","items":{"description":"A rule condition matching an absolute path.","oneOf":[{"$ref":"#/definitions/RuleSetConditionAbsolute"}]}},"RuleSetLoader":{"description":"A loader request.","type":"string","minLength":1},"RuleSetLoaderOptions":{"description":"Options passed to a loader.","anyOf":[{"type":"string"},{"type":"object"}]},"RuleSetLogicalConditions":{"description":"Logic operators used in a condition matcher.","type":"object","additionalProperties":false,"properties":{"and":{"description":"Logical AND.","oneOf":[{"$ref":"#/definitions/RuleSetConditions"}]},"not":{"description":"Logical NOT.","oneOf":[{"$ref":"#/definitions/RuleSetCondition"}]},"or":{"description":"Logical OR.","oneOf":[{"$ref":"#/definitions/RuleSetConditions"}]}}},"RuleSetLogicalConditionsAbsolute":{"description":"Logic operators used in a condition matcher.","type":"object","additionalProperties":false,"properties":{"and":{"description":"Logical AND.","oneOf":[{"$ref":"#/definitions/RuleSetConditionsAbsolute"}]},"not":{"description":"Logical NOT.","oneOf":[{"$ref":"#/definitions/RuleSetConditionAbsolute"}]},"or":{"description":"Logical OR.","oneOf":[{"$ref":"#/definitions/RuleSetConditionsAbsolute"}]}}},"RuleSetRule":{"description":"A rule description with conditions and effects for modules.","type":"object","additionalProperties":false,"properties":{"assert":{"description":"Match on import assertions of the dependency.","type":"object","additionalProperties":{"$ref":"#/definitions/RuleSetConditionOrConditions"}},"compiler":{"description":"Match the child compiler name.","oneOf":[{"$ref":"#/definitions/RuleSetConditionOrConditions"}]},"dependency":{"description":"Match dependency type.","oneOf":[{"$ref":"#/definitions/RuleSetConditionOrConditions"}]},"descriptionData":{"description":"Match values of properties in the description file (usually package.json).","type":"object","additionalProperties":{"$ref":"#/definitions/RuleSetConditionOrConditions"}},"enforce":{"description":"Enforce this rule as pre or post step.","enum":["pre","post"]},"exclude":{"description":"Shortcut for resource.exclude.","oneOf":[{"$ref":"#/definitions/RuleSetConditionOrConditionsAbsolute"}]},"generator":{"description":"The options for the module generator.","type":"object"},"include":{"description":"Shortcut for resource.include.","oneOf":[{"$ref":"#/definitions/RuleSetConditionOrConditionsAbsolute"}]},"issuer":{"description":"Match the issuer of the module (The module pointing to this module).","oneOf":[{"$ref":"#/definitions/RuleSetConditionOrConditionsAbsolute"}]},"issuerLayer":{"description":"Match layer of the issuer of this module (The module pointing to this module).","oneOf":[{"$ref":"#/definitions/RuleSetConditionOrConditions"}]},"layer":{"description":"Specifies the layer in which the module should be placed in.","type":"string"},"loader":{"description":"Shortcut for use.loader.","oneOf":[{"$ref":"#/definitions/RuleSetLoader"}]},"mimetype":{"description":"Match module mimetype when load from Data URI.","oneOf":[{"$ref":"#/definitions/RuleSetConditionOrConditions"}]},"oneOf":{"description":"Only execute the first matching rule in this array.","type":"array","items":{"description":"A rule.","oneOf":[{"$ref":"#/definitions/RuleSetRule"}]}},"options":{"description":"Shortcut for use.options.","cli":{"exclude":true},"oneOf":[{"$ref":"#/definitions/RuleSetLoaderOptions"}]},"parser":{"description":"Options for parsing.","type":"object","additionalProperties":true},"realResource":{"description":"Match the real resource path of the module.","oneOf":[{"$ref":"#/definitions/RuleSetConditionOrConditionsAbsolute"}]},"resolve":{"description":"Options for the resolver.","type":"object","oneOf":[{"$ref":"#/definitions/ResolveOptions"}]},"resource":{"description":"Match the resource path of the module.","oneOf":[{"$ref":"#/definitions/RuleSetConditionOrConditionsAbsolute"}]},"resourceFragment":{"description":"Match the resource fragment of the module.","oneOf":[{"$ref":"#/definitions/RuleSetConditionOrConditions"}]},"resourceQuery":{"description":"Match the resource query of the module.","oneOf":[{"$ref":"#/definitions/RuleSetConditionOrConditions"}]},"rules":{"description":"Match and execute these rules when this rule is matched.","type":"array","items":{"description":"A rule.","oneOf":[{"$ref":"#/definitions/RuleSetRule"}]}},"scheme":{"description":"Match module scheme.","oneOf":[{"$ref":"#/definitions/RuleSetConditionOrConditions"}]},"sideEffects":{"description":"Flags a module as with or without side effects.","type":"boolean"},"test":{"description":"Shortcut for resource.test.","oneOf":[{"$ref":"#/definitions/RuleSetConditionOrConditionsAbsolute"}]},"type":{"description":"Module type to use for the module.","type":"string"},"use":{"description":"Modifiers applied to the module when rule is matched.","oneOf":[{"$ref":"#/definitions/RuleSetUse"}]}}},"RuleSetRules":{"description":"A list of rules.","type":"array","items":{"description":"A rule.","anyOf":[{"cli":{"exclude":true},"enum":["..."]},{"$ref":"#/definitions/RuleSetRule"}]}},"RuleSetUse":{"description":"A list of descriptions of loaders applied.","anyOf":[{"type":"array","items":{"description":"An use item.","oneOf":[{"$ref":"#/definitions/RuleSetUseItem"}]}},{"instanceof":"Function","tsType":"((data: { resource: string, realResource: string, resourceQuery: string, issuer: string, compiler: string }) => RuleSetUseItem[])"},{"$ref":"#/definitions/RuleSetUseItem"}]},"RuleSetUseItem":{"description":"A description of an applied loader.","anyOf":[{"type":"object","additionalProperties":false,"properties":{"ident":{"description":"Unique loader options identifier.","type":"string"},"loader":{"description":"Loader name.","oneOf":[{"$ref":"#/definitions/RuleSetLoader"}]},"options":{"description":"Loader options.","oneOf":[{"$ref":"#/definitions/RuleSetLoaderOptions"}]}}},{"instanceof":"Function","tsType":"((data: object) => RuleSetUseItem|RuleSetUseItem[])"},{"$ref":"#/definitions/RuleSetLoader"}]},"ScriptType":{"description":"This option enables loading async chunks via a custom script type, such as script type=\\"module\\".","enum":[false,"text/javascript","module"]},"SnapshotOptions":{"description":"Options affecting how file system snapshots are created and validated.","type":"object","additionalProperties":false,"properties":{"buildDependencies":{"description":"Options for snapshotting build dependencies to determine if the whole cache need to be invalidated.","type":"object","additionalProperties":false,"properties":{"hash":{"description":"Use hashes of the content of the files/directories to determine invalidation.","type":"boolean"},"timestamp":{"description":"Use timestamps of the files/directories to determine invalidation.","type":"boolean"}}},"immutablePaths":{"description":"List of paths that are managed by a package manager and contain a version or hash in its path so all files are immutable.","type":"array","items":{"description":"List of paths that are managed by a package manager and contain a version or hash in its path so all files are immutable.","anyOf":[{"description":"A RegExp matching an immutable directory (usually a package manager cache directory, including the tailing slash)","instanceof":"RegExp","tsType":"RegExp"},{"description":"A path to an immutable directory (usually a package manager cache directory).","type":"string","absolutePath":true,"minLength":1}]}},"managedPaths":{"description":"List of paths that are managed by a package manager and can be trusted to not be modified otherwise.","type":"array","items":{"description":"List of paths that are managed by a package manager and can be trusted to not be modified otherwise.","anyOf":[{"description":"A RegExp matching a managed directory (usually a node_modules directory, including the tailing slash)","instanceof":"RegExp","tsType":"RegExp"},{"description":"A path to a managed directory (usually a node_modules directory).","type":"string","absolutePath":true,"minLength":1}]}},"module":{"description":"Options for snapshotting dependencies of modules to determine if they need to be built again.","type":"object","additionalProperties":false,"properties":{"hash":{"description":"Use hashes of the content of the files/directories to determine invalidation.","type":"boolean"},"timestamp":{"description":"Use timestamps of the files/directories to determine invalidation.","type":"boolean"}}},"resolve":{"description":"Options for snapshotting dependencies of request resolving to determine if requests need to be re-resolved.","type":"object","additionalProperties":false,"properties":{"hash":{"description":"Use hashes of the content of the files/directories to determine invalidation.","type":"boolean"},"timestamp":{"description":"Use timestamps of the files/directories to determine invalidation.","type":"boolean"}}},"resolveBuildDependencies":{"description":"Options for snapshotting the resolving of build dependencies to determine if the build dependencies need to be re-resolved.","type":"object","additionalProperties":false,"properties":{"hash":{"description":"Use hashes of the content of the files/directories to determine invalidation.","type":"boolean"},"timestamp":{"description":"Use timestamps of the files/directories to determine invalidation.","type":"boolean"}}}}},"SourceMapFilename":{"description":"The filename of the SourceMaps for the JavaScript files. They are inside the \'output.path\' directory.","type":"string","absolutePath":false},"SourcePrefix":{"description":"Prefixes every line of the source in the bundle with this string.","type":"string"},"StatsOptions":{"description":"Stats options object.","type":"object","additionalProperties":false,"properties":{"all":{"description":"Fallback value for stats options when an option is not defined (has precedence over local webpack defaults).","type":"boolean"},"assets":{"description":"Add assets information.","type":"boolean"},"assetsSort":{"description":"Sort the assets by that field.","type":"string"},"assetsSpace":{"description":"Space to display assets (groups will be collapsed to fit this space).","type":"number"},"builtAt":{"description":"Add built at time information.","type":"boolean"},"cached":{"description":"Add information about cached (not built) modules (deprecated: use \'cachedModules\' instead).","type":"boolean"},"cachedAssets":{"description":"Show cached assets (setting this to `false` only shows emitted files).","type":"boolean"},"cachedModules":{"description":"Add information about cached (not built) modules.","type":"boolean"},"children":{"description":"Add children information.","type":"boolean"},"chunkGroupAuxiliary":{"description":"Display auxiliary assets in chunk groups.","type":"boolean"},"chunkGroupChildren":{"description":"Display children of chunk groups.","type":"boolean"},"chunkGroupMaxAssets":{"description":"Limit of assets displayed in chunk groups.","type":"number"},"chunkGroups":{"description":"Display all chunk groups with the corresponding bundles.","type":"boolean"},"chunkModules":{"description":"Add built modules information to chunk information.","type":"boolean"},"chunkModulesSpace":{"description":"Space to display chunk modules (groups will be collapsed to fit this space, value is in number of modules/group).","type":"number"},"chunkOrigins":{"description":"Add the origins of chunks and chunk merging info.","type":"boolean"},"chunkRelations":{"description":"Add information about parent, children and sibling chunks to chunk information.","type":"boolean"},"chunks":{"description":"Add chunk information.","type":"boolean"},"chunksSort":{"description":"Sort the chunks by that field.","type":"string"},"colors":{"description":"Enables/Disables colorful output.","anyOf":[{"description":"Enables/Disables colorful output.","type":"boolean"},{"type":"object","additionalProperties":false,"properties":{"bold":{"description":"Custom color for bold text.","type":"string"},"cyan":{"description":"Custom color for cyan text.","type":"string"},"green":{"description":"Custom color for green text.","type":"string"},"magenta":{"description":"Custom color for magenta text.","type":"string"},"red":{"description":"Custom color for red text.","type":"string"},"yellow":{"description":"Custom color for yellow text.","type":"string"}}}]},"context":{"description":"Context directory for request shortening.","type":"string","absolutePath":true},"dependentModules":{"description":"Show chunk modules that are dependencies of other modules of the chunk.","type":"boolean"},"depth":{"description":"Add module depth in module graph.","type":"boolean"},"entrypoints":{"description":"Display the entry points with the corresponding bundles.","anyOf":[{"enum":["auto"]},{"type":"boolean"}]},"env":{"description":"Add --env information.","type":"boolean"},"errorDetails":{"description":"Add details to errors (like resolving log).","anyOf":[{"enum":["auto"]},{"type":"boolean"}]},"errorStack":{"description":"Add internal stack trace to errors.","type":"boolean"},"errors":{"description":"Add errors.","type":"boolean"},"errorsCount":{"description":"Add errors count.","type":"boolean"},"exclude":{"description":"Please use excludeModules instead.","cli":{"exclude":true},"anyOf":[{"type":"boolean"},{"$ref":"#/definitions/ModuleFilterTypes"}]},"excludeAssets":{"description":"Suppress assets that match the specified filters. Filters can be Strings, RegExps or Functions.","oneOf":[{"$ref":"#/definitions/AssetFilterTypes"}]},"excludeModules":{"description":"Suppress modules that match the specified filters. Filters can be Strings, RegExps, Booleans or Functions.","anyOf":[{"type":"boolean"},{"$ref":"#/definitions/ModuleFilterTypes"}]},"groupAssetsByChunk":{"description":"Group assets by how their are related to chunks.","type":"boolean"},"groupAssetsByEmitStatus":{"description":"Group assets by their status (emitted, compared for emit or cached).","type":"boolean"},"groupAssetsByExtension":{"description":"Group assets by their extension.","type":"boolean"},"groupAssetsByInfo":{"description":"Group assets by their asset info (immutable, development, hotModuleReplacement, etc).","type":"boolean"},"groupAssetsByPath":{"description":"Group assets by their path.","type":"boolean"},"groupModulesByAttributes":{"description":"Group modules by their attributes (errors, warnings, assets, optional, orphan, or dependent).","type":"boolean"},"groupModulesByCacheStatus":{"description":"Group modules by their status (cached or built and cacheable).","type":"boolean"},"groupModulesByExtension":{"description":"Group modules by their extension.","type":"boolean"},"groupModulesByLayer":{"description":"Group modules by their layer.","type":"boolean"},"groupModulesByPath":{"description":"Group modules by their path.","type":"boolean"},"groupModulesByType":{"description":"Group modules by their type.","type":"boolean"},"groupReasonsByOrigin":{"description":"Group reasons by their origin module.","type":"boolean"},"hash":{"description":"Add the hash of the compilation.","type":"boolean"},"ids":{"description":"Add ids.","type":"boolean"},"logging":{"description":"Add logging output.","anyOf":[{"description":"Specify log level of logging output.","enum":["none","error","warn","info","log","verbose"]},{"description":"Enable/disable logging output (`true`: shows normal logging output, loglevel: log).","type":"boolean"}]},"loggingDebug":{"description":"Include debug logging of specified loggers (i. e. for plugins or loaders). Filters can be Strings, RegExps or Functions.","anyOf":[{"description":"Enable/Disable debug logging for all loggers.","type":"boolean"},{"$ref":"#/definitions/FilterTypes"}]},"loggingTrace":{"description":"Add stack traces to logging output.","type":"boolean"},"moduleAssets":{"description":"Add information about assets inside modules.","type":"boolean"},"moduleTrace":{"description":"Add dependencies and origin of warnings/errors.","type":"boolean"},"modules":{"description":"Add built modules information.","type":"boolean"},"modulesSort":{"description":"Sort the modules by that field.","type":"string"},"modulesSpace":{"description":"Space to display modules (groups will be collapsed to fit this space, value is in number of modules/groups).","type":"number"},"nestedModules":{"description":"Add information about modules nested in other modules (like with module concatenation).","type":"boolean"},"nestedModulesSpace":{"description":"Space to display modules nested within other modules (groups will be collapsed to fit this space, value is in number of modules/group).","type":"number"},"optimizationBailout":{"description":"Show reasons why optimization bailed out for modules.","type":"boolean"},"orphanModules":{"description":"Add information about orphan modules.","type":"boolean"},"outputPath":{"description":"Add output path information.","type":"boolean"},"performance":{"description":"Add performance hint flags.","type":"boolean"},"preset":{"description":"Preset for the default values.","anyOf":[{"type":"boolean"},{"type":"string"}]},"providedExports":{"description":"Show exports provided by modules.","type":"boolean"},"publicPath":{"description":"Add public path information.","type":"boolean"},"reasons":{"description":"Add information about the reasons why modules are included.","type":"boolean"},"reasonsSpace":{"description":"Space to display reasons (groups will be collapsed to fit this space).","type":"number"},"relatedAssets":{"description":"Add information about assets that are related to other assets (like SourceMaps for assets).","type":"boolean"},"runtime":{"description":"Add information about runtime modules (deprecated: use \'runtimeModules\' instead).","type":"boolean"},"runtimeModules":{"description":"Add information about runtime modules.","type":"boolean"},"source":{"description":"Add the source code of modules.","type":"boolean"},"timings":{"description":"Add timing information.","type":"boolean"},"usedExports":{"description":"Show exports used by modules.","type":"boolean"},"version":{"description":"Add webpack version information.","type":"boolean"},"warnings":{"description":"Add warnings.","type":"boolean"},"warningsCount":{"description":"Add warnings count.","type":"boolean"},"warningsFilter":{"description":"Suppress listing warnings that match the specified filters (they will still be counted). Filters can be Strings, RegExps or Functions.","oneOf":[{"$ref":"#/definitions/WarningFilterTypes"}]}}},"StatsValue":{"description":"Stats options object or preset name.","anyOf":[{"enum":["none","summary","errors-only","errors-warnings","minimal","normal","detailed","verbose"]},{"type":"boolean"},{"$ref":"#/definitions/StatsOptions"}]},"StrictModuleErrorHandling":{"description":"Handles error in module loading correctly at a performance cost. This will handle module error compatible with the EcmaScript Modules spec.","type":"boolean"},"StrictModuleExceptionHandling":{"description":"Handles exceptions in module loading correctly at a performance cost (Deprecated). This will handle module error compatible with the Node.js CommonJS way.","type":"boolean"},"Target":{"description":"Environment to build for. An array of environments to build for all of them when possible.","anyOf":[{"type":"array","items":{"description":"Environment to build for.","type":"string","minLength":1},"minItems":1},{"enum":[false]},{"type":"string","minLength":1}]},"TrustedTypes":{"description":"Use a Trusted Types policy to create urls for chunks.","type":"object","additionalProperties":false,"properties":{"policyName":{"description":"The name of the Trusted Types policy created by webpack to serve bundle chunks.","type":"string","minLength":1}}},"UmdNamedDefine":{"description":"If `output.libraryTarget` is set to umd and `output.library` is set, setting this to true will name the AMD module.","type":"boolean"},"UniqueName":{"description":"A unique name of the webpack build to avoid multiple webpack runtimes to conflict when using globals.","type":"string","minLength":1},"WarningFilterItemTypes":{"description":"Filtering value, regexp or function.","cli":{"helper":true},"anyOf":[{"instanceof":"RegExp","tsType":"RegExp"},{"type":"string","absolutePath":false},{"instanceof":"Function","tsType":"((warning: import(\'../lib/stats/DefaultStatsFactoryPlugin\').StatsError, value: string) => boolean)"}]},"WarningFilterTypes":{"description":"Filtering warnings.","cli":{"helper":true},"anyOf":[{"type":"array","items":{"description":"Rule to filter.","cli":{"helper":true},"oneOf":[{"$ref":"#/definitions/WarningFilterItemTypes"}]}},{"$ref":"#/definitions/WarningFilterItemTypes"}]},"WasmLoading":{"description":"The method of loading WebAssembly Modules (methods included by default are \'fetch\' (web/WebWorker), \'async-node\' (node.js), but others might be added by plugins).","anyOf":[{"enum":[false]},{"$ref":"#/definitions/WasmLoadingType"}]},"WasmLoadingType":{"description":"The method of loading WebAssembly Modules (methods included by default are \'fetch\' (web/WebWorker), \'async-node\' (node.js), but others might be added by plugins).","anyOf":[{"enum":["fetch-streaming","fetch","async-node"]},{"type":"string"}]},"Watch":{"description":"Enter watch mode, which rebuilds on file change.","type":"boolean"},"WatchOptions":{"description":"Options for the watcher.","type":"object","additionalProperties":false,"properties":{"aggregateTimeout":{"description":"Delay the rebuilt after the first change. Value is a time in ms.","type":"number"},"followSymlinks":{"description":"Resolve symlinks and watch symlink and real file. This is usually not needed as webpack already resolves symlinks (\'resolve.symlinks\').","type":"boolean"},"ignored":{"description":"Ignore some files from watching (glob pattern or regexp).","anyOf":[{"type":"array","items":{"description":"A glob pattern for files that should be ignored from watching.","type":"string","minLength":1}},{"instanceof":"RegExp","tsType":"RegExp"},{"description":"A single glob pattern for files that should be ignored from watching.","type":"string","minLength":1}]},"poll":{"description":"Enable polling mode for watching.","anyOf":[{"description":"`number`: use polling with specified interval.","type":"number"},{"description":"`true`: use polling.","type":"boolean"}]},"stdin":{"description":"Stop watching when stdin stream has ended.","type":"boolean"}}},"WebassemblyModuleFilename":{"description":"The filename of WebAssembly modules as relative path inside the \'output.path\' directory.","type":"string","absolutePath":false},"WebpackOptionsNormalized":{"description":"Normalized webpack options object.","type":"object","additionalProperties":false,"properties":{"amd":{"$ref":"#/definitions/Amd"},"bail":{"$ref":"#/definitions/Bail"},"cache":{"$ref":"#/definitions/CacheOptionsNormalized"},"context":{"$ref":"#/definitions/Context"},"dependencies":{"$ref":"#/definitions/Dependencies"},"devServer":{"$ref":"#/definitions/DevServer"},"devtool":{"$ref":"#/definitions/DevTool"},"entry":{"$ref":"#/definitions/EntryNormalized"},"experiments":{"$ref":"#/definitions/ExperimentsNormalized"},"externals":{"$ref":"#/definitions/Externals"},"externalsPresets":{"$ref":"#/definitions/ExternalsPresets"},"externalsType":{"$ref":"#/definitions/ExternalsType"},"ignoreWarnings":{"$ref":"#/definitions/IgnoreWarningsNormalized"},"infrastructureLogging":{"$ref":"#/definitions/InfrastructureLogging"},"loader":{"$ref":"#/definitions/Loader"},"mode":{"$ref":"#/definitions/Mode"},"module":{"$ref":"#/definitions/ModuleOptionsNormalized"},"name":{"$ref":"#/definitions/Name"},"node":{"$ref":"#/definitions/Node"},"optimization":{"$ref":"#/definitions/Optimization"},"output":{"$ref":"#/definitions/OutputNormalized"},"parallelism":{"$ref":"#/definitions/Parallelism"},"performance":{"$ref":"#/definitions/Performance"},"plugins":{"$ref":"#/definitions/Plugins"},"profile":{"$ref":"#/definitions/Profile"},"recordsInputPath":{"$ref":"#/definitions/RecordsInputPath"},"recordsOutputPath":{"$ref":"#/definitions/RecordsOutputPath"},"resolve":{"$ref":"#/definitions/Resolve"},"resolveLoader":{"$ref":"#/definitions/ResolveLoader"},"snapshot":{"$ref":"#/definitions/SnapshotOptions"},"stats":{"$ref":"#/definitions/StatsValue"},"target":{"$ref":"#/definitions/Target"},"watch":{"$ref":"#/definitions/Watch"},"watchOptions":{"$ref":"#/definitions/WatchOptions"}},"required":["cache","snapshot","entry","experiments","externals","externalsPresets","infrastructureLogging","module","node","optimization","output","plugins","resolve","resolveLoader","stats","watchOptions"]},"WebpackPluginFunction":{"description":"Function acting as plugin.","instanceof":"Function","tsType":"(this: import(\'../lib/Compiler\'), compiler: import(\'../lib/Compiler\')) => void"},"WebpackPluginInstance":{"description":"Plugin instance.","type":"object","additionalProperties":true,"properties":{"apply":{"description":"The run point of the plugin, required method.","instanceof":"Function","tsType":"(compiler: import(\'../lib/Compiler\')) => void"}},"required":["apply"]}},"title":"WebpackOptions","description":"Options object as provided by the user.","type":"object","additionalProperties":false,"properties":{"amd":{"$ref":"#/definitions/Amd"},"bail":{"$ref":"#/definitions/Bail"},"cache":{"$ref":"#/definitions/CacheOptions"},"context":{"$ref":"#/definitions/Context"},"dependencies":{"$ref":"#/definitions/Dependencies"},"devServer":{"$ref":"#/definitions/DevServer"},"devtool":{"$ref":"#/definitions/DevTool"},"entry":{"$ref":"#/definitions/Entry"},"experiments":{"$ref":"#/definitions/Experiments"},"externals":{"$ref":"#/definitions/Externals"},"externalsPresets":{"$ref":"#/definitions/ExternalsPresets"},"externalsType":{"$ref":"#/definitions/ExternalsType"},"ignoreWarnings":{"$ref":"#/definitions/IgnoreWarnings"},"infrastructureLogging":{"$ref":"#/definitions/InfrastructureLogging"},"loader":{"$ref":"#/definitions/Loader"},"mode":{"$ref":"#/definitions/Mode"},"module":{"$ref":"#/definitions/ModuleOptions"},"name":{"$ref":"#/definitions/Name"},"node":{"$ref":"#/definitions/Node"},"optimization":{"$ref":"#/definitions/Optimization"},"output":{"$ref":"#/definitions/Output"},"parallelism":{"$ref":"#/definitions/Parallelism"},"performance":{"$ref":"#/definitions/Performance"},"plugins":{"$ref":"#/definitions/Plugins"},"profile":{"$ref":"#/definitions/Profile"},"recordsInputPath":{"$ref":"#/definitions/RecordsInputPath"},"recordsOutputPath":{"$ref":"#/definitions/RecordsOutputPath"},"recordsPath":{"$ref":"#/definitions/RecordsPath"},"resolve":{"$ref":"#/definitions/Resolve"},"resolveLoader":{"$ref":"#/definitions/ResolveLoader"},"snapshot":{"$ref":"#/definitions/SnapshotOptions"},"stats":{"$ref":"#/definitions/StatsValue"},"target":{"$ref":"#/definitions/Target"},"watch":{"$ref":"#/definitions/Watch"},"watchOptions":{"$ref":"#/definitions/WatchOptions"}}}'); +module.exports = JSON.parse('{"definitions":{"Amd":{"description":"Set the value of `require.amd` and `define.amd`. Or disable AMD support.","anyOf":[{"description":"You can pass `false` to disable AMD support.","enum":[false]},{"description":"You can pass an object to set the value of `require.amd` and `define.amd`.","type":"object"}]},"AmdContainer":{"description":"Add a container for define/require functions in the AMD module.","type":"string","minLength":1},"AssetFilterItemTypes":{"description":"Filtering value, regexp or function.","cli":{"helper":true},"anyOf":[{"instanceof":"RegExp","tsType":"RegExp"},{"type":"string","absolutePath":false},{"instanceof":"Function","tsType":"((name: string, asset: import(\'../lib/stats/DefaultStatsFactoryPlugin\').StatsAsset) => boolean)"}]},"AssetFilterTypes":{"description":"Filtering modules.","cli":{"helper":true},"anyOf":[{"type":"array","items":{"description":"Rule to filter.","cli":{"helper":true},"oneOf":[{"$ref":"#/definitions/AssetFilterItemTypes"}]}},{"$ref":"#/definitions/AssetFilterItemTypes"}]},"AssetGeneratorDataUrl":{"description":"The options for data url generator.","anyOf":[{"$ref":"#/definitions/AssetGeneratorDataUrlOptions"},{"$ref":"#/definitions/AssetGeneratorDataUrlFunction"}]},"AssetGeneratorDataUrlFunction":{"description":"Function that executes for module and should return an DataUrl string. It can have a string as \'ident\' property which contributes to the module hash.","instanceof":"Function","tsType":"((source: string | Buffer, context: { filename: string, module: import(\'../lib/Module\') }) => string)"},"AssetGeneratorDataUrlOptions":{"description":"Options object for data url generation.","type":"object","additionalProperties":false,"properties":{"encoding":{"description":"Asset encoding (defaults to base64).","enum":[false,"base64"]},"mimetype":{"description":"Asset mimetype (getting from file extension by default).","type":"string"}}},"AssetGeneratorOptions":{"description":"Generator options for asset modules.","type":"object","implements":["#/definitions/AssetInlineGeneratorOptions","#/definitions/AssetResourceGeneratorOptions"],"additionalProperties":false,"properties":{"dataUrl":{"$ref":"#/definitions/AssetGeneratorDataUrl"},"emit":{"description":"Emit an output asset from this asset module. This can be set to \'false\' to omit emitting e. g. for SSR.","type":"boolean"},"filename":{"$ref":"#/definitions/FilenameTemplate"},"outputPath":{"$ref":"#/definitions/AssetModuleOutputPath"},"publicPath":{"$ref":"#/definitions/RawPublicPath"}}},"AssetInlineGeneratorOptions":{"description":"Generator options for asset/inline modules.","type":"object","additionalProperties":false,"properties":{"dataUrl":{"$ref":"#/definitions/AssetGeneratorDataUrl"}}},"AssetModuleFilename":{"description":"The filename of asset modules as relative path inside the \'output.path\' directory.","anyOf":[{"type":"string","absolutePath":false},{"instanceof":"Function","tsType":"((pathData: import(\\"../lib/Compilation\\").PathData, assetInfo?: import(\\"../lib/Compilation\\").AssetInfo) => string)"}]},"AssetModuleOutputPath":{"description":"Emit the asset in the specified folder relative to \'output.path\'. This should only be needed when custom \'publicPath\' is specified to match the folder structure there.","anyOf":[{"type":"string","absolutePath":false},{"instanceof":"Function","tsType":"((pathData: import(\\"../lib/Compilation\\").PathData, assetInfo?: import(\\"../lib/Compilation\\").AssetInfo) => string)"}]},"AssetParserDataUrlFunction":{"description":"Function that executes for module and should return whenever asset should be inlined as DataUrl.","instanceof":"Function","tsType":"((source: string | Buffer, context: { filename: string, module: import(\'../lib/Module\') }) => boolean)"},"AssetParserDataUrlOptions":{"description":"Options object for DataUrl condition.","type":"object","additionalProperties":false,"properties":{"maxSize":{"description":"Maximum size of asset that should be inline as modules. Default: 8kb.","type":"number"}}},"AssetParserOptions":{"description":"Parser options for asset modules.","type":"object","additionalProperties":false,"properties":{"dataUrlCondition":{"description":"The condition for inlining the asset as DataUrl.","anyOf":[{"$ref":"#/definitions/AssetParserDataUrlOptions"},{"$ref":"#/definitions/AssetParserDataUrlFunction"}]}}},"AssetResourceGeneratorOptions":{"description":"Generator options for asset/resource modules.","type":"object","additionalProperties":false,"properties":{"emit":{"description":"Emit an output asset from this asset module. This can be set to \'false\' to omit emitting e. g. for SSR.","type":"boolean"},"filename":{"$ref":"#/definitions/FilenameTemplate"},"outputPath":{"$ref":"#/definitions/AssetModuleOutputPath"},"publicPath":{"$ref":"#/definitions/RawPublicPath"}}},"AuxiliaryComment":{"description":"Add a comment in the UMD wrapper.","anyOf":[{"description":"Append the same comment above each import style.","type":"string"},{"$ref":"#/definitions/LibraryCustomUmdCommentObject"}]},"Bail":{"description":"Report the first error as a hard error instead of tolerating it.","type":"boolean"},"CacheOptions":{"description":"Cache generated modules and chunks to improve performance for multiple incremental builds.","anyOf":[{"description":"Enable in memory caching.","enum":[true]},{"$ref":"#/definitions/CacheOptionsNormalized"}]},"CacheOptionsNormalized":{"description":"Cache generated modules and chunks to improve performance for multiple incremental builds.","anyOf":[{"description":"Disable caching.","enum":[false]},{"$ref":"#/definitions/MemoryCacheOptions"},{"$ref":"#/definitions/FileCacheOptions"}]},"Charset":{"description":"Add charset attribute for script tag.","type":"boolean"},"ChunkFilename":{"description":"Specifies the filename template of output files of non-initial chunks on disk. You must **not** specify an absolute path here, but the path may contain folders separated by \'/\'! The specified path is joined with the value of the \'output.path\' option to determine the location on disk.","oneOf":[{"$ref":"#/definitions/FilenameTemplate"}]},"ChunkFormat":{"description":"The format of chunks (formats included by default are \'array-push\' (web/WebWorker), \'commonjs\' (node.js), \'module\' (ESM), but others might be added by plugins).","anyOf":[{"enum":["array-push","commonjs","module",false]},{"type":"string"}]},"ChunkLoadTimeout":{"description":"Number of milliseconds before chunk request expires.","type":"number"},"ChunkLoading":{"description":"The method of loading chunks (methods included by default are \'jsonp\' (web), \'import\' (ESM), \'importScripts\' (WebWorker), \'require\' (sync node.js), \'async-node\' (async node.js), but others might be added by plugins).","anyOf":[{"enum":[false]},{"$ref":"#/definitions/ChunkLoadingType"}]},"ChunkLoadingGlobal":{"description":"The global variable used by webpack for loading of chunks.","type":"string"},"ChunkLoadingType":{"description":"The method of loading chunks (methods included by default are \'jsonp\' (web), \'import\' (ESM), \'importScripts\' (WebWorker), \'require\' (sync node.js), \'async-node\' (async node.js), but others might be added by plugins).","anyOf":[{"enum":["jsonp","import-scripts","require","async-node","import"]},{"type":"string"}]},"Clean":{"description":"Clean the output directory before emit.","anyOf":[{"type":"boolean"},{"$ref":"#/definitions/CleanOptions"}]},"CleanOptions":{"description":"Advanced options for cleaning assets.","type":"object","additionalProperties":false,"properties":{"dry":{"description":"Log the assets that should be removed instead of deleting them.","type":"boolean"},"keep":{"description":"Keep these assets.","anyOf":[{"instanceof":"RegExp","tsType":"RegExp"},{"type":"string","absolutePath":false},{"instanceof":"Function","tsType":"((filename: string) => boolean)"}]}}},"CompareBeforeEmit":{"description":"Check if to be emitted file already exists and have the same content before writing to output filesystem.","type":"boolean"},"Context":{"description":"The base directory (absolute path!) for resolving the `entry` option. If `output.pathinfo` is set, the included pathinfo is shortened to this directory.","type":"string","absolutePath":true},"CrossOriginLoading":{"description":"This option enables cross-origin loading of chunks.","enum":[false,"anonymous","use-credentials"]},"CssChunkFilename":{"description":"Specifies the filename template of non-initial output css files on disk. You must **not** specify an absolute path here, but the path may contain folders separated by \'/\'! The specified path is joined with the value of the \'output.path\' option to determine the location on disk.","oneOf":[{"$ref":"#/definitions/FilenameTemplate"}]},"CssExperimentOptions":{"description":"Options for css handling.","type":"object","additionalProperties":false,"properties":{"exportsOnly":{"description":"Avoid generating and loading a stylesheet and only embed exports from css into output javascript files.","type":"boolean"}}},"CssFilename":{"description":"Specifies the filename template of output css files on disk. You must **not** specify an absolute path here, but the path may contain folders separated by \'/\'! The specified path is joined with the value of the \'output.path\' option to determine the location on disk.","oneOf":[{"$ref":"#/definitions/FilenameTemplate"}]},"CssGeneratorOptions":{"description":"Generator options for css modules.","type":"object","additionalProperties":false,"properties":{}},"CssParserOptions":{"description":"Parser options for css modules.","type":"object","additionalProperties":false,"properties":{}},"Dependencies":{"description":"References to other configurations to depend on.","type":"array","items":{"description":"References to another configuration to depend on.","type":"string"}},"DevServer":{"description":"Options for the webpack-dev-server.","type":"object"},"DevTool":{"description":"A developer tool to enhance debugging (false | eval | [inline-|hidden-|eval-][nosources-][cheap-[module-]]source-map).","anyOf":[{"enum":[false,"eval"]},{"type":"string","pattern":"^(inline-|hidden-|eval-)?(nosources-)?(cheap-(module-)?)?source-map$"}]},"DevtoolFallbackModuleFilenameTemplate":{"description":"Similar to `output.devtoolModuleFilenameTemplate`, but used in the case of duplicate module identifiers.","anyOf":[{"type":"string"},{"instanceof":"Function","tsType":"Function"}]},"DevtoolModuleFilenameTemplate":{"description":"Filename template string of function for the sources array in a generated SourceMap.","anyOf":[{"type":"string"},{"instanceof":"Function","tsType":"Function"}]},"DevtoolNamespace":{"description":"Module namespace to use when interpolating filename template string for the sources array in a generated SourceMap. Defaults to `output.library` if not set. It\'s useful for avoiding runtime collisions in sourcemaps from multiple webpack projects built as libraries.","type":"string"},"EmptyGeneratorOptions":{"description":"No generator options are supported for this module type.","type":"object","additionalProperties":false},"EmptyParserOptions":{"description":"No parser options are supported for this module type.","type":"object","additionalProperties":false},"EnabledChunkLoadingTypes":{"description":"List of chunk loading types enabled for use by entry points.","type":"array","items":{"$ref":"#/definitions/ChunkLoadingType"}},"EnabledLibraryTypes":{"description":"List of library types enabled for use by entry points.","type":"array","items":{"$ref":"#/definitions/LibraryType"}},"EnabledWasmLoadingTypes":{"description":"List of wasm loading types enabled for use by entry points.","type":"array","items":{"$ref":"#/definitions/WasmLoadingType"}},"Entry":{"description":"The entry point(s) of the compilation.","anyOf":[{"$ref":"#/definitions/EntryDynamic"},{"$ref":"#/definitions/EntryStatic"}]},"EntryDescription":{"description":"An object with entry point description.","type":"object","additionalProperties":false,"properties":{"asyncChunks":{"description":"Enable/disable creating async chunks that are loaded on demand.","type":"boolean"},"baseUri":{"description":"Base uri for this entry.","type":"string"},"chunkLoading":{"$ref":"#/definitions/ChunkLoading"},"dependOn":{"description":"The entrypoints that the current entrypoint depend on. They must be loaded when this entrypoint is loaded.","anyOf":[{"description":"The entrypoints that the current entrypoint depend on. They must be loaded when this entrypoint is loaded.","type":"array","items":{"description":"An entrypoint that the current entrypoint depend on. It must be loaded when this entrypoint is loaded.","type":"string","minLength":1},"minItems":1,"uniqueItems":true},{"description":"An entrypoint that the current entrypoint depend on. It must be loaded when this entrypoint is loaded.","type":"string","minLength":1}]},"filename":{"$ref":"#/definitions/EntryFilename"},"import":{"$ref":"#/definitions/EntryItem"},"layer":{"$ref":"#/definitions/Layer"},"library":{"$ref":"#/definitions/LibraryOptions"},"publicPath":{"$ref":"#/definitions/PublicPath"},"runtime":{"$ref":"#/definitions/EntryRuntime"},"wasmLoading":{"$ref":"#/definitions/WasmLoading"}},"required":["import"]},"EntryDescriptionNormalized":{"description":"An object with entry point description.","type":"object","additionalProperties":false,"properties":{"asyncChunks":{"description":"Enable/disable creating async chunks that are loaded on demand.","type":"boolean"},"baseUri":{"description":"Base uri for this entry.","type":"string"},"chunkLoading":{"$ref":"#/definitions/ChunkLoading"},"dependOn":{"description":"The entrypoints that the current entrypoint depend on. They must be loaded when this entrypoint is loaded.","type":"array","items":{"description":"An entrypoint that the current entrypoint depend on. It must be loaded when this entrypoint is loaded.","type":"string","minLength":1},"minItems":1,"uniqueItems":true},"filename":{"$ref":"#/definitions/Filename"},"import":{"description":"Module(s) that are loaded upon startup. The last one is exported.","type":"array","items":{"description":"Module that is loaded upon startup. Only the last one is exported.","type":"string","minLength":1},"minItems":1,"uniqueItems":true},"layer":{"$ref":"#/definitions/Layer"},"library":{"$ref":"#/definitions/LibraryOptions"},"publicPath":{"$ref":"#/definitions/PublicPath"},"runtime":{"$ref":"#/definitions/EntryRuntime"},"wasmLoading":{"$ref":"#/definitions/WasmLoading"}}},"EntryDynamic":{"description":"A Function returning an entry object, an entry string, an entry array or a promise to these things.","instanceof":"Function","tsType":"(() => EntryStatic | Promise)"},"EntryDynamicNormalized":{"description":"A Function returning a Promise resolving to a normalized entry.","instanceof":"Function","tsType":"(() => Promise)"},"EntryFilename":{"description":"Specifies the filename of the output file on disk. You must **not** specify an absolute path here, but the path may contain folders separated by \'/\'! The specified path is joined with the value of the \'output.path\' option to determine the location on disk.","oneOf":[{"$ref":"#/definitions/FilenameTemplate"}]},"EntryItem":{"description":"Module(s) that are loaded upon startup.","anyOf":[{"description":"All modules are loaded upon startup. The last one is exported.","type":"array","items":{"description":"A module that is loaded upon startup. Only the last one is exported.","type":"string","minLength":1},"minItems":1,"uniqueItems":true},{"description":"The string is resolved to a module which is loaded upon startup.","type":"string","minLength":1}]},"EntryNormalized":{"description":"The entry point(s) of the compilation.","anyOf":[{"$ref":"#/definitions/EntryDynamicNormalized"},{"$ref":"#/definitions/EntryStaticNormalized"}]},"EntryObject":{"description":"Multiple entry bundles are created. The key is the entry name. The value can be a string, an array or an entry description object.","type":"object","additionalProperties":{"description":"An entry point with name.","anyOf":[{"$ref":"#/definitions/EntryItem"},{"$ref":"#/definitions/EntryDescription"}]}},"EntryRuntime":{"description":"The name of the runtime chunk. If set a runtime chunk with this name is created or an existing entrypoint is used as runtime.","anyOf":[{"enum":[false]},{"type":"string","minLength":1}]},"EntryStatic":{"description":"A static entry description.","anyOf":[{"$ref":"#/definitions/EntryObject"},{"$ref":"#/definitions/EntryUnnamed"}]},"EntryStaticNormalized":{"description":"Multiple entry bundles are created. The key is the entry name. The value is an entry description object.","type":"object","additionalProperties":{"description":"An object with entry point description.","oneOf":[{"$ref":"#/definitions/EntryDescriptionNormalized"}]}},"EntryUnnamed":{"description":"An entry point without name.","oneOf":[{"$ref":"#/definitions/EntryItem"}]},"Environment":{"description":"The abilities of the environment where the webpack generated code should run.","type":"object","additionalProperties":false,"properties":{"arrowFunction":{"description":"The environment supports arrow functions (\'() => { ... }\').","type":"boolean"},"bigIntLiteral":{"description":"The environment supports BigInt as literal (123n).","type":"boolean"},"const":{"description":"The environment supports const and let for variable declarations.","type":"boolean"},"destructuring":{"description":"The environment supports destructuring (\'{ a, b } = obj\').","type":"boolean"},"dynamicImport":{"description":"The environment supports an async import() function to import EcmaScript modules.","type":"boolean"},"dynamicImportInWorker":{"description":"The environment supports an async import() is available when creating a worker.","type":"boolean"},"forOf":{"description":"The environment supports \'for of\' iteration (\'for (const x of array) { ... }\').","type":"boolean"},"globalThis":{"description":"The environment supports \'globalThis\'.","type":"boolean"},"module":{"description":"The environment supports EcmaScript Module syntax to import EcmaScript modules (import ... from \'...\').","type":"boolean"},"optionalChaining":{"description":"The environment supports optional chaining (\'obj?.a\' or \'obj?.()\').","type":"boolean"},"templateLiteral":{"description":"The environment supports template literals.","type":"boolean"}}},"Experiments":{"description":"Enables/Disables experiments (experimental features with relax SemVer compatibility).","type":"object","implements":["#/definitions/ExperimentsCommon"],"additionalProperties":false,"properties":{"asyncWebAssembly":{"description":"Support WebAssembly as asynchronous EcmaScript Module.","type":"boolean"},"backCompat":{"description":"Enable backward-compat layer with deprecation warnings for many webpack 4 APIs.","type":"boolean"},"buildHttp":{"description":"Build http(s): urls using a lockfile and resource content cache.","anyOf":[{"$ref":"#/definitions/HttpUriAllowedUris"},{"$ref":"#/definitions/HttpUriOptions"}]},"cacheUnaffected":{"description":"Enable additional in memory caching of modules that are unchanged and reference only unchanged modules.","type":"boolean"},"css":{"description":"Enable css support.","anyOf":[{"type":"boolean"},{"$ref":"#/definitions/CssExperimentOptions"}]},"futureDefaults":{"description":"Apply defaults of next major version.","type":"boolean"},"layers":{"description":"Enable module layers.","type":"boolean"},"lazyCompilation":{"description":"Compile entrypoints and import()s only when they are accessed.","anyOf":[{"type":"boolean"},{"$ref":"#/definitions/LazyCompilationOptions"}]},"outputModule":{"description":"Allow output javascript files as module source type.","type":"boolean"},"syncWebAssembly":{"description":"Support WebAssembly as synchronous EcmaScript Module (outdated).","type":"boolean"},"topLevelAwait":{"description":"Allow using top-level-await in EcmaScript Modules.","type":"boolean"}}},"ExperimentsCommon":{"description":"Enables/Disables experiments (experimental features with relax SemVer compatibility).","type":"object","additionalProperties":false,"properties":{"asyncWebAssembly":{"description":"Support WebAssembly as asynchronous EcmaScript Module.","type":"boolean"},"backCompat":{"description":"Enable backward-compat layer with deprecation warnings for many webpack 4 APIs.","type":"boolean"},"cacheUnaffected":{"description":"Enable additional in memory caching of modules that are unchanged and reference only unchanged modules.","type":"boolean"},"futureDefaults":{"description":"Apply defaults of next major version.","type":"boolean"},"layers":{"description":"Enable module layers.","type":"boolean"},"outputModule":{"description":"Allow output javascript files as module source type.","type":"boolean"},"syncWebAssembly":{"description":"Support WebAssembly as synchronous EcmaScript Module (outdated).","type":"boolean"},"topLevelAwait":{"description":"Allow using top-level-await in EcmaScript Modules.","type":"boolean"}}},"ExperimentsNormalized":{"description":"Enables/Disables experiments (experimental features with relax SemVer compatibility).","type":"object","implements":["#/definitions/ExperimentsCommon"],"additionalProperties":false,"properties":{"asyncWebAssembly":{"description":"Support WebAssembly as asynchronous EcmaScript Module.","type":"boolean"},"backCompat":{"description":"Enable backward-compat layer with deprecation warnings for many webpack 4 APIs.","type":"boolean"},"buildHttp":{"description":"Build http(s): urls using a lockfile and resource content cache.","oneOf":[{"$ref":"#/definitions/HttpUriOptions"}]},"cacheUnaffected":{"description":"Enable additional in memory caching of modules that are unchanged and reference only unchanged modules.","type":"boolean"},"css":{"description":"Enable css support.","anyOf":[{"enum":[false]},{"$ref":"#/definitions/CssExperimentOptions"}]},"futureDefaults":{"description":"Apply defaults of next major version.","type":"boolean"},"layers":{"description":"Enable module layers.","type":"boolean"},"lazyCompilation":{"description":"Compile entrypoints and import()s only when they are accessed.","anyOf":[{"enum":[false]},{"$ref":"#/definitions/LazyCompilationOptions"}]},"outputModule":{"description":"Allow output javascript files as module source type.","type":"boolean"},"syncWebAssembly":{"description":"Support WebAssembly as synchronous EcmaScript Module (outdated).","type":"boolean"},"topLevelAwait":{"description":"Allow using top-level-await in EcmaScript Modules.","type":"boolean"}}},"Extends":{"description":"Extend configuration from another configuration (only works when using webpack-cli).","anyOf":[{"type":"array","items":{"$ref":"#/definitions/ExtendsItem"}},{"$ref":"#/definitions/ExtendsItem"}]},"ExtendsItem":{"description":"Path to the configuration to be extended (only works when using webpack-cli).","type":"string"},"ExternalItem":{"description":"Specify dependency that shouldn\'t be resolved by webpack, but should become dependencies of the resulting bundle. The kind of the dependency depends on `output.libraryTarget`.","anyOf":[{"description":"Every matched dependency becomes external.","instanceof":"RegExp","tsType":"RegExp"},{"description":"An exact matched dependency becomes external. The same string is used as external dependency.","type":"string"},{"description":"If an dependency matches exactly a property of the object, the property value is used as dependency.","type":"object","additionalProperties":{"$ref":"#/definitions/ExternalItemValue"},"properties":{"byLayer":{"description":"Specify externals depending on the layer.","anyOf":[{"type":"object","additionalProperties":{"$ref":"#/definitions/ExternalItem"}},{"instanceof":"Function","tsType":"((layer: string | null) => ExternalItem)"}]}}},{"description":"The function is called on each dependency (`function(context, request, callback(err, result))`).","instanceof":"Function","tsType":"(((data: ExternalItemFunctionData, callback: (err?: (Error | null), result?: ExternalItemValue) => void) => void) | ((data: ExternalItemFunctionData) => Promise))"}]},"ExternalItemFunctionData":{"description":"Data object passed as argument when a function is set for \'externals\'.","type":"object","additionalProperties":false,"properties":{"context":{"description":"The directory in which the request is placed.","type":"string"},"contextInfo":{"description":"Contextual information.","type":"object","tsType":"import(\'../lib/ModuleFactory\').ModuleFactoryCreateDataContextInfo"},"dependencyType":{"description":"The category of the referencing dependencies.","type":"string"},"getResolve":{"description":"Get a resolve function with the current resolver options.","instanceof":"Function","tsType":"((options?: ResolveOptions) => ((context: string, request: string, callback: (err?: Error, result?: string) => void) => void) | ((context: string, request: string) => Promise))"},"request":{"description":"The request as written by the user in the require/import expression/statement.","type":"string"}}},"ExternalItemValue":{"description":"The dependency used for the external.","anyOf":[{"type":"array","items":{"description":"A part of the target of the external.","type":"string","minLength":1}},{"description":"`true`: The dependency name is used as target of the external.","type":"boolean"},{"description":"The target of the external.","type":"string"},{"type":"object"}]},"Externals":{"description":"Specify dependencies that shouldn\'t be resolved by webpack, but should become dependencies of the resulting bundle. The kind of the dependency depends on `output.libraryTarget`.","anyOf":[{"type":"array","items":{"$ref":"#/definitions/ExternalItem"}},{"$ref":"#/definitions/ExternalItem"}]},"ExternalsPresets":{"description":"Enable presets of externals for specific targets.","type":"object","additionalProperties":false,"properties":{"electron":{"description":"Treat common electron built-in modules in main and preload context like \'electron\', \'ipc\' or \'shell\' as external and load them via require() when used.","type":"boolean"},"electronMain":{"description":"Treat electron built-in modules in the main context like \'app\', \'ipc-main\' or \'shell\' as external and load them via require() when used.","type":"boolean"},"electronPreload":{"description":"Treat electron built-in modules in the preload context like \'web-frame\', \'ipc-renderer\' or \'shell\' as external and load them via require() when used.","type":"boolean"},"electronRenderer":{"description":"Treat electron built-in modules in the renderer context like \'web-frame\', \'ipc-renderer\' or \'shell\' as external and load them via require() when used.","type":"boolean"},"node":{"description":"Treat node.js built-in modules like fs, path or vm as external and load them via require() when used.","type":"boolean"},"nwjs":{"description":"Treat NW.js legacy nw.gui module as external and load it via require() when used.","type":"boolean"},"web":{"description":"Treat references to \'http(s)://...\' and \'std:...\' as external and load them via import when used (Note that this changes execution order as externals are executed before any other code in the chunk).","type":"boolean"},"webAsync":{"description":"Treat references to \'http(s)://...\' and \'std:...\' as external and load them via async import() when used (Note that this external type is an async module, which has various effects on the execution).","type":"boolean"}}},"ExternalsType":{"description":"Specifies the default type of externals (\'amd*\', \'umd*\', \'system\' and \'jsonp\' depend on output.libraryTarget set to the same value).","enum":["var","module","assign","this","window","self","global","commonjs","commonjs2","commonjs-module","commonjs-static","amd","amd-require","umd","umd2","jsonp","system","promise","import","script","node-commonjs"]},"Falsy":{"description":"These values will be ignored by webpack and created to be used with \'&&\' or \'||\' to improve readability of configurations.","cli":{"exclude":true},"enum":[false,0,"",null],"undefinedAsNull":true,"tsType":"false | 0 | \'\' | null | undefined"},"FileCacheOptions":{"description":"Options object for persistent file-based caching.","type":"object","additionalProperties":false,"properties":{"allowCollectingMemory":{"description":"Allows to collect unused memory allocated during deserialization. This requires copying data into smaller buffers and has a performance cost.","type":"boolean"},"buildDependencies":{"description":"Dependencies the build depends on (in multiple categories, default categories: \'defaultWebpack\').","type":"object","additionalProperties":{"description":"List of dependencies the build depends on.","type":"array","items":{"description":"Request to a dependency (resolved as directory relative to the context directory).","type":"string","minLength":1}}},"cacheDirectory":{"description":"Base directory for the cache (defaults to node_modules/.cache/webpack).","type":"string","absolutePath":true},"cacheLocation":{"description":"Locations for the cache (defaults to cacheDirectory / name).","type":"string","absolutePath":true},"compression":{"description":"Compression type used for the cache files.","enum":[false,"gzip","brotli"]},"hashAlgorithm":{"description":"Algorithm used for generation the hash (see node.js crypto package).","type":"string"},"idleTimeout":{"description":"Time in ms after which idle period the cache storing should happen.","type":"number","minimum":0},"idleTimeoutAfterLargeChanges":{"description":"Time in ms after which idle period the cache storing should happen when larger changes has been detected (cumulative build time > 2 x avg cache store time).","type":"number","minimum":0},"idleTimeoutForInitialStore":{"description":"Time in ms after which idle period the initial cache storing should happen.","type":"number","minimum":0},"immutablePaths":{"description":"List of paths that are managed by a package manager and contain a version or hash in its path so all files are immutable.","type":"array","items":{"description":"List of paths that are managed by a package manager and contain a version or hash in its path so all files are immutable.","anyOf":[{"description":"A RegExp matching an immutable directory (usually a package manager cache directory, including the tailing slash)","instanceof":"RegExp","tsType":"RegExp"},{"description":"A path to an immutable directory (usually a package manager cache directory).","type":"string","absolutePath":true,"minLength":1}]}},"managedPaths":{"description":"List of paths that are managed by a package manager and can be trusted to not be modified otherwise.","type":"array","items":{"description":"List of paths that are managed by a package manager and can be trusted to not be modified otherwise.","anyOf":[{"description":"A RegExp matching a managed directory (usually a node_modules directory, including the tailing slash)","instanceof":"RegExp","tsType":"RegExp"},{"description":"A path to a managed directory (usually a node_modules directory).","type":"string","absolutePath":true,"minLength":1}]}},"maxAge":{"description":"Time for which unused cache entries stay in the filesystem cache at minimum (in milliseconds).","type":"number","minimum":0},"maxMemoryGenerations":{"description":"Number of generations unused cache entries stay in memory cache at minimum (0 = no memory cache used, 1 = may be removed after unused for a single compilation, ..., Infinity: kept forever). Cache entries will be deserialized from disk when removed from memory cache.","type":"number","minimum":0},"memoryCacheUnaffected":{"description":"Additionally cache computation of modules that are unchanged and reference only unchanged modules in memory.","type":"boolean"},"name":{"description":"Name for the cache. Different names will lead to different coexisting caches.","type":"string"},"profile":{"description":"Track and log detailed timing information for individual cache items.","type":"boolean"},"readonly":{"description":"Enable/disable readonly mode.","type":"boolean"},"store":{"description":"When to store data to the filesystem. (pack: Store data when compiler is idle in a single file).","enum":["pack"]},"type":{"description":"Filesystem caching.","enum":["filesystem"]},"version":{"description":"Version of the cache data. Different versions won\'t allow to reuse the cache and override existing content. Update the version when config changed in a way which doesn\'t allow to reuse cache. This will invalidate the cache.","type":"string"}},"required":["type"]},"Filename":{"description":"Specifies the filename of output files on disk. You must **not** specify an absolute path here, but the path may contain folders separated by \'/\'! The specified path is joined with the value of the \'output.path\' option to determine the location on disk.","oneOf":[{"$ref":"#/definitions/FilenameTemplate"}]},"FilenameTemplate":{"description":"Specifies the filename template of output files on disk. You must **not** specify an absolute path here, but the path may contain folders separated by \'/\'! The specified path is joined with the value of the \'output.path\' option to determine the location on disk.","anyOf":[{"type":"string","absolutePath":false,"minLength":1},{"instanceof":"Function","tsType":"((pathData: import(\\"../lib/Compilation\\").PathData, assetInfo?: import(\\"../lib/Compilation\\").AssetInfo) => string)"}]},"FilterItemTypes":{"description":"Filtering value, regexp or function.","cli":{"helper":true},"anyOf":[{"instanceof":"RegExp","tsType":"RegExp"},{"type":"string","absolutePath":false},{"instanceof":"Function","tsType":"((value: string) => boolean)"}]},"FilterTypes":{"description":"Filtering values.","cli":{"helper":true},"anyOf":[{"type":"array","items":{"description":"Rule to filter.","cli":{"helper":true},"oneOf":[{"$ref":"#/definitions/FilterItemTypes"}]}},{"$ref":"#/definitions/FilterItemTypes"}]},"GeneratorOptionsByModuleType":{"description":"Specify options for each generator.","type":"object","additionalProperties":{"description":"Options for generating.","type":"object","additionalProperties":true},"properties":{"asset":{"$ref":"#/definitions/AssetGeneratorOptions"},"asset/inline":{"$ref":"#/definitions/AssetInlineGeneratorOptions"},"asset/resource":{"$ref":"#/definitions/AssetResourceGeneratorOptions"},"javascript":{"$ref":"#/definitions/EmptyGeneratorOptions"},"javascript/auto":{"$ref":"#/definitions/EmptyGeneratorOptions"},"javascript/dynamic":{"$ref":"#/definitions/EmptyGeneratorOptions"},"javascript/esm":{"$ref":"#/definitions/EmptyGeneratorOptions"}}},"GlobalObject":{"description":"An expression which is used to address the global object/scope in runtime code.","type":"string","minLength":1},"HashDigest":{"description":"Digest type used for the hash.","type":"string"},"HashDigestLength":{"description":"Number of chars which are used for the hash.","type":"number","minimum":1},"HashFunction":{"description":"Algorithm used for generation the hash (see node.js crypto package).","anyOf":[{"type":"string","minLength":1},{"instanceof":"Function","tsType":"typeof import(\'../lib/util/Hash\')"}]},"HashSalt":{"description":"Any string which is added to the hash to salt it.","type":"string","minLength":1},"HotUpdateChunkFilename":{"description":"The filename of the Hot Update Chunks. They are inside the output.path directory.","type":"string","absolutePath":false},"HotUpdateGlobal":{"description":"The global variable used by webpack for loading of hot update chunks.","type":"string"},"HotUpdateMainFilename":{"description":"The filename of the Hot Update Main File. It is inside the \'output.path\' directory.","type":"string","absolutePath":false},"HttpUriAllowedUris":{"description":"List of allowed URIs for building http resources.","cli":{"exclude":true},"oneOf":[{"$ref":"#/definitions/HttpUriOptionsAllowedUris"}]},"HttpUriOptions":{"description":"Options for building http resources.","type":"object","additionalProperties":false,"properties":{"allowedUris":{"$ref":"#/definitions/HttpUriOptionsAllowedUris"},"cacheLocation":{"description":"Location where resource content is stored for lockfile entries. It\'s also possible to disable storing by passing false.","anyOf":[{"enum":[false]},{"type":"string","absolutePath":true}]},"frozen":{"description":"When set, anything that would lead to a modification of the lockfile or any resource content, will result in an error.","type":"boolean"},"lockfileLocation":{"description":"Location of the lockfile.","type":"string","absolutePath":true},"proxy":{"description":"Proxy configuration, which can be used to specify a proxy server to use for HTTP requests.","type":"string"},"upgrade":{"description":"When set, resources of existing lockfile entries will be fetched and entries will be upgraded when resource content has changed.","type":"boolean"}},"required":["allowedUris"]},"HttpUriOptionsAllowedUris":{"description":"List of allowed URIs (resp. the beginning of them).","type":"array","items":{"description":"List of allowed URIs (resp. the beginning of them).","anyOf":[{"description":"Allowed URI pattern.","instanceof":"RegExp","tsType":"RegExp"},{"description":"Allowed URI (resp. the beginning of it).","type":"string","pattern":"^https?://"},{"description":"Allowed URI filter function.","instanceof":"Function","tsType":"((uri: string) => boolean)"}]}},"IgnoreWarnings":{"description":"Ignore specific warnings.","type":"array","items":{"description":"Ignore specific warnings.","anyOf":[{"description":"A RegExp to select the warning message.","instanceof":"RegExp","tsType":"RegExp"},{"type":"object","additionalProperties":false,"properties":{"file":{"description":"A RegExp to select the origin file for the warning.","instanceof":"RegExp","tsType":"RegExp"},"message":{"description":"A RegExp to select the warning message.","instanceof":"RegExp","tsType":"RegExp"},"module":{"description":"A RegExp to select the origin module for the warning.","instanceof":"RegExp","tsType":"RegExp"}}},{"description":"A custom function to select warnings based on the raw warning instance.","instanceof":"Function","tsType":"((warning: import(\'../lib/WebpackError\'), compilation: import(\'../lib/Compilation\')) => boolean)"}]}},"IgnoreWarningsNormalized":{"description":"Ignore specific warnings.","type":"array","items":{"description":"A function to select warnings based on the raw warning instance.","instanceof":"Function","tsType":"((warning: import(\'../lib/WebpackError\'), compilation: import(\'../lib/Compilation\')) => boolean)"}},"Iife":{"description":"Wrap javascript code into IIFE\'s to avoid leaking into global scope.","type":"boolean"},"ImportFunctionName":{"description":"The name of the native import() function (can be exchanged for a polyfill).","type":"string"},"ImportMetaName":{"description":"The name of the native import.meta object (can be exchanged for a polyfill).","type":"string"},"InfrastructureLogging":{"description":"Options for infrastructure level logging.","type":"object","additionalProperties":false,"properties":{"appendOnly":{"description":"Only appends lines to the output. Avoids updating existing output e. g. for status messages. This option is only used when no custom console is provided.","type":"boolean"},"colors":{"description":"Enables/Disables colorful output. This option is only used when no custom console is provided.","type":"boolean"},"console":{"description":"Custom console used for logging.","tsType":"Console"},"debug":{"description":"Enable debug logging for specific loggers.","anyOf":[{"description":"Enable/Disable debug logging for all loggers.","type":"boolean"},{"$ref":"#/definitions/FilterTypes"}]},"level":{"description":"Log level.","enum":["none","error","warn","info","log","verbose"]},"stream":{"description":"Stream used for logging output. Defaults to process.stderr. This option is only used when no custom console is provided.","tsType":"NodeJS.WritableStream"}}},"JavascriptParserOptions":{"description":"Parser options for javascript modules.","type":"object","additionalProperties":true,"properties":{"amd":{"$ref":"#/definitions/Amd"},"browserify":{"description":"Enable/disable special handling for browserify bundles.","type":"boolean"},"commonjs":{"description":"Enable/disable parsing of CommonJs syntax.","type":"boolean"},"commonjsMagicComments":{"description":"Enable/disable parsing of magic comments in CommonJs syntax.","type":"boolean"},"createRequire":{"description":"Enable/disable parsing \\"import { createRequire } from \\"module\\"\\" and evaluating createRequire().","anyOf":[{"type":"boolean"},{"type":"string"}]},"dynamicImportFetchPriority":{"description":"Specifies global fetchPriority for dynamic import.","enum":["low","high","auto",false]},"dynamicImportMode":{"description":"Specifies global mode for dynamic import.","enum":["eager","weak","lazy","lazy-once"]},"dynamicImportPrefetch":{"description":"Specifies global prefetch for dynamic import.","anyOf":[{"type":"number"},{"type":"boolean"}]},"dynamicImportPreload":{"description":"Specifies global preload for dynamic import.","anyOf":[{"type":"number"},{"type":"boolean"}]},"exportsPresence":{"description":"Specifies the behavior of invalid export names in \\"import ... from ...\\" and \\"export ... from ...\\".","enum":["error","warn","auto",false]},"exprContextCritical":{"description":"Enable warnings for full dynamic dependencies.","type":"boolean"},"exprContextRecursive":{"description":"Enable recursive directory lookup for full dynamic dependencies.","type":"boolean"},"exprContextRegExp":{"description":"Sets the default regular expression for full dynamic dependencies.","anyOf":[{"instanceof":"RegExp","tsType":"RegExp"},{"type":"boolean"}]},"exprContextRequest":{"description":"Set the default request for full dynamic dependencies.","type":"string"},"harmony":{"description":"Enable/disable parsing of EcmaScript Modules syntax.","type":"boolean"},"import":{"description":"Enable/disable parsing of import() syntax.","type":"boolean"},"importExportsPresence":{"description":"Specifies the behavior of invalid export names in \\"import ... from ...\\".","enum":["error","warn","auto",false]},"importMeta":{"description":"Enable/disable evaluating import.meta.","type":"boolean"},"importMetaContext":{"description":"Enable/disable evaluating import.meta.webpackContext.","type":"boolean"},"node":{"$ref":"#/definitions/Node"},"reexportExportsPresence":{"description":"Specifies the behavior of invalid export names in \\"export ... from ...\\". This might be useful to disable during the migration from \\"export ... from ...\\" to \\"export type ... from ...\\" when reexporting types in TypeScript.","enum":["error","warn","auto",false]},"requireContext":{"description":"Enable/disable parsing of require.context syntax.","type":"boolean"},"requireEnsure":{"description":"Enable/disable parsing of require.ensure syntax.","type":"boolean"},"requireInclude":{"description":"Enable/disable parsing of require.include syntax.","type":"boolean"},"requireJs":{"description":"Enable/disable parsing of require.js special syntax like require.config, requirejs.config, require.version and requirejs.onError.","type":"boolean"},"strictExportPresence":{"description":"Deprecated in favor of \\"exportsPresence\\". Emit errors instead of warnings when imported names don\'t exist in imported module.","type":"boolean"},"strictThisContextOnImports":{"description":"Handle the this context correctly according to the spec for namespace objects.","type":"boolean"},"system":{"description":"Enable/disable parsing of System.js special syntax like System.import, System.get, System.set and System.register.","type":"boolean"},"unknownContextCritical":{"description":"Enable warnings when using the require function in a not statically analyse-able way.","type":"boolean"},"unknownContextRecursive":{"description":"Enable recursive directory lookup when using the require function in a not statically analyse-able way.","type":"boolean"},"unknownContextRegExp":{"description":"Sets the regular expression when using the require function in a not statically analyse-able way.","anyOf":[{"instanceof":"RegExp","tsType":"RegExp"},{"type":"boolean"}]},"unknownContextRequest":{"description":"Sets the request when using the require function in a not statically analyse-able way.","type":"string"},"url":{"description":"Enable/disable parsing of new URL() syntax.","anyOf":[{"enum":["relative"]},{"type":"boolean"}]},"worker":{"description":"Disable or configure parsing of WebWorker syntax like new Worker() or navigator.serviceWorker.register().","anyOf":[{"type":"array","items":{"description":"Specify a syntax that should be parsed as WebWorker reference. \'Abc\' handles \'new Abc()\', \'Abc from xyz\' handles \'import { Abc } from \\"xyz\\"; new Abc()\', \'abc()\' handles \'abc()\', and combinations are also possible.","type":"string","minLength":1}},{"type":"boolean"}]},"wrappedContextCritical":{"description":"Enable warnings for partial dynamic dependencies.","type":"boolean"},"wrappedContextRecursive":{"description":"Enable recursive directory lookup for partial dynamic dependencies.","type":"boolean"},"wrappedContextRegExp":{"description":"Set the inner regular expression for partial dynamic dependencies.","instanceof":"RegExp","tsType":"RegExp"}}},"Layer":{"description":"Specifies the layer in which modules of this entrypoint are placed.","anyOf":[{"enum":[null]},{"type":"string","minLength":1}]},"LazyCompilationDefaultBackendOptions":{"description":"Options for the default backend.","type":"object","additionalProperties":false,"properties":{"client":{"description":"A custom client.","type":"string"},"listen":{"description":"Specifies where to listen to from the server.","anyOf":[{"description":"A port.","type":"number"},{"description":"Listen options.","type":"object","additionalProperties":true,"properties":{"host":{"description":"A host.","type":"string"},"port":{"description":"A port.","type":"number"}},"tsType":"import(\\"net\\").ListenOptions"},{"description":"A custom listen function.","instanceof":"Function","tsType":"((server: import(\\"net\\").Server) => void)"}]},"protocol":{"description":"Specifies the protocol the client should use to connect to the server.","enum":["http","https"]},"server":{"description":"Specifies how to create the server handling the EventSource requests.","anyOf":[{"description":"ServerOptions for the http or https createServer call.","type":"object","additionalProperties":true,"properties":{},"tsType":"(import(\\"https\\").ServerOptions | import(\\"http\\").ServerOptions)"},{"description":"A custom create server function.","instanceof":"Function","tsType":"(() => import(\\"net\\").Server)"}]}}},"LazyCompilationOptions":{"description":"Options for compiling entrypoints and import()s only when they are accessed.","type":"object","additionalProperties":false,"properties":{"backend":{"description":"Specifies the backend that should be used for handling client keep alive.","anyOf":[{"description":"A custom backend.","instanceof":"Function","tsType":"(((compiler: import(\'../lib/Compiler\'), callback: (err?: Error, api?: import(\\"../lib/hmr/LazyCompilationPlugin\\").BackendApi) => void) => void) | ((compiler: import(\'../lib/Compiler\')) => Promise))"},{"$ref":"#/definitions/LazyCompilationDefaultBackendOptions"}]},"entries":{"description":"Enable/disable lazy compilation for entries.","type":"boolean"},"imports":{"description":"Enable/disable lazy compilation for import() modules.","type":"boolean"},"test":{"description":"Specify which entrypoints or import()ed modules should be lazily compiled. This is matched with the imported module and not the entrypoint name.","anyOf":[{"instanceof":"RegExp","tsType":"RegExp"},{"type":"string"},{"instanceof":"Function","tsType":"((module: import(\'../lib/Module\')) => boolean)"}]}}},"Library":{"description":"Make the output files a library, exporting the exports of the entry point.","anyOf":[{"$ref":"#/definitions/LibraryName"},{"$ref":"#/definitions/LibraryOptions"}]},"LibraryCustomUmdCommentObject":{"description":"Set explicit comments for `commonjs`, `commonjs2`, `amd`, and `root`.","type":"object","additionalProperties":false,"properties":{"amd":{"description":"Set comment for `amd` section in UMD.","type":"string"},"commonjs":{"description":"Set comment for `commonjs` (exports) section in UMD.","type":"string"},"commonjs2":{"description":"Set comment for `commonjs2` (module.exports) section in UMD.","type":"string"},"root":{"description":"Set comment for `root` (global variable) section in UMD.","type":"string"}}},"LibraryCustomUmdObject":{"description":"Description object for all UMD variants of the library name.","type":"object","additionalProperties":false,"properties":{"amd":{"description":"Name of the exposed AMD library in the UMD.","type":"string","minLength":1},"commonjs":{"description":"Name of the exposed commonjs export in the UMD.","type":"string","minLength":1},"root":{"description":"Name of the property exposed globally by a UMD library.","anyOf":[{"type":"array","items":{"description":"Part of the name of the property exposed globally by a UMD library.","type":"string","minLength":1}},{"type":"string","minLength":1}]}}},"LibraryExport":{"description":"Specify which export should be exposed as library.","anyOf":[{"type":"array","items":{"description":"Part of the export that should be exposed as library.","type":"string","minLength":1}},{"type":"string","minLength":1}]},"LibraryName":{"description":"The name of the library (some types allow unnamed libraries too).","anyOf":[{"type":"array","items":{"description":"A part of the library name.","type":"string","minLength":1},"minItems":1},{"type":"string","minLength":1},{"$ref":"#/definitions/LibraryCustomUmdObject"}]},"LibraryOptions":{"description":"Options for library.","type":"object","additionalProperties":false,"properties":{"amdContainer":{"$ref":"#/definitions/AmdContainer"},"auxiliaryComment":{"$ref":"#/definitions/AuxiliaryComment"},"export":{"$ref":"#/definitions/LibraryExport"},"name":{"$ref":"#/definitions/LibraryName"},"type":{"$ref":"#/definitions/LibraryType"},"umdNamedDefine":{"$ref":"#/definitions/UmdNamedDefine"}},"required":["type"]},"LibraryType":{"description":"Type of library (types included by default are \'var\', \'module\', \'assign\', \'assign-properties\', \'this\', \'window\', \'self\', \'global\', \'commonjs\', \'commonjs2\', \'commonjs-module\', \'commonjs-static\', \'amd\', \'amd-require\', \'umd\', \'umd2\', \'jsonp\', \'system\', but others might be added by plugins).","anyOf":[{"enum":["var","module","assign","assign-properties","this","window","self","global","commonjs","commonjs2","commonjs-module","commonjs-static","amd","amd-require","umd","umd2","jsonp","system"]},{"type":"string"}]},"Loader":{"description":"Custom values available in the loader context.","type":"object"},"MemoryCacheOptions":{"description":"Options object for in-memory caching.","type":"object","additionalProperties":false,"properties":{"cacheUnaffected":{"description":"Additionally cache computation of modules that are unchanged and reference only unchanged modules.","type":"boolean"},"maxGenerations":{"description":"Number of generations unused cache entries stay in memory cache at minimum (1 = may be removed after unused for a single compilation, ..., Infinity: kept forever).","type":"number","minimum":1},"type":{"description":"In memory caching.","enum":["memory"]}},"required":["type"]},"Mode":{"description":"Enable production optimizations or development hints.","enum":["development","production","none"]},"ModuleFilterItemTypes":{"description":"Filtering value, regexp or function.","cli":{"helper":true},"anyOf":[{"instanceof":"RegExp","tsType":"RegExp"},{"type":"string","absolutePath":false},{"instanceof":"Function","tsType":"((name: string, module: import(\'../lib/stats/DefaultStatsFactoryPlugin\').StatsModule, type: \'module\' | \'chunk\' | \'root-of-chunk\' | \'nested\') => boolean)"}]},"ModuleFilterTypes":{"description":"Filtering modules.","cli":{"helper":true},"anyOf":[{"type":"array","items":{"description":"Rule to filter.","cli":{"helper":true},"oneOf":[{"$ref":"#/definitions/ModuleFilterItemTypes"}]}},{"$ref":"#/definitions/ModuleFilterItemTypes"}]},"ModuleOptions":{"description":"Options affecting the normal modules (`NormalModuleFactory`).","type":"object","additionalProperties":false,"properties":{"defaultRules":{"description":"An array of rules applied by default for modules.","cli":{"exclude":true},"oneOf":[{"$ref":"#/definitions/RuleSetRules"}]},"exprContextCritical":{"description":"Enable warnings for full dynamic dependencies.","type":"boolean"},"exprContextRecursive":{"description":"Enable recursive directory lookup for full dynamic dependencies. Deprecated: This option has moved to \'module.parser.javascript.exprContextRecursive\'.","type":"boolean"},"exprContextRegExp":{"description":"Sets the default regular expression for full dynamic dependencies. Deprecated: This option has moved to \'module.parser.javascript.exprContextRegExp\'.","anyOf":[{"instanceof":"RegExp","tsType":"RegExp"},{"type":"boolean"}]},"exprContextRequest":{"description":"Set the default request for full dynamic dependencies. Deprecated: This option has moved to \'module.parser.javascript.exprContextRequest\'.","type":"string"},"generator":{"$ref":"#/definitions/GeneratorOptionsByModuleType"},"noParse":{"$ref":"#/definitions/NoParse"},"parser":{"$ref":"#/definitions/ParserOptionsByModuleType"},"rules":{"description":"An array of rules applied for modules.","oneOf":[{"$ref":"#/definitions/RuleSetRules"}]},"strictExportPresence":{"description":"Emit errors instead of warnings when imported names don\'t exist in imported module. Deprecated: This option has moved to \'module.parser.javascript.strictExportPresence\'.","type":"boolean"},"strictThisContextOnImports":{"description":"Handle the this context correctly according to the spec for namespace objects. Deprecated: This option has moved to \'module.parser.javascript.strictThisContextOnImports\'.","type":"boolean"},"unknownContextCritical":{"description":"Enable warnings when using the require function in a not statically analyse-able way. Deprecated: This option has moved to \'module.parser.javascript.unknownContextCritical\'.","type":"boolean"},"unknownContextRecursive":{"description":"Enable recursive directory lookup when using the require function in a not statically analyse-able way. Deprecated: This option has moved to \'module.parser.javascript.unknownContextRecursive\'.","type":"boolean"},"unknownContextRegExp":{"description":"Sets the regular expression when using the require function in a not statically analyse-able way. Deprecated: This option has moved to \'module.parser.javascript.unknownContextRegExp\'.","anyOf":[{"instanceof":"RegExp","tsType":"RegExp"},{"type":"boolean"}]},"unknownContextRequest":{"description":"Sets the request when using the require function in a not statically analyse-able way. Deprecated: This option has moved to \'module.parser.javascript.unknownContextRequest\'.","type":"string"},"unsafeCache":{"description":"Cache the resolving of module requests.","anyOf":[{"type":"boolean"},{"instanceof":"Function","tsType":"Function"}]},"wrappedContextCritical":{"description":"Enable warnings for partial dynamic dependencies. Deprecated: This option has moved to \'module.parser.javascript.wrappedContextCritical\'.","type":"boolean"},"wrappedContextRecursive":{"description":"Enable recursive directory lookup for partial dynamic dependencies. Deprecated: This option has moved to \'module.parser.javascript.wrappedContextRecursive\'.","type":"boolean"},"wrappedContextRegExp":{"description":"Set the inner regular expression for partial dynamic dependencies. Deprecated: This option has moved to \'module.parser.javascript.wrappedContextRegExp\'.","instanceof":"RegExp","tsType":"RegExp"}}},"ModuleOptionsNormalized":{"description":"Options affecting the normal modules (`NormalModuleFactory`).","type":"object","additionalProperties":false,"properties":{"defaultRules":{"description":"An array of rules applied by default for modules.","cli":{"exclude":true},"oneOf":[{"$ref":"#/definitions/RuleSetRules"}]},"generator":{"$ref":"#/definitions/GeneratorOptionsByModuleType"},"noParse":{"$ref":"#/definitions/NoParse"},"parser":{"$ref":"#/definitions/ParserOptionsByModuleType"},"rules":{"description":"An array of rules applied for modules.","oneOf":[{"$ref":"#/definitions/RuleSetRules"}]},"unsafeCache":{"description":"Cache the resolving of module requests.","anyOf":[{"type":"boolean"},{"instanceof":"Function","tsType":"Function"}]}},"required":["defaultRules","generator","parser","rules"]},"Name":{"description":"Name of the configuration. Used when loading multiple configurations.","type":"string"},"NoParse":{"description":"Don\'t parse files matching. It\'s matched against the full resolved request.","anyOf":[{"type":"array","items":{"description":"Don\'t parse files matching. It\'s matched against the full resolved request.","anyOf":[{"description":"A regular expression, when matched the module is not parsed.","instanceof":"RegExp","tsType":"RegExp"},{"description":"An absolute path, when the module starts with this path it is not parsed.","type":"string","absolutePath":true},{"instanceof":"Function","tsType":"Function"}]},"minItems":1},{"description":"A regular expression, when matched the module is not parsed.","instanceof":"RegExp","tsType":"RegExp"},{"description":"An absolute path, when the module starts with this path it is not parsed.","type":"string","absolutePath":true},{"instanceof":"Function","tsType":"Function"}]},"Node":{"description":"Include polyfills or mocks for various node stuff.","anyOf":[{"enum":[false]},{"$ref":"#/definitions/NodeOptions"}]},"NodeOptions":{"description":"Options object for node compatibility features.","type":"object","additionalProperties":false,"properties":{"__dirname":{"description":"Include a polyfill for the \'__dirname\' variable.","enum":[false,true,"warn-mock","mock","eval-only"]},"__filename":{"description":"Include a polyfill for the \'__filename\' variable.","enum":[false,true,"warn-mock","mock","eval-only"]},"global":{"description":"Include a polyfill for the \'global\' variable.","enum":[false,true,"warn"]}}},"Optimization":{"description":"Enables/Disables integrated optimizations.","type":"object","additionalProperties":false,"properties":{"checkWasmTypes":{"description":"Check for incompatible wasm types when importing/exporting from/to ESM.","type":"boolean"},"chunkIds":{"description":"Define the algorithm to choose chunk ids (named: readable ids for better debugging, deterministic: numeric hash ids for better long term caching, size: numeric ids focused on minimal initial download size, total-size: numeric ids focused on minimal total download size, false: no algorithm used, as custom one can be provided via plugin).","enum":["natural","named","deterministic","size","total-size",false]},"concatenateModules":{"description":"Concatenate modules when possible to generate less modules, more efficient code and enable more optimizations by the minimizer.","type":"boolean"},"emitOnErrors":{"description":"Emit assets even when errors occur. Critical errors are emitted into the generated code and will cause errors at runtime.","type":"boolean"},"flagIncludedChunks":{"description":"Also flag chunks as loaded which contain a subset of the modules.","type":"boolean"},"innerGraph":{"description":"Creates a module-internal dependency graph for top level symbols, exports and imports, to improve unused exports detection.","type":"boolean"},"mangleExports":{"description":"Rename exports when possible to generate shorter code (depends on optimization.usedExports and optimization.providedExports, true/\\"deterministic\\": generate short deterministic names optimized for caching, \\"size\\": generate the shortest possible names).","anyOf":[{"enum":["size","deterministic"]},{"type":"boolean"}]},"mangleWasmImports":{"description":"Reduce size of WASM by changing imports to shorter strings.","type":"boolean"},"mergeDuplicateChunks":{"description":"Merge chunks which contain the same modules.","type":"boolean"},"minimize":{"description":"Enable minimizing the output. Uses optimization.minimizer.","type":"boolean"},"minimizer":{"description":"Minimizer(s) to use for minimizing the output.","type":"array","cli":{"exclude":true},"items":{"description":"Plugin of type object or instanceof Function.","anyOf":[{"enum":["..."]},{"$ref":"#/definitions/Falsy"},{"$ref":"#/definitions/WebpackPluginInstance"},{"$ref":"#/definitions/WebpackPluginFunction"}]}},"moduleIds":{"description":"Define the algorithm to choose module ids (natural: numeric ids in order of usage, named: readable ids for better debugging, hashed: (deprecated) short hashes as ids for better long term caching, deterministic: numeric hash ids for better long term caching, size: numeric ids focused on minimal initial download size, false: no algorithm used, as custom one can be provided via plugin).","enum":["natural","named","hashed","deterministic","size",false]},"noEmitOnErrors":{"description":"Avoid emitting assets when errors occur (deprecated: use \'emitOnErrors\' instead).","type":"boolean","cli":{"exclude":true}},"nodeEnv":{"description":"Set process.env.NODE_ENV to a specific value.","anyOf":[{"enum":[false]},{"type":"string"}]},"portableRecords":{"description":"Generate records with relative paths to be able to move the context folder.","type":"boolean"},"providedExports":{"description":"Figure out which exports are provided by modules to generate more efficient code.","type":"boolean"},"realContentHash":{"description":"Use real [contenthash] based on final content of the assets.","type":"boolean"},"removeAvailableModules":{"description":"Removes modules from chunks when these modules are already included in all parents.","type":"boolean"},"removeEmptyChunks":{"description":"Remove chunks which are empty.","type":"boolean"},"runtimeChunk":{"$ref":"#/definitions/OptimizationRuntimeChunk"},"sideEffects":{"description":"Skip over modules which contain no side effects when exports are not used (false: disabled, \'flag\': only use manually placed side effects flag, true: also analyse source code for side effects).","anyOf":[{"enum":["flag"]},{"type":"boolean"}]},"splitChunks":{"description":"Optimize duplication and caching by splitting chunks by shared modules and cache group.","anyOf":[{"enum":[false]},{"$ref":"#/definitions/OptimizationSplitChunksOptions"}]},"usedExports":{"description":"Figure out which exports are used by modules to mangle export names, omit unused exports and generate more efficient code (true: analyse used exports for each runtime, \\"global\\": analyse exports globally for all runtimes combined).","anyOf":[{"enum":["global"]},{"type":"boolean"}]}}},"OptimizationRuntimeChunk":{"description":"Create an additional chunk which contains only the webpack runtime and chunk hash maps.","anyOf":[{"enum":["single","multiple"]},{"type":"boolean"},{"type":"object","additionalProperties":false,"properties":{"name":{"description":"The name or name factory for the runtime chunks.","anyOf":[{"type":"string"},{"instanceof":"Function","tsType":"Function"}]}}}]},"OptimizationRuntimeChunkNormalized":{"description":"Create an additional chunk which contains only the webpack runtime and chunk hash maps.","anyOf":[{"enum":[false]},{"type":"object","additionalProperties":false,"properties":{"name":{"description":"The name factory for the runtime chunks.","instanceof":"Function","tsType":"Function"}}}]},"OptimizationSplitChunksCacheGroup":{"description":"Options object for describing behavior of a cache group selecting modules that should be cached together.","type":"object","additionalProperties":false,"properties":{"automaticNameDelimiter":{"description":"Sets the name delimiter for created chunks.","type":"string","minLength":1},"chunks":{"description":"Select chunks for determining cache group content (defaults to \\"initial\\", \\"initial\\" and \\"all\\" requires adding these chunks to the HTML).","anyOf":[{"enum":["initial","async","all"]},{"instanceof":"RegExp","tsType":"RegExp"},{"instanceof":"Function","tsType":"((chunk: import(\'../lib/Chunk\')) => boolean)"}]},"enforce":{"description":"Ignore minimum size, minimum chunks and maximum requests and always create chunks for this cache group.","type":"boolean"},"enforceSizeThreshold":{"description":"Size threshold at which splitting is enforced and other restrictions (minRemainingSize, maxAsyncRequests, maxInitialRequests) are ignored.","oneOf":[{"$ref":"#/definitions/OptimizationSplitChunksSizes"}]},"filename":{"description":"Sets the template for the filename for created chunks.","anyOf":[{"type":"string","absolutePath":false,"minLength":1},{"instanceof":"Function","tsType":"((pathData: import(\\"../lib/Compilation\\").PathData, assetInfo?: import(\\"../lib/Compilation\\").AssetInfo) => string)"}]},"idHint":{"description":"Sets the hint for chunk id.","type":"string"},"layer":{"description":"Assign modules to a cache group by module layer.","anyOf":[{"instanceof":"RegExp","tsType":"RegExp"},{"type":"string"},{"instanceof":"Function","tsType":"Function"}]},"maxAsyncRequests":{"description":"Maximum number of requests which are accepted for on-demand loading.","type":"number","minimum":1},"maxAsyncSize":{"description":"Maximal size hint for the on-demand chunks.","oneOf":[{"$ref":"#/definitions/OptimizationSplitChunksSizes"}]},"maxInitialRequests":{"description":"Maximum number of initial chunks which are accepted for an entry point.","type":"number","minimum":1},"maxInitialSize":{"description":"Maximal size hint for the initial chunks.","oneOf":[{"$ref":"#/definitions/OptimizationSplitChunksSizes"}]},"maxSize":{"description":"Maximal size hint for the created chunks.","oneOf":[{"$ref":"#/definitions/OptimizationSplitChunksSizes"}]},"minChunks":{"description":"Minimum number of times a module has to be duplicated until it\'s considered for splitting.","type":"number","minimum":1},"minRemainingSize":{"description":"Minimal size for the chunks the stay after moving the modules to a new chunk.","oneOf":[{"$ref":"#/definitions/OptimizationSplitChunksSizes"}]},"minSize":{"description":"Minimal size for the created chunk.","oneOf":[{"$ref":"#/definitions/OptimizationSplitChunksSizes"}]},"minSizeReduction":{"description":"Minimum size reduction due to the created chunk.","oneOf":[{"$ref":"#/definitions/OptimizationSplitChunksSizes"}]},"name":{"description":"Give chunks for this cache group a name (chunks with equal name are merged).","anyOf":[{"enum":[false]},{"type":"string"},{"instanceof":"Function","tsType":"Function"}]},"priority":{"description":"Priority of this cache group.","type":"number"},"reuseExistingChunk":{"description":"Try to reuse existing chunk (with name) when it has matching modules.","type":"boolean"},"test":{"description":"Assign modules to a cache group by module name.","anyOf":[{"instanceof":"RegExp","tsType":"RegExp"},{"type":"string"},{"instanceof":"Function","tsType":"Function"}]},"type":{"description":"Assign modules to a cache group by module type.","anyOf":[{"instanceof":"RegExp","tsType":"RegExp"},{"type":"string"},{"instanceof":"Function","tsType":"Function"}]},"usedExports":{"description":"Compare used exports when checking common modules. Modules will only be put in the same chunk when exports are equal.","type":"boolean"}}},"OptimizationSplitChunksGetCacheGroups":{"description":"A function returning cache groups.","instanceof":"Function","tsType":"((module: import(\'../lib/Module\')) => OptimizationSplitChunksCacheGroup | OptimizationSplitChunksCacheGroup[] | void)"},"OptimizationSplitChunksOptions":{"description":"Options object for splitting chunks into smaller chunks.","type":"object","additionalProperties":false,"properties":{"automaticNameDelimiter":{"description":"Sets the name delimiter for created chunks.","type":"string","minLength":1},"cacheGroups":{"description":"Assign modules to a cache group (modules from different cache groups are tried to keep in separate chunks, default categories: \'default\', \'defaultVendors\').","type":"object","additionalProperties":{"description":"Configuration for a cache group.","anyOf":[{"enum":[false]},{"instanceof":"RegExp","tsType":"RegExp"},{"type":"string"},{"instanceof":"Function","tsType":"Function"},{"$ref":"#/definitions/OptimizationSplitChunksCacheGroup"}]},"not":{"description":"Using the cacheGroup shorthand syntax with a cache group named \'test\' is a potential config error\\nDid you intent to define a cache group with a test instead?\\ncacheGroups: {\\n : {\\n test: ...\\n }\\n}.","type":"object","additionalProperties":true,"properties":{"test":{"description":"The test property is a cache group name, but using the test option of the cache group could be intended instead.","anyOf":[{"instanceof":"RegExp","tsType":"RegExp"},{"type":"string"},{"instanceof":"Function","tsType":"Function"}]}},"required":["test"]}},"chunks":{"description":"Select chunks for determining shared modules (defaults to \\"async\\", \\"initial\\" and \\"all\\" requires adding these chunks to the HTML).","anyOf":[{"enum":["initial","async","all"]},{"instanceof":"RegExp","tsType":"RegExp"},{"instanceof":"Function","tsType":"((chunk: import(\'../lib/Chunk\')) => boolean)"}]},"defaultSizeTypes":{"description":"Sets the size types which are used when a number is used for sizes.","type":"array","items":{"description":"Size type, like \'javascript\', \'webassembly\'.","type":"string"},"minItems":1},"enforceSizeThreshold":{"description":"Size threshold at which splitting is enforced and other restrictions (minRemainingSize, maxAsyncRequests, maxInitialRequests) are ignored.","oneOf":[{"$ref":"#/definitions/OptimizationSplitChunksSizes"}]},"fallbackCacheGroup":{"description":"Options for modules not selected by any other cache group.","type":"object","additionalProperties":false,"properties":{"automaticNameDelimiter":{"description":"Sets the name delimiter for created chunks.","type":"string","minLength":1},"chunks":{"description":"Select chunks for determining shared modules (defaults to \\"async\\", \\"initial\\" and \\"all\\" requires adding these chunks to the HTML).","anyOf":[{"enum":["initial","async","all"]},{"instanceof":"RegExp","tsType":"RegExp"},{"instanceof":"Function","tsType":"((chunk: import(\'../lib/Chunk\')) => boolean)"}]},"maxAsyncSize":{"description":"Maximal size hint for the on-demand chunks.","oneOf":[{"$ref":"#/definitions/OptimizationSplitChunksSizes"}]},"maxInitialSize":{"description":"Maximal size hint for the initial chunks.","oneOf":[{"$ref":"#/definitions/OptimizationSplitChunksSizes"}]},"maxSize":{"description":"Maximal size hint for the created chunks.","oneOf":[{"$ref":"#/definitions/OptimizationSplitChunksSizes"}]},"minSize":{"description":"Minimal size for the created chunk.","oneOf":[{"$ref":"#/definitions/OptimizationSplitChunksSizes"}]},"minSizeReduction":{"description":"Minimum size reduction due to the created chunk.","oneOf":[{"$ref":"#/definitions/OptimizationSplitChunksSizes"}]}}},"filename":{"description":"Sets the template for the filename for created chunks.","anyOf":[{"type":"string","absolutePath":false,"minLength":1},{"instanceof":"Function","tsType":"((pathData: import(\\"../lib/Compilation\\").PathData, assetInfo?: import(\\"../lib/Compilation\\").AssetInfo) => string)"}]},"hidePathInfo":{"description":"Prevents exposing path info when creating names for parts splitted by maxSize.","type":"boolean"},"maxAsyncRequests":{"description":"Maximum number of requests which are accepted for on-demand loading.","type":"number","minimum":1},"maxAsyncSize":{"description":"Maximal size hint for the on-demand chunks.","oneOf":[{"$ref":"#/definitions/OptimizationSplitChunksSizes"}]},"maxInitialRequests":{"description":"Maximum number of initial chunks which are accepted for an entry point.","type":"number","minimum":1},"maxInitialSize":{"description":"Maximal size hint for the initial chunks.","oneOf":[{"$ref":"#/definitions/OptimizationSplitChunksSizes"}]},"maxSize":{"description":"Maximal size hint for the created chunks.","oneOf":[{"$ref":"#/definitions/OptimizationSplitChunksSizes"}]},"minChunks":{"description":"Minimum number of times a module has to be duplicated until it\'s considered for splitting.","type":"number","minimum":1},"minRemainingSize":{"description":"Minimal size for the chunks the stay after moving the modules to a new chunk.","oneOf":[{"$ref":"#/definitions/OptimizationSplitChunksSizes"}]},"minSize":{"description":"Minimal size for the created chunks.","oneOf":[{"$ref":"#/definitions/OptimizationSplitChunksSizes"}]},"minSizeReduction":{"description":"Minimum size reduction due to the created chunk.","oneOf":[{"$ref":"#/definitions/OptimizationSplitChunksSizes"}]},"name":{"description":"Give chunks created a name (chunks with equal name are merged).","anyOf":[{"enum":[false]},{"type":"string"},{"instanceof":"Function","tsType":"Function"}]},"usedExports":{"description":"Compare used exports when checking common modules. Modules will only be put in the same chunk when exports are equal.","type":"boolean"}}},"OptimizationSplitChunksSizes":{"description":"Size description for limits.","anyOf":[{"description":"Size of the javascript part of the chunk.","type":"number","minimum":0},{"description":"Specify size limits per size type.","type":"object","additionalProperties":{"description":"Size of the part of the chunk with the type of the key.","type":"number"}}]},"Output":{"description":"Options affecting the output of the compilation. `output` options tell webpack how to write the compiled files to disk.","type":"object","additionalProperties":false,"properties":{"amdContainer":{"cli":{"exclude":true},"oneOf":[{"$ref":"#/definitions/AmdContainer"}]},"assetModuleFilename":{"$ref":"#/definitions/AssetModuleFilename"},"asyncChunks":{"description":"Enable/disable creating async chunks that are loaded on demand.","type":"boolean"},"auxiliaryComment":{"cli":{"exclude":true},"oneOf":[{"$ref":"#/definitions/AuxiliaryComment"}]},"charset":{"$ref":"#/definitions/Charset"},"chunkFilename":{"$ref":"#/definitions/ChunkFilename"},"chunkFormat":{"$ref":"#/definitions/ChunkFormat"},"chunkLoadTimeout":{"$ref":"#/definitions/ChunkLoadTimeout"},"chunkLoading":{"$ref":"#/definitions/ChunkLoading"},"chunkLoadingGlobal":{"$ref":"#/definitions/ChunkLoadingGlobal"},"clean":{"$ref":"#/definitions/Clean"},"compareBeforeEmit":{"$ref":"#/definitions/CompareBeforeEmit"},"crossOriginLoading":{"$ref":"#/definitions/CrossOriginLoading"},"cssChunkFilename":{"$ref":"#/definitions/CssChunkFilename"},"cssFilename":{"$ref":"#/definitions/CssFilename"},"devtoolFallbackModuleFilenameTemplate":{"$ref":"#/definitions/DevtoolFallbackModuleFilenameTemplate"},"devtoolModuleFilenameTemplate":{"$ref":"#/definitions/DevtoolModuleFilenameTemplate"},"devtoolNamespace":{"$ref":"#/definitions/DevtoolNamespace"},"enabledChunkLoadingTypes":{"$ref":"#/definitions/EnabledChunkLoadingTypes"},"enabledLibraryTypes":{"$ref":"#/definitions/EnabledLibraryTypes"},"enabledWasmLoadingTypes":{"$ref":"#/definitions/EnabledWasmLoadingTypes"},"environment":{"$ref":"#/definitions/Environment"},"filename":{"$ref":"#/definitions/Filename"},"globalObject":{"$ref":"#/definitions/GlobalObject"},"hashDigest":{"$ref":"#/definitions/HashDigest"},"hashDigestLength":{"$ref":"#/definitions/HashDigestLength"},"hashFunction":{"$ref":"#/definitions/HashFunction"},"hashSalt":{"$ref":"#/definitions/HashSalt"},"hotUpdateChunkFilename":{"$ref":"#/definitions/HotUpdateChunkFilename"},"hotUpdateGlobal":{"$ref":"#/definitions/HotUpdateGlobal"},"hotUpdateMainFilename":{"$ref":"#/definitions/HotUpdateMainFilename"},"ignoreBrowserWarnings":{"description":"Ignore warnings in the browser.","type":"boolean"},"iife":{"$ref":"#/definitions/Iife"},"importFunctionName":{"$ref":"#/definitions/ImportFunctionName"},"importMetaName":{"$ref":"#/definitions/ImportMetaName"},"library":{"$ref":"#/definitions/Library"},"libraryExport":{"cli":{"exclude":true},"oneOf":[{"$ref":"#/definitions/LibraryExport"}]},"libraryTarget":{"cli":{"exclude":true},"oneOf":[{"$ref":"#/definitions/LibraryType"}]},"module":{"$ref":"#/definitions/OutputModule"},"path":{"$ref":"#/definitions/Path"},"pathinfo":{"$ref":"#/definitions/Pathinfo"},"publicPath":{"$ref":"#/definitions/PublicPath"},"scriptType":{"$ref":"#/definitions/ScriptType"},"sourceMapFilename":{"$ref":"#/definitions/SourceMapFilename"},"sourcePrefix":{"$ref":"#/definitions/SourcePrefix"},"strictModuleErrorHandling":{"$ref":"#/definitions/StrictModuleErrorHandling"},"strictModuleExceptionHandling":{"$ref":"#/definitions/StrictModuleExceptionHandling"},"trustedTypes":{"description":"Use a Trusted Types policy to create urls for chunks. \'output.uniqueName\' is used a default policy name. Passing a string sets a custom policy name.","anyOf":[{"enum":[true]},{"description":"The name of the Trusted Types policy created by webpack to serve bundle chunks.","type":"string","minLength":1},{"$ref":"#/definitions/TrustedTypes"}]},"umdNamedDefine":{"cli":{"exclude":true},"oneOf":[{"$ref":"#/definitions/UmdNamedDefine"}]},"uniqueName":{"$ref":"#/definitions/UniqueName"},"wasmLoading":{"$ref":"#/definitions/WasmLoading"},"webassemblyModuleFilename":{"$ref":"#/definitions/WebassemblyModuleFilename"},"workerChunkLoading":{"$ref":"#/definitions/ChunkLoading"},"workerPublicPath":{"$ref":"#/definitions/WorkerPublicPath"},"workerWasmLoading":{"$ref":"#/definitions/WasmLoading"}}},"OutputModule":{"description":"Output javascript files as module source type.","type":"boolean"},"OutputNormalized":{"description":"Normalized options affecting the output of the compilation. `output` options tell webpack how to write the compiled files to disk.","type":"object","additionalProperties":false,"properties":{"assetModuleFilename":{"$ref":"#/definitions/AssetModuleFilename"},"asyncChunks":{"description":"Enable/disable creating async chunks that are loaded on demand.","type":"boolean"},"charset":{"$ref":"#/definitions/Charset"},"chunkFilename":{"$ref":"#/definitions/ChunkFilename"},"chunkFormat":{"$ref":"#/definitions/ChunkFormat"},"chunkLoadTimeout":{"$ref":"#/definitions/ChunkLoadTimeout"},"chunkLoading":{"$ref":"#/definitions/ChunkLoading"},"chunkLoadingGlobal":{"$ref":"#/definitions/ChunkLoadingGlobal"},"clean":{"$ref":"#/definitions/Clean"},"compareBeforeEmit":{"$ref":"#/definitions/CompareBeforeEmit"},"crossOriginLoading":{"$ref":"#/definitions/CrossOriginLoading"},"cssChunkFilename":{"$ref":"#/definitions/CssChunkFilename"},"cssFilename":{"$ref":"#/definitions/CssFilename"},"devtoolFallbackModuleFilenameTemplate":{"$ref":"#/definitions/DevtoolFallbackModuleFilenameTemplate"},"devtoolModuleFilenameTemplate":{"$ref":"#/definitions/DevtoolModuleFilenameTemplate"},"devtoolNamespace":{"$ref":"#/definitions/DevtoolNamespace"},"enabledChunkLoadingTypes":{"$ref":"#/definitions/EnabledChunkLoadingTypes"},"enabledLibraryTypes":{"$ref":"#/definitions/EnabledLibraryTypes"},"enabledWasmLoadingTypes":{"$ref":"#/definitions/EnabledWasmLoadingTypes"},"environment":{"$ref":"#/definitions/Environment"},"filename":{"$ref":"#/definitions/Filename"},"globalObject":{"$ref":"#/definitions/GlobalObject"},"hashDigest":{"$ref":"#/definitions/HashDigest"},"hashDigestLength":{"$ref":"#/definitions/HashDigestLength"},"hashFunction":{"$ref":"#/definitions/HashFunction"},"hashSalt":{"$ref":"#/definitions/HashSalt"},"hotUpdateChunkFilename":{"$ref":"#/definitions/HotUpdateChunkFilename"},"hotUpdateGlobal":{"$ref":"#/definitions/HotUpdateGlobal"},"hotUpdateMainFilename":{"$ref":"#/definitions/HotUpdateMainFilename"},"ignoreBrowserWarnings":{"description":"Ignore warnings in the browser.","type":"boolean"},"iife":{"$ref":"#/definitions/Iife"},"importFunctionName":{"$ref":"#/definitions/ImportFunctionName"},"importMetaName":{"$ref":"#/definitions/ImportMetaName"},"library":{"$ref":"#/definitions/LibraryOptions"},"module":{"$ref":"#/definitions/OutputModule"},"path":{"$ref":"#/definitions/Path"},"pathinfo":{"$ref":"#/definitions/Pathinfo"},"publicPath":{"$ref":"#/definitions/PublicPath"},"scriptType":{"$ref":"#/definitions/ScriptType"},"sourceMapFilename":{"$ref":"#/definitions/SourceMapFilename"},"sourcePrefix":{"$ref":"#/definitions/SourcePrefix"},"strictModuleErrorHandling":{"$ref":"#/definitions/StrictModuleErrorHandling"},"strictModuleExceptionHandling":{"$ref":"#/definitions/StrictModuleExceptionHandling"},"trustedTypes":{"$ref":"#/definitions/TrustedTypes"},"uniqueName":{"$ref":"#/definitions/UniqueName"},"wasmLoading":{"$ref":"#/definitions/WasmLoading"},"webassemblyModuleFilename":{"$ref":"#/definitions/WebassemblyModuleFilename"},"workerChunkLoading":{"$ref":"#/definitions/ChunkLoading"},"workerPublicPath":{"$ref":"#/definitions/WorkerPublicPath"},"workerWasmLoading":{"$ref":"#/definitions/WasmLoading"}}},"Parallelism":{"description":"The number of parallel processed modules in the compilation.","type":"number","minimum":1},"ParserOptionsByModuleType":{"description":"Specify options for each parser.","type":"object","additionalProperties":{"description":"Options for parsing.","type":"object","additionalProperties":true},"properties":{"asset":{"$ref":"#/definitions/AssetParserOptions"},"asset/inline":{"$ref":"#/definitions/EmptyParserOptions"},"asset/resource":{"$ref":"#/definitions/EmptyParserOptions"},"asset/source":{"$ref":"#/definitions/EmptyParserOptions"},"javascript":{"$ref":"#/definitions/JavascriptParserOptions"},"javascript/auto":{"$ref":"#/definitions/JavascriptParserOptions"},"javascript/dynamic":{"$ref":"#/definitions/JavascriptParserOptions"},"javascript/esm":{"$ref":"#/definitions/JavascriptParserOptions"}}},"Path":{"description":"The output directory as **absolute path** (required).","type":"string","absolutePath":true},"Pathinfo":{"description":"Include comments with information about the modules.","anyOf":[{"enum":["verbose"]},{"type":"boolean"}]},"Performance":{"description":"Configuration for web performance recommendations.","anyOf":[{"enum":[false]},{"$ref":"#/definitions/PerformanceOptions"}]},"PerformanceOptions":{"description":"Configuration object for web performance recommendations.","type":"object","additionalProperties":false,"properties":{"assetFilter":{"description":"Filter function to select assets that are checked.","instanceof":"Function","tsType":"Function"},"hints":{"description":"Sets the format of the hints: warnings, errors or nothing at all.","enum":[false,"warning","error"]},"maxAssetSize":{"description":"File size limit (in bytes) when exceeded, that webpack will provide performance hints.","type":"number"},"maxEntrypointSize":{"description":"Total size of an entry point (in bytes).","type":"number"}}},"Plugins":{"description":"Add additional plugins to the compiler.","type":"array","items":{"description":"Plugin of type object or instanceof Function.","anyOf":[{"$ref":"#/definitions/Falsy"},{"$ref":"#/definitions/WebpackPluginInstance"},{"$ref":"#/definitions/WebpackPluginFunction"}]}},"Profile":{"description":"Capture timing information for each module.","type":"boolean"},"PublicPath":{"description":"The \'publicPath\' specifies the public URL address of the output files when referenced in a browser.","anyOf":[{"enum":["auto"]},{"$ref":"#/definitions/RawPublicPath"}]},"RawPublicPath":{"description":"The \'publicPath\' specifies the public URL address of the output files when referenced in a browser.","anyOf":[{"type":"string"},{"instanceof":"Function","tsType":"((pathData: import(\\"../lib/Compilation\\").PathData, assetInfo?: import(\\"../lib/Compilation\\").AssetInfo) => string)"}]},"RecordsInputPath":{"description":"Store compiler state to a json file.","anyOf":[{"enum":[false]},{"type":"string","absolutePath":true}]},"RecordsOutputPath":{"description":"Load compiler state from a json file.","anyOf":[{"enum":[false]},{"type":"string","absolutePath":true}]},"RecordsPath":{"description":"Store/Load compiler state from/to a json file. This will result in persistent ids of modules and chunks. An absolute path is expected. `recordsPath` is used for `recordsInputPath` and `recordsOutputPath` if they left undefined.","anyOf":[{"enum":[false]},{"type":"string","absolutePath":true}]},"Resolve":{"description":"Options for the resolver.","oneOf":[{"$ref":"#/definitions/ResolveOptions"}]},"ResolveAlias":{"description":"Redirect module requests.","anyOf":[{"type":"array","items":{"description":"Alias configuration.","type":"object","additionalProperties":false,"properties":{"alias":{"description":"New request.","anyOf":[{"description":"Multiple alternative requests.","type":"array","items":{"description":"One choice of request.","type":"string","minLength":1}},{"description":"Ignore request (replace with empty module).","enum":[false]},{"description":"New request.","type":"string","minLength":1}]},"name":{"description":"Request to be redirected.","type":"string"},"onlyModule":{"description":"Redirect only exact matching request.","type":"boolean"}},"required":["alias","name"]}},{"type":"object","additionalProperties":{"description":"New request.","anyOf":[{"description":"Multiple alternative requests.","type":"array","items":{"description":"One choice of request.","type":"string","minLength":1}},{"description":"Ignore request (replace with empty module).","enum":[false]},{"description":"New request.","type":"string","minLength":1}]}}]},"ResolveLoader":{"description":"Options for the resolver when resolving loaders.","oneOf":[{"$ref":"#/definitions/ResolveOptions"}]},"ResolveOptions":{"description":"Options object for resolving requests.","type":"object","additionalProperties":false,"properties":{"alias":{"$ref":"#/definitions/ResolveAlias"},"aliasFields":{"description":"Fields in the description file (usually package.json) which are used to redirect requests inside the module.","type":"array","items":{"description":"Field in the description file (usually package.json) which are used to redirect requests inside the module.","anyOf":[{"type":"array","items":{"description":"Part of the field path in the description file (usually package.json) which are used to redirect requests inside the module.","type":"string","minLength":1}},{"type":"string","minLength":1}]}},"byDependency":{"description":"Extra resolve options per dependency category. Typical categories are \\"commonjs\\", \\"amd\\", \\"esm\\".","type":"object","additionalProperties":{"description":"Options object for resolving requests.","oneOf":[{"$ref":"#/definitions/ResolveOptions"}]}},"cache":{"description":"Enable caching of successfully resolved requests (cache entries are revalidated).","type":"boolean"},"cachePredicate":{"description":"Predicate function to decide which requests should be cached.","instanceof":"Function","tsType":"((request: import(\'enhanced-resolve\').ResolveRequest) => boolean)"},"cacheWithContext":{"description":"Include the context information in the cache identifier when caching.","type":"boolean"},"conditionNames":{"description":"Condition names for exports field entry point.","type":"array","items":{"description":"Condition names for exports field entry point.","type":"string"}},"descriptionFiles":{"description":"Filenames used to find a description file (like a package.json).","type":"array","items":{"description":"Filename used to find a description file (like a package.json).","type":"string","minLength":1}},"enforceExtension":{"description":"Enforce the resolver to use one of the extensions from the extensions option (User must specify requests without extension).","type":"boolean"},"exportsFields":{"description":"Field names from the description file (usually package.json) which are used to provide entry points of a package.","type":"array","items":{"description":"Field name from the description file (usually package.json) which is used to provide entry points of a package.","type":"string"}},"extensionAlias":{"description":"An object which maps extension to extension aliases.","type":"object","additionalProperties":{"description":"Extension alias.","anyOf":[{"description":"Multiple extensions.","type":"array","items":{"description":"Aliased extension.","type":"string","minLength":1}},{"description":"Aliased extension.","type":"string","minLength":1}]}},"extensions":{"description":"Extensions added to the request when trying to find the file.","type":"array","items":{"description":"Extension added to the request when trying to find the file.","type":"string"}},"fallback":{"description":"Redirect module requests when normal resolving fails.","oneOf":[{"$ref":"#/definitions/ResolveAlias"}]},"fileSystem":{"description":"Filesystem for the resolver.","tsType":"(import(\'../lib/util/fs\').InputFileSystem)"},"fullySpecified":{"description":"Treats the request specified by the user as fully specified, meaning no extensions are added and the mainFiles in directories are not resolved (This doesn\'t affect requests from mainFields, aliasFields or aliases).","type":"boolean"},"importsFields":{"description":"Field names from the description file (usually package.json) which are used to provide internal request of a package (requests starting with # are considered as internal).","type":"array","items":{"description":"Field name from the description file (usually package.json) which is used to provide internal request of a package (requests starting with # are considered as internal).","type":"string"}},"mainFields":{"description":"Field names from the description file (package.json) which are used to find the default entry point.","type":"array","items":{"description":"Field name from the description file (package.json) which are used to find the default entry point.","anyOf":[{"type":"array","items":{"description":"Part of the field path from the description file (package.json) which are used to find the default entry point.","type":"string","minLength":1}},{"type":"string","minLength":1}]}},"mainFiles":{"description":"Filenames used to find the default entry point if there is no description file or main field.","type":"array","items":{"description":"Filename used to find the default entry point if there is no description file or main field.","type":"string","minLength":1}},"modules":{"description":"Folder names or directory paths where to find modules.","type":"array","items":{"description":"Folder name or directory path where to find modules.","type":"string","minLength":1}},"plugins":{"description":"Plugins for the resolver.","type":"array","cli":{"exclude":true},"items":{"description":"Plugin of type object or instanceof Function.","anyOf":[{"enum":["..."]},{"$ref":"#/definitions/Falsy"},{"$ref":"#/definitions/ResolvePluginInstance"}]}},"preferAbsolute":{"description":"Prefer to resolve server-relative URLs (starting with \'/\') as absolute paths before falling back to resolve in \'resolve.roots\'.","type":"boolean"},"preferRelative":{"description":"Prefer to resolve module requests as relative request and fallback to resolving as module.","type":"boolean"},"resolver":{"description":"Custom resolver.","tsType":"(import(\'enhanced-resolve\').Resolver)"},"restrictions":{"description":"A list of resolve restrictions. Resolve results must fulfill all of these restrictions to resolve successfully. Other resolve paths are taken when restrictions are not met.","type":"array","items":{"description":"Resolve restriction. Resolve result must fulfill this restriction.","anyOf":[{"instanceof":"RegExp","tsType":"RegExp"},{"type":"string","absolutePath":true,"minLength":1}]}},"roots":{"description":"A list of directories in which requests that are server-relative URLs (starting with \'/\') are resolved.","type":"array","items":{"description":"Directory in which requests that are server-relative URLs (starting with \'/\') are resolved.","type":"string"}},"symlinks":{"description":"Enable resolving symlinks to the original location.","type":"boolean"},"unsafeCache":{"description":"Enable caching of successfully resolved requests (cache entries are not revalidated).","anyOf":[{"type":"boolean"},{"type":"object","additionalProperties":true}]},"useSyncFileSystemCalls":{"description":"Use synchronous filesystem calls for the resolver.","type":"boolean"}}},"ResolvePluginInstance":{"description":"Plugin instance.","type":"object","additionalProperties":true,"properties":{"apply":{"description":"The run point of the plugin, required method.","instanceof":"Function","tsType":"(resolver: import(\'enhanced-resolve\').Resolver) => void"}},"required":["apply"]},"RuleSetCondition":{"description":"A condition matcher.","cli":{"helper":true},"anyOf":[{"instanceof":"RegExp","tsType":"RegExp"},{"type":"string"},{"instanceof":"Function","tsType":"((value: string) => boolean)"},{"$ref":"#/definitions/RuleSetLogicalConditions"},{"$ref":"#/definitions/RuleSetConditions"}]},"RuleSetConditionAbsolute":{"description":"A condition matcher matching an absolute path.","cli":{"helper":true},"anyOf":[{"instanceof":"RegExp","tsType":"RegExp"},{"type":"string","absolutePath":true},{"instanceof":"Function","tsType":"((value: string) => boolean)"},{"$ref":"#/definitions/RuleSetLogicalConditionsAbsolute"},{"$ref":"#/definitions/RuleSetConditionsAbsolute"}]},"RuleSetConditionOrConditions":{"description":"One or multiple rule conditions.","cli":{"helper":true},"anyOf":[{"$ref":"#/definitions/RuleSetCondition"},{"$ref":"#/definitions/RuleSetConditions"}]},"RuleSetConditionOrConditionsAbsolute":{"description":"One or multiple rule conditions matching an absolute path.","cli":{"helper":true},"anyOf":[{"$ref":"#/definitions/RuleSetConditionAbsolute"},{"$ref":"#/definitions/RuleSetConditionsAbsolute"}]},"RuleSetConditions":{"description":"A list of rule conditions.","type":"array","items":{"description":"A rule condition.","oneOf":[{"$ref":"#/definitions/RuleSetCondition"}]}},"RuleSetConditionsAbsolute":{"description":"A list of rule conditions matching an absolute path.","type":"array","items":{"description":"A rule condition matching an absolute path.","oneOf":[{"$ref":"#/definitions/RuleSetConditionAbsolute"}]}},"RuleSetLoader":{"description":"A loader request.","type":"string","minLength":1},"RuleSetLoaderOptions":{"description":"Options passed to a loader.","anyOf":[{"type":"string"},{"type":"object"}]},"RuleSetLogicalConditions":{"description":"Logic operators used in a condition matcher.","type":"object","additionalProperties":false,"properties":{"and":{"description":"Logical AND.","oneOf":[{"$ref":"#/definitions/RuleSetConditions"}]},"not":{"description":"Logical NOT.","oneOf":[{"$ref":"#/definitions/RuleSetCondition"}]},"or":{"description":"Logical OR.","oneOf":[{"$ref":"#/definitions/RuleSetConditions"}]}}},"RuleSetLogicalConditionsAbsolute":{"description":"Logic operators used in a condition matcher.","type":"object","additionalProperties":false,"properties":{"and":{"description":"Logical AND.","oneOf":[{"$ref":"#/definitions/RuleSetConditionsAbsolute"}]},"not":{"description":"Logical NOT.","oneOf":[{"$ref":"#/definitions/RuleSetConditionAbsolute"}]},"or":{"description":"Logical OR.","oneOf":[{"$ref":"#/definitions/RuleSetConditionsAbsolute"}]}}},"RuleSetRule":{"description":"A rule description with conditions and effects for modules.","type":"object","additionalProperties":false,"properties":{"assert":{"description":"Match on import assertions of the dependency.","type":"object","additionalProperties":{"$ref":"#/definitions/RuleSetConditionOrConditions"}},"compiler":{"description":"Match the child compiler name.","oneOf":[{"$ref":"#/definitions/RuleSetConditionOrConditions"}]},"dependency":{"description":"Match dependency type.","oneOf":[{"$ref":"#/definitions/RuleSetConditionOrConditions"}]},"descriptionData":{"description":"Match values of properties in the description file (usually package.json).","type":"object","additionalProperties":{"$ref":"#/definitions/RuleSetConditionOrConditions"}},"enforce":{"description":"Enforce this rule as pre or post step.","enum":["pre","post"]},"exclude":{"description":"Shortcut for resource.exclude.","oneOf":[{"$ref":"#/definitions/RuleSetConditionOrConditionsAbsolute"}]},"generator":{"description":"The options for the module generator.","type":"object"},"include":{"description":"Shortcut for resource.include.","oneOf":[{"$ref":"#/definitions/RuleSetConditionOrConditionsAbsolute"}]},"issuer":{"description":"Match the issuer of the module (The module pointing to this module).","oneOf":[{"$ref":"#/definitions/RuleSetConditionOrConditionsAbsolute"}]},"issuerLayer":{"description":"Match layer of the issuer of this module (The module pointing to this module).","oneOf":[{"$ref":"#/definitions/RuleSetConditionOrConditions"}]},"layer":{"description":"Specifies the layer in which the module should be placed in.","type":"string"},"loader":{"description":"Shortcut for use.loader.","oneOf":[{"$ref":"#/definitions/RuleSetLoader"}]},"mimetype":{"description":"Match module mimetype when load from Data URI.","oneOf":[{"$ref":"#/definitions/RuleSetConditionOrConditions"}]},"oneOf":{"description":"Only execute the first matching rule in this array.","type":"array","items":{"description":"A rule.","anyOf":[{"$ref":"#/definitions/Falsy"},{"$ref":"#/definitions/RuleSetRule"}]}},"options":{"description":"Shortcut for use.options.","cli":{"exclude":true},"oneOf":[{"$ref":"#/definitions/RuleSetLoaderOptions"}]},"parser":{"description":"Options for parsing.","type":"object","additionalProperties":true},"realResource":{"description":"Match the real resource path of the module.","oneOf":[{"$ref":"#/definitions/RuleSetConditionOrConditionsAbsolute"}]},"resolve":{"description":"Options for the resolver.","type":"object","oneOf":[{"$ref":"#/definitions/ResolveOptions"}]},"resource":{"description":"Match the resource path of the module.","oneOf":[{"$ref":"#/definitions/RuleSetConditionOrConditionsAbsolute"}]},"resourceFragment":{"description":"Match the resource fragment of the module.","oneOf":[{"$ref":"#/definitions/RuleSetConditionOrConditions"}]},"resourceQuery":{"description":"Match the resource query of the module.","oneOf":[{"$ref":"#/definitions/RuleSetConditionOrConditions"}]},"rules":{"description":"Match and execute these rules when this rule is matched.","type":"array","items":{"description":"A rule.","anyOf":[{"$ref":"#/definitions/Falsy"},{"$ref":"#/definitions/RuleSetRule"}]}},"scheme":{"description":"Match module scheme.","oneOf":[{"$ref":"#/definitions/RuleSetConditionOrConditions"}]},"sideEffects":{"description":"Flags a module as with or without side effects.","type":"boolean"},"test":{"description":"Shortcut for resource.test.","oneOf":[{"$ref":"#/definitions/RuleSetConditionOrConditionsAbsolute"}]},"type":{"description":"Module type to use for the module.","type":"string"},"use":{"description":"Modifiers applied to the module when rule is matched.","oneOf":[{"$ref":"#/definitions/RuleSetUse"}]}}},"RuleSetRules":{"description":"A list of rules.","type":"array","items":{"description":"A rule.","anyOf":[{"cli":{"exclude":true},"enum":["..."]},{"$ref":"#/definitions/Falsy"},{"$ref":"#/definitions/RuleSetRule"}]}},"RuleSetUse":{"description":"A list of descriptions of loaders applied.","anyOf":[{"type":"array","items":{"description":"An use item.","anyOf":[{"$ref":"#/definitions/Falsy"},{"$ref":"#/definitions/RuleSetUseItem"}]}},{"instanceof":"Function","tsType":"((data: { resource: string, realResource: string, resourceQuery: string, issuer: string, compiler: string }) => (Falsy | RuleSetUseItem)[])"},{"$ref":"#/definitions/RuleSetUseItem"}]},"RuleSetUseItem":{"description":"A description of an applied loader.","anyOf":[{"type":"object","additionalProperties":false,"properties":{"ident":{"description":"Unique loader options identifier.","type":"string"},"loader":{"description":"Loader name.","oneOf":[{"$ref":"#/definitions/RuleSetLoader"}]},"options":{"description":"Loader options.","oneOf":[{"$ref":"#/definitions/RuleSetLoaderOptions"}]}}},{"instanceof":"Function","tsType":"((data: object) => RuleSetUseItem | (Falsy | RuleSetUseItem)[])"},{"$ref":"#/definitions/RuleSetLoader"}]},"ScriptType":{"description":"This option enables loading async chunks via a custom script type, such as script type=\\"module\\".","enum":[false,"text/javascript","module"]},"SnapshotOptions":{"description":"Options affecting how file system snapshots are created and validated.","type":"object","additionalProperties":false,"properties":{"buildDependencies":{"description":"Options for snapshotting build dependencies to determine if the whole cache need to be invalidated.","type":"object","additionalProperties":false,"properties":{"hash":{"description":"Use hashes of the content of the files/directories to determine invalidation.","type":"boolean"},"timestamp":{"description":"Use timestamps of the files/directories to determine invalidation.","type":"boolean"}}},"immutablePaths":{"description":"List of paths that are managed by a package manager and contain a version or hash in its path so all files are immutable.","type":"array","items":{"description":"List of paths that are managed by a package manager and contain a version or hash in its path so all files are immutable.","anyOf":[{"description":"A RegExp matching an immutable directory (usually a package manager cache directory, including the tailing slash)","instanceof":"RegExp","tsType":"RegExp"},{"description":"A path to an immutable directory (usually a package manager cache directory).","type":"string","absolutePath":true,"minLength":1}]}},"managedPaths":{"description":"List of paths that are managed by a package manager and can be trusted to not be modified otherwise.","type":"array","items":{"description":"List of paths that are managed by a package manager and can be trusted to not be modified otherwise.","anyOf":[{"description":"A RegExp matching a managed directory (usually a node_modules directory, including the tailing slash)","instanceof":"RegExp","tsType":"RegExp"},{"description":"A path to a managed directory (usually a node_modules directory).","type":"string","absolutePath":true,"minLength":1}]}},"module":{"description":"Options for snapshotting dependencies of modules to determine if they need to be built again.","type":"object","additionalProperties":false,"properties":{"hash":{"description":"Use hashes of the content of the files/directories to determine invalidation.","type":"boolean"},"timestamp":{"description":"Use timestamps of the files/directories to determine invalidation.","type":"boolean"}}},"resolve":{"description":"Options for snapshotting dependencies of request resolving to determine if requests need to be re-resolved.","type":"object","additionalProperties":false,"properties":{"hash":{"description":"Use hashes of the content of the files/directories to determine invalidation.","type":"boolean"},"timestamp":{"description":"Use timestamps of the files/directories to determine invalidation.","type":"boolean"}}},"resolveBuildDependencies":{"description":"Options for snapshotting the resolving of build dependencies to determine if the build dependencies need to be re-resolved.","type":"object","additionalProperties":false,"properties":{"hash":{"description":"Use hashes of the content of the files/directories to determine invalidation.","type":"boolean"},"timestamp":{"description":"Use timestamps of the files/directories to determine invalidation.","type":"boolean"}}}}},"SourceMapFilename":{"description":"The filename of the SourceMaps for the JavaScript files. They are inside the \'output.path\' directory.","type":"string","absolutePath":false},"SourcePrefix":{"description":"Prefixes every line of the source in the bundle with this string.","type":"string"},"StatsOptions":{"description":"Stats options object.","type":"object","additionalProperties":false,"properties":{"all":{"description":"Fallback value for stats options when an option is not defined (has precedence over local webpack defaults).","type":"boolean"},"assets":{"description":"Add assets information.","type":"boolean"},"assetsSort":{"description":"Sort the assets by that field.","type":"string"},"assetsSpace":{"description":"Space to display assets (groups will be collapsed to fit this space).","type":"number"},"builtAt":{"description":"Add built at time information.","type":"boolean"},"cached":{"description":"Add information about cached (not built) modules (deprecated: use \'cachedModules\' instead).","type":"boolean"},"cachedAssets":{"description":"Show cached assets (setting this to `false` only shows emitted files).","type":"boolean"},"cachedModules":{"description":"Add information about cached (not built) modules.","type":"boolean"},"children":{"description":"Add children information.","type":"boolean"},"chunkGroupAuxiliary":{"description":"Display auxiliary assets in chunk groups.","type":"boolean"},"chunkGroupChildren":{"description":"Display children of chunk groups.","type":"boolean"},"chunkGroupMaxAssets":{"description":"Limit of assets displayed in chunk groups.","type":"number"},"chunkGroups":{"description":"Display all chunk groups with the corresponding bundles.","type":"boolean"},"chunkModules":{"description":"Add built modules information to chunk information.","type":"boolean"},"chunkModulesSpace":{"description":"Space to display chunk modules (groups will be collapsed to fit this space, value is in number of modules/group).","type":"number"},"chunkOrigins":{"description":"Add the origins of chunks and chunk merging info.","type":"boolean"},"chunkRelations":{"description":"Add information about parent, children and sibling chunks to chunk information.","type":"boolean"},"chunks":{"description":"Add chunk information.","type":"boolean"},"chunksSort":{"description":"Sort the chunks by that field.","type":"string"},"colors":{"description":"Enables/Disables colorful output.","anyOf":[{"description":"Enables/Disables colorful output.","type":"boolean"},{"type":"object","additionalProperties":false,"properties":{"bold":{"description":"Custom color for bold text.","type":"string"},"cyan":{"description":"Custom color for cyan text.","type":"string"},"green":{"description":"Custom color for green text.","type":"string"},"magenta":{"description":"Custom color for magenta text.","type":"string"},"red":{"description":"Custom color for red text.","type":"string"},"yellow":{"description":"Custom color for yellow text.","type":"string"}}}]},"context":{"description":"Context directory for request shortening.","type":"string","absolutePath":true},"dependentModules":{"description":"Show chunk modules that are dependencies of other modules of the chunk.","type":"boolean"},"depth":{"description":"Add module depth in module graph.","type":"boolean"},"entrypoints":{"description":"Display the entry points with the corresponding bundles.","anyOf":[{"enum":["auto"]},{"type":"boolean"}]},"env":{"description":"Add --env information.","type":"boolean"},"errorDetails":{"description":"Add details to errors (like resolving log).","anyOf":[{"enum":["auto"]},{"type":"boolean"}]},"errorStack":{"description":"Add internal stack trace to errors.","type":"boolean"},"errors":{"description":"Add errors.","type":"boolean"},"errorsCount":{"description":"Add errors count.","type":"boolean"},"errorsSpace":{"description":"Space to display errors (value is in number of lines).","type":"number"},"exclude":{"description":"Please use excludeModules instead.","cli":{"exclude":true},"anyOf":[{"type":"boolean"},{"$ref":"#/definitions/ModuleFilterTypes"}]},"excludeAssets":{"description":"Suppress assets that match the specified filters. Filters can be Strings, RegExps or Functions.","oneOf":[{"$ref":"#/definitions/AssetFilterTypes"}]},"excludeModules":{"description":"Suppress modules that match the specified filters. Filters can be Strings, RegExps, Booleans or Functions.","anyOf":[{"type":"boolean"},{"$ref":"#/definitions/ModuleFilterTypes"}]},"groupAssetsByChunk":{"description":"Group assets by how their are related to chunks.","type":"boolean"},"groupAssetsByEmitStatus":{"description":"Group assets by their status (emitted, compared for emit or cached).","type":"boolean"},"groupAssetsByExtension":{"description":"Group assets by their extension.","type":"boolean"},"groupAssetsByInfo":{"description":"Group assets by their asset info (immutable, development, hotModuleReplacement, etc).","type":"boolean"},"groupAssetsByPath":{"description":"Group assets by their path.","type":"boolean"},"groupModulesByAttributes":{"description":"Group modules by their attributes (errors, warnings, assets, optional, orphan, or dependent).","type":"boolean"},"groupModulesByCacheStatus":{"description":"Group modules by their status (cached or built and cacheable).","type":"boolean"},"groupModulesByExtension":{"description":"Group modules by their extension.","type":"boolean"},"groupModulesByLayer":{"description":"Group modules by their layer.","type":"boolean"},"groupModulesByPath":{"description":"Group modules by their path.","type":"boolean"},"groupModulesByType":{"description":"Group modules by their type.","type":"boolean"},"groupReasonsByOrigin":{"description":"Group reasons by their origin module.","type":"boolean"},"hash":{"description":"Add the hash of the compilation.","type":"boolean"},"ids":{"description":"Add ids.","type":"boolean"},"logging":{"description":"Add logging output.","anyOf":[{"description":"Specify log level of logging output.","enum":["none","error","warn","info","log","verbose"]},{"description":"Enable/disable logging output (`true`: shows normal logging output, loglevel: log).","type":"boolean"}]},"loggingDebug":{"description":"Include debug logging of specified loggers (i. e. for plugins or loaders). Filters can be Strings, RegExps or Functions.","anyOf":[{"description":"Enable/Disable debug logging for all loggers.","type":"boolean"},{"$ref":"#/definitions/FilterTypes"}]},"loggingTrace":{"description":"Add stack traces to logging output.","type":"boolean"},"moduleAssets":{"description":"Add information about assets inside modules.","type":"boolean"},"moduleTrace":{"description":"Add dependencies and origin of warnings/errors.","type":"boolean"},"modules":{"description":"Add built modules information.","type":"boolean"},"modulesSort":{"description":"Sort the modules by that field.","type":"string"},"modulesSpace":{"description":"Space to display modules (groups will be collapsed to fit this space, value is in number of modules/groups).","type":"number"},"nestedModules":{"description":"Add information about modules nested in other modules (like with module concatenation).","type":"boolean"},"nestedModulesSpace":{"description":"Space to display modules nested within other modules (groups will be collapsed to fit this space, value is in number of modules/group).","type":"number"},"optimizationBailout":{"description":"Show reasons why optimization bailed out for modules.","type":"boolean"},"orphanModules":{"description":"Add information about orphan modules.","type":"boolean"},"outputPath":{"description":"Add output path information.","type":"boolean"},"performance":{"description":"Add performance hint flags.","type":"boolean"},"preset":{"description":"Preset for the default values.","anyOf":[{"type":"boolean"},{"type":"string"}]},"providedExports":{"description":"Show exports provided by modules.","type":"boolean"},"publicPath":{"description":"Add public path information.","type":"boolean"},"reasons":{"description":"Add information about the reasons why modules are included.","type":"boolean"},"reasonsSpace":{"description":"Space to display reasons (groups will be collapsed to fit this space).","type":"number"},"relatedAssets":{"description":"Add information about assets that are related to other assets (like SourceMaps for assets).","type":"boolean"},"runtime":{"description":"Add information about runtime modules (deprecated: use \'runtimeModules\' instead).","type":"boolean"},"runtimeModules":{"description":"Add information about runtime modules.","type":"boolean"},"source":{"description":"Add the source code of modules.","type":"boolean"},"timings":{"description":"Add timing information.","type":"boolean"},"usedExports":{"description":"Show exports used by modules.","type":"boolean"},"version":{"description":"Add webpack version information.","type":"boolean"},"warnings":{"description":"Add warnings.","type":"boolean"},"warningsCount":{"description":"Add warnings count.","type":"boolean"},"warningsFilter":{"description":"Suppress listing warnings that match the specified filters (they will still be counted). Filters can be Strings, RegExps or Functions.","oneOf":[{"$ref":"#/definitions/WarningFilterTypes"}]},"warningsSpace":{"description":"Space to display warnings (value is in number of lines).","type":"number"}}},"StatsValue":{"description":"Stats options object or preset name.","anyOf":[{"enum":["none","summary","errors-only","errors-warnings","minimal","normal","detailed","verbose"]},{"type":"boolean"},{"$ref":"#/definitions/StatsOptions"}]},"StrictModuleErrorHandling":{"description":"Handles error in module loading correctly at a performance cost. This will handle module error compatible with the EcmaScript Modules spec.","type":"boolean"},"StrictModuleExceptionHandling":{"description":"Handles exceptions in module loading correctly at a performance cost (Deprecated). This will handle module error compatible with the Node.js CommonJS way.","type":"boolean"},"Target":{"description":"Environment to build for. An array of environments to build for all of them when possible.","anyOf":[{"type":"array","items":{"description":"Environment to build for.","type":"string","minLength":1},"minItems":1},{"enum":[false]},{"type":"string","minLength":1}]},"TrustedTypes":{"description":"Use a Trusted Types policy to create urls for chunks.","type":"object","additionalProperties":false,"properties":{"onPolicyCreationFailure":{"description":"If the call to `trustedTypes.createPolicy(...)` fails -- e.g., due to the policy name missing from the CSP `trusted-types` list, or it being a duplicate name, etc. -- controls whether to continue with loading in the hope that `require-trusted-types-for \'script\'` isn\'t enforced yet, versus fail immediately. Default behavior is \'stop\'.","enum":["continue","stop"]},"policyName":{"description":"The name of the Trusted Types policy created by webpack to serve bundle chunks.","type":"string","minLength":1}}},"UmdNamedDefine":{"description":"If `output.libraryTarget` is set to umd and `output.library` is set, setting this to true will name the AMD module.","type":"boolean"},"UniqueName":{"description":"A unique name of the webpack build to avoid multiple webpack runtimes to conflict when using globals.","type":"string","minLength":1},"WarningFilterItemTypes":{"description":"Filtering value, regexp or function.","cli":{"helper":true},"anyOf":[{"instanceof":"RegExp","tsType":"RegExp"},{"type":"string","absolutePath":false},{"instanceof":"Function","tsType":"((warning: import(\'../lib/stats/DefaultStatsFactoryPlugin\').StatsError, value: string) => boolean)"}]},"WarningFilterTypes":{"description":"Filtering warnings.","cli":{"helper":true},"anyOf":[{"type":"array","items":{"description":"Rule to filter.","cli":{"helper":true},"oneOf":[{"$ref":"#/definitions/WarningFilterItemTypes"}]}},{"$ref":"#/definitions/WarningFilterItemTypes"}]},"WasmLoading":{"description":"The method of loading WebAssembly Modules (methods included by default are \'fetch\' (web/WebWorker), \'async-node\' (node.js), but others might be added by plugins).","anyOf":[{"enum":[false]},{"$ref":"#/definitions/WasmLoadingType"}]},"WasmLoadingType":{"description":"The method of loading WebAssembly Modules (methods included by default are \'fetch\' (web/WebWorker), \'async-node\' (node.js), but others might be added by plugins).","anyOf":[{"enum":["fetch-streaming","fetch","async-node"]},{"type":"string"}]},"Watch":{"description":"Enter watch mode, which rebuilds on file change.","type":"boolean"},"WatchOptions":{"description":"Options for the watcher.","type":"object","additionalProperties":false,"properties":{"aggregateTimeout":{"description":"Delay the rebuilt after the first change. Value is a time in ms.","type":"number"},"followSymlinks":{"description":"Resolve symlinks and watch symlink and real file. This is usually not needed as webpack already resolves symlinks (\'resolve.symlinks\').","type":"boolean"},"ignored":{"description":"Ignore some files from watching (glob pattern or regexp).","anyOf":[{"type":"array","items":{"description":"A glob pattern for files that should be ignored from watching.","type":"string","minLength":1}},{"instanceof":"RegExp","tsType":"RegExp"},{"description":"A single glob pattern for files that should be ignored from watching.","type":"string","minLength":1}]},"poll":{"description":"Enable polling mode for watching.","anyOf":[{"description":"`number`: use polling with specified interval.","type":"number"},{"description":"`true`: use polling.","type":"boolean"}]},"stdin":{"description":"Stop watching when stdin stream has ended.","type":"boolean"}}},"WebassemblyModuleFilename":{"description":"The filename of WebAssembly modules as relative path inside the \'output.path\' directory.","type":"string","absolutePath":false},"WebpackOptionsNormalized":{"description":"Normalized webpack options object.","type":"object","additionalProperties":false,"properties":{"amd":{"$ref":"#/definitions/Amd"},"bail":{"$ref":"#/definitions/Bail"},"cache":{"$ref":"#/definitions/CacheOptionsNormalized"},"context":{"$ref":"#/definitions/Context"},"dependencies":{"$ref":"#/definitions/Dependencies"},"devServer":{"$ref":"#/definitions/DevServer"},"devtool":{"$ref":"#/definitions/DevTool"},"entry":{"$ref":"#/definitions/EntryNormalized"},"experiments":{"$ref":"#/definitions/ExperimentsNormalized"},"externals":{"$ref":"#/definitions/Externals"},"externalsPresets":{"$ref":"#/definitions/ExternalsPresets"},"externalsType":{"$ref":"#/definitions/ExternalsType"},"ignoreWarnings":{"$ref":"#/definitions/IgnoreWarningsNormalized"},"infrastructureLogging":{"$ref":"#/definitions/InfrastructureLogging"},"loader":{"$ref":"#/definitions/Loader"},"mode":{"$ref":"#/definitions/Mode"},"module":{"$ref":"#/definitions/ModuleOptionsNormalized"},"name":{"$ref":"#/definitions/Name"},"node":{"$ref":"#/definitions/Node"},"optimization":{"$ref":"#/definitions/Optimization"},"output":{"$ref":"#/definitions/OutputNormalized"},"parallelism":{"$ref":"#/definitions/Parallelism"},"performance":{"$ref":"#/definitions/Performance"},"plugins":{"$ref":"#/definitions/Plugins"},"profile":{"$ref":"#/definitions/Profile"},"recordsInputPath":{"$ref":"#/definitions/RecordsInputPath"},"recordsOutputPath":{"$ref":"#/definitions/RecordsOutputPath"},"resolve":{"$ref":"#/definitions/Resolve"},"resolveLoader":{"$ref":"#/definitions/ResolveLoader"},"snapshot":{"$ref":"#/definitions/SnapshotOptions"},"stats":{"$ref":"#/definitions/StatsValue"},"target":{"$ref":"#/definitions/Target"},"watch":{"$ref":"#/definitions/Watch"},"watchOptions":{"$ref":"#/definitions/WatchOptions"}},"required":["cache","snapshot","entry","experiments","externals","externalsPresets","infrastructureLogging","module","node","optimization","output","plugins","resolve","resolveLoader","stats","watchOptions"]},"WebpackPluginFunction":{"description":"Function acting as plugin.","instanceof":"Function","tsType":"(this: import(\'../lib/Compiler\'), compiler: import(\'../lib/Compiler\')) => void"},"WebpackPluginInstance":{"description":"Plugin instance.","type":"object","additionalProperties":true,"properties":{"apply":{"description":"The run point of the plugin, required method.","instanceof":"Function","tsType":"(compiler: import(\'../lib/Compiler\')) => void"}},"required":["apply"]},"WorkerPublicPath":{"description":"Worker public path. Much like the public path, this sets the location where the worker script file is intended to be found. If not set, webpack will use the publicPath. Don\'t set this option unless your worker scripts are located at a different path from your other script files.","type":"string"}},"title":"WebpackOptions","description":"Options object as provided by the user.","type":"object","additionalProperties":false,"properties":{"amd":{"$ref":"#/definitions/Amd"},"bail":{"$ref":"#/definitions/Bail"},"cache":{"$ref":"#/definitions/CacheOptions"},"context":{"$ref":"#/definitions/Context"},"dependencies":{"$ref":"#/definitions/Dependencies"},"devServer":{"$ref":"#/definitions/DevServer"},"devtool":{"$ref":"#/definitions/DevTool"},"entry":{"$ref":"#/definitions/Entry"},"experiments":{"$ref":"#/definitions/Experiments"},"extends":{"$ref":"#/definitions/Extends"},"externals":{"$ref":"#/definitions/Externals"},"externalsPresets":{"$ref":"#/definitions/ExternalsPresets"},"externalsType":{"$ref":"#/definitions/ExternalsType"},"ignoreWarnings":{"$ref":"#/definitions/IgnoreWarnings"},"infrastructureLogging":{"$ref":"#/definitions/InfrastructureLogging"},"loader":{"$ref":"#/definitions/Loader"},"mode":{"$ref":"#/definitions/Mode"},"module":{"$ref":"#/definitions/ModuleOptions"},"name":{"$ref":"#/definitions/Name"},"node":{"$ref":"#/definitions/Node"},"optimization":{"$ref":"#/definitions/Optimization"},"output":{"$ref":"#/definitions/Output"},"parallelism":{"$ref":"#/definitions/Parallelism"},"performance":{"$ref":"#/definitions/Performance"},"plugins":{"$ref":"#/definitions/Plugins"},"profile":{"$ref":"#/definitions/Profile"},"recordsInputPath":{"$ref":"#/definitions/RecordsInputPath"},"recordsOutputPath":{"$ref":"#/definitions/RecordsOutputPath"},"recordsPath":{"$ref":"#/definitions/RecordsPath"},"resolve":{"$ref":"#/definitions/Resolve"},"resolveLoader":{"$ref":"#/definitions/ResolveLoader"},"snapshot":{"$ref":"#/definitions/SnapshotOptions"},"stats":{"$ref":"#/definitions/StatsValue"},"target":{"$ref":"#/definitions/Target"},"watch":{"$ref":"#/definitions/Watch"},"watchOptions":{"$ref":"#/definitions/WatchOptions"}}}'); /***/ }), -/***/ 80139: +/***/ 12605: /***/ (function(module) { "use strict"; @@ -170119,7 +178636,7 @@ module.exports = JSON.parse('{"definitions":{"BannerFunction":{"description":"Th /***/ }), -/***/ 8122: +/***/ 9413: /***/ (function(module) { "use strict"; @@ -170127,7 +178644,7 @@ module.exports = JSON.parse('{"title":"DllPluginOptions","type":"object","additi /***/ }), -/***/ 83051: +/***/ 4107: /***/ (function(module) { "use strict"; @@ -170135,7 +178652,7 @@ module.exports = JSON.parse('{"definitions":{"DllReferencePluginOptionsContent": /***/ }), -/***/ 87764: +/***/ 25908: /***/ (function(module) { "use strict"; @@ -170143,7 +178660,7 @@ module.exports = JSON.parse('{"definitions":{"HashFunction":{"description":"Algo /***/ }), -/***/ 5574: +/***/ 72453: /***/ (function(module) { "use strict"; @@ -170151,7 +178668,7 @@ module.exports = JSON.parse('{"title":"IgnorePluginOptions","anyOf":[{"type":"ob /***/ }), -/***/ 56868: +/***/ 55314: /***/ (function(module) { "use strict"; @@ -170159,7 +178676,7 @@ module.exports = JSON.parse('{"title":"JsonModulesPluginParserOptions","type":"o /***/ }), -/***/ 77781: +/***/ 14772: /***/ (function(module) { "use strict"; @@ -170167,7 +178684,7 @@ module.exports = JSON.parse('{"title":"LoaderOptionsPluginOptions","type":"objec /***/ }), -/***/ 77155: +/***/ 76423: /***/ (function(module) { "use strict"; @@ -170175,15 +178692,15 @@ module.exports = JSON.parse('{"definitions":{"HandlerFunction":{"description":"F /***/ }), -/***/ 90116: +/***/ 74285: /***/ (function(module) { "use strict"; -module.exports = JSON.parse('{"definitions":{"rule":{"description":"Include source maps for modules based on their extension (defaults to .js and .css).","anyOf":[{"instanceof":"RegExp","tsType":"RegExp"},{"type":"string","minLength":1}]},"rules":{"description":"Include source maps for modules based on their extension (defaults to .js and .css).","anyOf":[{"type":"array","items":{"description":"A rule condition.","oneOf":[{"$ref":"#/definitions/rule"}]}},{"$ref":"#/definitions/rule"}]}},"title":"SourceMapDevToolPluginOptions","type":"object","additionalProperties":false,"properties":{"append":{"description":"Appends the given value to the original asset. Usually the #sourceMappingURL comment. [url] is replaced with a URL to the source map file. false disables the appending.","anyOf":[{"description":"Append no SourceMap comment to the bundle, but still generate SourceMaps.","enum":[false,null]},{"type":"string","minLength":1}]},"columns":{"description":"Indicates whether column mappings should be used (defaults to true).","type":"boolean"},"exclude":{"description":"Exclude modules that match the given value from source map generation.","oneOf":[{"$ref":"#/definitions/rules"}]},"fallbackModuleFilenameTemplate":{"description":"Generator string or function to create identifiers of modules for the \'sources\' array in the SourceMap used only if \'moduleFilenameTemplate\' would result in a conflict.","anyOf":[{"type":"string","minLength":1},{"description":"Custom function generating the identifier.","instanceof":"Function","tsType":"Function"}]},"fileContext":{"description":"Path prefix to which the [file] placeholder is relative to.","type":"string"},"filename":{"description":"Defines the output filename of the SourceMap (will be inlined if no value is provided).","anyOf":[{"description":"Disable separate SourceMap file and inline SourceMap as DataUrl.","enum":[false,null]},{"type":"string","absolutePath":false,"minLength":1}]},"include":{"description":"Include source maps for module paths that match the given value.","oneOf":[{"$ref":"#/definitions/rules"}]},"module":{"description":"Indicates whether SourceMaps from loaders should be used (defaults to true).","type":"boolean"},"moduleFilenameTemplate":{"description":"Generator string or function to create identifiers of modules for the \'sources\' array in the SourceMap.","anyOf":[{"type":"string","minLength":1},{"description":"Custom function generating the identifier.","instanceof":"Function","tsType":"Function"}]},"namespace":{"description":"Namespace prefix to allow multiple webpack roots in the devtools.","type":"string"},"noSources":{"description":"Omit the \'sourceContents\' array from the SourceMap.","type":"boolean"},"publicPath":{"description":"Provide a custom public path for the SourceMapping comment.","type":"string"},"sourceRoot":{"description":"Provide a custom value for the \'sourceRoot\' property in the SourceMap.","type":"string"},"test":{"$ref":"#/definitions/rules"}}}'); +module.exports = JSON.parse('{"definitions":{"rule":{"description":"Include source maps for modules based on their extension (defaults to .js and .css).","anyOf":[{"instanceof":"RegExp","tsType":"RegExp"},{"type":"string","minLength":1}]},"rules":{"description":"Include source maps for modules based on their extension (defaults to .js and .css).","anyOf":[{"type":"array","items":{"description":"A rule condition.","oneOf":[{"$ref":"#/definitions/rule"}]}},{"$ref":"#/definitions/rule"}]}},"title":"SourceMapDevToolPluginOptions","type":"object","additionalProperties":false,"properties":{"append":{"description":"Appends the given value to the original asset. Usually the #sourceMappingURL comment. [url] is replaced with a URL to the source map file. false disables the appending.","anyOf":[{"description":"Append no SourceMap comment to the bundle, but still generate SourceMaps.","enum":[false,null]},{"type":"string","minLength":1},{"instanceof":"Function","tsType":"((pathData: import(\\"../../lib/Compilation\\").PathData, assetInfo?: import(\\"../../lib/Compilation\\").AssetInfo) => string)"}]},"columns":{"description":"Indicates whether column mappings should be used (defaults to true).","type":"boolean"},"exclude":{"description":"Exclude modules that match the given value from source map generation.","oneOf":[{"$ref":"#/definitions/rules"}]},"fallbackModuleFilenameTemplate":{"description":"Generator string or function to create identifiers of modules for the \'sources\' array in the SourceMap used only if \'moduleFilenameTemplate\' would result in a conflict.","anyOf":[{"type":"string","minLength":1},{"description":"Custom function generating the identifier.","instanceof":"Function","tsType":"Function"}]},"fileContext":{"description":"Path prefix to which the [file] placeholder is relative to.","type":"string"},"filename":{"description":"Defines the output filename of the SourceMap (will be inlined if no value is provided).","anyOf":[{"description":"Disable separate SourceMap file and inline SourceMap as DataUrl.","enum":[false,null]},{"type":"string","absolutePath":false,"minLength":1}]},"include":{"description":"Include source maps for module paths that match the given value.","oneOf":[{"$ref":"#/definitions/rules"}]},"module":{"description":"Indicates whether SourceMaps from loaders should be used (defaults to true).","type":"boolean"},"moduleFilenameTemplate":{"description":"Generator string or function to create identifiers of modules for the \'sources\' array in the SourceMap.","anyOf":[{"type":"string","minLength":1},{"description":"Custom function generating the identifier.","instanceof":"Function","tsType":"Function"}]},"namespace":{"description":"Namespace prefix to allow multiple webpack roots in the devtools.","type":"string"},"noSources":{"description":"Omit the \'sourceContents\' array from the SourceMap.","type":"boolean"},"publicPath":{"description":"Provide a custom public path for the SourceMapping comment.","type":"string"},"sourceRoot":{"description":"Provide a custom value for the \'sourceRoot\' property in the SourceMap.","type":"string"},"test":{"$ref":"#/definitions/rules"}}}'); /***/ }), -/***/ 29625: +/***/ 51554: /***/ (function(module) { "use strict"; @@ -170191,15 +178708,15 @@ module.exports = JSON.parse('{"title":"WatchIgnorePluginOptions","type":"object" /***/ }), -/***/ 94674: +/***/ 94769: /***/ (function(module) { "use strict"; -module.exports = JSON.parse('{"definitions":{"AuxiliaryComment":{"description":"Add a comment in the UMD wrapper.","anyOf":[{"description":"Append the same comment above each import style.","type":"string"},{"$ref":"#/definitions/LibraryCustomUmdCommentObject"}]},"EntryRuntime":{"description":"The name of the runtime chunk. If set a runtime chunk with this name is created or an existing entrypoint is used as runtime.","anyOf":[{"enum":[false]},{"type":"string","minLength":1}]},"Exposes":{"description":"Modules that should be exposed by this container. When provided, property name is used as public name, otherwise public name is automatically inferred from request.","anyOf":[{"type":"array","items":{"description":"Modules that should be exposed by this container.","anyOf":[{"$ref":"#/definitions/ExposesItem"},{"$ref":"#/definitions/ExposesObject"}]}},{"$ref":"#/definitions/ExposesObject"}]},"ExposesConfig":{"description":"Advanced configuration for modules that should be exposed by this container.","type":"object","additionalProperties":false,"properties":{"import":{"description":"Request to a module that should be exposed by this container.","anyOf":[{"$ref":"#/definitions/ExposesItem"},{"$ref":"#/definitions/ExposesItems"}]},"name":{"description":"Custom chunk name for the exposed module.","type":"string"}},"required":["import"]},"ExposesItem":{"description":"Module that should be exposed by this container.","type":"string","minLength":1},"ExposesItems":{"description":"Modules that should be exposed by this container.","type":"array","items":{"$ref":"#/definitions/ExposesItem"}},"ExposesObject":{"description":"Modules that should be exposed by this container. Property names are used as public paths.","type":"object","additionalProperties":{"description":"Modules that should be exposed by this container.","anyOf":[{"$ref":"#/definitions/ExposesConfig"},{"$ref":"#/definitions/ExposesItem"},{"$ref":"#/definitions/ExposesItems"}]}},"LibraryCustomUmdCommentObject":{"description":"Set explicit comments for `commonjs`, `commonjs2`, `amd`, and `root`.","type":"object","additionalProperties":false,"properties":{"amd":{"description":"Set comment for `amd` section in UMD.","type":"string"},"commonjs":{"description":"Set comment for `commonjs` (exports) section in UMD.","type":"string"},"commonjs2":{"description":"Set comment for `commonjs2` (module.exports) section in UMD.","type":"string"},"root":{"description":"Set comment for `root` (global variable) section in UMD.","type":"string"}}},"LibraryCustomUmdObject":{"description":"Description object for all UMD variants of the library name.","type":"object","additionalProperties":false,"properties":{"amd":{"description":"Name of the exposed AMD library in the UMD.","type":"string","minLength":1},"commonjs":{"description":"Name of the exposed commonjs export in the UMD.","type":"string","minLength":1},"root":{"description":"Name of the property exposed globally by a UMD library.","anyOf":[{"type":"array","items":{"description":"Part of the name of the property exposed globally by a UMD library.","type":"string","minLength":1}},{"type":"string","minLength":1}]}}},"LibraryExport":{"description":"Specify which export should be exposed as library.","anyOf":[{"type":"array","items":{"description":"Part of the export that should be exposed as library.","type":"string","minLength":1}},{"type":"string","minLength":1}]},"LibraryName":{"description":"The name of the library (some types allow unnamed libraries too).","anyOf":[{"type":"array","items":{"description":"A part of the library name.","type":"string","minLength":1},"minItems":1},{"type":"string","minLength":1},{"$ref":"#/definitions/LibraryCustomUmdObject"}]},"LibraryOptions":{"description":"Options for library.","type":"object","additionalProperties":false,"properties":{"auxiliaryComment":{"$ref":"#/definitions/AuxiliaryComment"},"export":{"$ref":"#/definitions/LibraryExport"},"name":{"$ref":"#/definitions/LibraryName"},"type":{"$ref":"#/definitions/LibraryType"},"umdNamedDefine":{"$ref":"#/definitions/UmdNamedDefine"}},"required":["type"]},"LibraryType":{"description":"Type of library (types included by default are \'var\', \'module\', \'assign\', \'assign-properties\', \'this\', \'window\', \'self\', \'global\', \'commonjs\', \'commonjs2\', \'commonjs-module\', \'commonjs-static\', \'amd\', \'amd-require\', \'umd\', \'umd2\', \'jsonp\', \'system\', but others might be added by plugins).","anyOf":[{"enum":["var","module","assign","assign-properties","this","window","self","global","commonjs","commonjs2","commonjs-module","commonjs-static","amd","amd-require","umd","umd2","jsonp","system"]},{"type":"string"}]},"UmdNamedDefine":{"description":"If `output.libraryTarget` is set to umd and `output.library` is set, setting this to true will name the AMD module.","type":"boolean"}},"title":"ContainerPluginOptions","type":"object","additionalProperties":false,"properties":{"exposes":{"$ref":"#/definitions/Exposes"},"filename":{"description":"The filename for this container relative path inside the `output.path` directory.","type":"string","absolutePath":false,"minLength":1},"library":{"$ref":"#/definitions/LibraryOptions"},"name":{"description":"The name for this container.","type":"string","minLength":1},"runtime":{"$ref":"#/definitions/EntryRuntime"},"shareScope":{"description":"The name of the share scope which is shared with the host (defaults to \'default\').","type":"string","minLength":1}},"required":["name","exposes"]}'); +module.exports = JSON.parse('{"definitions":{"AmdContainer":{"description":"Add a container for define/require functions in the AMD module.","type":"string","minLength":1},"AuxiliaryComment":{"description":"Add a comment in the UMD wrapper.","anyOf":[{"description":"Append the same comment above each import style.","type":"string"},{"$ref":"#/definitions/LibraryCustomUmdCommentObject"}]},"EntryRuntime":{"description":"The name of the runtime chunk. If set a runtime chunk with this name is created or an existing entrypoint is used as runtime.","anyOf":[{"enum":[false]},{"type":"string","minLength":1}]},"Exposes":{"description":"Modules that should be exposed by this container. When provided, property name is used as public name, otherwise public name is automatically inferred from request.","anyOf":[{"type":"array","items":{"description":"Modules that should be exposed by this container.","anyOf":[{"$ref":"#/definitions/ExposesItem"},{"$ref":"#/definitions/ExposesObject"}]}},{"$ref":"#/definitions/ExposesObject"}]},"ExposesConfig":{"description":"Advanced configuration for modules that should be exposed by this container.","type":"object","additionalProperties":false,"properties":{"import":{"description":"Request to a module that should be exposed by this container.","anyOf":[{"$ref":"#/definitions/ExposesItem"},{"$ref":"#/definitions/ExposesItems"}]},"name":{"description":"Custom chunk name for the exposed module.","type":"string"}},"required":["import"]},"ExposesItem":{"description":"Module that should be exposed by this container.","type":"string","minLength":1},"ExposesItems":{"description":"Modules that should be exposed by this container.","type":"array","items":{"$ref":"#/definitions/ExposesItem"}},"ExposesObject":{"description":"Modules that should be exposed by this container. Property names are used as public paths.","type":"object","additionalProperties":{"description":"Modules that should be exposed by this container.","anyOf":[{"$ref":"#/definitions/ExposesConfig"},{"$ref":"#/definitions/ExposesItem"},{"$ref":"#/definitions/ExposesItems"}]}},"LibraryCustomUmdCommentObject":{"description":"Set explicit comments for `commonjs`, `commonjs2`, `amd`, and `root`.","type":"object","additionalProperties":false,"properties":{"amd":{"description":"Set comment for `amd` section in UMD.","type":"string"},"commonjs":{"description":"Set comment for `commonjs` (exports) section in UMD.","type":"string"},"commonjs2":{"description":"Set comment for `commonjs2` (module.exports) section in UMD.","type":"string"},"root":{"description":"Set comment for `root` (global variable) section in UMD.","type":"string"}}},"LibraryCustomUmdObject":{"description":"Description object for all UMD variants of the library name.","type":"object","additionalProperties":false,"properties":{"amd":{"description":"Name of the exposed AMD library in the UMD.","type":"string","minLength":1},"commonjs":{"description":"Name of the exposed commonjs export in the UMD.","type":"string","minLength":1},"root":{"description":"Name of the property exposed globally by a UMD library.","anyOf":[{"type":"array","items":{"description":"Part of the name of the property exposed globally by a UMD library.","type":"string","minLength":1}},{"type":"string","minLength":1}]}}},"LibraryExport":{"description":"Specify which export should be exposed as library.","anyOf":[{"type":"array","items":{"description":"Part of the export that should be exposed as library.","type":"string","minLength":1}},{"type":"string","minLength":1}]},"LibraryName":{"description":"The name of the library (some types allow unnamed libraries too).","anyOf":[{"type":"array","items":{"description":"A part of the library name.","type":"string","minLength":1},"minItems":1},{"type":"string","minLength":1},{"$ref":"#/definitions/LibraryCustomUmdObject"}]},"LibraryOptions":{"description":"Options for library.","type":"object","additionalProperties":false,"properties":{"amdContainer":{"$ref":"#/definitions/AmdContainer"},"auxiliaryComment":{"$ref":"#/definitions/AuxiliaryComment"},"export":{"$ref":"#/definitions/LibraryExport"},"name":{"$ref":"#/definitions/LibraryName"},"type":{"$ref":"#/definitions/LibraryType"},"umdNamedDefine":{"$ref":"#/definitions/UmdNamedDefine"}},"required":["type"]},"LibraryType":{"description":"Type of library (types included by default are \'var\', \'module\', \'assign\', \'assign-properties\', \'this\', \'window\', \'self\', \'global\', \'commonjs\', \'commonjs2\', \'commonjs-module\', \'commonjs-static\', \'amd\', \'amd-require\', \'umd\', \'umd2\', \'jsonp\', \'system\', but others might be added by plugins).","anyOf":[{"enum":["var","module","assign","assign-properties","this","window","self","global","commonjs","commonjs2","commonjs-module","commonjs-static","amd","amd-require","umd","umd2","jsonp","system"]},{"type":"string"}]},"UmdNamedDefine":{"description":"If `output.libraryTarget` is set to umd and `output.library` is set, setting this to true will name the AMD module.","type":"boolean"}},"title":"ContainerPluginOptions","type":"object","additionalProperties":false,"properties":{"exposes":{"$ref":"#/definitions/Exposes"},"filename":{"description":"The filename for this container relative path inside the `output.path` directory.","type":"string","absolutePath":false,"minLength":1},"library":{"$ref":"#/definitions/LibraryOptions"},"name":{"description":"The name for this container.","type":"string","minLength":1},"runtime":{"$ref":"#/definitions/EntryRuntime"},"shareScope":{"description":"The name of the share scope which is shared with the host (defaults to \'default\').","type":"string","minLength":1}},"required":["name","exposes"]}'); /***/ }), -/***/ 39902: +/***/ 61748: /***/ (function(module) { "use strict"; @@ -170207,15 +178724,15 @@ module.exports = JSON.parse('{"definitions":{"ExternalsType":{"description":"Spe /***/ }), -/***/ 64549: +/***/ 66132: /***/ (function(module) { "use strict"; -module.exports = JSON.parse('{"definitions":{"AuxiliaryComment":{"description":"Add a comment in the UMD wrapper.","anyOf":[{"description":"Append the same comment above each import style.","type":"string"},{"$ref":"#/definitions/LibraryCustomUmdCommentObject"}]},"EntryRuntime":{"description":"The name of the runtime chunk. If set a runtime chunk with this name is created or an existing entrypoint is used as runtime.","anyOf":[{"enum":[false]},{"type":"string","minLength":1}]},"Exposes":{"description":"Modules that should be exposed by this container. When provided, property name is used as public name, otherwise public name is automatically inferred from request.","anyOf":[{"type":"array","items":{"description":"Modules that should be exposed by this container.","anyOf":[{"$ref":"#/definitions/ExposesItem"},{"$ref":"#/definitions/ExposesObject"}]}},{"$ref":"#/definitions/ExposesObject"}]},"ExposesConfig":{"description":"Advanced configuration for modules that should be exposed by this container.","type":"object","additionalProperties":false,"properties":{"import":{"description":"Request to a module that should be exposed by this container.","anyOf":[{"$ref":"#/definitions/ExposesItem"},{"$ref":"#/definitions/ExposesItems"}]},"name":{"description":"Custom chunk name for the exposed module.","type":"string"}},"required":["import"]},"ExposesItem":{"description":"Module that should be exposed by this container.","type":"string","minLength":1},"ExposesItems":{"description":"Modules that should be exposed by this container.","type":"array","items":{"$ref":"#/definitions/ExposesItem"}},"ExposesObject":{"description":"Modules that should be exposed by this container. Property names are used as public paths.","type":"object","additionalProperties":{"description":"Modules that should be exposed by this container.","anyOf":[{"$ref":"#/definitions/ExposesConfig"},{"$ref":"#/definitions/ExposesItem"},{"$ref":"#/definitions/ExposesItems"}]}},"ExternalsType":{"description":"Specifies the default type of externals (\'amd*\', \'umd*\', \'system\' and \'jsonp\' depend on output.libraryTarget set to the same value).","enum":["var","module","assign","this","window","self","global","commonjs","commonjs2","commonjs-module","commonjs-static","amd","amd-require","umd","umd2","jsonp","system","promise","import","script","node-commonjs"]},"LibraryCustomUmdCommentObject":{"description":"Set explicit comments for `commonjs`, `commonjs2`, `amd`, and `root`.","type":"object","additionalProperties":false,"properties":{"amd":{"description":"Set comment for `amd` section in UMD.","type":"string"},"commonjs":{"description":"Set comment for `commonjs` (exports) section in UMD.","type":"string"},"commonjs2":{"description":"Set comment for `commonjs2` (module.exports) section in UMD.","type":"string"},"root":{"description":"Set comment for `root` (global variable) section in UMD.","type":"string"}}},"LibraryCustomUmdObject":{"description":"Description object for all UMD variants of the library name.","type":"object","additionalProperties":false,"properties":{"amd":{"description":"Name of the exposed AMD library in the UMD.","type":"string","minLength":1},"commonjs":{"description":"Name of the exposed commonjs export in the UMD.","type":"string","minLength":1},"root":{"description":"Name of the property exposed globally by a UMD library.","anyOf":[{"type":"array","items":{"description":"Part of the name of the property exposed globally by a UMD library.","type":"string","minLength":1}},{"type":"string","minLength":1}]}}},"LibraryExport":{"description":"Specify which export should be exposed as library.","anyOf":[{"type":"array","items":{"description":"Part of the export that should be exposed as library.","type":"string","minLength":1}},{"type":"string","minLength":1}]},"LibraryName":{"description":"The name of the library (some types allow unnamed libraries too).","anyOf":[{"type":"array","items":{"description":"A part of the library name.","type":"string","minLength":1},"minItems":1},{"type":"string","minLength":1},{"$ref":"#/definitions/LibraryCustomUmdObject"}]},"LibraryOptions":{"description":"Options for library.","type":"object","additionalProperties":false,"properties":{"auxiliaryComment":{"$ref":"#/definitions/AuxiliaryComment"},"export":{"$ref":"#/definitions/LibraryExport"},"name":{"$ref":"#/definitions/LibraryName"},"type":{"$ref":"#/definitions/LibraryType"},"umdNamedDefine":{"$ref":"#/definitions/UmdNamedDefine"}},"required":["type"]},"LibraryType":{"description":"Type of library (types included by default are \'var\', \'module\', \'assign\', \'assign-properties\', \'this\', \'window\', \'self\', \'global\', \'commonjs\', \'commonjs2\', \'commonjs-module\', \'commonjs-static\', \'amd\', \'amd-require\', \'umd\', \'umd2\', \'jsonp\', \'system\', but others might be added by plugins).","anyOf":[{"enum":["var","module","assign","assign-properties","this","window","self","global","commonjs","commonjs2","commonjs-module","commonjs-static","amd","amd-require","umd","umd2","jsonp","system"]},{"type":"string"}]},"Remotes":{"description":"Container locations and request scopes from which modules should be resolved and loaded at runtime. When provided, property name is used as request scope, otherwise request scope is automatically inferred from container location.","anyOf":[{"type":"array","items":{"description":"Container locations and request scopes from which modules should be resolved and loaded at runtime.","anyOf":[{"$ref":"#/definitions/RemotesItem"},{"$ref":"#/definitions/RemotesObject"}]}},{"$ref":"#/definitions/RemotesObject"}]},"RemotesConfig":{"description":"Advanced configuration for container locations from which modules should be resolved and loaded at runtime.","type":"object","additionalProperties":false,"properties":{"external":{"description":"Container locations from which modules should be resolved and loaded at runtime.","anyOf":[{"$ref":"#/definitions/RemotesItem"},{"$ref":"#/definitions/RemotesItems"}]},"shareScope":{"description":"The name of the share scope shared with this remote.","type":"string","minLength":1}},"required":["external"]},"RemotesItem":{"description":"Container location from which modules should be resolved and loaded at runtime.","type":"string","minLength":1},"RemotesItems":{"description":"Container locations from which modules should be resolved and loaded at runtime.","type":"array","items":{"$ref":"#/definitions/RemotesItem"}},"RemotesObject":{"description":"Container locations from which modules should be resolved and loaded at runtime. Property names are used as request scopes.","type":"object","additionalProperties":{"description":"Container locations from which modules should be resolved and loaded at runtime.","anyOf":[{"$ref":"#/definitions/RemotesConfig"},{"$ref":"#/definitions/RemotesItem"},{"$ref":"#/definitions/RemotesItems"}]}},"Shared":{"description":"Modules that should be shared in the share scope. When provided, property names are used to match requested modules in this compilation.","anyOf":[{"type":"array","items":{"description":"Modules that should be shared in the share scope.","anyOf":[{"$ref":"#/definitions/SharedItem"},{"$ref":"#/definitions/SharedObject"}]}},{"$ref":"#/definitions/SharedObject"}]},"SharedConfig":{"description":"Advanced configuration for modules that should be shared in the share scope.","type":"object","additionalProperties":false,"properties":{"eager":{"description":"Include the provided and fallback module directly instead behind an async request. This allows to use this shared module in initial load too. All possible shared modules need to be eager too.","type":"boolean"},"import":{"description":"Provided module that should be provided to share scope. Also acts as fallback module if no shared module is found in share scope or version isn\'t valid. Defaults to the property name.","anyOf":[{"description":"No provided or fallback module.","enum":[false]},{"$ref":"#/definitions/SharedItem"}]},"packageName":{"description":"Package name to determine required version from description file. This is only needed when package name can\'t be automatically determined from request.","type":"string","minLength":1},"requiredVersion":{"description":"Version requirement from module in share scope.","anyOf":[{"description":"No version requirement check.","enum":[false]},{"description":"Version as string. Can be prefixed with \'^\' or \'~\' for minimum matches. Each part of the version should be separated by a dot \'.\'.","type":"string"}]},"shareKey":{"description":"Module is looked up under this key from the share scope.","type":"string","minLength":1},"shareScope":{"description":"Share scope name.","type":"string","minLength":1},"singleton":{"description":"Allow only a single version of the shared module in share scope (disabled by default).","type":"boolean"},"strictVersion":{"description":"Do not accept shared module if version is not valid (defaults to yes, if local fallback module is available and shared module is not a singleton, otherwise no, has no effect if there is no required version specified).","type":"boolean"},"version":{"description":"Version of the provided module. Will replace lower matching versions, but not higher.","anyOf":[{"description":"Don\'t provide a version.","enum":[false]},{"description":"Version as string. Each part of the version should be separated by a dot \'.\'.","type":"string"}]}}},"SharedItem":{"description":"A module that should be shared in the share scope.","type":"string","minLength":1},"SharedObject":{"description":"Modules that should be shared in the share scope. Property names are used to match requested modules in this compilation. Relative requests are resolved, module requests are matched unresolved, absolute paths will match resolved requests. A trailing slash will match all requests with this prefix. In this case shareKey must also have a trailing slash.","type":"object","additionalProperties":{"description":"Modules that should be shared in the share scope.","anyOf":[{"$ref":"#/definitions/SharedConfig"},{"$ref":"#/definitions/SharedItem"}]}},"UmdNamedDefine":{"description":"If `output.libraryTarget` is set to umd and `output.library` is set, setting this to true will name the AMD module.","type":"boolean"}},"title":"ModuleFederationPluginOptions","type":"object","additionalProperties":false,"properties":{"exposes":{"$ref":"#/definitions/Exposes"},"filename":{"description":"The filename of the container as relative path inside the `output.path` directory.","type":"string","absolutePath":false},"library":{"$ref":"#/definitions/LibraryOptions"},"name":{"description":"The name of the container.","type":"string"},"remoteType":{"description":"The external type of the remote containers.","oneOf":[{"$ref":"#/definitions/ExternalsType"}]},"remotes":{"$ref":"#/definitions/Remotes"},"runtime":{"$ref":"#/definitions/EntryRuntime"},"shareScope":{"description":"Share scope name used for all shared modules (defaults to \'default\').","type":"string","minLength":1},"shared":{"$ref":"#/definitions/Shared"}}}'); +module.exports = JSON.parse('{"definitions":{"AmdContainer":{"description":"Add a container for define/require functions in the AMD module.","type":"string","minLength":1},"AuxiliaryComment":{"description":"Add a comment in the UMD wrapper.","anyOf":[{"description":"Append the same comment above each import style.","type":"string"},{"$ref":"#/definitions/LibraryCustomUmdCommentObject"}]},"EntryRuntime":{"description":"The name of the runtime chunk. If set a runtime chunk with this name is created or an existing entrypoint is used as runtime.","anyOf":[{"enum":[false]},{"type":"string","minLength":1}]},"Exposes":{"description":"Modules that should be exposed by this container. When provided, property name is used as public name, otherwise public name is automatically inferred from request.","anyOf":[{"type":"array","items":{"description":"Modules that should be exposed by this container.","anyOf":[{"$ref":"#/definitions/ExposesItem"},{"$ref":"#/definitions/ExposesObject"}]}},{"$ref":"#/definitions/ExposesObject"}]},"ExposesConfig":{"description":"Advanced configuration for modules that should be exposed by this container.","type":"object","additionalProperties":false,"properties":{"import":{"description":"Request to a module that should be exposed by this container.","anyOf":[{"$ref":"#/definitions/ExposesItem"},{"$ref":"#/definitions/ExposesItems"}]},"name":{"description":"Custom chunk name for the exposed module.","type":"string"}},"required":["import"]},"ExposesItem":{"description":"Module that should be exposed by this container.","type":"string","minLength":1},"ExposesItems":{"description":"Modules that should be exposed by this container.","type":"array","items":{"$ref":"#/definitions/ExposesItem"}},"ExposesObject":{"description":"Modules that should be exposed by this container. Property names are used as public paths.","type":"object","additionalProperties":{"description":"Modules that should be exposed by this container.","anyOf":[{"$ref":"#/definitions/ExposesConfig"},{"$ref":"#/definitions/ExposesItem"},{"$ref":"#/definitions/ExposesItems"}]}},"ExternalsType":{"description":"Specifies the default type of externals (\'amd*\', \'umd*\', \'system\' and \'jsonp\' depend on output.libraryTarget set to the same value).","enum":["var","module","assign","this","window","self","global","commonjs","commonjs2","commonjs-module","commonjs-static","amd","amd-require","umd","umd2","jsonp","system","promise","import","script","node-commonjs"]},"LibraryCustomUmdCommentObject":{"description":"Set explicit comments for `commonjs`, `commonjs2`, `amd`, and `root`.","type":"object","additionalProperties":false,"properties":{"amd":{"description":"Set comment for `amd` section in UMD.","type":"string"},"commonjs":{"description":"Set comment for `commonjs` (exports) section in UMD.","type":"string"},"commonjs2":{"description":"Set comment for `commonjs2` (module.exports) section in UMD.","type":"string"},"root":{"description":"Set comment for `root` (global variable) section in UMD.","type":"string"}}},"LibraryCustomUmdObject":{"description":"Description object for all UMD variants of the library name.","type":"object","additionalProperties":false,"properties":{"amd":{"description":"Name of the exposed AMD library in the UMD.","type":"string","minLength":1},"commonjs":{"description":"Name of the exposed commonjs export in the UMD.","type":"string","minLength":1},"root":{"description":"Name of the property exposed globally by a UMD library.","anyOf":[{"type":"array","items":{"description":"Part of the name of the property exposed globally by a UMD library.","type":"string","minLength":1}},{"type":"string","minLength":1}]}}},"LibraryExport":{"description":"Specify which export should be exposed as library.","anyOf":[{"type":"array","items":{"description":"Part of the export that should be exposed as library.","type":"string","minLength":1}},{"type":"string","minLength":1}]},"LibraryName":{"description":"The name of the library (some types allow unnamed libraries too).","anyOf":[{"type":"array","items":{"description":"A part of the library name.","type":"string","minLength":1},"minItems":1},{"type":"string","minLength":1},{"$ref":"#/definitions/LibraryCustomUmdObject"}]},"LibraryOptions":{"description":"Options for library.","type":"object","additionalProperties":false,"properties":{"amdContainer":{"$ref":"#/definitions/AmdContainer"},"auxiliaryComment":{"$ref":"#/definitions/AuxiliaryComment"},"export":{"$ref":"#/definitions/LibraryExport"},"name":{"$ref":"#/definitions/LibraryName"},"type":{"$ref":"#/definitions/LibraryType"},"umdNamedDefine":{"$ref":"#/definitions/UmdNamedDefine"}},"required":["type"]},"LibraryType":{"description":"Type of library (types included by default are \'var\', \'module\', \'assign\', \'assign-properties\', \'this\', \'window\', \'self\', \'global\', \'commonjs\', \'commonjs2\', \'commonjs-module\', \'commonjs-static\', \'amd\', \'amd-require\', \'umd\', \'umd2\', \'jsonp\', \'system\', but others might be added by plugins).","anyOf":[{"enum":["var","module","assign","assign-properties","this","window","self","global","commonjs","commonjs2","commonjs-module","commonjs-static","amd","amd-require","umd","umd2","jsonp","system"]},{"type":"string"}]},"Remotes":{"description":"Container locations and request scopes from which modules should be resolved and loaded at runtime. When provided, property name is used as request scope, otherwise request scope is automatically inferred from container location.","anyOf":[{"type":"array","items":{"description":"Container locations and request scopes from which modules should be resolved and loaded at runtime.","anyOf":[{"$ref":"#/definitions/RemotesItem"},{"$ref":"#/definitions/RemotesObject"}]}},{"$ref":"#/definitions/RemotesObject"}]},"RemotesConfig":{"description":"Advanced configuration for container locations from which modules should be resolved and loaded at runtime.","type":"object","additionalProperties":false,"properties":{"external":{"description":"Container locations from which modules should be resolved and loaded at runtime.","anyOf":[{"$ref":"#/definitions/RemotesItem"},{"$ref":"#/definitions/RemotesItems"}]},"shareScope":{"description":"The name of the share scope shared with this remote.","type":"string","minLength":1}},"required":["external"]},"RemotesItem":{"description":"Container location from which modules should be resolved and loaded at runtime.","type":"string","minLength":1},"RemotesItems":{"description":"Container locations from which modules should be resolved and loaded at runtime.","type":"array","items":{"$ref":"#/definitions/RemotesItem"}},"RemotesObject":{"description":"Container locations from which modules should be resolved and loaded at runtime. Property names are used as request scopes.","type":"object","additionalProperties":{"description":"Container locations from which modules should be resolved and loaded at runtime.","anyOf":[{"$ref":"#/definitions/RemotesConfig"},{"$ref":"#/definitions/RemotesItem"},{"$ref":"#/definitions/RemotesItems"}]}},"Shared":{"description":"Modules that should be shared in the share scope. When provided, property names are used to match requested modules in this compilation.","anyOf":[{"type":"array","items":{"description":"Modules that should be shared in the share scope.","anyOf":[{"$ref":"#/definitions/SharedItem"},{"$ref":"#/definitions/SharedObject"}]}},{"$ref":"#/definitions/SharedObject"}]},"SharedConfig":{"description":"Advanced configuration for modules that should be shared in the share scope.","type":"object","additionalProperties":false,"properties":{"eager":{"description":"Include the provided and fallback module directly instead behind an async request. This allows to use this shared module in initial load too. All possible shared modules need to be eager too.","type":"boolean"},"import":{"description":"Provided module that should be provided to share scope. Also acts as fallback module if no shared module is found in share scope or version isn\'t valid. Defaults to the property name.","anyOf":[{"description":"No provided or fallback module.","enum":[false]},{"$ref":"#/definitions/SharedItem"}]},"packageName":{"description":"Package name to determine required version from description file. This is only needed when package name can\'t be automatically determined from request.","type":"string","minLength":1},"requiredVersion":{"description":"Version requirement from module in share scope.","anyOf":[{"description":"No version requirement check.","enum":[false]},{"description":"Version as string. Can be prefixed with \'^\' or \'~\' for minimum matches. Each part of the version should be separated by a dot \'.\'.","type":"string"}]},"shareKey":{"description":"Module is looked up under this key from the share scope.","type":"string","minLength":1},"shareScope":{"description":"Share scope name.","type":"string","minLength":1},"singleton":{"description":"Allow only a single version of the shared module in share scope (disabled by default).","type":"boolean"},"strictVersion":{"description":"Do not accept shared module if version is not valid (defaults to yes, if local fallback module is available and shared module is not a singleton, otherwise no, has no effect if there is no required version specified).","type":"boolean"},"version":{"description":"Version of the provided module. Will replace lower matching versions, but not higher.","anyOf":[{"description":"Don\'t provide a version.","enum":[false]},{"description":"Version as string. Each part of the version should be separated by a dot \'.\'.","type":"string"}]}}},"SharedItem":{"description":"A module that should be shared in the share scope.","type":"string","minLength":1},"SharedObject":{"description":"Modules that should be shared in the share scope. Property names are used to match requested modules in this compilation. Relative requests are resolved, module requests are matched unresolved, absolute paths will match resolved requests. A trailing slash will match all requests with this prefix. In this case shareKey must also have a trailing slash.","type":"object","additionalProperties":{"description":"Modules that should be shared in the share scope.","anyOf":[{"$ref":"#/definitions/SharedConfig"},{"$ref":"#/definitions/SharedItem"}]}},"UmdNamedDefine":{"description":"If `output.libraryTarget` is set to umd and `output.library` is set, setting this to true will name the AMD module.","type":"boolean"}},"title":"ModuleFederationPluginOptions","type":"object","additionalProperties":false,"properties":{"exposes":{"$ref":"#/definitions/Exposes"},"filename":{"description":"The filename of the container as relative path inside the `output.path` directory.","type":"string","absolutePath":false},"library":{"$ref":"#/definitions/LibraryOptions"},"name":{"description":"The name of the container.","type":"string"},"remoteType":{"description":"The external type of the remote containers.","oneOf":[{"$ref":"#/definitions/ExternalsType"}]},"remotes":{"$ref":"#/definitions/Remotes"},"runtime":{"$ref":"#/definitions/EntryRuntime"},"shareScope":{"description":"Share scope name used for all shared modules (defaults to \'default\').","type":"string","minLength":1},"shared":{"$ref":"#/definitions/Shared"}}}'); /***/ }), -/***/ 34399: +/***/ 88962: /***/ (function(module) { "use strict"; @@ -170223,7 +178740,7 @@ module.exports = JSON.parse('{"title":"ProfilingPluginOptions","type":"object"," /***/ }), -/***/ 7510: +/***/ 91376: /***/ (function(module) { "use strict"; @@ -170231,7 +178748,7 @@ module.exports = JSON.parse('{"title":"OccurrenceChunkIdsPluginOptions","type":" /***/ }), -/***/ 45699: +/***/ 54257: /***/ (function(module) { "use strict"; @@ -170239,7 +178756,7 @@ module.exports = JSON.parse('{"title":"OccurrenceModuleIdsPluginOptions","type": /***/ }), -/***/ 50298: +/***/ 48892: /***/ (function(module) { "use strict"; @@ -170247,7 +178764,7 @@ module.exports = JSON.parse('{"title":"AggressiveSplittingPluginOptions","type": /***/ }), -/***/ 70757: +/***/ 42536: /***/ (function(module) { "use strict"; @@ -170255,7 +178772,7 @@ module.exports = JSON.parse('{"title":"LimitChunkCountPluginOptions","type":"obj /***/ }), -/***/ 87260: +/***/ 54973: /***/ (function(module) { "use strict"; @@ -170263,7 +178780,7 @@ module.exports = JSON.parse('{"title":"MinChunkSizePluginOptions","type":"object /***/ }), -/***/ 4828: +/***/ 53529: /***/ (function(module) { "use strict"; @@ -170271,7 +178788,7 @@ module.exports = JSON.parse('{"definitions":{"HttpUriOptions":{"description":"Op /***/ }), -/***/ 64223: +/***/ 22139: /***/ (function(module) { "use strict"; @@ -170279,7 +178796,7 @@ module.exports = JSON.parse('{"definitions":{"Consumes":{"description":"Modules /***/ }), -/***/ 64939: +/***/ 99244: /***/ (function(module) { "use strict"; @@ -170385,7 +178902,7 @@ __webpack_require__.r(__webpack_exports__); /* harmony export */ "FetchCompileWasmPlugin": function() { return /* binding */ FetchCompileWasmPlugin; }, /* harmony export */ "StringXor": function() { return /* binding */ StringXor; } /* harmony export */ }); -/* harmony import */ var webpack__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3516); +/* harmony import */ var webpack__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7265); /* harmony import */ var webpack__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(webpack__WEBPACK_IMPORTED_MODULE_0__); /* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {}; /* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in webpack__WEBPACK_IMPORTED_MODULE_0__) if(["default","BasicEffectRulePlugin","BasicMatcherRulePlugin","UseEffectRulePlugin","ObjectMatcherRulePlugin","RuleSetCompiler","BasicEvaluatedExpression","NodeTargetPlugin","NodeTemplatePlugin","LimitChunkCountPlugin","WebWorkerTemplatePlugin","FetchCompileAsyncWasmPlugin","FetchCompileWasmPlugin","StringXor"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = function(key) { return webpack__WEBPACK_IMPORTED_MODULE_0__[key]; }.bind(0, __WEBPACK_IMPORT_KEY__) @@ -170395,21 +178912,21 @@ __webpack_require__.r(__webpack_exports__); // export webpack rules -const BasicEffectRulePlugin = __webpack_require__(24208) -const BasicMatcherRulePlugin = __webpack_require__(43759) -const UseEffectRulePlugin = __webpack_require__(20552) -const ObjectMatcherRulePlugin = __webpack_require__(8465) -const RuleSetCompiler = __webpack_require__(89023) +const BasicEffectRulePlugin = __webpack_require__(22818) +const BasicMatcherRulePlugin = __webpack_require__(42510) +const UseEffectRulePlugin = __webpack_require__(20110) +const ObjectMatcherRulePlugin = __webpack_require__(58927) +const RuleSetCompiler = __webpack_require__(49041) // refer to nextjs https://github.com/vercel/next.js/blob/canary/packages/next/src/bundles/webpack/bundle5.js -const BasicEvaluatedExpression =__webpack_require__(88981) -const NodeTargetPlugin = __webpack_require__(6640) -const NodeTemplatePlugin = __webpack_require__(66235) -const LimitChunkCountPlugin = __webpack_require__(57823) -const WebWorkerTemplatePlugin = __webpack_require__(71270) -const FetchCompileAsyncWasmPlugin = __webpack_require__(40968) -const FetchCompileWasmPlugin = __webpack_require__(23056) -const StringXor = __webpack_require__(78565) +const BasicEvaluatedExpression =__webpack_require__(52493) +const NodeTargetPlugin = __webpack_require__(63887) +const NodeTemplatePlugin = __webpack_require__(16842) +const LimitChunkCountPlugin = __webpack_require__(96296) +const WebWorkerTemplatePlugin = __webpack_require__(75919) +const FetchCompileAsyncWasmPlugin = __webpack_require__(28862) +const FetchCompileWasmPlugin = __webpack_require__(24728) +const StringXor = __webpack_require__(81650) diff --git a/packages/bundler-webpack/compiled/webpack/lazy-compilation-node.js b/packages/bundler-webpack/compiled/webpack/lazy-compilation-node.js index 5dd417b7b0ad..da4058583b11 100644 --- a/packages/bundler-webpack/compiled/webpack/lazy-compilation-node.js +++ b/packages/bundler-webpack/compiled/webpack/lazy-compilation-node.js @@ -3,11 +3,17 @@ "use strict"; var urlBase = decodeURIComponent(__resourceQuery.slice(1)); + +/** + * @param {{ data: string, onError: (err: Error) => void, active: boolean, module: module }} options options + * @returns {() => void} function to destroy response + */ exports.keepAlive = function (options) { var data = options.data; var onError = options.onError; var active = options.active; var module = options.module; + /** @type {import("http").IncomingMessage} */ var response; var request = ( urlBase.startsWith("https") ? require("https") : require("http") @@ -27,6 +33,10 @@ exports.keepAlive = function (options) { } } ); + + /** + * @param {Error} err error + */ function errorHandler(err) { err.message = "Problem communicating active modules to the server: " + err.message; diff --git a/packages/bundler-webpack/compiled/webpack/lazy-compilation-web.js b/packages/bundler-webpack/compiled/webpack/lazy-compilation-web.js index 62d955c5a22b..ec8253f0a3ca 100644 --- a/packages/bundler-webpack/compiled/webpack/lazy-compilation-web.js +++ b/packages/bundler-webpack/compiled/webpack/lazy-compilation-web.js @@ -9,6 +9,7 @@ if (typeof EventSource !== "function") { } var urlBase = decodeURIComponent(__resourceQuery.slice(1)); +/** @type {EventSource | undefined} */ var activeEventSource; var activeKeys = new Map(); var errorHandlers = new Set(); @@ -19,6 +20,10 @@ var updateEventSource = function updateEventSource() { activeEventSource = new EventSource( urlBase + Array.from(activeKeys.keys()).join("@") ); + /** + * @this {EventSource} + * @param {Event & { message?: string, filename?: string, lineno?: number, colno?: number, error?: Error }} event event + */ activeEventSource.onerror = function (event) { errorHandlers.forEach(function (onError) { onError( @@ -42,6 +47,10 @@ var updateEventSource = function updateEventSource() { } }; +/** + * @param {{ data: string, onError: (err: Error) => void, active: boolean, module: module }} options options + * @returns {() => void} function to destroy response + */ exports.keepAlive = function (options) { var data = options.data; var onError = options.onError; diff --git a/packages/bundler-webpack/package.json b/packages/bundler-webpack/package.json index 3afd28a65115..cc3207505798 100644 --- a/packages/bundler-webpack/package.json +++ b/packages/bundler-webpack/package.json @@ -78,7 +78,7 @@ "terser": "5.16.1", "terser-webpack-plugin": "5.3.6", "url-loader": "4.1.1", - "webpack": "5.76.1", + "webpack": "5.88.2", "webpack-5-chain": "8.0.1", "webpack-bundle-analyzer": "4.7.0", "webpack-dev-middleware": "6.0.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1b7d17bf699b..c924633d2e1f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1934,7 +1934,7 @@ importers: version: link:../mfsu '@umijs/react-refresh-webpack-plugin': specifier: 0.5.11 - version: 0.5.11(react-refresh@0.14.0)(webpack@5.76.1) + version: 0.5.11(react-refresh@0.14.0)(webpack@5.88.2) '@umijs/utils': specifier: workspace:* version: link:../utils @@ -1943,13 +1943,13 @@ importers: version: 2.8.5 css-loader: specifier: 6.7.1 - version: 6.7.1(webpack@5.76.1) + version: 6.7.1(webpack@5.88.2) es5-imcompatible-versions: specifier: ^0.1.78 version: 0.1.78 fork-ts-checker-webpack-plugin: specifier: 8.0.0 - version: 8.0.0(typescript@4.9.4)(webpack@5.76.1) + version: 8.0.0(typescript@4.9.4)(webpack@5.88.2) jest-worker: specifier: 29.4.3 version: 29.4.3 @@ -1992,7 +1992,7 @@ importers: version: 10.4.13(postcss@8.4.21) babel-loader: specifier: 9.1.2 - version: 9.1.2(webpack@5.76.1) + version: 9.1.2(webpack@5.88.2) compression: specifier: 1.7.4 version: 1.7.4 @@ -2001,43 +2001,43 @@ importers: version: 1.6.0 copy-webpack-plugin: specifier: 10.2.4 - version: 10.2.4(webpack@5.76.1) + version: 10.2.4(webpack@5.88.2) css-minimizer-webpack-plugin: specifier: 4.0.0 - version: 4.0.0(webpack@5.76.1) + version: 4.0.0(webpack@5.88.2) cssnano: specifier: 5.1.7 version: 5.1.7(postcss@8.4.21) file-loader: specifier: 6.2.0 - version: 6.2.0(webpack@5.76.1) + version: 6.2.0(webpack@5.88.2) less-loader: specifier: 11.1.0 - version: 11.1.0(webpack@5.76.1) + version: 11.1.0(webpack@5.88.2) mini-css-extract-plugin: specifier: 2.7.2 - version: 2.7.2(webpack@5.76.1) + version: 2.7.2(webpack@5.88.2) postcss-flexbugs-fixes: specifier: 5.0.2 version: 5.0.2(postcss@8.4.21) postcss-loader: specifier: 7.0.2 - version: 7.0.2(postcss@8.4.21)(webpack@5.76.1) + version: 7.0.2(postcss@8.4.21)(webpack@5.88.2) purgecss-webpack-plugin: specifier: 4.1.3 - version: 4.1.3(webpack@5.76.1) + version: 4.1.3(webpack@5.88.2) sass-loader: specifier: 13.2.0 - version: 13.2.0(webpack@5.76.1) + version: 13.2.0(webpack@5.88.2) schema-utils: specifier: 4.0.0 version: 4.0.0 speed-measure-webpack-plugin: specifier: 1.5.0 - version: 1.5.0(webpack@5.76.1) + version: 1.5.0(webpack@5.88.2) style-loader: specifier: 3.3.1 - version: 3.3.1(webpack@5.76.1) + version: 3.3.1(webpack@5.88.2) svgo-loader: specifier: 3.0.0 version: 3.0.0 @@ -2049,13 +2049,13 @@ importers: version: 5.16.1 terser-webpack-plugin: specifier: 5.3.6 - version: 5.3.6(@swc/core@1.3.67)(uglify-js@3.17.4)(webpack@5.76.1) + version: 5.3.6(@swc/core@1.3.67)(uglify-js@3.17.4)(webpack@5.88.2) url-loader: specifier: 4.1.1 - version: 4.1.1(file-loader@6.2.0)(webpack@5.76.1) + version: 4.1.1(file-loader@6.2.0)(webpack@5.88.2) webpack: - specifier: 5.76.1 - version: 5.76.1(@swc/core@1.3.67)(uglify-js@3.17.4) + specifier: 5.88.2 + version: 5.88.2(@swc/core@1.3.67)(uglify-js@3.17.4) webpack-5-chain: specifier: 8.0.1 version: 8.0.1 @@ -2064,16 +2064,16 @@ importers: version: 4.7.0 webpack-dev-middleware: specifier: 6.0.1 - version: 6.0.1(webpack@5.76.1) + version: 6.0.1(webpack@5.88.2) webpack-manifest-plugin: specifier: 5.0.0 - version: 5.0.0(webpack@5.76.1) + version: 5.0.0(webpack@5.88.2) webpack-sources: specifier: 3.2.3 version: 3.2.3 webpackbar: specifier: 5.0.2 - version: 5.0.2(webpack@5.76.1) + version: 5.0.2(webpack@5.88.2) ws: specifier: 8.12.0 version: 8.12.0 @@ -14864,7 +14864,7 @@ packages: resolution: {integrity: sha512-9K4zoImiZc3HlIp6AVUDE4CWYx22a+lhSZMYNpbjW04+YF0KWj4pJXnEMjdnFTiQibFFmElcsasJXDbdI/EPhA==} dependencies: '@types/eslint': 8.4.6 - '@types/estree': 1.0.0 + '@types/estree': 1.0.1 /@types/eslint@7.29.0: resolution: {integrity: sha512-VNcvioYDH8/FxaeTKkM4/TiTwt6pBV9E3OfGmvaw8tPl0rrHCJ4Ll15HRT+pMiFAf/MLQvAzC+6RzUMEL9Ceng==} @@ -14876,7 +14876,7 @@ packages: /@types/eslint@8.4.6: resolution: {integrity: sha512-/fqTbjxyFUaYNO7VcW5g+4npmqVACz1bB7RTHYuLj+PRjw9hrCwrUXVQFpChUS0JsyEFvMZ7U/PfmvWgxJhI9g==} dependencies: - '@types/estree': 1.0.0 + '@types/estree': 1.0.1 '@types/json-schema': 7.0.12 /@types/estree-jsx@0.0.1: @@ -14900,6 +14900,7 @@ packages: /@types/estree@1.0.0: resolution: {integrity: sha512-WulqXMDUTYAXCjZnk6JtIHPigp55cVtDgDrO2gHRwhyJto21+1zbVCtOYB2L1F9w4qCQ0rOGWBnBe0FNTiEJIQ==} + dev: true /@types/estree@1.0.1: resolution: {integrity: sha512-LG4opVs2ANWZ1TJoKc937iMmNstM/d0ae1vNbnBvBhqCSezgVUOzcLCqbI5elV8Vy6WKwKjaqR+zO9VKirBBCA==} @@ -15416,7 +15417,7 @@ packages: dependencies: '@types/node': 18.11.18 tapable: 2.2.1 - webpack: 5.76.1(@swc/core@1.3.67)(uglify-js@3.17.4) + webpack: 5.88.2(@swc/core@1.3.67)(uglify-js@3.17.4) transitivePeerDependencies: - '@swc/core' - esbuild @@ -16290,7 +16291,7 @@ packages: '@umijs/mfsu': 4.0.0-canary.20220628.2 '@umijs/utils': 4.0.0-canary.20220628.2 cors: 2.8.5 - css-loader: 6.7.1(webpack@5.76.1) + css-loader: 6.7.1(webpack@5.88.2) es5-imcompatible-versions: 0.1.78 jest-worker: 27.5.1 node-libs-browser: 2.2.1 @@ -16324,9 +16325,9 @@ packages: '@umijs/mfsu': 4.0.75 '@umijs/utils': 4.0.75 cors: 2.8.5 - css-loader: 6.7.1(webpack@5.76.1) + css-loader: 6.7.1(webpack@5.88.2) es5-imcompatible-versions: 0.1.78 - fork-ts-checker-webpack-plugin: 8.0.0(typescript@4.9.4)(webpack@5.76.1) + fork-ts-checker-webpack-plugin: 8.0.0(typescript@4.9.4)(webpack@5.88.2) jest-worker: 29.4.3 lightningcss: 1.19.0 node-libs-browser: 2.2.1 @@ -16362,7 +16363,7 @@ packages: '@umijs/mfsu': 4.0.75 '@umijs/utils': 4.0.75 cors: 2.8.5 - css-loader: 6.7.1(webpack@5.76.1) + css-loader: 6.7.1(webpack@5.88.2) es5-imcompatible-versions: 0.1.78 fork-ts-checker-webpack-plugin: 8.0.0(typescript@4.8.4) jest-worker: 29.4.3 @@ -16955,7 +16956,7 @@ packages: - webpack-plugin-serve dev: true - /@umijs/react-refresh-webpack-plugin@0.5.11(react-refresh@0.14.0)(webpack@5.76.1): + /@umijs/react-refresh-webpack-plugin@0.5.11(react-refresh@0.14.0)(webpack@5.88.2): resolution: {integrity: sha512-RtFvB+/GmjRhpHcqNgnw8iWZpTlxOnmNxi8eDcecxMmxmSgeDj25LV0jr4Q6rOhv3GTIfVGBhkwz+khGT5tfmg==} engines: {node: '>= 10.13'} peerDependencies: @@ -16993,7 +16994,7 @@ packages: react-refresh: 0.14.0 schema-utils: 3.1.1 source-map: 0.7.4 - webpack: 5.76.1(@swc/core@1.3.67)(uglify-js@3.17.4) + webpack: 5.88.2(@swc/core@1.3.67)(uglify-js@3.17.4) dev: false /@umijs/renderer-react@4.0.0-canary.20220628.2(react-dom@17.0.2)(react@17.0.2): @@ -17730,15 +17731,30 @@ packages: '@webassemblyjs/helper-numbers': 1.11.1 '@webassemblyjs/helper-wasm-bytecode': 1.11.1 + /@webassemblyjs/ast@1.11.6: + resolution: {integrity: sha512-IN1xI7PwOvLPgjcf180gC1bqn3q/QaOCwYUahIOhbYUu8KA/3tw2RT/T0Gidi1l7Hhj5D/INhJxiICObqpMu4Q==} + dependencies: + '@webassemblyjs/helper-numbers': 1.11.6 + '@webassemblyjs/helper-wasm-bytecode': 1.11.6 + /@webassemblyjs/floating-point-hex-parser@1.11.1: resolution: {integrity: sha512-iGRfyc5Bq+NnNuX8b5hwBrRjzf0ocrJPI6GWFodBFzmFnyvrQ83SHKhmilCU/8Jv67i4GJZBMhEzltxzcNagtQ==} + /@webassemblyjs/floating-point-hex-parser@1.11.6: + resolution: {integrity: sha512-ejAj9hfRJ2XMsNHk/v6Fu2dGS+i4UaXBXGemOfQ/JfQ6mdQg/WXtwleQRLLS4OvfDhv8rYnVwH27YJLMyYsxhw==} + /@webassemblyjs/helper-api-error@1.11.1: resolution: {integrity: sha512-RlhS8CBCXfRUR/cwo2ho9bkheSXG0+NwooXcc3PAILALf2QLdFyj7KGsKRbVc95hZnhnERon4kW/D3SZpp6Tcg==} + /@webassemblyjs/helper-api-error@1.11.6: + resolution: {integrity: sha512-o0YkoP4pVu4rN8aTJgAyj9hC2Sv5UlkzCHhxqWj8butaLvnpdc2jOwh4ewE6CX0txSfLn/UYaV/pheS2Txg//Q==} + /@webassemblyjs/helper-buffer@1.11.1: resolution: {integrity: sha512-gwikF65aDNeeXa8JxXa2BAk+REjSyhrNC9ZwdT0f8jc4dQQeDQ7G4m0f2QCLPJiMTTO6wfDmRmj/pW0PsUvIcA==} + /@webassemblyjs/helper-buffer@1.11.6: + resolution: {integrity: sha512-z3nFzdcp1mb8nEOFFk8DrYLpHvhKC3grJD2ardfKOzmbmJvEf/tPIqCY+sNcwZIY8ZD7IkB2l7/pqhUhqm7hLA==} + /@webassemblyjs/helper-numbers@1.11.1: resolution: {integrity: sha512-vDkbxiB8zfnPdNK9Rajcey5C0w+QJugEglN0of+kmO8l7lDb77AnlKYQF7aarZuCrv+l0UvqL+68gSDr3k9LPQ==} dependencies: @@ -17746,9 +17762,19 @@ packages: '@webassemblyjs/helper-api-error': 1.11.1 '@xtuc/long': 4.2.2 + /@webassemblyjs/helper-numbers@1.11.6: + resolution: {integrity: sha512-vUIhZ8LZoIWHBohiEObxVm6hwP034jwmc9kuq5GdHZH0wiLVLIPcMCdpJzG4C11cHoQ25TFIQj9kaVADVX7N3g==} + dependencies: + '@webassemblyjs/floating-point-hex-parser': 1.11.6 + '@webassemblyjs/helper-api-error': 1.11.6 + '@xtuc/long': 4.2.2 + /@webassemblyjs/helper-wasm-bytecode@1.11.1: resolution: {integrity: sha512-PvpoOGiJwXeTrSf/qfudJhwlvDQxFgelbMqtq52WWiXC6Xgg1IREdngmPN3bs4RoO83PnL/nFrxucXj1+BX62Q==} + /@webassemblyjs/helper-wasm-bytecode@1.11.6: + resolution: {integrity: sha512-sFFHKwcmBprO9e7Icf0+gddyWYDViL8bpPjJJl0WHxCdETktXdmtWLGVzoHbqUcY4Be1LkNfwTmXOJUFZYSJdA==} + /@webassemblyjs/helper-wasm-section@1.11.1: resolution: {integrity: sha512-10P9No29rYX1j7F3EVPX3JvGPQPae+AomuSTPiF9eBQeChHI6iqjMIwR9JmOJXwpnn/oVGDk7I5IlskuMwU/pg==} dependencies: @@ -17757,19 +17783,40 @@ packages: '@webassemblyjs/helper-wasm-bytecode': 1.11.1 '@webassemblyjs/wasm-gen': 1.11.1 + /@webassemblyjs/helper-wasm-section@1.11.6: + resolution: {integrity: sha512-LPpZbSOwTpEC2cgn4hTydySy1Ke+XEu+ETXuoyvuyezHO3Kjdu90KK95Sh9xTbmjrCsUwvWwCOQQNta37VrS9g==} + dependencies: + '@webassemblyjs/ast': 1.11.6 + '@webassemblyjs/helper-buffer': 1.11.6 + '@webassemblyjs/helper-wasm-bytecode': 1.11.6 + '@webassemblyjs/wasm-gen': 1.11.6 + /@webassemblyjs/ieee754@1.11.1: resolution: {integrity: sha512-hJ87QIPtAMKbFq6CGTkZYJivEwZDbQUgYd3qKSadTNOhVY7p+gfP6Sr0lLRVTaG1JjFj+r3YchoqRYxNH3M0GQ==} dependencies: '@xtuc/ieee754': 1.2.0 + /@webassemblyjs/ieee754@1.11.6: + resolution: {integrity: sha512-LM4p2csPNvbij6U1f19v6WR56QZ8JcHg3QIJTlSwzFcmx6WSORicYj6I63f9yU1kEUtrpG+kjkiIAkevHpDXrg==} + dependencies: + '@xtuc/ieee754': 1.2.0 + /@webassemblyjs/leb128@1.11.1: resolution: {integrity: sha512-BJ2P0hNZ0u+Th1YZXJpzW6miwqQUGcIHT1G/sf72gLVD9DZ5AdYTqPNbHZh6K1M5VmKvFXwGSWZADz+qBWxeRw==} dependencies: '@xtuc/long': 4.2.2 + /@webassemblyjs/leb128@1.11.6: + resolution: {integrity: sha512-m7a0FhE67DQXgouf1tbN5XQcdWoNgaAuoULHIfGFIEVKA6tu/edls6XnIlkmS6FrXAquJRPni3ZZKjw6FSPjPQ==} + dependencies: + '@xtuc/long': 4.2.2 + /@webassemblyjs/utf8@1.11.1: resolution: {integrity: sha512-9kqcxAEdMhiwQkHpkNiorZzqpGrodQQ2IGrHHxCy+Ozng0ofyMA0lTqiLkVs1uzTRejX+/O0EOT7KxqVPuXosQ==} + /@webassemblyjs/utf8@1.11.6: + resolution: {integrity: sha512-vtXf2wTQ3+up9Zsg8sa2yWiQpzSsMyXj0qViVP6xKGCUT8p8YJ6HqI7l5eCnWx1T/FYdsv07HQs2wTFbbof/RA==} + /@webassemblyjs/wasm-edit@1.11.1: resolution: {integrity: sha512-g+RsupUC1aTHfR8CDgnsVRVZFJqdkFHpsHMfJuWQzWU3tvnLC07UqHICfP+4XyL2tnr1amvl1Sdp06TnYCmVkA==} dependencies: @@ -17782,6 +17829,18 @@ packages: '@webassemblyjs/wasm-parser': 1.11.1 '@webassemblyjs/wast-printer': 1.11.1 + /@webassemblyjs/wasm-edit@1.11.6: + resolution: {integrity: sha512-Ybn2I6fnfIGuCR+Faaz7YcvtBKxvoLV3Lebn1tM4o/IAJzmi9AWYIPWpyBfU8cC+JxAO57bk4+zdsTjJR+VTOw==} + dependencies: + '@webassemblyjs/ast': 1.11.6 + '@webassemblyjs/helper-buffer': 1.11.6 + '@webassemblyjs/helper-wasm-bytecode': 1.11.6 + '@webassemblyjs/helper-wasm-section': 1.11.6 + '@webassemblyjs/wasm-gen': 1.11.6 + '@webassemblyjs/wasm-opt': 1.11.6 + '@webassemblyjs/wasm-parser': 1.11.6 + '@webassemblyjs/wast-printer': 1.11.6 + /@webassemblyjs/wasm-gen@1.11.1: resolution: {integrity: sha512-F7QqKXwwNlMmsulj6+O7r4mmtAlCWfO/0HdgOxSklZfQcDu0TpLiD1mRt/zF25Bk59FIjEuGAIyn5ei4yMfLhA==} dependencies: @@ -17791,6 +17850,15 @@ packages: '@webassemblyjs/leb128': 1.11.1 '@webassemblyjs/utf8': 1.11.1 + /@webassemblyjs/wasm-gen@1.11.6: + resolution: {integrity: sha512-3XOqkZP/y6B4F0PBAXvI1/bky7GryoogUtfwExeP/v7Nzwo1QLcq5oQmpKlftZLbT+ERUOAZVQjuNVak6UXjPA==} + dependencies: + '@webassemblyjs/ast': 1.11.6 + '@webassemblyjs/helper-wasm-bytecode': 1.11.6 + '@webassemblyjs/ieee754': 1.11.6 + '@webassemblyjs/leb128': 1.11.6 + '@webassemblyjs/utf8': 1.11.6 + /@webassemblyjs/wasm-opt@1.11.1: resolution: {integrity: sha512-VqnkNqnZlU5EB64pp1l7hdm3hmQw7Vgqa0KF/KCNO9sIpI6Fk6brDEiX+iCOYrvMuBWDws0NkTOxYEb85XQHHw==} dependencies: @@ -17799,6 +17867,14 @@ packages: '@webassemblyjs/wasm-gen': 1.11.1 '@webassemblyjs/wasm-parser': 1.11.1 + /@webassemblyjs/wasm-opt@1.11.6: + resolution: {integrity: sha512-cOrKuLRE7PCe6AsOVl7WasYf3wbSo4CeOk6PkrjS7g57MFfVUF9u6ysQBBODX0LdgSvQqRiGz3CXvIDKcPNy4g==} + dependencies: + '@webassemblyjs/ast': 1.11.6 + '@webassemblyjs/helper-buffer': 1.11.6 + '@webassemblyjs/wasm-gen': 1.11.6 + '@webassemblyjs/wasm-parser': 1.11.6 + /@webassemblyjs/wasm-parser@1.11.1: resolution: {integrity: sha512-rrBujw+dJu32gYB7/Lup6UhdkPx9S9SnobZzRVL7VcBH9Bt9bCBLEuX/YXOOtBsOZ4NQrRykKhffRWHvigQvOA==} dependencies: @@ -17809,12 +17885,28 @@ packages: '@webassemblyjs/leb128': 1.11.1 '@webassemblyjs/utf8': 1.11.1 + /@webassemblyjs/wasm-parser@1.11.6: + resolution: {integrity: sha512-6ZwPeGzMJM3Dqp3hCsLgESxBGtT/OeCvCZ4TA1JUPYgmhAx38tTPR9JaKy0S5H3evQpO/h2uWs2j6Yc/fjkpTQ==} + dependencies: + '@webassemblyjs/ast': 1.11.6 + '@webassemblyjs/helper-api-error': 1.11.6 + '@webassemblyjs/helper-wasm-bytecode': 1.11.6 + '@webassemblyjs/ieee754': 1.11.6 + '@webassemblyjs/leb128': 1.11.6 + '@webassemblyjs/utf8': 1.11.6 + /@webassemblyjs/wast-printer@1.11.1: resolution: {integrity: sha512-IQboUWM4eKzWW+N/jij2sRatKMh99QEelo3Eb2q0qXkvPRISAj8Qxtmw5itwqK+TTkBuUIE45AxYPToqPtL5gg==} dependencies: '@webassemblyjs/ast': 1.11.1 '@xtuc/long': 4.2.2 + /@webassemblyjs/wast-printer@1.11.6: + resolution: {integrity: sha512-JM7AhRcE+yW2GWYaKeHL5vt4xqee5N2WcezptmgyhNS+ScggqcT1OtXykhAb13Sn5Yas0j2uv9tHgrjwvzAP4A==} + dependencies: + '@webassemblyjs/ast': 1.11.6 + '@xtuc/long': 4.2.2 + /@webgpu/glslang@0.0.15: resolution: {integrity: sha512-niT+Prh3Aff8Uf1MVBVUsaNjFj9rJAKDXuoHIKiQbB+6IUP/3J3JIhBNyZ7lDhytvXxw6ppgnwKZdDJ08UMj4Q==} @@ -17959,6 +18051,14 @@ packages: acorn: ^8 dependencies: acorn: 8.8.2 + dev: true + + /acorn-import-assertions@1.9.0(acorn@8.8.2): + resolution: {integrity: sha512-cmMwop9x+8KFhxvKrKfPYmN6/pKTYYHBqLa0DfvVZcKMJWNyWLnaqND7dx/qn66R7ewM1UX5XMaDVP5wlVTaVA==} + peerDependencies: + acorn: ^8 + dependencies: + acorn: 8.8.2 /acorn-jsx@5.3.2(acorn@7.4.1): resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} @@ -19448,7 +19548,7 @@ packages: webpack: 5.75.0(esbuild@0.17.19)(uglify-js@3.17.4)(webpack-cli@5.0.1) dev: true - /babel-loader@9.1.2(webpack@5.76.1): + /babel-loader@9.1.2(webpack@5.88.2): resolution: {integrity: sha512-mN14niXW43tddohGl8HPu5yfQq70iUThvFL/4QzESA7GcZoC0eVOhvWdQ8+3UlSjaDE9MVtsW9mxDY07W7VpVA==} engines: {node: '>= 14.15.0'} peerDependencies: @@ -19460,7 +19560,7 @@ packages: dependencies: find-cache-dir: 3.3.2 schema-utils: 4.0.0 - webpack: 5.76.1(@swc/core@1.3.67)(uglify-js@3.17.4) + webpack: 5.88.2(@swc/core@1.3.67)(uglify-js@3.17.4) dev: true /babel-plugin-dynamic-import-node@2.3.3: @@ -21611,7 +21711,7 @@ packages: dependencies: toggle-selection: 1.0.6 - /copy-webpack-plugin@10.2.4(webpack@5.76.1): + /copy-webpack-plugin@10.2.4(webpack@5.88.2): resolution: {integrity: sha512-xFVltahqlsRcyyJqQbDY6EYTtyQZF9rf+JPjwHObLdPFMEISqkFkr7mFoVOC6BfYS/dNThyoQKvziugm+OnwBg==} engines: {node: '>= 12.20.0'} peerDependencies: @@ -21626,7 +21726,7 @@ packages: normalize-path: 3.0.0 schema-utils: 4.0.0 serialize-javascript: 6.0.0 - webpack: 5.76.1(@swc/core@1.3.67)(uglify-js@3.17.4) + webpack: 5.88.2(@swc/core@1.3.67)(uglify-js@3.17.4) dev: true /core-js-compat@3.27.1: @@ -21893,7 +21993,7 @@ packages: isobject: 3.0.1 dev: false - /css-loader@6.7.1(webpack@5.76.1): + /css-loader@6.7.1(webpack@5.88.2): resolution: {integrity: sha512-yB5CNFa14MbPJcomwNh3wLThtkZgcNyI2bNMRt8iE5Z8Vwl7f8vQXFAzn2HDOJvtDq2NTZBUGMSUNNyrv3/+cw==} engines: {node: '>= 12.13.0'} peerDependencies: @@ -21910,9 +22010,9 @@ packages: postcss-modules-values: 4.0.0(postcss@8.4.21) postcss-value-parser: 4.2.0 semver: 7.3.7 - webpack: 5.76.1(@swc/core@1.3.67)(uglify-js@3.17.4) + webpack: 5.88.2(@swc/core@1.3.67)(uglify-js@3.17.4) - /css-minimizer-webpack-plugin@4.0.0(webpack@5.76.1): + /css-minimizer-webpack-plugin@4.0.0(webpack@5.88.2): resolution: {integrity: sha512-7ZXXRzRHvofv3Uac5Y+RkWRNo0ZMlcg8e9/OtrqUYmwDWJo+qs67GvdeFrXLsFb7czKNwjQhPkM0avlIYl+1nA==} engines: {node: '>= 14.15.0'} peerDependencies: @@ -21939,7 +22039,7 @@ packages: schema-utils: 4.0.0 serialize-javascript: 6.0.0 source-map: 0.6.1 - webpack: 5.76.1(@swc/core@1.3.67)(uglify-js@3.17.4) + webpack: 5.88.2(@swc/core@1.3.67)(uglify-js@3.17.4) dev: true /css-prefers-color-scheme@6.0.3(postcss@8.4.21): @@ -23378,7 +23478,6 @@ packages: dependencies: graceful-fs: 4.2.11 tapable: 2.2.1 - dev: true /enhanced-resolve@5.9.3: resolution: {integrity: sha512-Bq9VSor+kjvW3f9/MiiR4eE3XYgOl7/rS8lnSxbRbF3kS0B2r+Y9w5krBWxZgDxASVZbdYrn5wT4j/Wb0J9qow==} @@ -23575,6 +23674,9 @@ packages: /es-module-lexer@0.9.3: resolution: {integrity: sha512-1HQ2M2sPtxwnvOvT1ZClHyQDiggdNjURWpY2we6aMKCQiUVxTmVs2UYPLIrD84sS+kMdUwfBSylbJPwNnBrnHQ==} + /es-module-lexer@1.3.1: + resolution: {integrity: sha512-JUFAyicQV9mXc3YRxPnDlrfBKpqt6hUYzz9/boprUJHs4e4KVr3XwOF70doO6gwXUor6EWZJAyWAfKki84t20Q==} + /es-set-tostringtag@2.0.1: resolution: {integrity: sha512-g3OMbtlwY3QewlqAiMLI47KywjWZoEytKr8pf6iTC8uJq5bIAH52Z9pnQ8pVL6whrCto53JZDuUIsifGeLorTg==} engines: {node: '>= 0.4'} @@ -25774,7 +25876,7 @@ packages: dependencies: flat-cache: 3.0.4 - /file-loader@6.2.0(webpack@5.76.1): + /file-loader@6.2.0(webpack@5.88.2): resolution: {integrity: sha512-qo3glqyTa61Ytg4u73GultjHGjdRyig3tG6lPtyX/jOEJvHif9uB0/OCI2Kif6ctF3caQTW2G5gym21oAsI4pw==} engines: {node: '>= 10.13.0'} peerDependencies: @@ -25785,7 +25887,7 @@ packages: dependencies: loader-utils: 2.0.4 schema-utils: 3.1.1 - webpack: 5.76.1(@swc/core@1.3.67)(uglify-js@3.17.4) + webpack: 5.88.2(@swc/core@1.3.67)(uglify-js@3.17.4) dev: true /file-name@0.1.0: @@ -26136,7 +26238,7 @@ packages: typescript: 4.8.4 dev: true - /fork-ts-checker-webpack-plugin@8.0.0(typescript@4.9.4)(webpack@5.76.1): + /fork-ts-checker-webpack-plugin@8.0.0(typescript@4.9.4)(webpack@5.88.2): resolution: {integrity: sha512-mX3qW3idpueT2klaQXBzrIM/pHw+T0B/V9KHEvNrqijTq9NFnMZU6oreVxDYcf33P8a5cW+67PjodNHthGnNVg==} engines: {node: '>=12.13.0', yarn: '>=1.0.0'} peerDependencies: @@ -26159,7 +26261,7 @@ packages: semver: 7.3.8 tapable: 2.2.1 typescript: 4.9.4 - webpack: 5.76.1(@swc/core@1.3.67)(uglify-js@3.17.4) + webpack: 5.88.2(@swc/core@1.3.67)(uglify-js@3.17.4) /form-data@2.3.3: resolution: {integrity: sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==} @@ -29896,7 +29998,7 @@ packages: - supports-color dev: true - /less-loader@11.1.0(webpack@5.76.1): + /less-loader@11.1.0(webpack@5.88.2): resolution: {integrity: sha512-C+uDBV7kS7W5fJlUjq5mPBeBVhYpTIm5gB09APT9o3n/ILeaXVsiSFTbZpTJCJwQ/Crczfn3DmfQFwxYusWFug==} engines: {node: '>= 14.15.0'} peerDependencies: @@ -29907,7 +30009,7 @@ packages: optional: true dependencies: klona: 2.0.5 - webpack: 5.76.1(@swc/core@1.3.67)(uglify-js@3.17.4) + webpack: 5.88.2(@swc/core@1.3.67)(uglify-js@3.17.4) dev: true /less@4.1.3: @@ -31515,7 +31617,7 @@ packages: resolution: {integrity: sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==} engines: {node: '>=4'} - /mini-css-extract-plugin@2.7.2(webpack@5.76.1): + /mini-css-extract-plugin@2.7.2(webpack@5.88.2): resolution: {integrity: sha512-EdlUizq13o0Pd+uCp+WO/JpkLvHRVGt97RqfeGhXqAcorYo1ypJSpkV+WDT0vY/kmh/p7wRdJNJtuyK540PXDw==} engines: {node: '>= 12.13.0'} peerDependencies: @@ -31525,7 +31627,7 @@ packages: optional: true dependencies: schema-utils: 4.0.0 - webpack: 5.76.1(@swc/core@1.3.67)(uglify-js@3.17.4) + webpack: 5.88.2(@swc/core@1.3.67)(uglify-js@3.17.4) dev: true /minimalistic-assert@1.0.1: @@ -34167,7 +34269,7 @@ packages: ts-node: 10.9.1(@types/node@18.11.18)(typescript@4.9.4) yaml: 1.10.2 - /postcss-loader@7.0.2(postcss@8.4.21)(webpack@5.76.1): + /postcss-loader@7.0.2(postcss@8.4.21)(webpack@5.88.2): resolution: {integrity: sha512-fUJzV/QH7NXUAqV8dWJ9Lg4aTkDCezpTS5HgJ2DvqznexTbSTxgi/dTECvTZ15BwKTtk8G/bqI/QTu2HPd3ZCg==} engines: {node: '>= 14.15.0'} peerDependencies: @@ -34183,7 +34285,7 @@ packages: klona: 2.0.5 postcss: 8.4.21 semver: 7.3.8 - webpack: 5.76.1(@swc/core@1.3.67)(uglify-js@3.17.4) + webpack: 5.88.2(@swc/core@1.3.67)(uglify-js@3.17.4) dev: true /postcss-logical@5.0.4(postcss@8.4.21): @@ -35291,7 +35393,7 @@ packages: resolution: {integrity: sha512-QFADYnsVoBMw1srW7OVKEYjG+MbIa49s54w1MA1EDY6r2r/sTcKKYqRX1f4GYvnXP7eN/Pe9HFcX+hwzmrXRHA==} dev: true - /purgecss-webpack-plugin@4.1.3(webpack@5.76.1): + /purgecss-webpack-plugin@4.1.3(webpack@5.88.2): resolution: {integrity: sha512-1OHS0WE935w66FjaFSlV06ycmn3/A8a6Q+iVUmmCYAujQ1HPdX+psMXUhASEW0uF1PYEpOlhMc5ApigVqYK08g==} peerDependencies: webpack: '*' @@ -35300,7 +35402,7 @@ packages: optional: true dependencies: purgecss: 4.1.3 - webpack: 5.76.1(@swc/core@1.3.67)(uglify-js@3.17.4) + webpack: 5.88.2(@swc/core@1.3.67)(uglify-js@3.17.4) webpack-sources: 3.2.3 dev: true @@ -41179,7 +41281,7 @@ packages: - supports-color dev: true - /sass-loader@13.2.0(webpack@5.76.1): + /sass-loader@13.2.0(webpack@5.88.2): resolution: {integrity: sha512-JWEp48djQA4nbZxmgC02/Wh0eroSUutulROUusYJO9P9zltRbNN80JCBHqRGzjd4cmZCa/r88xgfkjGD0TXsHg==} engines: {node: '>= 14.15.0'} peerDependencies: @@ -41202,7 +41304,7 @@ packages: dependencies: klona: 2.0.5 neo-async: 2.6.2 - webpack: 5.76.1(@swc/core@1.3.67)(uglify-js@3.17.4) + webpack: 5.88.2(@swc/core@1.3.67)(uglify-js@3.17.4) dev: true /sass@1.57.1: @@ -41281,6 +41383,14 @@ packages: ajv: 6.12.6 ajv-keywords: 3.5.2(ajv@6.12.6) + /schema-utils@3.3.0: + resolution: {integrity: sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg==} + engines: {node: '>= 10.13.0'} + dependencies: + '@types/json-schema': 7.0.12 + ajv: 6.12.6 + ajv-keywords: 3.5.2(ajv@6.12.6) + /schema-utils@4.0.0: resolution: {integrity: sha512-1edyXKgh6XnJsJSQ8mKWXnN/BVaIbFMLpouRUrXgVq7WYne5kw3MW7UPhO44uRXQSIpTSXoJbmrR2X0w9kUTyg==} engines: {node: '>= 12.13.0'} @@ -41447,6 +41557,11 @@ packages: dependencies: randombytes: 2.1.0 + /serialize-javascript@6.0.1: + resolution: {integrity: sha512-owoXEFjWRllis8/M1Q+Cw5k8ZH40e3zhp/ovX+Xr/vi1qj6QesbyXXViFbpNvWvPNAD62SutwEXavefrLJWj7w==} + dependencies: + randombytes: 2.1.0 + /serve-index@1.9.1: resolution: {integrity: sha512-pXHfKNP4qujrtteMrSBb0rc8HJ9Ms/GrXwcUtUtD5s4ewDJI8bT3Cz2zTVRMKtri49pLx2e0Ya8ziP5Ya2pZZw==} engines: {node: '>= 0.8.0'} @@ -42020,7 +42135,7 @@ packages: /specificity@0.4.1: resolution: {integrity: sha512-1klA3Gi5PD1Wv9Q0wUoOQN1IWAuPu0D1U03ThXTr0cJ20+/iq2tHSDnK7Kk/0LXJ1ztUB2/1Os0wKmfyNgUQfg==} - /speed-measure-webpack-plugin@1.5.0(webpack@5.76.1): + /speed-measure-webpack-plugin@1.5.0(webpack@5.88.2): resolution: {integrity: sha512-Re0wX5CtM6gW7bZA64ONOfEPEhwbiSF/vz6e2GvadjuaPrQcHTQdRGsD8+BE7iUOysXH8tIenkPCQBEcspXsNg==} engines: {node: '>=6.0.0'} peerDependencies: @@ -42030,7 +42145,7 @@ packages: optional: true dependencies: chalk: 4.1.2 - webpack: 5.76.1(@swc/core@1.3.67)(uglify-js@3.17.4) + webpack: 5.88.2(@swc/core@1.3.67)(uglify-js@3.17.4) dev: true /splaytree@3.1.1: @@ -42450,7 +42565,7 @@ packages: through: 2.3.8 dev: true - /style-loader@3.3.1(webpack@5.76.1): + /style-loader@3.3.1(webpack@5.88.2): resolution: {integrity: sha512-GPcQ+LDJbrcxHORTRes6Jy2sfvK2kS6hpSfI/fXhPt+spVzxF6LJ1dHLN9zIGmVaaP044YKaIatFaufENRiDoQ==} engines: {node: '>= 12.13.0'} peerDependencies: @@ -42459,7 +42574,7 @@ packages: webpack: optional: true dependencies: - webpack: 5.76.1(@swc/core@1.3.67)(uglify-js@3.17.4) + webpack: 5.88.2(@swc/core@1.3.67)(uglify-js@3.17.4) dev: true /style-mod@4.0.0: @@ -43174,7 +43289,7 @@ packages: supports-hyperlinks: 2.2.0 dev: true - /terser-webpack-plugin@5.3.6(@swc/core@1.3.67)(uglify-js@3.17.4)(webpack@5.76.1): + /terser-webpack-plugin@5.3.6(@swc/core@1.3.67)(uglify-js@3.17.4)(webpack@5.88.2): resolution: {integrity: sha512-kfLFk+PoLUQIbLmB1+PZDMRSZS99Mp+/MHqDNmMA6tOItzRt+Npe3E+fsMs5mfcM0wCtrrdU387UnV+vnSffXQ==} engines: {node: '>= 10.13.0'} peerDependencies: @@ -43199,7 +43314,8 @@ packages: serialize-javascript: 6.0.0 terser: 5.16.1 uglify-js: 3.17.4 - webpack: 5.76.1(@swc/core@1.3.67)(uglify-js@3.17.4) + webpack: 5.88.2(@swc/core@1.3.67)(uglify-js@3.17.4) + dev: true /terser-webpack-plugin@5.3.6(esbuild@0.17.19)(uglify-js@3.17.4)(webpack@5.75.0): resolution: {integrity: sha512-kfLFk+PoLUQIbLmB1+PZDMRSZS99Mp+/MHqDNmMA6tOItzRt+Npe3E+fsMs5mfcM0wCtrrdU387UnV+vnSffXQ==} @@ -43255,6 +43371,33 @@ packages: webpack: 5.76.1(uglify-js@3.17.4) dev: true + /terser-webpack-plugin@5.3.9(@swc/core@1.3.67)(uglify-js@3.17.4)(webpack@5.88.2): + resolution: {integrity: sha512-ZuXsqE07EcggTWQjXUj+Aot/OMcD0bMKGgF63f7UxYcu5/AJF53aIpK1YoP5xR9l6s/Hy2b+t1AM0bLNPRuhwA==} + engines: {node: '>= 10.13.0'} + peerDependencies: + '@swc/core': '*' + esbuild: '*' + uglify-js: '*' + webpack: ^5.1.0 + peerDependenciesMeta: + '@swc/core': + optional: true + esbuild: + optional: true + uglify-js: + optional: true + webpack: + optional: true + dependencies: + '@jridgewell/trace-mapping': 0.3.18 + '@swc/core': 1.3.67 + jest-worker: 27.5.1 + schema-utils: 3.3.0 + serialize-javascript: 6.0.1 + terser: 5.17.4 + uglify-js: 3.17.4 + webpack: 5.88.2(@swc/core@1.3.67)(uglify-js@3.17.4) + /terser@5.16.1: resolution: {integrity: sha512-xvQfyfA1ayT0qdK47zskQgRZeWLoOQ8JQ6mIgRGVNwZKdQMU+5FkCBjmv4QjcrTzyZquRw2FVtlJSRUmMKQslw==} engines: {node: '>=10'} @@ -44600,7 +44743,7 @@ packages: resolution: {integrity: sha512-Am1ousAhSLBeB9cG/7k7r2R0zj50uDRlZHPGbazid5s9rlF1F/QKYObEKSIunSjIOkJZqwRRLpvewjEkM7pSqg==} dev: true - /url-loader@4.1.1(file-loader@6.2.0)(webpack@5.76.1): + /url-loader@4.1.1(file-loader@6.2.0)(webpack@5.88.2): resolution: {integrity: sha512-3BTV812+AVHHOJQO8O5MkWgZ5aosP7GnROJwvzLS9hWDj00lZ6Z0wNak423Lp9PBZN05N+Jk/N5Si8jRAlGyWA==} engines: {node: '>= 10.13.0'} peerDependencies: @@ -44612,11 +44755,11 @@ packages: webpack: optional: true dependencies: - file-loader: 6.2.0(webpack@5.76.1) + file-loader: 6.2.0(webpack@5.88.2) loader-utils: 2.0.2 mime-types: 2.1.35 schema-utils: 3.1.1 - webpack: 5.76.1(@swc/core@1.3.67)(uglify-js@3.17.4) + webpack: 5.88.2(@swc/core@1.3.67)(uglify-js@3.17.4) dev: true /url-parse-lax@1.0.0: @@ -45354,7 +45497,7 @@ packages: schema-utils: 4.0.0 webpack: 5.75.0(esbuild@0.17.19)(uglify-js@3.17.4)(webpack-cli@5.0.1) - /webpack-dev-middleware@6.0.1(webpack@5.76.1): + /webpack-dev-middleware@6.0.1(webpack@5.88.2): resolution: {integrity: sha512-PZPZ6jFinmqVPJZbisfggDiC+2EeGZ1ZByyMP5sOFJcPPWSexalISz+cvm+j+oYPT7FIJyxT76esjnw9DhE5sw==} engines: {node: '>= 14.15.0'} peerDependencies: @@ -45368,7 +45511,7 @@ packages: mime-types: 2.1.35 range-parser: 1.2.1 schema-utils: 4.0.0 - webpack: 5.76.1(@swc/core@1.3.67)(uglify-js@3.17.4) + webpack: 5.88.2(@swc/core@1.3.67)(uglify-js@3.17.4) dev: true /webpack-dev-server@4.11.1(webpack-cli@5.0.1)(webpack@5.75.0): @@ -45421,7 +45564,7 @@ packages: - supports-color - utf-8-validate - /webpack-manifest-plugin@5.0.0(webpack@5.76.1): + /webpack-manifest-plugin@5.0.0(webpack@5.88.2): resolution: {integrity: sha512-8RQfMAdc5Uw3QbCQ/CBV/AXqOR8mt03B6GJmRbhWopE8GzRfEpn+k0ZuWywxW+5QZsffhmFDY1J6ohqJo+eMuw==} engines: {node: '>=12.22.0'} peerDependencies: @@ -45431,7 +45574,7 @@ packages: optional: true dependencies: tapable: 2.2.1 - webpack: 5.76.1(@swc/core@1.3.67)(uglify-js@3.17.4) + webpack: 5.88.2(@swc/core@1.3.67)(uglify-js@3.17.4) webpack-sources: 2.3.1 dev: true @@ -45498,7 +45641,7 @@ packages: - esbuild - uglify-js - /webpack@5.76.1(@swc/core@1.3.67)(uglify-js@3.17.4): + /webpack@5.76.1(uglify-js@3.17.4): resolution: {integrity: sha512-4+YIK4Abzv8172/SGqObnUjaIHjLEuUasz9EwQj/9xmPPkYJy2Mh03Q/lJfSD3YLzbxy5FeTq5Uw0323Oh6SJQ==} engines: {node: '>=10.13.0'} hasBin: true @@ -45529,16 +45672,17 @@ packages: neo-async: 2.6.2 schema-utils: 3.1.1 tapable: 2.2.1 - terser-webpack-plugin: 5.3.6(@swc/core@1.3.67)(uglify-js@3.17.4)(webpack@5.76.1) + terser-webpack-plugin: 5.3.6(uglify-js@3.17.4)(webpack@5.76.1) watchpack: 2.4.0 webpack-sources: 3.2.3 transitivePeerDependencies: - '@swc/core' - esbuild - uglify-js + dev: true - /webpack@5.76.1(uglify-js@3.17.4): - resolution: {integrity: sha512-4+YIK4Abzv8172/SGqObnUjaIHjLEuUasz9EwQj/9xmPPkYJy2Mh03Q/lJfSD3YLzbxy5FeTq5Uw0323Oh6SJQ==} + /webpack@5.88.2(@swc/core@1.3.67)(uglify-js@3.17.4): + resolution: {integrity: sha512-JmcgNZ1iKj+aiR0OvTYtWQqJwq37Pf683dY9bVORwVbUrDhLhdn/PlO2sHsFHPkj7sHNQF3JwaAkp49V+Sq1tQ==} engines: {node: '>=10.13.0'} hasBin: true peerDependencies: @@ -45548,36 +45692,35 @@ packages: optional: true dependencies: '@types/eslint-scope': 3.7.4 - '@types/estree': 0.0.51 - '@webassemblyjs/ast': 1.11.1 - '@webassemblyjs/wasm-edit': 1.11.1 - '@webassemblyjs/wasm-parser': 1.11.1 + '@types/estree': 1.0.1 + '@webassemblyjs/ast': 1.11.6 + '@webassemblyjs/wasm-edit': 1.11.6 + '@webassemblyjs/wasm-parser': 1.11.6 acorn: 8.8.2 - acorn-import-assertions: 1.8.0(acorn@8.8.2) + acorn-import-assertions: 1.9.0(acorn@8.8.2) browserslist: 4.21.5 chrome-trace-event: 1.0.3 - enhanced-resolve: 5.10.0 - es-module-lexer: 0.9.3 + enhanced-resolve: 5.15.0 + es-module-lexer: 1.3.1 eslint-scope: 5.1.1 events: 3.3.0 glob-to-regexp: 0.4.1 - graceful-fs: 4.2.10 + graceful-fs: 4.2.11 json-parse-even-better-errors: 2.3.1 loader-runner: 4.3.0 mime-types: 2.1.35 neo-async: 2.6.2 - schema-utils: 3.1.1 + schema-utils: 3.3.0 tapable: 2.2.1 - terser-webpack-plugin: 5.3.6(uglify-js@3.17.4)(webpack@5.76.1) + terser-webpack-plugin: 5.3.9(@swc/core@1.3.67)(uglify-js@3.17.4)(webpack@5.88.2) watchpack: 2.4.0 webpack-sources: 3.2.3 transitivePeerDependencies: - '@swc/core' - esbuild - uglify-js - dev: true - /webpackbar@5.0.2(webpack@5.76.1): + /webpackbar@5.0.2(webpack@5.88.2): resolution: {integrity: sha512-BmFJo7veBDgQzfWXl/wwYXr/VFus0614qZ8i9znqcl9fnEdiVkdbi0TedLQ6xAK92HZHDJ0QmyQ0fmuZPAgCYQ==} engines: {node: '>=12'} peerDependencies: @@ -45590,7 +45733,7 @@ packages: consola: 2.15.3 pretty-time: 1.1.0 std-env: 3.3.1 - webpack: 5.76.1(@swc/core@1.3.67)(uglify-js@3.17.4) + webpack: 5.88.2(@swc/core@1.3.67)(uglify-js@3.17.4) dev: true /webpod@0.0.2: