@rsbuild/core 1.0.0-alpha.4 → 1.0.0-alpha.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/compiled/rspack-chain/index.d.ts +1 -0
- package/compiled/rspack-chain/index.js +66 -66
- package/compiled/rspack-chain/package.json +1 -1
- package/compiled/webpack-bundle-analyzer/index.js +163 -11
- package/dist/index.cjs +240 -196
- package/dist/index.js +242 -198
- package/dist-types/pluginHelper.d.ts +1 -1
- package/dist-types/rspack/HtmlBasicPlugin.d.ts +2 -2
- package/dist-types/rspack/preload/HtmlPreloadOrPrefetchPlugin.d.ts +1 -1
- package/dist-types/rspack/preload/helpers/type.d.ts +1 -1
- package/dist-types/server/middlewares.d.ts +12 -1
- package/dist-types/server/socketServer.d.ts +1 -0
- package/dist-types/types/config/html.d.ts +2 -2
- package/dist-types/types/config/tools.d.ts +2 -2
- package/dist-types/types/hooks.d.ts +1 -1
- package/dist-types/types/plugin.d.ts +1 -1
- package/package.json +3 -4
- package/compiled/gzip-size/index.d.ts +0 -1
- package/compiled/gzip-size/index.js +0 -242
- package/compiled/gzip-size/package.json +0 -1
|
@@ -431,6 +431,7 @@ declare namespace Config {
|
|
|
431
431
|
type SplitChunksObject = Exclude<RspackOptimization['splitChunks'], false>;
|
|
432
432
|
class Optimization extends ChainedMap<Config> {
|
|
433
433
|
minimizer(name: string): Config.Plugin<this, PluginInstance>;
|
|
434
|
+
minimizers: TypedChainedMap<this, Config.Plugin<this, PluginInstance>>;
|
|
434
435
|
splitChunks: TypedChainedMap<this, SplitChunksObject> &
|
|
435
436
|
((value: SplitChunksObject | false) => this);
|
|
436
437
|
|
|
@@ -777,7 +777,7 @@ exports.toString = toString;
|
|
|
777
777
|
|
|
778
778
|
/***/ }),
|
|
779
779
|
|
|
780
|
-
/***/
|
|
780
|
+
/***/ 805:
|
|
781
781
|
/***/ ((module) => {
|
|
782
782
|
|
|
783
783
|
module.exports = class extends Function {
|
|
@@ -796,55 +796,55 @@ module.exports = class extends Function {
|
|
|
796
796
|
|
|
797
797
|
/***/ }),
|
|
798
798
|
|
|
799
|
-
/***/
|
|
799
|
+
/***/ 528:
|
|
800
800
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
801
801
|
|
|
802
|
-
const createMap = __nccwpck_require__(
|
|
803
|
-
const createChainable = __nccwpck_require__(
|
|
802
|
+
const createMap = __nccwpck_require__(538);
|
|
803
|
+
const createChainable = __nccwpck_require__(772);
|
|
804
804
|
|
|
805
805
|
module.exports = createMap(createChainable(Object));
|
|
806
806
|
|
|
807
807
|
|
|
808
808
|
/***/ }),
|
|
809
809
|
|
|
810
|
-
/***/
|
|
810
|
+
/***/ 17:
|
|
811
811
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
812
812
|
|
|
813
|
-
const createSet = __nccwpck_require__(
|
|
814
|
-
const createChainable = __nccwpck_require__(
|
|
813
|
+
const createSet = __nccwpck_require__(8);
|
|
814
|
+
const createChainable = __nccwpck_require__(772);
|
|
815
815
|
|
|
816
816
|
module.exports = createSet(createChainable(Object));
|
|
817
817
|
|
|
818
818
|
|
|
819
819
|
/***/ }),
|
|
820
820
|
|
|
821
|
-
/***/
|
|
821
|
+
/***/ 244:
|
|
822
822
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
823
823
|
|
|
824
|
-
const Callable = __nccwpck_require__(
|
|
825
|
-
const createMap = __nccwpck_require__(
|
|
826
|
-
const createChainable = __nccwpck_require__(
|
|
827
|
-
const createValue = __nccwpck_require__(
|
|
824
|
+
const Callable = __nccwpck_require__(805);
|
|
825
|
+
const createMap = __nccwpck_require__(538);
|
|
826
|
+
const createChainable = __nccwpck_require__(772);
|
|
827
|
+
const createValue = __nccwpck_require__(445);
|
|
828
828
|
|
|
829
829
|
module.exports = createValue(createMap(createChainable(Callable)));
|
|
830
830
|
|
|
831
831
|
|
|
832
832
|
/***/ }),
|
|
833
833
|
|
|
834
|
-
/***/
|
|
834
|
+
/***/ 968:
|
|
835
835
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
836
836
|
|
|
837
|
-
const ChainedMap = __nccwpck_require__(
|
|
838
|
-
const ChainedValueMap = __nccwpck_require__(
|
|
839
|
-
const ChainedSet = __nccwpck_require__(
|
|
840
|
-
const Resolve = __nccwpck_require__(
|
|
841
|
-
const ResolveLoader = __nccwpck_require__(
|
|
842
|
-
const Output = __nccwpck_require__(
|
|
843
|
-
const DevServer = __nccwpck_require__(
|
|
844
|
-
const Plugin = __nccwpck_require__(
|
|
845
|
-
const Module = __nccwpck_require__(
|
|
846
|
-
const Optimization = __nccwpck_require__(
|
|
847
|
-
const Performance = __nccwpck_require__(
|
|
837
|
+
const ChainedMap = __nccwpck_require__(528);
|
|
838
|
+
const ChainedValueMap = __nccwpck_require__(244);
|
|
839
|
+
const ChainedSet = __nccwpck_require__(17);
|
|
840
|
+
const Resolve = __nccwpck_require__(513);
|
|
841
|
+
const ResolveLoader = __nccwpck_require__(443);
|
|
842
|
+
const Output = __nccwpck_require__(641);
|
|
843
|
+
const DevServer = __nccwpck_require__(963);
|
|
844
|
+
const Plugin = __nccwpck_require__(448);
|
|
845
|
+
const Module = __nccwpck_require__(358);
|
|
846
|
+
const Optimization = __nccwpck_require__(369);
|
|
847
|
+
const Performance = __nccwpck_require__(616);
|
|
848
848
|
|
|
849
849
|
module.exports = class extends ChainedMap {
|
|
850
850
|
constructor() {
|
|
@@ -1041,11 +1041,11 @@ module.exports = class extends ChainedMap {
|
|
|
1041
1041
|
|
|
1042
1042
|
/***/ }),
|
|
1043
1043
|
|
|
1044
|
-
/***/
|
|
1044
|
+
/***/ 963:
|
|
1045
1045
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
1046
1046
|
|
|
1047
|
-
const ChainedMap = __nccwpck_require__(
|
|
1048
|
-
const ChainedSet = __nccwpck_require__(
|
|
1047
|
+
const ChainedMap = __nccwpck_require__(528);
|
|
1048
|
+
const ChainedSet = __nccwpck_require__(17);
|
|
1049
1049
|
|
|
1050
1050
|
module.exports = class extends ChainedMap {
|
|
1051
1051
|
constructor(parent) {
|
|
@@ -1126,11 +1126,11 @@ module.exports = class extends ChainedMap {
|
|
|
1126
1126
|
|
|
1127
1127
|
/***/ }),
|
|
1128
1128
|
|
|
1129
|
-
/***/
|
|
1129
|
+
/***/ 358:
|
|
1130
1130
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
1131
1131
|
|
|
1132
|
-
const ChainedMap = __nccwpck_require__(
|
|
1133
|
-
const Rule = __nccwpck_require__(
|
|
1132
|
+
const ChainedMap = __nccwpck_require__(528);
|
|
1133
|
+
const Rule = __nccwpck_require__(904);
|
|
1134
1134
|
|
|
1135
1135
|
module.exports = class extends ChainedMap {
|
|
1136
1136
|
constructor(parent) {
|
|
@@ -1195,12 +1195,12 @@ module.exports = class extends ChainedMap {
|
|
|
1195
1195
|
|
|
1196
1196
|
/***/ }),
|
|
1197
1197
|
|
|
1198
|
-
/***/
|
|
1198
|
+
/***/ 369:
|
|
1199
1199
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
1200
1200
|
|
|
1201
|
-
const ChainedMap = __nccwpck_require__(
|
|
1202
|
-
const ChainedValueMap = __nccwpck_require__(
|
|
1203
|
-
const Plugin = __nccwpck_require__(
|
|
1201
|
+
const ChainedMap = __nccwpck_require__(528);
|
|
1202
|
+
const ChainedValueMap = __nccwpck_require__(244);
|
|
1203
|
+
const Plugin = __nccwpck_require__(448);
|
|
1204
1204
|
|
|
1205
1205
|
module.exports = class extends ChainedMap {
|
|
1206
1206
|
constructor(parent) {
|
|
@@ -1268,7 +1268,7 @@ module.exports = class extends ChainedMap {
|
|
|
1268
1268
|
|
|
1269
1269
|
/***/ }),
|
|
1270
1270
|
|
|
1271
|
-
/***/
|
|
1271
|
+
/***/ 832:
|
|
1272
1272
|
/***/ ((module) => {
|
|
1273
1273
|
|
|
1274
1274
|
module.exports = (Class) =>
|
|
@@ -1315,10 +1315,10 @@ module.exports = (Class) =>
|
|
|
1315
1315
|
|
|
1316
1316
|
/***/ }),
|
|
1317
1317
|
|
|
1318
|
-
/***/
|
|
1318
|
+
/***/ 641:
|
|
1319
1319
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
1320
1320
|
|
|
1321
|
-
const ChainedMap = __nccwpck_require__(
|
|
1321
|
+
const ChainedMap = __nccwpck_require__(528);
|
|
1322
1322
|
|
|
1323
1323
|
module.exports = class extends ChainedMap {
|
|
1324
1324
|
constructor(parent) {
|
|
@@ -1376,10 +1376,10 @@ module.exports = class extends ChainedMap {
|
|
|
1376
1376
|
|
|
1377
1377
|
/***/ }),
|
|
1378
1378
|
|
|
1379
|
-
/***/
|
|
1379
|
+
/***/ 616:
|
|
1380
1380
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
1381
1381
|
|
|
1382
|
-
const ChainedValueMap = __nccwpck_require__(
|
|
1382
|
+
const ChainedValueMap = __nccwpck_require__(244);
|
|
1383
1383
|
|
|
1384
1384
|
module.exports = class extends ChainedValueMap {
|
|
1385
1385
|
constructor(parent) {
|
|
@@ -1391,11 +1391,11 @@ module.exports = class extends ChainedValueMap {
|
|
|
1391
1391
|
|
|
1392
1392
|
/***/ }),
|
|
1393
1393
|
|
|
1394
|
-
/***/
|
|
1394
|
+
/***/ 448:
|
|
1395
1395
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
1396
1396
|
|
|
1397
|
-
const ChainedMap = __nccwpck_require__(
|
|
1398
|
-
const Orderable = __nccwpck_require__(
|
|
1397
|
+
const ChainedMap = __nccwpck_require__(528);
|
|
1398
|
+
const Orderable = __nccwpck_require__(832);
|
|
1399
1399
|
|
|
1400
1400
|
module.exports = Orderable(
|
|
1401
1401
|
class extends ChainedMap {
|
|
@@ -1463,7 +1463,7 @@ module.exports = Orderable(
|
|
|
1463
1463
|
// or webpack configuration won't end up being used.
|
|
1464
1464
|
if (typeof plugin === 'string') {
|
|
1465
1465
|
pluginPath = plugin;
|
|
1466
|
-
plugin = __nccwpck_require__(
|
|
1466
|
+
plugin = __nccwpck_require__(484)(pluginPath);
|
|
1467
1467
|
}
|
|
1468
1468
|
|
|
1469
1469
|
const constructorName = plugin.__expression
|
|
@@ -1488,12 +1488,12 @@ module.exports = Orderable(
|
|
|
1488
1488
|
|
|
1489
1489
|
/***/ }),
|
|
1490
1490
|
|
|
1491
|
-
/***/
|
|
1491
|
+
/***/ 513:
|
|
1492
1492
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
1493
1493
|
|
|
1494
|
-
const ChainedMap = __nccwpck_require__(
|
|
1495
|
-
const ChainedSet = __nccwpck_require__(
|
|
1496
|
-
const Plugin = __nccwpck_require__(
|
|
1494
|
+
const ChainedMap = __nccwpck_require__(528);
|
|
1495
|
+
const ChainedSet = __nccwpck_require__(17);
|
|
1496
|
+
const Plugin = __nccwpck_require__(448);
|
|
1497
1497
|
|
|
1498
1498
|
const childMaps = ['alias', 'fallback', 'byDependency'];
|
|
1499
1499
|
const childSets = [
|
|
@@ -1587,11 +1587,11 @@ module.exports = class extends ChainedMap {
|
|
|
1587
1587
|
|
|
1588
1588
|
/***/ }),
|
|
1589
1589
|
|
|
1590
|
-
/***/
|
|
1590
|
+
/***/ 443:
|
|
1591
1591
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
1592
1592
|
|
|
1593
|
-
const Resolve = __nccwpck_require__(
|
|
1594
|
-
const ChainedSet = __nccwpck_require__(
|
|
1593
|
+
const Resolve = __nccwpck_require__(513);
|
|
1594
|
+
const ChainedSet = __nccwpck_require__(17);
|
|
1595
1595
|
|
|
1596
1596
|
module.exports = class extends Resolve {
|
|
1597
1597
|
constructor(parent) {
|
|
@@ -1626,14 +1626,14 @@ module.exports = class extends Resolve {
|
|
|
1626
1626
|
|
|
1627
1627
|
/***/ }),
|
|
1628
1628
|
|
|
1629
|
-
/***/
|
|
1629
|
+
/***/ 904:
|
|
1630
1630
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
1631
1631
|
|
|
1632
|
-
const ChainedMap = __nccwpck_require__(
|
|
1633
|
-
const ChainedSet = __nccwpck_require__(
|
|
1634
|
-
const Orderable = __nccwpck_require__(
|
|
1635
|
-
const Use = __nccwpck_require__(
|
|
1636
|
-
const Resolve = __nccwpck_require__(
|
|
1632
|
+
const ChainedMap = __nccwpck_require__(528);
|
|
1633
|
+
const ChainedSet = __nccwpck_require__(17);
|
|
1634
|
+
const Orderable = __nccwpck_require__(832);
|
|
1635
|
+
const Use = __nccwpck_require__(995);
|
|
1636
|
+
const Resolve = __nccwpck_require__(513);
|
|
1637
1637
|
|
|
1638
1638
|
function toArray(arr) {
|
|
1639
1639
|
return Array.isArray(arr) ? arr : [arr];
|
|
@@ -1779,12 +1779,12 @@ module.exports = Rule;
|
|
|
1779
1779
|
|
|
1780
1780
|
/***/ }),
|
|
1781
1781
|
|
|
1782
|
-
/***/
|
|
1782
|
+
/***/ 995:
|
|
1783
1783
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
1784
1784
|
|
|
1785
1785
|
const merge = __nccwpck_require__(296);
|
|
1786
|
-
const ChainedMap = __nccwpck_require__(
|
|
1787
|
-
const Orderable = __nccwpck_require__(
|
|
1786
|
+
const ChainedMap = __nccwpck_require__(528);
|
|
1787
|
+
const Orderable = __nccwpck_require__(832);
|
|
1788
1788
|
|
|
1789
1789
|
module.exports = Orderable(
|
|
1790
1790
|
class extends ChainedMap {
|
|
@@ -1828,7 +1828,7 @@ module.exports = Orderable(
|
|
|
1828
1828
|
|
|
1829
1829
|
/***/ }),
|
|
1830
1830
|
|
|
1831
|
-
/***/
|
|
1831
|
+
/***/ 772:
|
|
1832
1832
|
/***/ ((module) => {
|
|
1833
1833
|
|
|
1834
1834
|
module.exports = function createChainable(superClass) {
|
|
@@ -1852,7 +1852,7 @@ module.exports = function createChainable(superClass) {
|
|
|
1852
1852
|
|
|
1853
1853
|
/***/ }),
|
|
1854
1854
|
|
|
1855
|
-
/***/
|
|
1855
|
+
/***/ 538:
|
|
1856
1856
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
1857
1857
|
|
|
1858
1858
|
const merge = __nccwpck_require__(296);
|
|
@@ -2011,7 +2011,7 @@ module.exports = function createMap(superClass) {
|
|
|
2011
2011
|
|
|
2012
2012
|
/***/ }),
|
|
2013
2013
|
|
|
2014
|
-
/***/
|
|
2014
|
+
/***/ 8:
|
|
2015
2015
|
/***/ ((module) => {
|
|
2016
2016
|
|
|
2017
2017
|
module.exports = function createSet(superClass) {
|
|
@@ -2075,7 +2075,7 @@ module.exports = function createSet(superClass) {
|
|
|
2075
2075
|
|
|
2076
2076
|
/***/ }),
|
|
2077
2077
|
|
|
2078
|
-
/***/
|
|
2078
|
+
/***/ 445:
|
|
2079
2079
|
/***/ ((module) => {
|
|
2080
2080
|
|
|
2081
2081
|
module.exports = function createValue(superClass) {
|
|
@@ -2123,7 +2123,7 @@ module.exports = function createValue(superClass) {
|
|
|
2123
2123
|
|
|
2124
2124
|
/***/ }),
|
|
2125
2125
|
|
|
2126
|
-
/***/
|
|
2126
|
+
/***/ 484:
|
|
2127
2127
|
/***/ ((module) => {
|
|
2128
2128
|
|
|
2129
2129
|
function webpackEmptyContext(req) {
|
|
@@ -2133,7 +2133,7 @@ function webpackEmptyContext(req) {
|
|
|
2133
2133
|
}
|
|
2134
2134
|
webpackEmptyContext.keys = () => ([]);
|
|
2135
2135
|
webpackEmptyContext.resolve = webpackEmptyContext;
|
|
2136
|
-
webpackEmptyContext.id =
|
|
2136
|
+
webpackEmptyContext.id = 484;
|
|
2137
2137
|
module.exports = webpackEmptyContext;
|
|
2138
2138
|
|
|
2139
2139
|
/***/ })
|
|
@@ -2185,7 +2185,7 @@ module.exports = webpackEmptyContext;
|
|
|
2185
2185
|
/******/ // startup
|
|
2186
2186
|
/******/ // Load entry module and return exports
|
|
2187
2187
|
/******/ // This entry module is referenced by other modules so it can't be inlined
|
|
2188
|
-
/******/ var __webpack_exports__ = __nccwpck_require__(
|
|
2188
|
+
/******/ var __webpack_exports__ = __nccwpck_require__(968);
|
|
2189
2189
|
/******/ module.exports = __webpack_exports__;
|
|
2190
2190
|
/******/
|
|
2191
2191
|
/******/ })()
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"rspack-chain","author":"rspack-contrib","version":"0.7.
|
|
1
|
+
{"name":"rspack-chain","author":"rspack-contrib","version":"0.7.4","license":"MPL-2.0","types":"index.d.ts","type":"commonjs"}
|
|
@@ -7814,6 +7814,166 @@ exports.parse = parse;
|
|
|
7814
7814
|
}));
|
|
7815
7815
|
|
|
7816
7816
|
|
|
7817
|
+
/***/ }),
|
|
7818
|
+
|
|
7819
|
+
/***/ 225:
|
|
7820
|
+
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
7821
|
+
|
|
7822
|
+
var Stream = __nccwpck_require__(2781)
|
|
7823
|
+
var writeMethods = ["write", "end", "destroy"]
|
|
7824
|
+
var readMethods = ["resume", "pause"]
|
|
7825
|
+
var readEvents = ["data", "close"]
|
|
7826
|
+
var slice = Array.prototype.slice
|
|
7827
|
+
|
|
7828
|
+
module.exports = duplex
|
|
7829
|
+
|
|
7830
|
+
function forEach (arr, fn) {
|
|
7831
|
+
if (arr.forEach) {
|
|
7832
|
+
return arr.forEach(fn)
|
|
7833
|
+
}
|
|
7834
|
+
|
|
7835
|
+
for (var i = 0; i < arr.length; i++) {
|
|
7836
|
+
fn(arr[i], i)
|
|
7837
|
+
}
|
|
7838
|
+
}
|
|
7839
|
+
|
|
7840
|
+
function duplex(writer, reader) {
|
|
7841
|
+
var stream = new Stream()
|
|
7842
|
+
var ended = false
|
|
7843
|
+
|
|
7844
|
+
forEach(writeMethods, proxyWriter)
|
|
7845
|
+
|
|
7846
|
+
forEach(readMethods, proxyReader)
|
|
7847
|
+
|
|
7848
|
+
forEach(readEvents, proxyStream)
|
|
7849
|
+
|
|
7850
|
+
reader.on("end", handleEnd)
|
|
7851
|
+
|
|
7852
|
+
writer.on("drain", function() {
|
|
7853
|
+
stream.emit("drain")
|
|
7854
|
+
})
|
|
7855
|
+
|
|
7856
|
+
writer.on("error", reemit)
|
|
7857
|
+
reader.on("error", reemit)
|
|
7858
|
+
|
|
7859
|
+
stream.writable = writer.writable
|
|
7860
|
+
stream.readable = reader.readable
|
|
7861
|
+
|
|
7862
|
+
return stream
|
|
7863
|
+
|
|
7864
|
+
function proxyWriter(methodName) {
|
|
7865
|
+
stream[methodName] = method
|
|
7866
|
+
|
|
7867
|
+
function method() {
|
|
7868
|
+
return writer[methodName].apply(writer, arguments)
|
|
7869
|
+
}
|
|
7870
|
+
}
|
|
7871
|
+
|
|
7872
|
+
function proxyReader(methodName) {
|
|
7873
|
+
stream[methodName] = method
|
|
7874
|
+
|
|
7875
|
+
function method() {
|
|
7876
|
+
stream.emit(methodName)
|
|
7877
|
+
var func = reader[methodName]
|
|
7878
|
+
if (func) {
|
|
7879
|
+
return func.apply(reader, arguments)
|
|
7880
|
+
}
|
|
7881
|
+
reader.emit(methodName)
|
|
7882
|
+
}
|
|
7883
|
+
}
|
|
7884
|
+
|
|
7885
|
+
function proxyStream(methodName) {
|
|
7886
|
+
reader.on(methodName, reemit)
|
|
7887
|
+
|
|
7888
|
+
function reemit() {
|
|
7889
|
+
var args = slice.call(arguments)
|
|
7890
|
+
args.unshift(methodName)
|
|
7891
|
+
stream.emit.apply(stream, args)
|
|
7892
|
+
}
|
|
7893
|
+
}
|
|
7894
|
+
|
|
7895
|
+
function handleEnd() {
|
|
7896
|
+
if (ended) {
|
|
7897
|
+
return
|
|
7898
|
+
}
|
|
7899
|
+
ended = true
|
|
7900
|
+
var args = slice.call(arguments)
|
|
7901
|
+
args.unshift("end")
|
|
7902
|
+
stream.emit.apply(stream, args)
|
|
7903
|
+
}
|
|
7904
|
+
|
|
7905
|
+
function reemit(err) {
|
|
7906
|
+
stream.emit("error", err)
|
|
7907
|
+
}
|
|
7908
|
+
}
|
|
7909
|
+
|
|
7910
|
+
|
|
7911
|
+
/***/ }),
|
|
7912
|
+
|
|
7913
|
+
/***/ 2759:
|
|
7914
|
+
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
7915
|
+
|
|
7916
|
+
"use strict";
|
|
7917
|
+
|
|
7918
|
+
const fs = __nccwpck_require__(7147);
|
|
7919
|
+
const stream = __nccwpck_require__(2781);
|
|
7920
|
+
const zlib = __nccwpck_require__(9796);
|
|
7921
|
+
const {promisify} = __nccwpck_require__(3837);
|
|
7922
|
+
const duplexer = __nccwpck_require__(225);
|
|
7923
|
+
|
|
7924
|
+
const getOptions = options => ({level: 9, ...options});
|
|
7925
|
+
const gzip = promisify(zlib.gzip);
|
|
7926
|
+
|
|
7927
|
+
module.exports = async (input, options) => {
|
|
7928
|
+
if (!input) {
|
|
7929
|
+
return 0;
|
|
7930
|
+
}
|
|
7931
|
+
|
|
7932
|
+
const data = await gzip(input, getOptions(options));
|
|
7933
|
+
return data.length;
|
|
7934
|
+
};
|
|
7935
|
+
|
|
7936
|
+
module.exports.sync = (input, options) => zlib.gzipSync(input, getOptions(options)).length;
|
|
7937
|
+
|
|
7938
|
+
module.exports.stream = options => {
|
|
7939
|
+
const input = new stream.PassThrough();
|
|
7940
|
+
const output = new stream.PassThrough();
|
|
7941
|
+
const wrapper = duplexer(input, output);
|
|
7942
|
+
|
|
7943
|
+
let gzipSize = 0;
|
|
7944
|
+
const gzip = zlib.createGzip(getOptions(options))
|
|
7945
|
+
.on('data', buf => {
|
|
7946
|
+
gzipSize += buf.length;
|
|
7947
|
+
})
|
|
7948
|
+
.on('error', () => {
|
|
7949
|
+
wrapper.gzipSize = 0;
|
|
7950
|
+
})
|
|
7951
|
+
.on('end', () => {
|
|
7952
|
+
wrapper.gzipSize = gzipSize;
|
|
7953
|
+
wrapper.emit('gzip-size', gzipSize);
|
|
7954
|
+
output.end();
|
|
7955
|
+
});
|
|
7956
|
+
|
|
7957
|
+
input.pipe(gzip);
|
|
7958
|
+
input.pipe(output, {end: false});
|
|
7959
|
+
|
|
7960
|
+
return wrapper;
|
|
7961
|
+
};
|
|
7962
|
+
|
|
7963
|
+
module.exports.file = (path, options) => {
|
|
7964
|
+
return new Promise((resolve, reject) => {
|
|
7965
|
+
const stream = fs.createReadStream(path);
|
|
7966
|
+
stream.on('error', reject);
|
|
7967
|
+
|
|
7968
|
+
const gzipStream = stream.pipe(module.exports.stream(options));
|
|
7969
|
+
gzipStream.on('error', reject);
|
|
7970
|
+
gzipStream.on('gzip-size', resolve);
|
|
7971
|
+
});
|
|
7972
|
+
};
|
|
7973
|
+
|
|
7974
|
+
module.exports.fileSync = (path, options) => module.exports.sync(fs.readFileSync(path), options);
|
|
7975
|
+
|
|
7976
|
+
|
|
7817
7977
|
/***/ }),
|
|
7818
7978
|
|
|
7819
7979
|
/***/ 5486:
|
|
@@ -8866,7 +9026,7 @@ const fs = __nccwpck_require__(7147);
|
|
|
8866
9026
|
|
|
8867
9027
|
const path = __nccwpck_require__(1017);
|
|
8868
9028
|
|
|
8869
|
-
const gzipSize = __nccwpck_require__(
|
|
9029
|
+
const gzipSize = __nccwpck_require__(2759);
|
|
8870
9030
|
|
|
8871
9031
|
const {
|
|
8872
9032
|
parseChunked
|
|
@@ -9981,7 +10141,7 @@ __webpack_unused_export__ = ({
|
|
|
9981
10141
|
});
|
|
9982
10142
|
exports.Z = void 0;
|
|
9983
10143
|
|
|
9984
|
-
var _gzipSize = _interopRequireDefault(__nccwpck_require__(
|
|
10144
|
+
var _gzipSize = _interopRequireDefault(__nccwpck_require__(2759));
|
|
9985
10145
|
|
|
9986
10146
|
var _Module = _interopRequireDefault(__nccwpck_require__(1322));
|
|
9987
10147
|
|
|
@@ -10059,7 +10219,7 @@ Object.defineProperty(exports, "__esModule", ({
|
|
|
10059
10219
|
}));
|
|
10060
10220
|
exports["default"] = void 0;
|
|
10061
10221
|
|
|
10062
|
-
var _gzipSize = _interopRequireDefault(__nccwpck_require__(
|
|
10222
|
+
var _gzipSize = _interopRequireDefault(__nccwpck_require__(2759));
|
|
10063
10223
|
|
|
10064
10224
|
var _Node = _interopRequireDefault(__nccwpck_require__(2382));
|
|
10065
10225
|
|
|
@@ -14700,14 +14860,6 @@ module.exports = eval("require")("bufferutil");
|
|
|
14700
14860
|
module.exports = eval("require")("utf-8-validate");
|
|
14701
14861
|
|
|
14702
14862
|
|
|
14703
|
-
/***/ }),
|
|
14704
|
-
|
|
14705
|
-
/***/ 7115:
|
|
14706
|
-
/***/ ((module) => {
|
|
14707
|
-
|
|
14708
|
-
"use strict";
|
|
14709
|
-
module.exports = require("../gzip-size");
|
|
14710
|
-
|
|
14711
14863
|
/***/ }),
|
|
14712
14864
|
|
|
14713
14865
|
/***/ 3684:
|