Unverified Commit 84c299bd authored by Tobias Koppers's avatar Tobias Koppers Committed by GitHub

upgrade webpack to 5.53.0 (#29168)

parent 50c75282
......@@ -2,7 +2,7 @@
"dependencies": {
"schema-utils3": "npm:schema-utils@3.0.0",
"webpack-sources3": "npm:webpack-sources@3.2.0",
"webpack5": "npm:webpack@5.52.0"
"webpack5": "npm:webpack@5.53.0"
},
"resolutions": {
"browserslist": "4.16.6",
......
......@@ -23,15 +23,20 @@
resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.50.tgz#1e0caa9364d3fccd2931c3ed96fdbeaa5d4cca83"
integrity sha512-C6N5s2ZFtuZRj54k2/zyRhNDjJwwcViAM3Nbm8zjBpbqAdZ00mr0CFxvSKeO8Y/e03WVFLpQMdHYVfUd6SB+Hw==
"@types/json-schema@*", "@types/json-schema@^7.0.6", "@types/json-schema@^7.0.8":
"@types/json-schema@*", "@types/json-schema@^7.0.8":
version "7.0.9"
resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.9.tgz#97edc9037ea0c38585320b28964dde3b39e4660d"
integrity sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ==
"@types/json-schema@^7.0.6":
version "7.0.8"
resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.8.tgz#edf1bf1dbf4e04413ca8e5b17b3b7d7d54b59818"
integrity sha512-YSBPTLTVm2e2OoQIDYx8HaeWJ5tTToLH67kXR7zYNGupXMEHa2++G8k+DczX2cFVgalypqtyZIcU19AFcmOpmg==
"@types/node@*":
version "16.4.4"
resolved "https://registry.yarnpkg.com/@types/node/-/node-16.4.4.tgz#bb0744c1dcc1fc374f51d3fd41d028331a2420d4"
integrity sha512-BH/jX0HjzElFCQdAwaEMwuGBQwm6ViDZ00X6LKdnRRmGWOzkWugEH4+7a0BwfHQ8DfPPCSd/mdsm3Nu8FKFu0w==
version "16.9.1"
resolved "https://registry.yarnpkg.com/@types/node/-/node-16.9.1.tgz#0611b37db4246c937feef529ddcc018cf8e35708"
integrity sha512-QpLcX9ZSsq3YYUUnD3nFDY8H7wctAhQj/TFKL8Ya8v5fMm3CFXxo8zStsLAl780ltoYoo1WvKUVGBQK+1ifr7g==
"@webassemblyjs/ast@1.11.1":
version "1.11.1"
......@@ -170,9 +175,9 @@ acorn-import-assertions@^1.7.6:
integrity sha512-FlVvVFA1TX6l3lp8VjDnYYq7R1nyW6x3svAt4nDgrWQ9SBaSh9CnbwgSUTasgfNfOG5HlM1ehugCvM+hjo56LA==
acorn@^8.4.1:
version "8.4.1"
resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.4.1.tgz#56c36251fc7cabc7096adc18f05afe814321a28c"
integrity sha512-asabaBSkEKosYKMITunzX177CXxQ4Q8BSSzMTKD+FefUhipQC70gfW5SiUDhYQ3vk8G+81HqQk7Fv9OXwwn9KA==
version "8.5.0"
resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.5.0.tgz#4512ccb99b3698c752591e9bb4472e38ad43cee2"
integrity sha512-yXbYeFy+jUuYd3/CDcg2NkIYE991XYX/bje7LmjJigUciaeO1JR4XxXgCIV1/Zc/dRuFEyw1L0pbA+qynJkW5Q==
ajv-keywords@^3.5.2:
version "3.5.2"
......@@ -201,9 +206,9 @@ browserslist@4.16.6, browserslist@^4.14.5:
node-releases "^1.1.71"
buffer-from@^1.0.0:
version "1.1.1"
resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef"
integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==
version "1.1.2"
resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5"
integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==
caniuse-lite@1.0.30001228, caniuse-lite@^1.0.30001219:
version "1.0.30001228"
......@@ -216,9 +221,9 @@ chrome-trace-event@^1.0.2:
integrity sha512-p3KULyQg4S7NIHixdwbGX+nFHkoBiA4YQmyWtjb8XngSKV124nJmRysgAeujbUVb15vh+RvFUfCPqU7rXk+hZg==
colorette@^1.2.2:
version "1.2.2"
resolved "https://registry.yarnpkg.com/colorette/-/colorette-1.2.2.tgz#cbcc79d5e99caea2dbf10eb3a26fd8b3e6acfa94"
integrity sha512-MKGMzyfeuutC/ZJ1cba9NqcNpfeqMUcYmyF1ZFY6/Cn7CNSAKx6a+s48sqLqyAiZuaP2TcqMhoo+dlwFnVxT9w==
version "1.4.0"
resolved "https://registry.yarnpkg.com/colorette/-/colorette-1.4.0.tgz#5190fbb87276259a86ad700bff2c6d6faa3fca40"
integrity sha512-Y2oEozpomLn7Q3HFP7dpww7AtMJplbM9lGZP6RDfHqmbeRjiwRg4n6VM6j4KLmRke85uWEI7JqF17f3pqdRA0g==
commander@^2.20.0:
version "2.20.3"
......@@ -226,9 +231,9 @@ commander@^2.20.0:
integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==
electron-to-chromium@^1.3.723:
version "1.3.789"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.789.tgz#c3ea060ba1e36e41c87943a47ed2daadc545be2b"
integrity sha512-lK4xn6C6ZF1kgLaC/EhOtC1MSKENExj3rMwGVnBTfHW81Z/Hb1Rge5YaWawN/YOXy3xCaESuE4KWSD50kOZ9rQ==
version "1.3.840"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.840.tgz#3f2a1df97015d9b1db5d86a4c6bd4cdb920adcbb"
integrity sha512-yRoUmTLDJnkIJx23xLY7GbSvnmDCq++NSuxHDQ0jiyDJ9YZBUGJcrdUqm+ZwZFzMbCciVzfem2N2AWiHJcWlbw==
enhanced-resolve@^5.8.0:
version "5.8.2"
......@@ -294,19 +299,19 @@ glob-to-regexp@^0.4.1:
integrity sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==
graceful-fs@^4.1.2, graceful-fs@^4.2.4:
version "4.2.6"
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.6.tgz#ff040b2b0853b23c3d31027523706f1885d76bee"
integrity sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ==
version "4.2.8"
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.8.tgz#e412b8d33f5e006593cbd3cee6df9f2cebbe802a"
integrity sha512-qkIilPUYcNhJpd33n0GBXTB1MMPp14TxEsEs0pTrsSVucApsYzW5V+Q8Qxhik6KU3evy+qkAAowTByymK0avdg==
has-flag@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b"
integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==
jest-worker@^27.0.2:
version "27.0.6"
resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-27.0.6.tgz#a5fdb1e14ad34eb228cfe162d9f729cdbfa28aed"
integrity sha512-qupxcj/dRuA3xHPMUd40gr2EaAurFbkwzOh7wfPaeE9id7hyjURRQoqNfHifHK3XjJU6YJJUQKILGUnwGPEOCA==
jest-worker@^27.0.6:
version "27.2.0"
resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-27.2.0.tgz#11eef39f1c88f41384ca235c2f48fe50bc229bc0"
integrity sha512-laB0ZVIBz+voh/QQy9dmUuuDsadixeerrKqyVpgPz+CCWiOYjOBabUXHIXZhsdvkWbLqSHbgkAHWl5cg24Q6RA==
dependencies:
"@types/node" "*"
merge-stream "^2.0.0"
......@@ -350,9 +355,9 @@ neo-async@^2.6.2:
integrity sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==
node-releases@^1.1.71:
version "1.1.73"
resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.73.tgz#dd4e81ddd5277ff846b80b52bb40c49edf7a7b20"
integrity sha512-uW7fodD6pyW2FZNZnp/Z3hvWKeEW1Y8R1+1CnErE8cXFXzl5blBOoVB41CvMer6P6Q0S5FXDwcHgFd1Wj0U9zg==
version "1.1.75"
resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.75.tgz#6dd8c876b9897a1b8e5a02de26afa79bb54ebbfe"
integrity sha512-Qe5OUajvqrqDSy6wrWFmMwfJ0jVgwiw4T3KqmbTcZ62qW0gQkheXYhcFM1+lOVcGUoRxcEcfyvFMAnDgaF1VWw==
p-limit@^3.1.0:
version "3.1.0"
......@@ -387,7 +392,7 @@ safe-buffer@^5.1.0:
ajv "^6.12.5"
ajv-keywords "^3.5.2"
schema-utils@^3.0.0, schema-utils@^3.1.0:
schema-utils@^3.1.0, schema-utils@^3.1.1:
version "3.1.1"
resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-3.1.1.tgz#bc74c4b6b6995c1d88f76a8b77bea7219e0c8281"
integrity sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw==
......@@ -403,10 +408,10 @@ serialize-javascript@^6.0.0:
dependencies:
randombytes "^2.1.0"
source-map-support@~0.5.19:
version "0.5.19"
resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.19.tgz#a98b62f86dcaf4f67399648c085291ab9e8fed61"
integrity sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==
source-map-support@~0.5.20:
version "0.5.20"
resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.20.tgz#12166089f8f5e5e8c56926b377633392dd2cb6c9"
integrity sha512-n1lZZ8Ve4ksRqizaBQgxXDgKwttHDhyfQjA6YZZn8+AroHbsIz+JjwxQDxbp+7y5OYCI8t1Yk7etjD9CRd2hIw==
dependencies:
buffer-from "^1.0.0"
source-map "^0.6.0"
......@@ -429,30 +434,30 @@ supports-color@^8.0.0:
has-flag "^4.0.0"
tapable@^2.1.1, tapable@^2.2.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/tapable/-/tapable-2.2.0.tgz#5c373d281d9c672848213d0e037d1c4165ab426b"
integrity sha512-FBk4IesMV1rBxX2tfiK8RAmogtWn53puLOQlvO8XuwlgxcYbP4mVPS9Ph4aeamSyyVjOl24aYWAuc8U5kCVwMw==
version "2.2.1"
resolved "https://registry.yarnpkg.com/tapable/-/tapable-2.2.1.tgz#1967a73ef4060a82f12ab96af86d52fdb76eeca0"
integrity sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==
terser-webpack-plugin@^5.1.3:
version "5.1.4"
resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-5.1.4.tgz#c369cf8a47aa9922bd0d8a94fe3d3da11a7678a1"
integrity sha512-C2WkFwstHDhVEmsmlCxrXUtVklS+Ir1A7twrYzrDrQQOIMOaVAYykaoo/Aq1K0QRkMoY2hhvDQY1cm4jnIMFwA==
version "5.2.4"
resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-5.2.4.tgz#ad1be7639b1cbe3ea49fab995cbe7224b31747a1"
integrity sha512-E2CkNMN+1cho04YpdANyRrn8CyN4yMy+WdFKZIySFZrGXZxJwJP6PMNGGc/Mcr6qygQHUUqRxnAPmi0M9f00XA==
dependencies:
jest-worker "^27.0.2"
jest-worker "^27.0.6"
p-limit "^3.1.0"
schema-utils "^3.0.0"
schema-utils "^3.1.1"
serialize-javascript "^6.0.0"
source-map "^0.6.1"
terser "^5.7.0"
terser "^5.7.2"
terser@^5.7.0:
version "5.7.1"
resolved "https://registry.yarnpkg.com/terser/-/terser-5.7.1.tgz#2dc7a61009b66bb638305cb2a824763b116bf784"
integrity sha512-b3e+d5JbHAe/JSjwsC3Zn55wsBIM7AsHLjKxT31kGCldgbpFePaFo+PiddtO6uwRZWRw7sPXmAN8dTW61xmnSg==
terser@^5.7.2:
version "5.8.0"
resolved "https://registry.yarnpkg.com/terser/-/terser-5.8.0.tgz#c6d352f91aed85cc6171ccb5e84655b77521d947"
integrity sha512-f0JH+6yMpneYcRJN314lZrSwu9eKkUFEHLN/kNy8ceh8gaRiLgFPJqrB9HsXjhEGdv4e/ekjTOFxIlL6xlma8A==
dependencies:
commander "^2.20.0"
source-map "~0.7.2"
source-map-support "~0.5.19"
source-map-support "~0.5.20"
uri-js@^4.2.2:
version "4.4.1"
......@@ -475,10 +480,10 @@ watchpack@^2.2.0:
resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-3.2.0.tgz#b16973bcf844ebcdb3afde32eda1c04d0b90f89d"
integrity sha512-fahN08Et7P9trej8xz/Z7eRu8ltyiygEo/hnRi9KqBUs80KeDcnf96ZJo++ewWd84fEf3xSX9bp4ZS9hbw0OBw==
"webpack5@npm:webpack@5.52.0":
version "5.52.0"
resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.52.0.tgz#88d997c2c3ebb62abcaa453d2a26e0fd917c71a3"
integrity sha512-yRZOat8jWGwBwHpco3uKQhVU7HYaNunZiJ4AkAVQkPCUGoZk/tiIXiwG+8HIy/F+qsiZvSOa+GLQOj3q5RKRYg==
"webpack5@npm:webpack@5.53.0":
version "5.53.0"
resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.53.0.tgz#f463cd9c6fc1356ae4b9b7ac911fd1f5b2df86af"
integrity sha512-RZ1Z3z3ni44snoWjfWeHFyzvd9HMVYDYC5VXmlYUT6NWgEOWdCNpad5Fve2CzzHoRED7WtsKe+FCyP5Vk4pWiQ==
dependencies:
"@types/eslint-scope" "^3.7.0"
"@types/estree" "^0.0.50"
......
......@@ -34,30 +34,6 @@ module.exports = {"i8":"4.3.0"};
/***/ }),
/***/ 11840:
/***/ (function(module) {
"use strict";
module.exports = JSON.parse("{\"additionalProperties\":false,\"definitions\":{\"file-conditions\":{\"anyOf\":[{\"instanceof\":\"RegExp\"},{\"type\":\"string\"}]}},\"properties\":{\"test\":{\"anyOf\":[{\"$ref\":\"#/definitions/file-conditions\"},{\"items\":{\"anyOf\":[{\"$ref\":\"#/definitions/file-conditions\"}]},\"type\":\"array\"}]},\"include\":{\"anyOf\":[{\"$ref\":\"#/definitions/file-conditions\"},{\"items\":{\"anyOf\":[{\"$ref\":\"#/definitions/file-conditions\"}]},\"type\":\"array\"}]},\"exclude\":{\"anyOf\":[{\"$ref\":\"#/definitions/file-conditions\"},{\"items\":{\"anyOf\":[{\"$ref\":\"#/definitions/file-conditions\"}]},\"type\":\"array\"}]},\"chunkFilter\":{\"instanceof\":\"Function\"},\"cache\":{\"anyOf\":[{\"type\":\"boolean\"},{\"type\":\"string\"}]},\"cacheKeys\":{\"instanceof\":\"Function\"},\"parallel\":{\"anyOf\":[{\"type\":\"boolean\"},{\"type\":\"integer\"}]},\"sourceMap\":{\"type\":\"boolean\"},\"minify\":{\"instanceof\":\"Function\"},\"terserOptions\":{\"additionalProperties\":true,\"type\":\"object\"},\"extractComments\":{\"anyOf\":[{\"type\":\"boolean\"},{\"type\":\"string\"},{\"instanceof\":\"RegExp\"},{\"instanceof\":\"Function\"},{\"additionalProperties\":false,\"properties\":{\"condition\":{\"anyOf\":[{\"type\":\"boolean\"},{\"type\":\"string\"},{\"instanceof\":\"RegExp\"},{\"instanceof\":\"Function\"}]},\"filename\":{\"anyOf\":[{\"type\":\"string\"},{\"instanceof\":\"Function\"}]},\"banner\":{\"anyOf\":[{\"type\":\"boolean\"},{\"type\":\"string\"},{\"instanceof\":\"Function\"}]}},\"type\":\"object\"}]},\"warningsFilter\":{\"instanceof\":\"Function\"}},\"type\":\"object\"}");
/***/ }),
/***/ 92203:
/***/ (function(module) {
"use strict";
module.exports = JSON.parse("{\"name\":\"terser\",\"description\":\"JavaScript parser, mangler/compressor and beautifier toolkit for ES6+\",\"homepage\":\"https://terser.org\",\"author\":\"Mihai Bazon <mihai.bazon@gmail.com> (http://lisperator.net/)\",\"license\":\"BSD-2-Clause\",\"version\":\"4.8.0\",\"engines\":{\"node\":\">=6.0.0\"},\"maintainers\":[\"Fábio Santos <fabiosantosart@gmail.com>\"],\"repository\":\"https://github.com/terser/terser\",\"main\":\"dist/bundle.min.js\",\"types\":\"tools/terser.d.ts\",\"bin\":{\"terser\":\"bin/terser\"},\"files\":[\"bin\",\"dist\",\"tools\",\"LICENSE\",\"README.md\",\"CHANGELOG.md\",\"PATRONS.md\"],\"dependencies\":{\"commander\":\"^2.20.0\",\"source-map\":\"~0.6.1\",\"source-map-support\":\"~0.5.12\"},\"devDependencies\":{\"acorn\":\"^7.1.1\",\"astring\":\"^1.4.1\",\"eslint\":\"^6.3.0\",\"eslump\":\"^2.0.0\",\"mocha\":\"^7.1.2\",\"mochallel\":\"^2.0.0\",\"pre-commit\":\"^1.2.2\",\"rimraf\":\"^3.0.0\",\"rollup\":\"2.0.6\",\"rollup-plugin-terser\":\"5.3.0\",\"semver\":\"^7.1.3\"},\"scripts\":{\"test\":\"npm run build -- --configTest && node test/run-tests.js\",\"test:compress\":\"npm run build -- --configTest && node test/compress.js\",\"test:mocha\":\"npm run build -- --configTest && node test/mocha.js\",\"lint\":\"eslint lib\",\"lint-fix\":\"eslint --fix lib\",\"build\":\"rimraf dist/* && rollup --config --silent\",\"prepare\":\"npm run build\",\"postversion\":\"echo 'Remember to update the changelog!'\"},\"keywords\":[\"uglify\",\"terser\",\"uglify-es\",\"uglify-js\",\"minify\",\"minifier\",\"javascript\",\"ecmascript\",\"es5\",\"es6\",\"es7\",\"es8\",\"es2015\",\"es2016\",\"es2017\",\"async\",\"await\"],\"eslintConfig\":{\"parserOptions\":{\"sourceType\":\"module\"},\"env\":{\"es6\":true},\"globals\":{\"describe\":false,\"it\":false,\"require\":false,\"global\":false,\"process\":false},\"rules\":{\"brace-style\":[\"error\",\"1tbs\",{\"allowSingleLine\":true}],\"quotes\":[\"error\",\"double\",\"avoid-escape\"],\"no-debugger\":\"error\",\"no-undef\":\"error\",\"no-unused-vars\":[\"error\",{\"varsIgnorePattern\":\"^_$\"}],\"no-tabs\":\"error\",\"semi\":[\"error\",\"always\"],\"no-extra-semi\":\"error\",\"no-irregular-whitespace\":\"error\",\"space-before-blocks\":[\"error\",\"always\"]}},\"pre-commit\":[\"lint-fix\",\"test\"]}");
/***/ }),
/***/ 9122:
/***/ (function(module) {
"use strict";
module.exports = {"i8":"1.4.4"};
/***/ }),
/***/ 11335:
/***/ (function(module) {
......@@ -54753,14 +54729,6 @@ function nextTick(fn, arg1, arg2, arg3) {
return prr
})
/***/ }),
/***/ 79822:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
module.exports = __webpack_require__(76417).randomBytes
/***/ }),
/***/ 42770:
......@@ -58328,252 +58296,6 @@ function isRegExp (x) {
}
/***/ }),
/***/ 85841:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
"use strict";
/*
Copyright (c) 2014, Yahoo! Inc. All rights reserved.
Copyrights licensed under the New BSD License.
See the accompanying LICENSE file for terms.
*/
var randomBytes = __webpack_require__(79822);
// Generate an internal UID to make the regexp pattern harder to guess.
var UID_LENGTH = 16;
var UID = generateUID();
var PLACE_HOLDER_REGEXP = new RegExp('(\\\\)?"@__(F|R|D|M|S|U|I)-' + UID + '-(\\d+)__@"', 'g');
var IS_NATIVE_CODE_REGEXP = /\{\s*\[native code\]\s*\}/g;
var IS_PURE_FUNCTION = /function.*?\(/;
var IS_ARROW_FUNCTION = /.*?=>.*?/;
var UNSAFE_CHARS_REGEXP = /[<>\/\u2028\u2029]/g;
var RESERVED_SYMBOLS = ['*', 'async'];
// Mapping of unsafe HTML and invalid JavaScript line terminator chars to their
// Unicode char counterparts which are safe to use in JavaScript strings.
var ESCAPED_CHARS = {
'<' : '\\u003C',
'>' : '\\u003E',
'/' : '\\u002F',
'\u2028': '\\u2028',
'\u2029': '\\u2029'
};
function escapeUnsafeChars(unsafeChar) {
return ESCAPED_CHARS[unsafeChar];
}
function generateUID() {
var bytes = randomBytes(UID_LENGTH);
var result = '';
for(var i=0; i<UID_LENGTH; ++i) {
result += bytes[i].toString(16);
}
return result;
}
function deleteFunctions(obj){
var functionKeys = [];
for (var key in obj) {
if (typeof obj[key] === "function") {
functionKeys.push(key);
}
}
for (var i = 0; i < functionKeys.length; i++) {
delete obj[functionKeys[i]];
}
}
module.exports = function serialize(obj, options) {
options || (options = {});
// Backwards-compatibility for `space` as the second argument.
if (typeof options === 'number' || typeof options === 'string') {
options = {space: options};
}
var functions = [];
var regexps = [];
var dates = [];
var maps = [];
var sets = [];
var undefs = [];
var infinities= [];
// Returns placeholders for functions and regexps (identified by index)
// which are later replaced by their string representation.
function replacer(key, value) {
// For nested function
if(options.ignoreFunction){
deleteFunctions(value);
}
if (!value && value !== undefined) {
return value;
}
// If the value is an object w/ a toJSON method, toJSON is called before
// the replacer runs, so we use this[key] to get the non-toJSONed value.
var origValue = this[key];
var type = typeof origValue;
if (type === 'object') {
if(origValue instanceof RegExp) {
return '@__R-' + UID + '-' + (regexps.push(origValue) - 1) + '__@';
}
if(origValue instanceof Date) {
return '@__D-' + UID + '-' + (dates.push(origValue) - 1) + '__@';
}
if(origValue instanceof Map) {
return '@__M-' + UID + '-' + (maps.push(origValue) - 1) + '__@';
}
if(origValue instanceof Set) {
return '@__S-' + UID + '-' + (sets.push(origValue) - 1) + '__@';
}
}
if (type === 'function') {
return '@__F-' + UID + '-' + (functions.push(origValue) - 1) + '__@';
}
if (type === 'undefined') {
return '@__U-' + UID + '-' + (undefs.push(origValue) - 1) + '__@';
}
if (type === 'number' && !isNaN(origValue) && !isFinite(origValue)) {
return '@__I-' + UID + '-' + (infinities.push(origValue) - 1) + '__@';
}
return value;
}
function serializeFunc(fn) {
var serializedFn = fn.toString();
if (IS_NATIVE_CODE_REGEXP.test(serializedFn)) {
throw new TypeError('Serializing native function: ' + fn.name);
}
// pure functions, example: {key: function() {}}
if(IS_PURE_FUNCTION.test(serializedFn)) {
return serializedFn;
}
// arrow functions, example: arg1 => arg1+5
if(IS_ARROW_FUNCTION.test(serializedFn)) {
return serializedFn;
}
var argsStartsAt = serializedFn.indexOf('(');
var def = serializedFn.substr(0, argsStartsAt)
.trim()
.split(' ')
.filter(function(val) { return val.length > 0 });
var nonReservedSymbols = def.filter(function(val) {
return RESERVED_SYMBOLS.indexOf(val) === -1
});
// enhanced literal objects, example: {key() {}}
if(nonReservedSymbols.length > 0) {
return (def.indexOf('async') > -1 ? 'async ' : '') + 'function'
+ (def.join('').indexOf('*') > -1 ? '*' : '')
+ serializedFn.substr(argsStartsAt);
}
// arrow functions
return serializedFn;
}
// Check if the parameter is function
if (options.ignoreFunction && typeof obj === "function") {
obj = undefined;
}
// Protects against `JSON.stringify()` returning `undefined`, by serializing
// to the literal string: "undefined".
if (obj === undefined) {
return String(obj);
}
var str;
// Creates a JSON string representation of the value.
// NOTE: Node 0.12 goes into slow mode with extra JSON.stringify() args.
if (options.isJSON && !options.space) {
str = JSON.stringify(obj);
} else {
str = JSON.stringify(obj, options.isJSON ? null : replacer, options.space);
}
// Protects against `JSON.stringify()` returning `undefined`, by serializing
// to the literal string: "undefined".
if (typeof str !== 'string') {
return String(str);
}
// Replace unsafe HTML and invalid JavaScript line terminator chars with
// their safe Unicode char counterpart. This _must_ happen before the
// regexps and functions are serialized and added back to the string.
if (options.unsafe !== true) {
str = str.replace(UNSAFE_CHARS_REGEXP, escapeUnsafeChars);
}
if (functions.length === 0 && regexps.length === 0 && dates.length === 0 && maps.length === 0 && sets.length === 0 && undefs.length === 0 && infinities.length === 0) {
return str;
}
// Replaces all occurrences of function, regexp, date, map and set placeholders in the
// JSON string with their string representations. If the original value can
// not be found, then `undefined` is used.
return str.replace(PLACE_HOLDER_REGEXP, function (match, backSlash, type, valueIndex) {
// The placeholder may not be preceded by a backslash. This is to prevent
// replacing things like `"a\"@__R-<UID>-0__@"` and thus outputting
// invalid JS.
if (backSlash) {
return match;
}
if (type === 'D') {
return "new Date(\"" + dates[valueIndex].toISOString() + "\")";
}
if (type === 'R') {
return "new RegExp(" + serialize(regexps[valueIndex].source) + ", \"" + regexps[valueIndex].flags + "\")";
}
if (type === 'M') {
return "new Map(" + serialize(Array.from(maps[valueIndex].entries()), options) + ")";
}
if (type === 'S') {
return "new Set(" + serialize(Array.from(sets[valueIndex].values()), options) + ")";
}
if (type === 'U') {
return 'undefined'
}
if (type === 'I') {
return infinities[valueIndex];
}
var fn = functions[valueIndex];
return serializeFunc(fn);
});
}
/***/ }),
/***/ 34857:
......@@ -62151,707 +61873,6 @@ function extend(Parent, extendFn) {
module.exports = extend;
/***/ }),
/***/ 16326:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports.default = void 0;
var _os = _interopRequireDefault(__webpack_require__(12087));
var _cacache = _interopRequireDefault(__webpack_require__(36801));
var _findCacheDir = _interopRequireDefault(__webpack_require__(61844));
var _workerFarm = _interopRequireDefault(__webpack_require__(18921));
var _serializeJavascript = _interopRequireDefault(__webpack_require__(85841));
var _isWsl = _interopRequireDefault(__webpack_require__(47543));
var _minify = _interopRequireDefault(__webpack_require__(30787));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const worker = __webpack_require__.ab + "worker.js";
class TaskRunner {
constructor(options = {}) {
const {
cache,
parallel
} = options;
this.cacheDir = cache === true ? (0, _findCacheDir.default)({
name: 'terser-webpack-plugin'
}) || _os.default.tmpdir() : cache; // In some cases cpus() returns undefined
// https://github.com/nodejs/node/issues/19022
const cpus = _os.default.cpus() || {
length: 1
}; // WSL sometimes freezes, error seems to be on the WSL side
// https://github.com/webpack-contrib/terser-webpack-plugin/issues/21
this.maxConcurrentWorkers = _isWsl.default ? 1 : parallel === true ? cpus.length - 1 : Math.min(Number(parallel) || 0, cpus.length - 1);
}
run(tasks, callback) {
/* istanbul ignore if */
if (!tasks.length) {
callback(null, []);
return;
}
if (this.maxConcurrentWorkers > 1) {
const workerOptions = process.platform === 'win32' ? {
maxConcurrentWorkers: this.maxConcurrentWorkers,
maxConcurrentCallsPerWorker: 1
} : {
maxConcurrentWorkers: this.maxConcurrentWorkers
};
this.workers = (0, _workerFarm.default)(workerOptions, __webpack_require__.ab + "worker.js");
this.boundWorkers = (options, cb) => {
try {
this.workers((0, _serializeJavascript.default)(options), cb);
} catch (error) {
// worker-farm can fail with ENOMEM or something else
cb(error);
}
};
} else {
this.boundWorkers = (options, cb) => {
try {
cb(null, (0, _minify.default)(options));
} catch (error) {
cb(error);
}
};
}
let toRun = tasks.length;
const results = [];
const step = (index, data) => {
toRun -= 1;
results[index] = data;
if (!toRun) {
callback(null, results);
}
};
tasks.forEach((task, index) => {
const enqueue = () => {
this.boundWorkers(task, (error, data) => {
const result = error ? {
error
} : data;
const done = () => step(index, result);
if (this.cacheDir && !result.error) {
_cacache.default.put(this.cacheDir, (0, _serializeJavascript.default)(task.cacheKeys), JSON.stringify(data)).then(done, done);
} else {
done();
}
});
};
if (this.cacheDir) {
_cacache.default.get(this.cacheDir, (0, _serializeJavascript.default)(task.cacheKeys)).then(({
data
}) => step(index, JSON.parse(data)), enqueue);
} else {
enqueue();
}
});
}
exit() {
if (this.workers) {
_workerFarm.default.end(this.workers);
}
}
}
exports.default = TaskRunner;
/***/ }),
/***/ 89301:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
"use strict";
const plugin = __webpack_require__(43884);
module.exports = plugin.default;
/***/ }),
/***/ 43884:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports.default = void 0;
var _crypto = _interopRequireDefault(__webpack_require__(76417));
var _path = _interopRequireDefault(__webpack_require__(85622));
var _sourceMap = __webpack_require__(96241);
var _webpackSources = __webpack_require__(53665);
var _RequestShortener = _interopRequireDefault(__webpack_require__(54254));
var _ModuleFilenameHelpers = _interopRequireDefault(__webpack_require__(71474));
var _schemaUtils = _interopRequireDefault(__webpack_require__(33225));
var _serializeJavascript = _interopRequireDefault(__webpack_require__(85841));
var _package = _interopRequireDefault(__webpack_require__(92203));
var _options = _interopRequireDefault(__webpack_require__(11840));
var _TaskRunner = _interopRequireDefault(__webpack_require__(16326));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
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; }
const warningRegex = /\[.+:([0-9]+),([0-9]+)\]/;
class TerserPlugin {
constructor(options = {}) {
(0, _schemaUtils.default)(_options.default, options, 'Terser Plugin');
const {
minify,
terserOptions = {},
test = /\.m?js(\?.*)?$/i,
chunkFilter = () => true,
warningsFilter = () => true,
extractComments = false,
sourceMap = false,
cache = false,
cacheKeys = defaultCacheKeys => defaultCacheKeys,
parallel = false,
include,
exclude
} = options;
this.options = {
test,
chunkFilter,
warningsFilter,
extractComments,
sourceMap,
cache,
cacheKeys,
parallel,
include,
exclude,
minify,
terserOptions: _objectSpread({
output: {
comments: extractComments ? false : /^\**!|@preserve|@license|@cc_on/i
}
}, terserOptions)
};
}
static isSourceMap(input) {
// All required options for `new SourceMapConsumer(...options)`
// https://github.com/mozilla/source-map#new-sourcemapconsumerrawsourcemap
return Boolean(input && input.version && input.sources && Array.isArray(input.sources) && typeof input.mappings === 'string');
}
static buildSourceMap(inputSourceMap) {
if (!inputSourceMap || !TerserPlugin.isSourceMap(inputSourceMap)) {
return null;
}
return new _sourceMap.SourceMapConsumer(inputSourceMap);
}
static buildError(err, file, sourceMap, requestShortener) {
// Handling error which should have line, col, filename and message
if (err.line) {
const original = sourceMap && sourceMap.originalPositionFor({
line: err.line,
column: err.col
});
if (original && original.source && requestShortener) {
return new Error(`${file} from Terser\n${err.message} [${requestShortener.shorten(original.source)}:${original.line},${original.column}][${file}:${err.line},${err.col}]`);
}
return new Error(`${file} from Terser\n${err.message} [${file}:${err.line},${err.col}]`);
} else if (err.stack) {
return new Error(`${file} from Terser\n${err.stack}`);
}
return new Error(`${file} from Terser\n${err.message}`);
}
static buildWarning(warning, file, sourceMap, requestShortener, warningsFilter) {
let warningMessage = warning;
let locationMessage = '';
let source = null;
if (sourceMap) {
const match = warningRegex.exec(warning);
if (match) {
const line = +match[1];
const column = +match[2];
const original = sourceMap.originalPositionFor({
line,
column
});
if (original && original.source && original.source !== file && requestShortener) {
({
source
} = original);
warningMessage = `${warningMessage.replace(warningRegex, '')}`;
locationMessage = `[${requestShortener.shorten(original.source)}:${original.line},${original.column}]`;
}
}
}
if (warningsFilter && !warningsFilter(warning, source)) {
return null;
}
return `Terser Plugin: ${warningMessage}${locationMessage}`;
}
apply(compiler) {
const buildModuleFn = moduleArg => {
// to get detailed location info about errors
moduleArg.useSourceMap = true;
};
const optimizeFn = (compilation, chunks, callback) => {
const taskRunner = new _TaskRunner.default({
cache: this.options.cache,
parallel: this.options.parallel
});
const processedAssets = new WeakSet();
const tasks = [];
const {
chunkFilter
} = this.options;
Array.from(chunks).filter(chunk => chunkFilter && chunkFilter(chunk)).reduce((acc, chunk) => acc.concat(chunk.files || []), []).concat(compilation.additionalChunkAssets || []).filter(_ModuleFilenameHelpers.default.matchObject.bind(null, this.options)).forEach(file => {
let inputSourceMap;
const asset = compilation.assets[file];
if (processedAssets.has(asset)) {
return;
}
try {
let input;
if (this.options.sourceMap && asset.sourceAndMap) {
const {
source,
map
} = asset.sourceAndMap();
input = source;
if (TerserPlugin.isSourceMap(map)) {
inputSourceMap = map;
} else {
inputSourceMap = map;
compilation.warnings.push(new Error(`${file} contains invalid source map`));
}
} else {
input = asset.source();
inputSourceMap = null;
} // Handling comment extraction
let commentsFile = false;
if (this.options.extractComments) {
commentsFile = this.options.extractComments.filename || `${file}.LICENSE`;
if (typeof commentsFile === 'function') {
commentsFile = commentsFile(file);
}
}
const task = {
file,
input,
inputSourceMap,
commentsFile,
extractComments: this.options.extractComments,
terserOptions: this.options.terserOptions,
minify: this.options.minify
};
if (this.options.cache) {
const defaultCacheKeys = {
terser: _package.default.version,
node_version: process.version,
// eslint-disable-next-line global-require
'terser-webpack-plugin': __webpack_require__(9122)/* .version */ .i8,
'terser-webpack-plugin-options': this.options,
hash: _crypto.default.createHash('md4').update(input).digest('hex')
};
task.cacheKeys = this.options.cacheKeys(defaultCacheKeys, file);
}
tasks.push(task);
} catch (error) {
compilation.errors.push(TerserPlugin.buildError(error, file, TerserPlugin.buildSourceMap(inputSourceMap), new _RequestShortener.default(compiler.context)));
}
});
taskRunner.run(tasks, (tasksError, results) => {
if (tasksError) {
compilation.errors.push(tasksError);
return;
}
results.forEach((data, index) => {
const {
file,
input,
inputSourceMap,
commentsFile
} = tasks[index];
const {
error,
map,
code,
warnings
} = data;
let {
extractedComments
} = data;
let sourceMap = null;
if (error || warnings && warnings.length > 0) {
sourceMap = TerserPlugin.buildSourceMap(inputSourceMap);
} // Handling results
// Error case: add errors, and go to next file
if (error) {
compilation.errors.push(TerserPlugin.buildError(error, file, sourceMap, new _RequestShortener.default(compiler.context)));
return;
}
let outputSource;
if (map) {
outputSource = new _webpackSources.SourceMapSource(code, file, JSON.parse(map), input, inputSourceMap, true);
} else {
outputSource = new _webpackSources.RawSource(code);
} // Write extracted comments to commentsFile
if (commentsFile && extractedComments && extractedComments.length > 0) {
if (commentsFile in compilation.assets) {
const commentsFileSource = compilation.assets[commentsFile].source();
extractedComments = extractedComments.filter(comment => !commentsFileSource.includes(comment));
}
if (extractedComments.length > 0) {
// Add a banner to the original file
if (this.options.extractComments.banner !== false) {
let banner = this.options.extractComments.banner || `For license information please see ${_path.default.posix.basename(commentsFile)}`;
if (typeof banner === 'function') {
banner = banner(commentsFile);
}
if (banner) {
outputSource = new _webpackSources.ConcatSource(`/*! ${banner} */\n`, outputSource);
}
}
const commentsSource = new _webpackSources.RawSource(`${extractedComments.join('\n\n')}\n`);
if (commentsFile in compilation.assets) {
// commentsFile already exists, append new comments...
if (compilation.assets[commentsFile] instanceof _webpackSources.ConcatSource) {
compilation.assets[commentsFile].add('\n');
compilation.assets[commentsFile].add(commentsSource);
} else {
compilation.assets[commentsFile] = new _webpackSources.ConcatSource(compilation.assets[commentsFile], '\n', commentsSource);
}
} else {
compilation.assets[commentsFile] = commentsSource;
}
}
} // Updating assets
processedAssets.add(compilation.assets[file] = outputSource); // Handling warnings
if (warnings && warnings.length > 0) {
warnings.forEach(warning => {
const builtWarning = TerserPlugin.buildWarning(warning, file, sourceMap, new _RequestShortener.default(compiler.context), this.options.warningsFilter);
if (builtWarning) {
compilation.warnings.push(builtWarning);
}
});
}
});
taskRunner.exit();
callback();
});
};
const plugin = {
name: this.constructor.name
};
compiler.hooks.compilation.tap(plugin, compilation => {
if (this.options.sourceMap) {
compilation.hooks.buildModule.tap(plugin, buildModuleFn);
}
const {
mainTemplate,
chunkTemplate
} = compilation; // Regenerate `contenthash` for minified assets
for (const template of [mainTemplate, chunkTemplate]) {
template.hooks.hashForChunk.tap(plugin, hash => {
const data = (0, _serializeJavascript.default)({
terser: _package.default.version,
terserOptions: this.options.terserOptions
});
hash.update('TerserPlugin');
hash.update(data);
});
}
compilation.hooks.optimizeChunkAssets.tapAsync(plugin, optimizeFn.bind(this, compilation));
});
}
}
var _default = TerserPlugin;
exports.default = _default;
/***/ }),
/***/ 30787:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports.default = void 0;
var _terser = __webpack_require__(54775);
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; }
const buildTerserOptions = ({
ecma,
warnings,
parse = {},
compress = {},
mangle,
module,
output,
toplevel,
nameCache,
ie8,
/* eslint-disable camelcase */
keep_classnames,
keep_fnames,
/* eslint-enable camelcase */
safari10
} = {}) => ({
ecma,
warnings,
parse: _objectSpread({}, parse),
compress: typeof compress === 'boolean' ? compress : _objectSpread({}, compress),
// eslint-disable-next-line no-nested-ternary
mangle: mangle == null ? true : typeof mangle === 'boolean' ? mangle : _objectSpread({}, mangle),
output: _objectSpread({
shebang: true,
comments: false,
beautify: false,
semicolons: true
}, output),
module,
// Ignoring sourceMap from options
sourceMap: null,
toplevel,
nameCache,
ie8,
keep_classnames,
keep_fnames,
safari10
});
const buildComments = (options, terserOptions, extractedComments) => {
const condition = {};
const commentsOpts = terserOptions.output.comments; // Use /^\**!|@preserve|@license|@cc_on/i RegExp
if (typeof options.extractComments === 'boolean') {
condition.preserve = commentsOpts;
condition.extract = /^\**!|@preserve|@license|@cc_on/i;
} else if (typeof options.extractComments === 'string' || options.extractComments instanceof RegExp) {
// extractComments specifies the extract condition and commentsOpts specifies the preserve condition
condition.preserve = commentsOpts;
condition.extract = options.extractComments;
} else if (typeof options.extractComments === 'function') {
condition.preserve = commentsOpts;
condition.extract = options.extractComments;
} else if (Object.prototype.hasOwnProperty.call(options.extractComments, 'condition')) {
// Extract condition is given in extractComments.condition
condition.preserve = commentsOpts;
condition.extract = options.extractComments.condition;
} else {
// No extract condition is given. Extract comments that match commentsOpts instead of preserving them
condition.preserve = false;
condition.extract = commentsOpts;
} // Ensure that both conditions are functions
['preserve', 'extract'].forEach(key => {
let regexStr;
let regex;
switch (typeof condition[key]) {
case 'boolean':
condition[key] = condition[key] ? () => true : () => false;
break;
case 'function':
break;
case 'string':
if (condition[key] === 'all') {
condition[key] = () => true;
break;
}
if (condition[key] === 'some') {
condition[key] = (astNode, comment) => {
return comment.type === 'comment2' && /^\**!|@preserve|@license|@cc_on/i.test(comment.value);
};
break;
}
regexStr = condition[key];
condition[key] = (astNode, comment) => {
return new RegExp(regexStr).test(comment.value);
};
break;
default:
regex = condition[key];
condition[key] = (astNode, comment) => regex.test(comment.value);
}
}); // Redefine the comments function to extract and preserve
// comments according to the two conditions
return (astNode, comment) => {
if (condition.extract(astNode, comment)) {
const commentText = comment.type === 'comment2' ? `/*${comment.value}*/` : `//${comment.value}`; // Don't include duplicate comments
if (!extractedComments.includes(commentText)) {
extractedComments.push(commentText);
}
}
return condition.preserve(astNode, comment);
};
};
const minify = options => {
const {
file,
input,
inputSourceMap,
extractComments,
minify: minifyFn
} = options;
if (minifyFn) {
return minifyFn({
[file]: input
}, inputSourceMap);
} // Copy terser options
const terserOptions = buildTerserOptions(options.terserOptions); // Let terser generate a SourceMap
if (inputSourceMap) {
terserOptions.sourceMap = true;
}
const extractedComments = [];
if (extractComments) {
terserOptions.output.comments = buildComments(options, terserOptions, extractedComments);
}
const {
error,
map,
code,
warnings
} = (0, _terser.minify)({
[file]: input
}, terserOptions);
return {
error,
map,
code,
warnings,
extractedComments
};
};
var _default = minify;
exports.default = _default;
/***/ }),
/***/ 71708:
......@@ -91583,7 +90604,7 @@ class WebpackOptionsDefaulter extends OptionsDefaulter {
{
apply: compiler => {
// Lazy load the Terser plugin
const TerserPlugin = __webpack_require__(89301);
const TerserPlugin = __webpack_require__(56052);
const SourceMapDevToolPlugin = __webpack_require__(11851);
new TerserPlugin({
cache: true,
......@@ -130464,445 +129485,6 @@ module.exports = ajv =>
});
/***/ }),
/***/ 69657:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
"use strict";
const DEFAULT_OPTIONS = {
workerOptions : {}
, maxCallsPerWorker : Infinity
, maxConcurrentWorkers : (__webpack_require__(12087).cpus() || { length: 1 }).length
, maxConcurrentCallsPerWorker : 10
, maxConcurrentCalls : Infinity
, maxCallTime : Infinity // exceed this and the whole worker is terminated
, maxRetries : Infinity
, forcedKillTime : 100
, autoStart : false
, onChild : function() {}
}
const fork = __webpack_require__(68079)
, TimeoutError = __webpack_require__(48916).create('TimeoutError')
, ProcessTerminatedError = __webpack_require__(48916).create('ProcessTerminatedError')
, MaxConcurrentCallsError = __webpack_require__(48916).create('MaxConcurrentCallsError')
function Farm (options, path) {
this.options = Object.assign({}, DEFAULT_OPTIONS, options)
this.path = path
this.activeCalls = 0
}
// make a handle to pass back in the form of an external API
Farm.prototype.mkhandle = function (method) {
return function () {
let args = Array.prototype.slice.call(arguments)
if (this.activeCalls + this.callQueue.length >= this.options.maxConcurrentCalls) {
let err = new MaxConcurrentCallsError('Too many concurrent calls (active: ' + this.activeCalls + ', queued: ' + this.callQueue.length + ')')
if (typeof args[args.length - 1] == 'function')
return process.nextTick(args[args.length - 1].bind(null, err))
throw err
}
this.addCall({
method : method
, callback : args.pop()
, args : args
, retries : 0
})
}.bind(this)
}
// a constructor of sorts
Farm.prototype.setup = function (methods) {
let iface
if (!methods) { // single-function export
iface = this.mkhandle()
} else { // multiple functions on the export
iface = {}
methods.forEach(function (m) {
iface[m] = this.mkhandle(m)
}.bind(this))
}
this.searchStart = -1
this.childId = -1
this.children = {}
this.activeChildren = 0
this.callQueue = []
if (this.options.autoStart) {
while (this.activeChildren < this.options.maxConcurrentWorkers)
this.startChild()
}
return iface
}
// when a child exits, check if there are any outstanding jobs and requeue them
Farm.prototype.onExit = function (childId) {
// delay this to give any sends a chance to finish
setTimeout(function () {
let doQueue = false
if (this.children[childId] && this.children[childId].activeCalls) {
this.children[childId].calls.forEach(function (call, i) {
if (!call) return
else if (call.retries >= this.options.maxRetries) {
this.receive({
idx : i
, child : childId
, args : [ new ProcessTerminatedError('cancel after ' + call.retries + ' retries!') ]
})
} else {
call.retries++
this.callQueue.unshift(call)
doQueue = true
}
}.bind(this))
}
this.stopChild(childId)
doQueue && this.processQueue()
}.bind(this), 10)
}
// start a new worker
Farm.prototype.startChild = function () {
this.childId++
let forked = fork(this.path, this.options.workerOptions)
, id = this.childId
, c = {
send : forked.send
, child : forked.child
, calls : []
, activeCalls : 0
, exitCode : null
}
this.options.onChild(forked.child);
forked.child.on('message', function(data) {
if (data.owner !== 'farm') {
return;
}
this.receive(data);
}.bind(this))
forked.child.once('exit', function (code) {
c.exitCode = code
this.onExit(id)
}.bind(this))
this.activeChildren++
this.children[id] = c
}
// stop a worker, identified by id
Farm.prototype.stopChild = function (childId) {
let child = this.children[childId]
if (child) {
child.send({owner: 'farm', event: 'die'})
setTimeout(function () {
if (child.exitCode === null)
child.child.kill('SIGKILL')
}, this.options.forcedKillTime).unref()
;delete this.children[childId]
this.activeChildren--
}
}
// called from a child process, the data contains information needed to
// look up the child and the original call so we can invoke the callback
Farm.prototype.receive = function (data) {
let idx = data.idx
, childId = data.child
, args = data.args
, child = this.children[childId]
, call
if (!child) {
return console.error(
'Worker Farm: Received message for unknown child. '
+ 'This is likely as a result of premature child death, '
+ 'the operation will have been re-queued.'
)
}
call = child.calls[idx]
if (!call) {
return console.error(
'Worker Farm: Received message for unknown index for existing child. '
+ 'This should not happen!'
)
}
if (this.options.maxCallTime !== Infinity)
clearTimeout(call.timer)
if (args[0] && args[0].$error == '$error') {
let e = args[0]
switch (e.type) {
case 'TypeError': args[0] = new TypeError(e.message); break
case 'RangeError': args[0] = new RangeError(e.message); break
case 'EvalError': args[0] = new EvalError(e.message); break
case 'ReferenceError': args[0] = new ReferenceError(e.message); break
case 'SyntaxError': args[0] = new SyntaxError(e.message); break
case 'URIError': args[0] = new URIError(e.message); break
default: args[0] = new Error(e.message)
}
args[0].type = e.type
args[0].stack = e.stack
// Copy any custom properties to pass it on.
Object.keys(e).forEach(function(key) {
args[0][key] = e[key];
});
}
process.nextTick(function () {
call.callback.apply(null, args)
})
;delete child.calls[idx]
child.activeCalls--
this.activeCalls--
if (child.calls.length >= this.options.maxCallsPerWorker
&& !Object.keys(child.calls).length) {
// this child has finished its run, kill it
this.stopChild(childId)
}
// allow any outstanding calls to be processed
this.processQueue()
}
Farm.prototype.childTimeout = function (childId) {
let child = this.children[childId]
, i
if (!child)
return
for (i in child.calls) {
this.receive({
idx : i
, child : childId
, args : [ new TimeoutError('worker call timed out!') ]
})
}
this.stopChild(childId)
}
// send a call to a worker, identified by id
Farm.prototype.send = function (childId, call) {
let child = this.children[childId]
, idx = child.calls.length
child.calls.push(call)
child.activeCalls++
this.activeCalls++
child.send({
owner : 'farm'
, idx : idx
, child : childId
, method : call.method
, args : call.args
})
if (this.options.maxCallTime !== Infinity) {
call.timer =
setTimeout(this.childTimeout.bind(this, childId), this.options.maxCallTime)
}
}
// a list of active worker ids, in order, but the starting offset is
// shifted each time this method is called, so we work our way through
// all workers when handing out jobs
Farm.prototype.childKeys = function () {
let cka = Object.keys(this.children)
, cks
if (this.searchStart >= cka.length - 1)
this.searchStart = 0
else
this.searchStart++
cks = cka.splice(0, this.searchStart)
return cka.concat(cks)
}
// Calls are added to a queue, this processes the queue and is called
// whenever there might be a chance to send more calls to the workers.
// The various options all impact on when we're able to send calls,
// they may need to be kept in a queue until a worker is ready.
Farm.prototype.processQueue = function () {
let cka, i = 0, childId
if (!this.callQueue.length)
return this.ending && this.end()
if (this.activeChildren < this.options.maxConcurrentWorkers)
this.startChild()
for (cka = this.childKeys(); i < cka.length; i++) {
childId = +cka[i]
if (this.children[childId].activeCalls < this.options.maxConcurrentCallsPerWorker
&& this.children[childId].calls.length < this.options.maxCallsPerWorker) {
this.send(childId, this.callQueue.shift())
if (!this.callQueue.length)
return this.ending && this.end()
} /*else {
console.log(
, this.children[childId].activeCalls < this.options.maxConcurrentCallsPerWorker
, this.children[childId].calls.length < this.options.maxCallsPerWorker
, this.children[childId].calls.length , this.options.maxCallsPerWorker)
}*/
}
if (this.ending)
this.end()
}
// add a new call to the call queue, then trigger a process of the queue
Farm.prototype.addCall = function (call) {
if (this.ending)
return this.end() // don't add anything new to the queue
this.callQueue.push(call)
this.processQueue()
}
// kills child workers when they're all done
Farm.prototype.end = function (callback) {
let complete = true
if (this.ending === false)
return
if (callback)
this.ending = callback
else if (this.ending == null)
this.ending = true
Object.keys(this.children).forEach(function (child) {
if (!this.children[child])
return
if (!this.children[child].activeCalls)
this.stopChild(child)
else
complete = false
}.bind(this))
if (complete && typeof this.ending == 'function') {
process.nextTick(function () {
this.ending()
this.ending = false
}.bind(this))
}
}
module.exports = Farm
module.exports.TimeoutError = TimeoutError
/***/ }),
/***/ 68079:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
"use strict";
const childProcess = __webpack_require__(63129)
, childModule = __webpack_require__.ab + "index.js"
function fork (forkModule, workerOptions) {
// suppress --debug / --inspect flags while preserving others (like --harmony)
let filteredArgs = process.execArgv.filter(function (v) {
return !(/^--(debug|inspect)/).test(v)
})
, options = Object.assign({
execArgv : filteredArgs
, env : process.env
, cwd : process.cwd()
}, workerOptions)
, child = childProcess.fork(__webpack_require__.ab + "index.js", process.argv, options)
child.on('error', function() {
// this *should* be picked up by onExit and the operation requeued
})
child.send({ owner: 'farm', module: forkModule })
// return a send() function for this child
return {
send : child.send.bind(child)
, child : child
}
}
module.exports = fork
/***/ }),
/***/ 18921:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
"use strict";
const Farm = __webpack_require__(69657)
let farms = [] // keep record of farms so we can end() them if required
function farm (options, path, methods) {
if (typeof options == 'string') {
methods = path
path = options
options = {}
}
let f = new Farm(options, path)
, api = f.setup(methods)
farms.push({ farm: f, api: api })
// return the public API
return api
}
function end (api, callback) {
for (let i = 0; i < farms.length; i++)
if (farms[i] && farms[i].api === api)
return farms[i].farm.end(callback)
process.nextTick(callback.bind(null, new Error('Worker farm not found!')))
}
module.exports = farm
module.exports.end = end
/***/ }),
/***/ 27410:
......@@ -130952,14 +129534,6 @@ module.exports = require("buffer");;
/***/ }),
/***/ 63129:
/***/ (function(module) {
"use strict";
module.exports = require("child_process");;
/***/ }),
/***/ 47257:
/***/ (function(module) {
......@@ -131016,11 +129590,11 @@ module.exports = require("module");;
/***/ }),
/***/ 36801:
/***/ 56052:
/***/ (function(module) {
"use strict";
module.exports = require("next/dist/compiled/cacache");;
module.exports = require("next/dist/build/webpack/plugins/terser-webpack-plugin");;
/***/ }),
......@@ -131032,22 +129606,6 @@ module.exports = require("next/dist/compiled/debug");;
/***/ }),
/***/ 61844:
/***/ (function(module) {
"use strict";
module.exports = require("next/dist/compiled/find-cache-dir");;
/***/ }),
/***/ 47543:
/***/ (function(module) {
"use strict";
module.exports = require("next/dist/compiled/is-wsl");;
/***/ }),
/***/ 36386:
/***/ (function(module) {
......@@ -131072,14 +129630,6 @@ module.exports = require("next/dist/compiled/source-map");;
/***/ }),
/***/ 54775:
/***/ (function(module) {
"use strict";
module.exports = require("next/dist/compiled/terser");;
/***/ }),
/***/ 53665:
/***/ (function(module) {
This source diff could not be displayed because it is too large. You can view the blob instead.
module.exports =
/******/ (function() { // webpackBootstrap
/******/ "use strict";
/******/ var __webpack_modules__ = ({
/***/ 305:
/***/ (function() {
let $module
/*
let contextProto = this.context;
while (contextProto = Object.getPrototypeOf(contextProto)) {
completionGroups.push(Object.getOwnPropertyNames(contextProto));
}
*/
function handle (data) {
let idx = data.idx
, child = data.child
, method = data.method
, args = data.args
, callback = function () {
let _args = Array.prototype.slice.call(arguments)
if (_args[0] instanceof Error) {
let e = _args[0]
_args[0] = {
'$error' : '$error'
, 'type' : e.constructor.name
, 'message' : e.message
, 'stack' : e.stack
}
Object.keys(e).forEach(function(key) {
_args[0][key] = e[key]
})
}
process.send({ owner: 'farm', idx: idx, child: child, args: _args })
}
, exec
if (method == null && typeof $module == 'function')
exec = $module
else if (typeof $module[method] == 'function')
exec = $module[method]
if (!exec)
return console.error('NO SUCH METHOD:', method)
exec.apply(null, args.concat([ callback ]))
}
process.on('message', function (data) {
if (data.owner !== 'farm') {
return;
}
if (!$module) return $module = require(data.module)
if (data.event == 'die') return process.exit(0)
handle(data)
})
/***/ })
/******/ });
/************************************************************************/
/******/ // The module cache
/******/ var __webpack_module_cache__ = {};
/******/
/******/ // The require function
/******/ function __nccwpck_require__(moduleId) {
/******/ // Check if module is in cache
/******/ if(__webpack_module_cache__[moduleId]) {
/******/ return __webpack_module_cache__[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
/******/ // no module.id needed
/******/ // no module.loaded needed
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ var threw = true;
/******/ try {
/******/ __webpack_modules__[moduleId](module, module.exports, __nccwpck_require__);
/******/ threw = false;
/******/ } finally {
/******/ if(threw) delete __webpack_module_cache__[moduleId];
/******/ }
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/************************************************************************/
/******/ /* webpack/runtime/compat */
/******/
/******/ __nccwpck_require__.ab = __dirname + "/";/************************************************************************/
/******/ // module exports must be returned from runtime so entry inlining is disabled
/******/ // startup
/******/ // Load entry module and return exports
/******/ return __nccwpck_require__(305);
/******/ })()
;
\ No newline at end of file
module.exports =
/******/ (function() { // webpackBootstrap
/******/ "use strict";
/******/ var __webpack_modules__ = ({
/***/ 149:
/***/ (function(module, exports, __nccwpck_require__) {
/* module decorator */ module = __nccwpck_require__.nmd(module);
const {
minify: terserMinify
} = __nccwpck_require__(775);
/** @typedef {import("source-map").RawSourceMap} RawSourceMap */
/** @typedef {import("./index.js").ExtractCommentsOptions} ExtractCommentsOptions */
/** @typedef {import("./index.js").CustomMinifyFunction} CustomMinifyFunction */
/** @typedef {import("terser").MinifyOptions} TerserMinifyOptions */
/** @typedef {import("terser").MinifyOutput} MinifyOutput */
/** @typedef {import("terser").FormatOptions} FormatOptions */
/** @typedef {import("terser").MangleOptions} MangleOptions */
/** @typedef {import("./index.js").ExtractCommentsFunction} ExtractCommentsFunction */
/** @typedef {import("./index.js").ExtractCommentsCondition} ExtractCommentsCondition */
/**
* @typedef {Object.<any, any>} CustomMinifyOptions
*/
/**
* @typedef {Object} InternalMinifyOptions
* @property {string} name
* @property {string} input
* @property {RawSourceMap} [inputSourceMap]
* @property {ExtractCommentsOptions} extractComments
* @property {CustomMinifyFunction} [minify]
* @property {TerserMinifyOptions | CustomMinifyOptions} minifyOptions
*/
/**
* @typedef {Array<string>} ExtractedComments
*/
/**
* @typedef {Promise<MinifyOutput & { extractedComments?: ExtractedComments}>} InternalMinifyResult
*/
/**
* @typedef {TerserMinifyOptions & { sourceMap: undefined } & ({ output: FormatOptions & { beautify: boolean } } | { format: FormatOptions & { beautify: boolean } })} NormalizedTerserMinifyOptions
*/
/**
* @param {TerserMinifyOptions} [terserOptions={}]
* @returns {NormalizedTerserMinifyOptions}
*/
function buildTerserOptions(terserOptions = {}) {
// Need deep copy objects to avoid https://github.com/terser/terser/issues/366
return { ...terserOptions,
compress: typeof terserOptions.compress === "boolean" ? terserOptions.compress : { ...terserOptions.compress
},
// ecma: terserOptions.ecma,
// ie8: terserOptions.ie8,
// keep_classnames: terserOptions.keep_classnames,
// keep_fnames: terserOptions.keep_fnames,
mangle: terserOptions.mangle == null ? true : typeof terserOptions.mangle === "boolean" ? terserOptions.mangle : { ...terserOptions.mangle
},
// module: terserOptions.module,
// nameCache: { ...terserOptions.toplevel },
// the `output` option is deprecated
...(terserOptions.format ? {
format: {
beautify: false,
...terserOptions.format
}
} : {
output: {
beautify: false,
...terserOptions.output
}
}),
parse: { ...terserOptions.parse
},
// safari10: terserOptions.safari10,
// Ignoring sourceMap from options
// eslint-disable-next-line no-undefined
sourceMap: undefined // toplevel: terserOptions.toplevel
};
}
/**
* @param {any} value
* @returns {boolean}
*/
function isObject(value) {
const type = typeof value;
return value != null && (type === "object" || type === "function");
}
/**
* @param {ExtractCommentsOptions} extractComments
* @param {NormalizedTerserMinifyOptions} terserOptions
* @param {ExtractedComments} extractedComments
* @returns {ExtractCommentsFunction}
*/
function buildComments(extractComments, terserOptions, extractedComments) {
/** @type {{ [index: string]: ExtractCommentsCondition }} */
const condition = {};
let comments;
if (terserOptions.format) {
({
comments
} = terserOptions.format);
} else if (terserOptions.output) {
({
comments
} = terserOptions.output);
}
condition.preserve = typeof comments !== "undefined" ? comments : false;
if (typeof extractComments === "boolean" && extractComments) {
condition.extract = "some";
} else if (typeof extractComments === "string" || extractComments instanceof RegExp) {
condition.extract = extractComments;
} else if (typeof extractComments === "function") {
condition.extract = extractComments;
} else if (extractComments && isObject(extractComments)) {
condition.extract = typeof extractComments.condition === "boolean" && extractComments.condition ? "some" : typeof extractComments.condition !== "undefined" ? extractComments.condition : "some";
} else {
// No extract
// Preserve using "commentsOpts" or "some"
condition.preserve = typeof comments !== "undefined" ? comments : "some";
condition.extract = false;
} // Ensure that both conditions are functions
["preserve", "extract"].forEach(key => {
/** @type {undefined | string} */
let regexStr;
/** @type {undefined | RegExp} */
let regex;
switch (typeof condition[key]) {
case "boolean":
condition[key] = condition[key] ? () => true : () => false;
break;
case "function":
break;
case "string":
if (condition[key] === "all") {
condition[key] = () => true;
break;
}
if (condition[key] === "some") {
condition[key] =
/** @type {ExtractCommentsFunction} */
(astNode, comment) => (comment.type === "comment2" || comment.type === "comment1") && /@preserve|@lic|@cc_on|^\**!/i.test(comment.value);
break;
}
regexStr =
/** @type {string} */
condition[key];
condition[key] =
/** @type {ExtractCommentsFunction} */
(astNode, comment) => new RegExp(
/** @type {string} */
regexStr).test(comment.value);
break;
default:
regex =
/** @type {RegExp} */
condition[key];
condition[key] =
/** @type {ExtractCommentsFunction} */
(astNode, comment) =>
/** @type {RegExp} */
regex.test(comment.value);
}
}); // Redefine the comments function to extract and preserve
// comments according to the two conditions
return (astNode, comment) => {
if (
/** @type {{ extract: ExtractCommentsFunction }} */
condition.extract(astNode, comment)) {
const commentText = comment.type === "comment2" ? `/*${comment.value}*/` : `//${comment.value}`; // Don't include duplicate comments
if (!extractedComments.includes(commentText)) {
extractedComments.push(commentText);
}
}
return (
/** @type {{ preserve: ExtractCommentsFunction }} */
condition.preserve(astNode, comment)
);
};
}
/**
* @param {InternalMinifyOptions} options
* @returns {InternalMinifyResult}
*/
async function minify(options) {
const {
name,
input,
inputSourceMap,
minify: minifyFn,
minifyOptions
} = options;
if (minifyFn) {
return minifyFn({
[name]: input
}, inputSourceMap, minifyOptions);
} // Copy terser options
const terserOptions = buildTerserOptions(minifyOptions); // Let terser generate a SourceMap
if (inputSourceMap) {
// @ts-ignore
terserOptions.sourceMap = {
asObject: true
};
}
/** @type {ExtractedComments} */
const extractedComments = [];
const {
extractComments
} = options;
if (terserOptions.output) {
terserOptions.output.comments = buildComments(extractComments, terserOptions, extractedComments);
} else if (terserOptions.format) {
terserOptions.format.comments = buildComments(extractComments, terserOptions, extractedComments);
}
const result = await terserMinify({
[name]: input
}, terserOptions);
return { ...result,
extractedComments
};
}
/**
* @param {string} options
* @returns {InternalMinifyResult}
*/
function transform(options) {
// 'use strict' => this === undefined (Clean Scope)
// Safer for possible security issues, albeit not critical at all here
// eslint-disable-next-line no-param-reassign
const evaluatedOptions =
/** @type {InternalMinifyOptions} */
// eslint-disable-next-line no-new-func
new Function("exports", "require", "module", "__filename", "__dirname", `'use strict'\nreturn ${options}`)(exports, require, module, __filename, __dirname);
return minify(evaluatedOptions);
}
module.exports.minify = minify;
module.exports.transform = transform;
/***/ }),
/***/ 775:
/***/ (function(module) {
module.exports = require("next/dist/compiled/terser");;
/***/ })
/******/ });
/************************************************************************/
/******/ // The module cache
/******/ var __webpack_module_cache__ = {};
/******/
/******/ // The require function
/******/ function __nccwpck_require__(moduleId) {
/******/ // Check if module is in cache
/******/ if(__webpack_module_cache__[moduleId]) {
/******/ return __webpack_module_cache__[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
/******/ id: moduleId,
/******/ loaded: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ var threw = true;
/******/ try {
/******/ __webpack_modules__[moduleId](module, module.exports, __nccwpck_require__);
/******/ threw = false;
/******/ } finally {
/******/ if(threw) delete __webpack_module_cache__[moduleId];
/******/ }
/******/
/******/ // Flag the module as loaded
/******/ module.loaded = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/************************************************************************/
/******/ /* webpack/runtime/node module decorator */
/******/ !function() {
/******/ __nccwpck_require__.nmd = function(module) {
/******/ module.paths = [];
/******/ if (!module.children) module.children = [];
/******/ return module;
/******/ };
/******/ }();
/******/
/******/ /* webpack/runtime/compat */
/******/
/******/ __nccwpck_require__.ab = __dirname + "/";/************************************************************************/
/******/ // module exports must be returned from runtime so entry inlining is disabled
/******/ // startup
/******/ // Load entry module and return exports
/******/ return __nccwpck_require__(149);
/******/ })()
;
\ No newline at end of file
module.exports =
/******/ (function() { // webpackBootstrap
/******/ "use strict";
/******/ var __webpack_modules__ = ({
/***/ 787:
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports.default = void 0;
var _terser = __nccwpck_require__(775);
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; }
const buildTerserOptions = ({
ecma,
warnings,
parse = {},
compress = {},
mangle,
module,
output,
toplevel,
nameCache,
ie8,
/* eslint-disable camelcase */
keep_classnames,
keep_fnames,
/* eslint-enable camelcase */
safari10
} = {}) => ({
ecma,
warnings,
parse: _objectSpread({}, parse),
compress: typeof compress === 'boolean' ? compress : _objectSpread({}, compress),
// eslint-disable-next-line no-nested-ternary
mangle: mangle == null ? true : typeof mangle === 'boolean' ? mangle : _objectSpread({}, mangle),
output: _objectSpread({
shebang: true,
comments: false,
beautify: false,
semicolons: true
}, output),
module,
// Ignoring sourceMap from options
sourceMap: null,
toplevel,
nameCache,
ie8,
keep_classnames,
keep_fnames,
safari10
});
const buildComments = (options, terserOptions, extractedComments) => {
const condition = {};
const commentsOpts = terserOptions.output.comments; // Use /^\**!|@preserve|@license|@cc_on/i RegExp
if (typeof options.extractComments === 'boolean') {
condition.preserve = commentsOpts;
condition.extract = /^\**!|@preserve|@license|@cc_on/i;
} else if (typeof options.extractComments === 'string' || options.extractComments instanceof RegExp) {
// extractComments specifies the extract condition and commentsOpts specifies the preserve condition
condition.preserve = commentsOpts;
condition.extract = options.extractComments;
} else if (typeof options.extractComments === 'function') {
condition.preserve = commentsOpts;
condition.extract = options.extractComments;
} else if (Object.prototype.hasOwnProperty.call(options.extractComments, 'condition')) {
// Extract condition is given in extractComments.condition
condition.preserve = commentsOpts;
condition.extract = options.extractComments.condition;
} else {
// No extract condition is given. Extract comments that match commentsOpts instead of preserving them
condition.preserve = false;
condition.extract = commentsOpts;
} // Ensure that both conditions are functions
['preserve', 'extract'].forEach(key => {
let regexStr;
let regex;
switch (typeof condition[key]) {
case 'boolean':
condition[key] = condition[key] ? () => true : () => false;
break;
case 'function':
break;
case 'string':
if (condition[key] === 'all') {
condition[key] = () => true;
break;
}
if (condition[key] === 'some') {
condition[key] = (astNode, comment) => {
return comment.type === 'comment2' && /^\**!|@preserve|@license|@cc_on/i.test(comment.value);
};
break;
}
regexStr = condition[key];
condition[key] = (astNode, comment) => {
return new RegExp(regexStr).test(comment.value);
};
break;
default:
regex = condition[key];
condition[key] = (astNode, comment) => regex.test(comment.value);
}
}); // Redefine the comments function to extract and preserve
// comments according to the two conditions
return (astNode, comment) => {
if (condition.extract(astNode, comment)) {
const commentText = comment.type === 'comment2' ? `/*${comment.value}*/` : `//${comment.value}`; // Don't include duplicate comments
if (!extractedComments.includes(commentText)) {
extractedComments.push(commentText);
}
}
return condition.preserve(astNode, comment);
};
};
const minify = options => {
const {
file,
input,
inputSourceMap,
extractComments,
minify: minifyFn
} = options;
if (minifyFn) {
return minifyFn({
[file]: input
}, inputSourceMap);
} // Copy terser options
const terserOptions = buildTerserOptions(options.terserOptions); // Let terser generate a SourceMap
if (inputSourceMap) {
terserOptions.sourceMap = true;
}
const extractedComments = [];
if (extractComments) {
terserOptions.output.comments = buildComments(options, terserOptions, extractedComments);
}
const {
error,
map,
code,
warnings
} = (0, _terser.minify)({
[file]: input
}, terserOptions);
return {
error,
map,
code,
warnings,
extractedComments
};
};
var _default = minify;
exports.default = _default;
/***/ }),
/***/ 359:
/***/ (function(module, exports, __nccwpck_require__) {
/* module decorator */ module = __nccwpck_require__.nmd(module);
var _minify = _interopRequireDefault(__nccwpck_require__(787));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
module.exports = (options, callback) => {
try {
// 'use strict' => this === undefined (Clean Scope)
// Safer for possible security issues, albeit not critical at all here
// eslint-disable-next-line no-new-func, no-param-reassign
options = new Function('exports', 'require', 'module', '__filename', '__dirname', `'use strict'\nreturn ${options}`)(exports, require, module, __filename, __dirname);
callback(null, (0, _minify.default)(options));
} catch (errors) {
callback(errors);
}
};
/***/ }),
/***/ 775:
/***/ (function(module) {
module.exports = require("next/dist/compiled/terser");;
/***/ })
/******/ });
/************************************************************************/
/******/ // The module cache
/******/ var __webpack_module_cache__ = {};
/******/
/******/ // The require function
/******/ function __nccwpck_require__(moduleId) {
/******/ // Check if module is in cache
/******/ if(__webpack_module_cache__[moduleId]) {
/******/ return __webpack_module_cache__[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
/******/ id: moduleId,
/******/ loaded: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ var threw = true;
/******/ try {
/******/ __webpack_modules__[moduleId](module, module.exports, __nccwpck_require__);
/******/ threw = false;
/******/ } finally {
/******/ if(threw) delete __webpack_module_cache__[moduleId];
/******/ }
/******/
/******/ // Flag the module as loaded
/******/ module.loaded = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/************************************************************************/
/******/ /* webpack/runtime/node module decorator */
/******/ !function() {
/******/ __nccwpck_require__.nmd = function(module) {
/******/ module.paths = [];
/******/ if (!module.children) module.children = [];
/******/ return module;
/******/ };
/******/ }();
/******/
/******/ /* webpack/runtime/compat */
/******/
/******/ __nccwpck_require__.ab = __dirname + "/";/************************************************************************/
/******/ // module exports must be returned from runtime so entry inlining is disabled
/******/ // startup
/******/ // Load entry module and return exports
/******/ return __nccwpck_require__(359);
/******/ })()
;
\ No newline at end of file
......@@ -61,6 +61,9 @@ const externals = {
chokidar: 'chokidar',
'jest-worker': 'jest-worker',
'terser-webpack-plugin':
'next/dist/build/webpack/plugins/terser-webpack-plugin',
}
// eslint-disable-next-line camelcase
externals['amphtml-validator'] = 'next/dist/compiled/amphtml-validator'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment