@rsbuild/core 1.2.2 → 1.2.4
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/css-loader/index.js +18 -20
- package/compiled/postcss-load-config/index.js +9 -3
- package/compiled/postcss-loader/index.js +6 -6
- package/compiled/rsbuild-dev-middleware/index.js +177 -145
- package/compiled/rspack-chain/index.d.ts +2 -2
- package/compiled/rspack-chain/index.js +98 -71
- package/compiled/rspack-chain/license +22 -373
- package/compiled/rspack-chain/package.json +1 -1
- package/compiled/style-loader/index.js +10 -10
- package/dist/client/hmr.js +22 -13
- package/dist/index.cjs +81 -60
- package/dist/index.js +81 -60
- package/dist/transformLoader.mjs +3 -1
- package/dist/transformRawLoader.mjs +3 -1
- package/dist-types/configChain.d.ts +1 -2
- package/dist-types/index.d.ts +1 -1
- package/dist-types/plugins/basic.d.ts +1 -1
- package/dist-types/provider/createCompiler.d.ts +2 -1
- package/dist-types/provider/helpers.d.ts +1 -1
- package/dist-types/server/devMiddleware.d.ts +1 -1
- package/dist-types/server/helper.d.ts +1 -0
- package/dist-types/server/hmrFallback.d.ts +10 -0
- package/dist-types/types/config.d.ts +3 -1
- package/dist-types/types/hooks.d.ts +1 -0
- package/dist-types/types/plugin.d.ts +11 -2
- package/package.json +5 -5
|
@@ -159,12 +159,12 @@ declare namespace Config {
|
|
|
159
159
|
|
|
160
160
|
type RspackEntry = NonNullable<Configuration['entry']>;
|
|
161
161
|
|
|
162
|
-
type
|
|
162
|
+
type RspackEntryObject = Exclude<
|
|
163
163
|
RspackEntry,
|
|
164
164
|
string | string[] | Function
|
|
165
165
|
>[string];
|
|
166
166
|
|
|
167
|
-
class EntryPoint extends TypedChainedSet<Config,
|
|
167
|
+
class EntryPoint extends TypedChainedSet<Config, RspackEntryObject> {}
|
|
168
168
|
|
|
169
169
|
type RspackModule = Required<NonNullable<Configuration['module']>>;
|
|
170
170
|
|
|
@@ -627,7 +627,7 @@
|
|
|
627
627
|
};
|
|
628
628
|
exports.toString = toString;
|
|
629
629
|
},
|
|
630
|
-
|
|
630
|
+
777: (module) => {
|
|
631
631
|
module.exports = class extends Function {
|
|
632
632
|
constructor() {
|
|
633
633
|
super();
|
|
@@ -640,35 +640,66 @@
|
|
|
640
640
|
}
|
|
641
641
|
};
|
|
642
642
|
},
|
|
643
|
-
|
|
644
|
-
const createMap = __nccwpck_require__(
|
|
645
|
-
const createChainable = __nccwpck_require__(
|
|
643
|
+
747: (module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
644
|
+
const createMap = __nccwpck_require__(156);
|
|
645
|
+
const createChainable = __nccwpck_require__(363);
|
|
646
646
|
module.exports = createMap(createChainable(Object));
|
|
647
647
|
},
|
|
648
|
-
|
|
649
|
-
const createSet = __nccwpck_require__(
|
|
650
|
-
const createChainable = __nccwpck_require__(
|
|
648
|
+
109: (module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
649
|
+
const createSet = __nccwpck_require__(998);
|
|
650
|
+
const createChainable = __nccwpck_require__(363);
|
|
651
651
|
module.exports = createSet(createChainable(Object));
|
|
652
652
|
},
|
|
653
|
-
|
|
654
|
-
const Callable = __nccwpck_require__(
|
|
655
|
-
const createMap = __nccwpck_require__(
|
|
656
|
-
const createChainable = __nccwpck_require__(
|
|
657
|
-
const createValue = __nccwpck_require__(
|
|
653
|
+
360: (module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
654
|
+
const Callable = __nccwpck_require__(777);
|
|
655
|
+
const createMap = __nccwpck_require__(156);
|
|
656
|
+
const createChainable = __nccwpck_require__(363);
|
|
657
|
+
const createValue = __nccwpck_require__(987);
|
|
658
658
|
module.exports = createValue(createMap(createChainable(Callable)));
|
|
659
659
|
},
|
|
660
|
-
|
|
661
|
-
const ChainedMap = __nccwpck_require__(
|
|
662
|
-
const ChainedValueMap = __nccwpck_require__(
|
|
663
|
-
const ChainedSet = __nccwpck_require__(
|
|
664
|
-
const Resolve = __nccwpck_require__(
|
|
665
|
-
const ResolveLoader = __nccwpck_require__(
|
|
666
|
-
const Output = __nccwpck_require__(
|
|
667
|
-
const DevServer = __nccwpck_require__(
|
|
668
|
-
const Plugin = __nccwpck_require__(
|
|
669
|
-
const Module = __nccwpck_require__(
|
|
670
|
-
const Optimization = __nccwpck_require__(
|
|
671
|
-
const Performance = __nccwpck_require__(
|
|
660
|
+
751: (module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
661
|
+
const ChainedMap = __nccwpck_require__(747);
|
|
662
|
+
const ChainedValueMap = __nccwpck_require__(360);
|
|
663
|
+
const ChainedSet = __nccwpck_require__(109);
|
|
664
|
+
const Resolve = __nccwpck_require__(313);
|
|
665
|
+
const ResolveLoader = __nccwpck_require__(482);
|
|
666
|
+
const Output = __nccwpck_require__(68);
|
|
667
|
+
const DevServer = __nccwpck_require__(93);
|
|
668
|
+
const Plugin = __nccwpck_require__(594);
|
|
669
|
+
const Module = __nccwpck_require__(261);
|
|
670
|
+
const Optimization = __nccwpck_require__(336);
|
|
671
|
+
const Performance = __nccwpck_require__(575);
|
|
672
|
+
const castArray = (value) => (Array.isArray(value) ? value : [value]);
|
|
673
|
+
const toEntryObject = (entryPoints) => {
|
|
674
|
+
const entry = Object.keys(entryPoints).reduce(
|
|
675
|
+
(acc, key) =>
|
|
676
|
+
Object.assign(acc, { [key]: entryPoints[key].values() }),
|
|
677
|
+
{},
|
|
678
|
+
);
|
|
679
|
+
const formattedEntry = {};
|
|
680
|
+
for (const [entryName, entryValue] of Object.entries(entry)) {
|
|
681
|
+
const entryImport = [];
|
|
682
|
+
let entryDescription = null;
|
|
683
|
+
for (const item of castArray(entryValue)) {
|
|
684
|
+
if (typeof item === "string") {
|
|
685
|
+
entryImport.push(item);
|
|
686
|
+
continue;
|
|
687
|
+
}
|
|
688
|
+
if (item.import) {
|
|
689
|
+
entryImport.push(...castArray(item.import));
|
|
690
|
+
}
|
|
691
|
+
if (entryDescription) {
|
|
692
|
+
Object.assign(entryDescription, item);
|
|
693
|
+
} else {
|
|
694
|
+
entryDescription = item;
|
|
695
|
+
}
|
|
696
|
+
}
|
|
697
|
+
formattedEntry[entryName] = entryDescription
|
|
698
|
+
? { ...entryDescription, import: entryImport }
|
|
699
|
+
: entryImport;
|
|
700
|
+
}
|
|
701
|
+
return formattedEntry;
|
|
702
|
+
};
|
|
672
703
|
module.exports = class extends ChainedMap {
|
|
673
704
|
constructor() {
|
|
674
705
|
super();
|
|
@@ -777,11 +808,7 @@
|
|
|
777
808
|
optimization: this.optimization.toConfig(),
|
|
778
809
|
plugins: this.plugins.values().map((plugin) => plugin.toConfig()),
|
|
779
810
|
performance: this.performance.entries(),
|
|
780
|
-
entry:
|
|
781
|
-
(acc, key) =>
|
|
782
|
-
Object.assign(acc, { [key]: entryPoints[key].values() }),
|
|
783
|
-
{},
|
|
784
|
-
),
|
|
811
|
+
entry: toEntryObject(entryPoints),
|
|
785
812
|
}),
|
|
786
813
|
);
|
|
787
814
|
}
|
|
@@ -818,9 +845,9 @@
|
|
|
818
845
|
}
|
|
819
846
|
};
|
|
820
847
|
},
|
|
821
|
-
|
|
822
|
-
const ChainedMap = __nccwpck_require__(
|
|
823
|
-
const ChainedSet = __nccwpck_require__(
|
|
848
|
+
93: (module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
849
|
+
const ChainedMap = __nccwpck_require__(747);
|
|
850
|
+
const ChainedSet = __nccwpck_require__(109);
|
|
824
851
|
module.exports = class extends ChainedMap {
|
|
825
852
|
constructor(parent) {
|
|
826
853
|
super(parent);
|
|
@@ -892,9 +919,9 @@
|
|
|
892
919
|
}
|
|
893
920
|
};
|
|
894
921
|
},
|
|
895
|
-
|
|
896
|
-
const ChainedMap = __nccwpck_require__(
|
|
897
|
-
const Rule = __nccwpck_require__(
|
|
922
|
+
261: (module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
923
|
+
const ChainedMap = __nccwpck_require__(747);
|
|
924
|
+
const Rule = __nccwpck_require__(991);
|
|
898
925
|
module.exports = class extends ChainedMap {
|
|
899
926
|
constructor(parent) {
|
|
900
927
|
super(parent);
|
|
@@ -949,10 +976,10 @@
|
|
|
949
976
|
}
|
|
950
977
|
};
|
|
951
978
|
},
|
|
952
|
-
|
|
953
|
-
const ChainedMap = __nccwpck_require__(
|
|
954
|
-
const ChainedValueMap = __nccwpck_require__(
|
|
955
|
-
const Plugin = __nccwpck_require__(
|
|
979
|
+
336: (module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
980
|
+
const ChainedMap = __nccwpck_require__(747);
|
|
981
|
+
const ChainedValueMap = __nccwpck_require__(360);
|
|
982
|
+
const Plugin = __nccwpck_require__(594);
|
|
956
983
|
module.exports = class extends ChainedMap {
|
|
957
984
|
constructor(parent) {
|
|
958
985
|
super(parent);
|
|
@@ -1014,7 +1041,7 @@
|
|
|
1014
1041
|
}
|
|
1015
1042
|
};
|
|
1016
1043
|
},
|
|
1017
|
-
|
|
1044
|
+
925: (module) => {
|
|
1018
1045
|
module.exports = (Class) =>
|
|
1019
1046
|
class extends Class {
|
|
1020
1047
|
before(name) {
|
|
@@ -1046,8 +1073,8 @@
|
|
|
1046
1073
|
}
|
|
1047
1074
|
};
|
|
1048
1075
|
},
|
|
1049
|
-
|
|
1050
|
-
const ChainedMap = __nccwpck_require__(
|
|
1076
|
+
68: (module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
1077
|
+
const ChainedMap = __nccwpck_require__(747);
|
|
1051
1078
|
module.exports = class extends ChainedMap {
|
|
1052
1079
|
constructor(parent) {
|
|
1053
1080
|
super(parent);
|
|
@@ -1101,8 +1128,8 @@
|
|
|
1101
1128
|
}
|
|
1102
1129
|
};
|
|
1103
1130
|
},
|
|
1104
|
-
|
|
1105
|
-
const ChainedValueMap = __nccwpck_require__(
|
|
1131
|
+
575: (module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
1132
|
+
const ChainedValueMap = __nccwpck_require__(360);
|
|
1106
1133
|
module.exports = class extends ChainedValueMap {
|
|
1107
1134
|
constructor(parent) {
|
|
1108
1135
|
super(parent);
|
|
@@ -1115,9 +1142,9 @@
|
|
|
1115
1142
|
}
|
|
1116
1143
|
};
|
|
1117
1144
|
},
|
|
1118
|
-
|
|
1119
|
-
const ChainedMap = __nccwpck_require__(
|
|
1120
|
-
const Orderable = __nccwpck_require__(
|
|
1145
|
+
594: (module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
1146
|
+
const ChainedMap = __nccwpck_require__(747);
|
|
1147
|
+
const Orderable = __nccwpck_require__(925);
|
|
1121
1148
|
module.exports = Orderable(
|
|
1122
1149
|
class extends ChainedMap {
|
|
1123
1150
|
constructor(parent, name, type = "plugin") {
|
|
@@ -1171,7 +1198,7 @@
|
|
|
1171
1198
|
}
|
|
1172
1199
|
if (typeof plugin === "string") {
|
|
1173
1200
|
pluginPath = plugin;
|
|
1174
|
-
plugin = __nccwpck_require__(
|
|
1201
|
+
plugin = __nccwpck_require__(520)(pluginPath);
|
|
1175
1202
|
}
|
|
1176
1203
|
const constructorName = plugin.__expression
|
|
1177
1204
|
? `(${plugin.__expression})`
|
|
@@ -1189,10 +1216,10 @@
|
|
|
1189
1216
|
},
|
|
1190
1217
|
);
|
|
1191
1218
|
},
|
|
1192
|
-
|
|
1193
|
-
const ChainedMap = __nccwpck_require__(
|
|
1194
|
-
const ChainedSet = __nccwpck_require__(
|
|
1195
|
-
const Plugin = __nccwpck_require__(
|
|
1219
|
+
313: (module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
1220
|
+
const ChainedMap = __nccwpck_require__(747);
|
|
1221
|
+
const ChainedSet = __nccwpck_require__(109);
|
|
1222
|
+
const Plugin = __nccwpck_require__(594);
|
|
1196
1223
|
const childMaps = ["alias", "fallback", "byDependency", "extensionAlias"];
|
|
1197
1224
|
const childSets = [
|
|
1198
1225
|
"aliasFields",
|
|
@@ -1271,9 +1298,9 @@
|
|
|
1271
1298
|
}
|
|
1272
1299
|
};
|
|
1273
1300
|
},
|
|
1274
|
-
|
|
1275
|
-
const Resolve = __nccwpck_require__(
|
|
1276
|
-
const ChainedSet = __nccwpck_require__(
|
|
1301
|
+
482: (module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
1302
|
+
const Resolve = __nccwpck_require__(313);
|
|
1303
|
+
const ChainedSet = __nccwpck_require__(109);
|
|
1277
1304
|
module.exports = class extends Resolve {
|
|
1278
1305
|
constructor(parent) {
|
|
1279
1306
|
super(parent);
|
|
@@ -1300,12 +1327,12 @@
|
|
|
1300
1327
|
}
|
|
1301
1328
|
};
|
|
1302
1329
|
},
|
|
1303
|
-
|
|
1304
|
-
const ChainedMap = __nccwpck_require__(
|
|
1305
|
-
const ChainedSet = __nccwpck_require__(
|
|
1306
|
-
const Orderable = __nccwpck_require__(
|
|
1307
|
-
const Use = __nccwpck_require__(
|
|
1308
|
-
const Resolve = __nccwpck_require__(
|
|
1330
|
+
991: (module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
1331
|
+
const ChainedMap = __nccwpck_require__(747);
|
|
1332
|
+
const ChainedSet = __nccwpck_require__(109);
|
|
1333
|
+
const Orderable = __nccwpck_require__(925);
|
|
1334
|
+
const Use = __nccwpck_require__(146);
|
|
1335
|
+
const Resolve = __nccwpck_require__(313);
|
|
1309
1336
|
function toArray(arr) {
|
|
1310
1337
|
return Array.isArray(arr) ? arr : [arr];
|
|
1311
1338
|
}
|
|
@@ -1433,10 +1460,10 @@
|
|
|
1433
1460
|
);
|
|
1434
1461
|
module.exports = Rule;
|
|
1435
1462
|
},
|
|
1436
|
-
|
|
1463
|
+
146: (module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
1437
1464
|
const merge = __nccwpck_require__(779);
|
|
1438
|
-
const ChainedMap = __nccwpck_require__(
|
|
1439
|
-
const Orderable = __nccwpck_require__(
|
|
1465
|
+
const ChainedMap = __nccwpck_require__(747);
|
|
1466
|
+
const Orderable = __nccwpck_require__(925);
|
|
1440
1467
|
module.exports = Orderable(
|
|
1441
1468
|
class extends ChainedMap {
|
|
1442
1469
|
constructor(parent, name) {
|
|
@@ -1469,7 +1496,7 @@
|
|
|
1469
1496
|
},
|
|
1470
1497
|
);
|
|
1471
1498
|
},
|
|
1472
|
-
|
|
1499
|
+
363: (module) => {
|
|
1473
1500
|
module.exports = function createChainable(superClass) {
|
|
1474
1501
|
return class extends superClass {
|
|
1475
1502
|
constructor(parent) {
|
|
@@ -1486,7 +1513,7 @@
|
|
|
1486
1513
|
};
|
|
1487
1514
|
};
|
|
1488
1515
|
},
|
|
1489
|
-
|
|
1516
|
+
156: (module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
1490
1517
|
const merge = __nccwpck_require__(779);
|
|
1491
1518
|
module.exports = function createMap(superClass) {
|
|
1492
1519
|
return class extends superClass {
|
|
@@ -1610,7 +1637,7 @@
|
|
|
1610
1637
|
};
|
|
1611
1638
|
};
|
|
1612
1639
|
},
|
|
1613
|
-
|
|
1640
|
+
998: (module) => {
|
|
1614
1641
|
module.exports = function createSet(superClass) {
|
|
1615
1642
|
return class extends superClass {
|
|
1616
1643
|
constructor(...args) {
|
|
@@ -1660,7 +1687,7 @@
|
|
|
1660
1687
|
};
|
|
1661
1688
|
};
|
|
1662
1689
|
},
|
|
1663
|
-
|
|
1690
|
+
987: (module) => {
|
|
1664
1691
|
module.exports = function createValue(superClass) {
|
|
1665
1692
|
return class extends superClass {
|
|
1666
1693
|
constructor(...args) {
|
|
@@ -1698,7 +1725,7 @@
|
|
|
1698
1725
|
};
|
|
1699
1726
|
};
|
|
1700
1727
|
},
|
|
1701
|
-
|
|
1728
|
+
520: (module) => {
|
|
1702
1729
|
function webpackEmptyContext(req) {
|
|
1703
1730
|
var e = new Error("Cannot find module '" + req + "'");
|
|
1704
1731
|
e.code = "MODULE_NOT_FOUND";
|
|
@@ -1706,7 +1733,7 @@
|
|
|
1706
1733
|
}
|
|
1707
1734
|
webpackEmptyContext.keys = () => [];
|
|
1708
1735
|
webpackEmptyContext.resolve = webpackEmptyContext;
|
|
1709
|
-
webpackEmptyContext.id =
|
|
1736
|
+
webpackEmptyContext.id = 520;
|
|
1710
1737
|
module.exports = webpackEmptyContext;
|
|
1711
1738
|
},
|
|
1712
1739
|
};
|
|
@@ -1736,6 +1763,6 @@
|
|
|
1736
1763
|
})();
|
|
1737
1764
|
if (typeof __nccwpck_require__ !== "undefined")
|
|
1738
1765
|
__nccwpck_require__.ab = __dirname + "/";
|
|
1739
|
-
var __webpack_exports__ = __nccwpck_require__(
|
|
1766
|
+
var __webpack_exports__ = __nccwpck_require__(751);
|
|
1740
1767
|
module.exports = __webpack_exports__;
|
|
1741
1768
|
})();
|