@rsbuild/webpack 1.1.6 → 1.2.0-beta.0
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/README.md +1 -1
- package/dist/{664.cjs → 739.cjs} +7 -7
- package/dist/{863.js → 808.js} +6 -6
- package/dist/997.cjs +19 -24
- package/dist/997.js +19 -24
- package/dist/index.cjs +315 -317
- package/dist/index.js +23 -28
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<p align="center">
|
|
2
|
-
<a href="https://rsbuild.dev" target="blank"><img src="https://
|
|
2
|
+
<a href="https://rsbuild.dev" target="blank"><img src="https://assets.rspack.dev/rsbuild/rsbuild-banner.png" alt="Rsbuild Logo" /></a>
|
|
3
3
|
</p>
|
|
4
4
|
|
|
5
5
|
# @rsbuild/webpack
|
package/dist/{664.cjs → 739.cjs}
RENAMED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
let __rslib_import_meta_url__ = 'undefined' == typeof document ? new (require('url'.replace('', ''))).URL('file:' + __filename).href : document.currentScript && document.currentScript.src || new URL('main.js', document.baseURI).href;
|
|
3
3
|
exports.ids = [
|
|
4
|
-
'
|
|
4
|
+
'739'
|
|
5
5
|
], exports.modules = {
|
|
6
6
|
"./src/progress/ProgressPlugin.ts": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
7
7
|
__webpack_require__.d(__webpack_exports__, {
|
|
8
8
|
ProgressPlugin: ()=>ProgressPlugin
|
|
9
9
|
});
|
|
10
|
-
var core_ = __webpack_require__("@rsbuild/core"), external_picocolors_ = __webpack_require__("picocolors"), external_picocolors_default = __webpack_require__.n(external_picocolors_), external_webpack_ = __webpack_require__("webpack?
|
|
10
|
+
var core_ = __webpack_require__("@rsbuild/core"), external_picocolors_ = __webpack_require__("picocolors"), external_picocolors_default = __webpack_require__.n(external_picocolors_), external_webpack_ = __webpack_require__("webpack?70a8"), external_webpack_default = __webpack_require__.n(external_webpack_), external_node_console_ = __webpack_require__("node:console"), cli_truncate = __webpack_require__("../../../node_modules/.pnpm/cli-truncate@2.1.0/node_modules/cli-truncate/index.js"), cli_truncate_default = __webpack_require__.n(cli_truncate), build = __webpack_require__("../../../node_modules/.pnpm/patch-console@1.0.0/node_modules/patch-console/build/index.js"), build_default = __webpack_require__.n(build);
|
|
11
11
|
let clamp = (x, min, max)=>Math.min(max, Math.max(min, x)), defaultOption = {
|
|
12
12
|
total: 100,
|
|
13
13
|
current: 0,
|
|
@@ -78,7 +78,7 @@ exports.ids = [
|
|
|
78
78
|
let create = (stream)=>{
|
|
79
79
|
let previousLineCount = 0, previousOutput = '', render = (str)=>{
|
|
80
80
|
let output = `${str}\n`;
|
|
81
|
-
|
|
81
|
+
output !== previousOutput && (previousOutput = output, stream.write(ansi_escapes_default().eraseLines(previousLineCount) + output), previousLineCount = output.split('\n').length);
|
|
82
82
|
};
|
|
83
83
|
return render.clear = ()=>{
|
|
84
84
|
stream.write(ansi_escapes_default().eraseLines(previousLineCount)), previousOutput = '', previousLineCount = 0;
|
|
@@ -100,7 +100,7 @@ exports.ids = [
|
|
|
100
100
|
'yellow',
|
|
101
101
|
'blue',
|
|
102
102
|
'magenta'
|
|
103
|
-
], getProgressColor = (index)=>colorList[index % colorList.length], bus = new class
|
|
103
|
+
], getProgressColor = (index)=>colorList[index % colorList.length], bus = new class {
|
|
104
104
|
update(state) {
|
|
105
105
|
let index = this.states.findIndex((i)=>i.id === state.id);
|
|
106
106
|
if (-1 === index) {
|
|
@@ -129,7 +129,7 @@ exports.ids = [
|
|
|
129
129
|
}).filter((item)=>null !== item).join('\n'), this.writeToStd();
|
|
130
130
|
}
|
|
131
131
|
destroy() {
|
|
132
|
-
|
|
132
|
+
this.destroyed || this.restore(), this.destroyed = !0;
|
|
133
133
|
}
|
|
134
134
|
clear() {
|
|
135
135
|
this.log.clear(), this.log.done();
|
|
@@ -176,8 +176,8 @@ exports.ids = [
|
|
|
176
176
|
});
|
|
177
177
|
}
|
|
178
178
|
constructor(options){
|
|
179
|
-
let prevPercentage
|
|
180
|
-
let nonTTYLogger = (prevPercentage = 0, {
|
|
179
|
+
let prevPercentage;
|
|
180
|
+
let { id = 'Rsbuild' } = options, nonTTYLogger = (prevPercentage = 0, {
|
|
181
181
|
log: ({ id, done, current, hasErrors, compileTime })=>{
|
|
182
182
|
let suffix = external_picocolors_default().gray(`(${id})`);
|
|
183
183
|
if (done) {
|
package/dist/{863.js → 808.js}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export const ids = [
|
|
2
|
-
'
|
|
2
|
+
'808'
|
|
3
3
|
];
|
|
4
4
|
export const modules = {
|
|
5
5
|
"./src/progress/ProgressPlugin.ts": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
@@ -77,7 +77,7 @@ export const modules = {
|
|
|
77
77
|
let create = (stream)=>{
|
|
78
78
|
let previousLineCount = 0, previousOutput = '', render = (str)=>{
|
|
79
79
|
let output = `${str}\n`;
|
|
80
|
-
|
|
80
|
+
output !== previousOutput && (previousOutput = output, stream.write(ansi_escapes_default().eraseLines(previousLineCount) + output), previousLineCount = output.split('\n').length);
|
|
81
81
|
};
|
|
82
82
|
return render.clear = ()=>{
|
|
83
83
|
stream.write(ansi_escapes_default().eraseLines(previousLineCount)), previousOutput = '', previousLineCount = 0;
|
|
@@ -99,7 +99,7 @@ export const modules = {
|
|
|
99
99
|
'yellow',
|
|
100
100
|
'blue',
|
|
101
101
|
'magenta'
|
|
102
|
-
], getProgressColor = (index)=>colorList[index % colorList.length], bus = new class
|
|
102
|
+
], getProgressColor = (index)=>colorList[index % colorList.length], bus = new class {
|
|
103
103
|
update(state) {
|
|
104
104
|
let index = this.states.findIndex((i)=>i.id === state.id);
|
|
105
105
|
if (-1 === index) {
|
|
@@ -128,7 +128,7 @@ export const modules = {
|
|
|
128
128
|
}).filter((item)=>null !== item).join('\n'), this.writeToStd();
|
|
129
129
|
}
|
|
130
130
|
destroy() {
|
|
131
|
-
|
|
131
|
+
this.destroyed || this.restore(), this.destroyed = !0;
|
|
132
132
|
}
|
|
133
133
|
clear() {
|
|
134
134
|
this.log.clear(), this.log.done();
|
|
@@ -175,8 +175,8 @@ export const modules = {
|
|
|
175
175
|
});
|
|
176
176
|
}
|
|
177
177
|
constructor(options){
|
|
178
|
-
let prevPercentage
|
|
179
|
-
let nonTTYLogger = (prevPercentage = 0, {
|
|
178
|
+
let prevPercentage;
|
|
179
|
+
let { id = 'Rsbuild' } = options, nonTTYLogger = (prevPercentage = 0, {
|
|
180
180
|
log: ({ id, done, current, hasErrors, compileTime })=>{
|
|
181
181
|
let suffix = external_picocolors_.default.gray(`(${id})`);
|
|
182
182
|
if (done) {
|
package/dist/997.cjs
CHANGED
|
@@ -430,13 +430,13 @@ exports.ids = [
|
|
|
430
430
|
});
|
|
431
431
|
}
|
|
432
432
|
convert.rgb.hsl = function(rgb) {
|
|
433
|
-
let h
|
|
433
|
+
let h;
|
|
434
434
|
let r = rgb[0] / 255, g = rgb[1] / 255, b = rgb[2] / 255, min = Math.min(r, g, b), max = Math.max(r, g, b), delta = max - min;
|
|
435
435
|
max === min ? h = 0 : r === max ? h = (g - b) / delta : g === max ? h = 2 + (b - r) / delta : b === max && (h = 4 + (r - g) / delta), (h = Math.min(60 * h, 360)) < 0 && (h += 360);
|
|
436
436
|
let l = (min + max) / 2;
|
|
437
437
|
return [
|
|
438
438
|
h,
|
|
439
|
-
100 * (
|
|
439
|
+
100 * (max === min ? 0 : l <= 0.5 ? delta / (max + min) : delta / (2 - max - min)),
|
|
440
440
|
100 * l
|
|
441
441
|
];
|
|
442
442
|
}, convert.rgb.hsv = function(rgb) {
|
|
@@ -450,9 +450,9 @@ exports.ids = [
|
|
|
450
450
|
100 * v
|
|
451
451
|
];
|
|
452
452
|
}, convert.rgb.hwb = function(rgb) {
|
|
453
|
-
let r = rgb[0], g = rgb[1], b = rgb[2]
|
|
453
|
+
let r = rgb[0], g = rgb[1], b = rgb[2];
|
|
454
454
|
return [
|
|
455
|
-
|
|
455
|
+
convert.rgb.hsl(rgb)[0],
|
|
456
456
|
1 / 255 * Math.min(r, Math.min(g, b)) * 100,
|
|
457
457
|
100 * (b = 1 - 1 / 255 * Math.max(r, Math.max(g, b)))
|
|
458
458
|
];
|
|
@@ -464,16 +464,13 @@ exports.ids = [
|
|
|
464
464
|
100 * ((1 - b - k) / (1 - k) || 0),
|
|
465
465
|
100 * k
|
|
466
466
|
];
|
|
467
|
-
}
|
|
468
|
-
convert.rgb.keyword = function(rgb) {
|
|
467
|
+
}, convert.rgb.keyword = function(rgb) {
|
|
469
468
|
let currentClosestKeyword;
|
|
470
469
|
let reversed = reverseKeywords[rgb];
|
|
471
470
|
if (reversed) return reversed;
|
|
472
471
|
let currentClosestDistance = 1 / 0;
|
|
473
472
|
for (let keyword of Object.keys(cssKeywords)){
|
|
474
|
-
|
|
475
|
-
let value = cssKeywords[keyword];
|
|
476
|
-
let distance = (x = rgb, y = value, (x[0] - y[0]) ** 2 + (x[1] - y[1]) ** 2 + (x[2] - y[2]) ** 2);
|
|
473
|
+
let value = cssKeywords[keyword], distance = (rgb[0] - value[0]) ** 2 + (rgb[1] - value[1]) ** 2 + (rgb[2] - value[2]) ** 2;
|
|
477
474
|
distance < currentClosestDistance && (currentClosestDistance = distance, currentClosestKeyword = keyword);
|
|
478
475
|
}
|
|
479
476
|
return currentClosestKeyword;
|
|
@@ -563,9 +560,9 @@ exports.ids = [
|
|
|
563
560
|
let h = hsv[0], s = hsv[1] / 100, v = hsv[2] / 100, vmin = Math.max(v, 0.01);
|
|
564
561
|
l = (2 - s) * v;
|
|
565
562
|
let lmin = (2 - s) * vmin;
|
|
566
|
-
return
|
|
563
|
+
return [
|
|
567
564
|
h,
|
|
568
|
-
100 * sl,
|
|
565
|
+
100 * (sl = (sl = s * vmin / (lmin <= 1 ? lmin : 2 - lmin)) || 0),
|
|
569
566
|
100 * (l /= 2)
|
|
570
567
|
];
|
|
571
568
|
}, convert.hwb.rgb = function(hwb) {
|
|
@@ -657,8 +654,7 @@ exports.ids = [
|
|
|
657
654
|
return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]);
|
|
658
655
|
}, convert.rgb.ansi256 = function(args) {
|
|
659
656
|
let r = args[0], g = args[1], b = args[2];
|
|
660
|
-
|
|
661
|
-
return 16 + 36 * Math.round(r / 255 * 5) + 6 * Math.round(g / 255 * 5) + Math.round(b / 255 * 5);
|
|
657
|
+
return r === g && g === b ? r < 8 ? 16 : r > 248 ? 231 : Math.round((r - 8) / 247 * 24) + 232 : 16 + 36 * Math.round(r / 255 * 5) + 6 * Math.round(g / 255 * 5) + Math.round(b / 255 * 5);
|
|
662
658
|
}, convert.ansi16.rgb = function(args) {
|
|
663
659
|
let color = args % 10;
|
|
664
660
|
if (0 === color || 7 === color) return args > 50 && (color += 3.5), [
|
|
@@ -682,10 +678,9 @@ exports.ids = [
|
|
|
682
678
|
c
|
|
683
679
|
];
|
|
684
680
|
}
|
|
685
|
-
let r = Math.floor((args -= 16) / 36) / 5 * 255, g = Math.floor((rem = args % 36) / 6) / 5 * 255;
|
|
686
681
|
return [
|
|
687
|
-
|
|
688
|
-
|
|
682
|
+
Math.floor((args -= 16) / 36) / 5 * 255,
|
|
683
|
+
Math.floor((rem = args % 36) / 6) / 5 * 255,
|
|
689
684
|
rem % 6 / 5 * 255
|
|
690
685
|
];
|
|
691
686
|
}, convert.rgb.hex = function(args) {
|
|
@@ -707,10 +702,10 @@ exports.ids = [
|
|
|
707
702
|
0xFF & integer
|
|
708
703
|
];
|
|
709
704
|
}, convert.rgb.hcg = function(rgb) {
|
|
710
|
-
let grayscale
|
|
705
|
+
let grayscale;
|
|
711
706
|
let r = rgb[0] / 255, g = rgb[1] / 255, b = rgb[2] / 255, max = Math.max(Math.max(r, g), b), min = Math.min(Math.min(r, g), b), chroma = max - min;
|
|
712
707
|
return grayscale = chroma < 1 ? min / (1 - chroma) : 0, [
|
|
713
|
-
|
|
708
|
+
(chroma <= 0 ? 0 : max === r ? (g - b) / chroma % 6 : max === g ? 2 + (b - r) / chroma : 4 + (r - g) / chroma) / 6 % 1 * 360,
|
|
714
709
|
100 * chroma,
|
|
715
710
|
100 * grayscale
|
|
716
711
|
];
|
|
@@ -845,8 +840,8 @@ exports.ids = [
|
|
|
845
840
|
};
|
|
846
841
|
},
|
|
847
842
|
"../../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/index.js": function(module, __unused_webpack_exports, __webpack_require__) {
|
|
848
|
-
let conversions = __webpack_require__("../../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/conversions.js"), route = __webpack_require__("../../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/route.js"), convert = {}
|
|
849
|
-
|
|
843
|
+
let conversions = __webpack_require__("../../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/conversions.js"), route = __webpack_require__("../../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/route.js"), convert = {};
|
|
844
|
+
Object.keys(conversions).forEach((fromModel)=>{
|
|
850
845
|
convert[fromModel] = {}, Object.defineProperty(convert[fromModel], 'channels', {
|
|
851
846
|
value: conversions[fromModel].channels
|
|
852
847
|
}), Object.defineProperty(convert[fromModel], 'labels', {
|
|
@@ -900,7 +895,7 @@ exports.ids = [
|
|
|
900
895
|
}(fromModel), conversion = {}, models = Object.keys(graph);
|
|
901
896
|
for(let len = models.length, i = 0; i < len; i++){
|
|
902
897
|
let toModel = models[i];
|
|
903
|
-
|
|
898
|
+
null !== graph[toModel].parent && (conversion[toModel] = function(toModel, graph) {
|
|
904
899
|
let path = [
|
|
905
900
|
graph[toModel].parent,
|
|
906
901
|
toModel
|
|
@@ -911,7 +906,7 @@ exports.ids = [
|
|
|
911
906
|
};
|
|
912
907
|
}(conversions[graph[cur].parent][cur], fn), cur = graph[cur].parent;
|
|
913
908
|
return fn.conversion = path, fn;
|
|
914
|
-
}(toModel, graph);
|
|
909
|
+
}(toModel, graph));
|
|
915
910
|
}
|
|
916
911
|
return conversion;
|
|
917
912
|
};
|
|
@@ -1669,7 +1664,7 @@ exports.ids = [
|
|
|
1669
1664
|
},
|
|
1670
1665
|
"../../../node_modules/.pnpm/is-fullwidth-code-point@3.0.0/node_modules/is-fullwidth-code-point/index.js": function(module) {
|
|
1671
1666
|
"use strict";
|
|
1672
|
-
let isFullwidthCodePoint = (codePoint)=>!Number.isNaN(codePoint) &&
|
|
1667
|
+
let isFullwidthCodePoint = (codePoint)=>!Number.isNaN(codePoint) && !!(codePoint >= 0x1100) && (!!(codePoint <= 0x115F) || 0x2329 === codePoint || 0x232A === codePoint || !!(0x2E80 <= codePoint) && !!(codePoint <= 0x3247) && 0x303F !== codePoint || !!(0x3250 <= codePoint) && !!(codePoint <= 0x4DBF) || !!(0x4E00 <= codePoint) && !!(codePoint <= 0xA4C6) || !!(0xA960 <= codePoint) && !!(codePoint <= 0xA97C) || !!(0xAC00 <= codePoint) && !!(codePoint <= 0xD7A3) || !!(0xF900 <= codePoint) && !!(codePoint <= 0xFAFF) || !!(0xFE10 <= codePoint) && !!(codePoint <= 0xFE19) || !!(0xFE30 <= codePoint) && !!(codePoint <= 0xFE6B) || !!(0xFF01 <= codePoint) && !!(codePoint <= 0xFF60) || !!(0xFFE0 <= codePoint) && !!(codePoint <= 0xFFE6) || !!(0x1B000 <= codePoint) && !!(codePoint <= 0x1B001) || !!(0x1F200 <= codePoint) && !!(codePoint <= 0x1F251) || !!(0x20000 <= codePoint) && !!(codePoint <= 0x3FFFD));
|
|
1673
1668
|
module.exports = isFullwidthCodePoint, module.exports.default = isFullwidthCodePoint;
|
|
1674
1669
|
},
|
|
1675
1670
|
"../../../node_modules/.pnpm/patch-console@1.0.0/node_modules/patch-console/build/index.js": function(module, __unused_webpack_exports, __webpack_require__) {
|
|
@@ -1772,7 +1767,7 @@ exports.ids = [
|
|
|
1772
1767
|
let width = 0;
|
|
1773
1768
|
for(let i = 0; i < string.length; i++){
|
|
1774
1769
|
let code = string.codePointAt(i);
|
|
1775
|
-
|
|
1770
|
+
!(code <= 0x1F) && (!(code >= 0x7F) || !(code <= 0x9F)) && (!(code >= 0x300) || !(code <= 0x36F)) && (code > 0xFFFF && i++, width += isFullwidthCodePoint(code) ? 2 : 1);
|
|
1776
1771
|
}
|
|
1777
1772
|
return width;
|
|
1778
1773
|
};
|
package/dist/997.js
CHANGED
|
@@ -425,13 +425,13 @@ export const modules = {
|
|
|
425
425
|
});
|
|
426
426
|
}
|
|
427
427
|
convert.rgb.hsl = function(rgb) {
|
|
428
|
-
let h
|
|
428
|
+
let h;
|
|
429
429
|
let r = rgb[0] / 255, g = rgb[1] / 255, b = rgb[2] / 255, min = Math.min(r, g, b), max = Math.max(r, g, b), delta = max - min;
|
|
430
430
|
max === min ? h = 0 : r === max ? h = (g - b) / delta : g === max ? h = 2 + (b - r) / delta : b === max && (h = 4 + (r - g) / delta), (h = Math.min(60 * h, 360)) < 0 && (h += 360);
|
|
431
431
|
let l = (min + max) / 2;
|
|
432
432
|
return [
|
|
433
433
|
h,
|
|
434
|
-
100 * (
|
|
434
|
+
100 * (max === min ? 0 : l <= 0.5 ? delta / (max + min) : delta / (2 - max - min)),
|
|
435
435
|
100 * l
|
|
436
436
|
];
|
|
437
437
|
}, convert.rgb.hsv = function(rgb) {
|
|
@@ -445,9 +445,9 @@ export const modules = {
|
|
|
445
445
|
100 * v
|
|
446
446
|
];
|
|
447
447
|
}, convert.rgb.hwb = function(rgb) {
|
|
448
|
-
let r = rgb[0], g = rgb[1], b = rgb[2]
|
|
448
|
+
let r = rgb[0], g = rgb[1], b = rgb[2];
|
|
449
449
|
return [
|
|
450
|
-
|
|
450
|
+
convert.rgb.hsl(rgb)[0],
|
|
451
451
|
1 / 255 * Math.min(r, Math.min(g, b)) * 100,
|
|
452
452
|
100 * (b = 1 - 1 / 255 * Math.max(r, Math.max(g, b)))
|
|
453
453
|
];
|
|
@@ -459,16 +459,13 @@ export const modules = {
|
|
|
459
459
|
100 * ((1 - b - k) / (1 - k) || 0),
|
|
460
460
|
100 * k
|
|
461
461
|
];
|
|
462
|
-
}
|
|
463
|
-
convert.rgb.keyword = function(rgb) {
|
|
462
|
+
}, convert.rgb.keyword = function(rgb) {
|
|
464
463
|
let currentClosestKeyword;
|
|
465
464
|
let reversed = reverseKeywords[rgb];
|
|
466
465
|
if (reversed) return reversed;
|
|
467
466
|
let currentClosestDistance = 1 / 0;
|
|
468
467
|
for (let keyword of Object.keys(cssKeywords)){
|
|
469
|
-
|
|
470
|
-
let value = cssKeywords[keyword];
|
|
471
|
-
let distance = (x = rgb, y = value, (x[0] - y[0]) ** 2 + (x[1] - y[1]) ** 2 + (x[2] - y[2]) ** 2);
|
|
468
|
+
let value = cssKeywords[keyword], distance = (rgb[0] - value[0]) ** 2 + (rgb[1] - value[1]) ** 2 + (rgb[2] - value[2]) ** 2;
|
|
472
469
|
distance < currentClosestDistance && (currentClosestDistance = distance, currentClosestKeyword = keyword);
|
|
473
470
|
}
|
|
474
471
|
return currentClosestKeyword;
|
|
@@ -558,9 +555,9 @@ export const modules = {
|
|
|
558
555
|
let h = hsv[0], s = hsv[1] / 100, v = hsv[2] / 100, vmin = Math.max(v, 0.01);
|
|
559
556
|
l = (2 - s) * v;
|
|
560
557
|
let lmin = (2 - s) * vmin;
|
|
561
|
-
return
|
|
558
|
+
return [
|
|
562
559
|
h,
|
|
563
|
-
100 * sl,
|
|
560
|
+
100 * (sl = (sl = s * vmin / (lmin <= 1 ? lmin : 2 - lmin)) || 0),
|
|
564
561
|
100 * (l /= 2)
|
|
565
562
|
];
|
|
566
563
|
}, convert.hwb.rgb = function(hwb) {
|
|
@@ -652,8 +649,7 @@ export const modules = {
|
|
|
652
649
|
return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]);
|
|
653
650
|
}, convert.rgb.ansi256 = function(args) {
|
|
654
651
|
let r = args[0], g = args[1], b = args[2];
|
|
655
|
-
|
|
656
|
-
return 16 + 36 * Math.round(r / 255 * 5) + 6 * Math.round(g / 255 * 5) + Math.round(b / 255 * 5);
|
|
652
|
+
return r === g && g === b ? r < 8 ? 16 : r > 248 ? 231 : Math.round((r - 8) / 247 * 24) + 232 : 16 + 36 * Math.round(r / 255 * 5) + 6 * Math.round(g / 255 * 5) + Math.round(b / 255 * 5);
|
|
657
653
|
}, convert.ansi16.rgb = function(args) {
|
|
658
654
|
let color = args % 10;
|
|
659
655
|
if (0 === color || 7 === color) return args > 50 && (color += 3.5), [
|
|
@@ -677,10 +673,9 @@ export const modules = {
|
|
|
677
673
|
c
|
|
678
674
|
];
|
|
679
675
|
}
|
|
680
|
-
let r = Math.floor((args -= 16) / 36) / 5 * 255, g = Math.floor((rem = args % 36) / 6) / 5 * 255;
|
|
681
676
|
return [
|
|
682
|
-
|
|
683
|
-
|
|
677
|
+
Math.floor((args -= 16) / 36) / 5 * 255,
|
|
678
|
+
Math.floor((rem = args % 36) / 6) / 5 * 255,
|
|
684
679
|
rem % 6 / 5 * 255
|
|
685
680
|
];
|
|
686
681
|
}, convert.rgb.hex = function(args) {
|
|
@@ -702,10 +697,10 @@ export const modules = {
|
|
|
702
697
|
0xFF & integer
|
|
703
698
|
];
|
|
704
699
|
}, convert.rgb.hcg = function(rgb) {
|
|
705
|
-
let grayscale
|
|
700
|
+
let grayscale;
|
|
706
701
|
let r = rgb[0] / 255, g = rgb[1] / 255, b = rgb[2] / 255, max = Math.max(Math.max(r, g), b), min = Math.min(Math.min(r, g), b), chroma = max - min;
|
|
707
702
|
return grayscale = chroma < 1 ? min / (1 - chroma) : 0, [
|
|
708
|
-
|
|
703
|
+
(chroma <= 0 ? 0 : max === r ? (g - b) / chroma % 6 : max === g ? 2 + (b - r) / chroma : 4 + (r - g) / chroma) / 6 % 1 * 360,
|
|
709
704
|
100 * chroma,
|
|
710
705
|
100 * grayscale
|
|
711
706
|
];
|
|
@@ -840,8 +835,8 @@ export const modules = {
|
|
|
840
835
|
};
|
|
841
836
|
},
|
|
842
837
|
"../../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/index.js": function(module, __unused_webpack_exports, __webpack_require__) {
|
|
843
|
-
let conversions = __webpack_require__("../../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/conversions.js"), route = __webpack_require__("../../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/route.js"), convert = {}
|
|
844
|
-
|
|
838
|
+
let conversions = __webpack_require__("../../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/conversions.js"), route = __webpack_require__("../../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/route.js"), convert = {};
|
|
839
|
+
Object.keys(conversions).forEach((fromModel)=>{
|
|
845
840
|
convert[fromModel] = {}, Object.defineProperty(convert[fromModel], 'channels', {
|
|
846
841
|
value: conversions[fromModel].channels
|
|
847
842
|
}), Object.defineProperty(convert[fromModel], 'labels', {
|
|
@@ -895,7 +890,7 @@ export const modules = {
|
|
|
895
890
|
}(fromModel), conversion = {}, models = Object.keys(graph);
|
|
896
891
|
for(let len = models.length, i = 0; i < len; i++){
|
|
897
892
|
let toModel = models[i];
|
|
898
|
-
|
|
893
|
+
null !== graph[toModel].parent && (conversion[toModel] = function(toModel, graph) {
|
|
899
894
|
let path = [
|
|
900
895
|
graph[toModel].parent,
|
|
901
896
|
toModel
|
|
@@ -906,7 +901,7 @@ export const modules = {
|
|
|
906
901
|
};
|
|
907
902
|
}(conversions[graph[cur].parent][cur], fn), cur = graph[cur].parent;
|
|
908
903
|
return fn.conversion = path, fn;
|
|
909
|
-
}(toModel, graph);
|
|
904
|
+
}(toModel, graph));
|
|
910
905
|
}
|
|
911
906
|
return conversion;
|
|
912
907
|
};
|
|
@@ -1661,7 +1656,7 @@ export const modules = {
|
|
|
1661
1656
|
};
|
|
1662
1657
|
},
|
|
1663
1658
|
"../../../node_modules/.pnpm/is-fullwidth-code-point@3.0.0/node_modules/is-fullwidth-code-point/index.js": function(module) {
|
|
1664
|
-
let isFullwidthCodePoint = (codePoint)=>!Number.isNaN(codePoint) &&
|
|
1659
|
+
let isFullwidthCodePoint = (codePoint)=>!Number.isNaN(codePoint) && !!(codePoint >= 0x1100) && (!!(codePoint <= 0x115F) || 0x2329 === codePoint || 0x232A === codePoint || !!(0x2E80 <= codePoint) && !!(codePoint <= 0x3247) && 0x303F !== codePoint || !!(0x3250 <= codePoint) && !!(codePoint <= 0x4DBF) || !!(0x4E00 <= codePoint) && !!(codePoint <= 0xA4C6) || !!(0xA960 <= codePoint) && !!(codePoint <= 0xA97C) || !!(0xAC00 <= codePoint) && !!(codePoint <= 0xD7A3) || !!(0xF900 <= codePoint) && !!(codePoint <= 0xFAFF) || !!(0xFE10 <= codePoint) && !!(codePoint <= 0xFE19) || !!(0xFE30 <= codePoint) && !!(codePoint <= 0xFE6B) || !!(0xFF01 <= codePoint) && !!(codePoint <= 0xFF60) || !!(0xFFE0 <= codePoint) && !!(codePoint <= 0xFFE6) || !!(0x1B000 <= codePoint) && !!(codePoint <= 0x1B001) || !!(0x1F200 <= codePoint) && !!(codePoint <= 0x1F251) || !!(0x20000 <= codePoint) && !!(codePoint <= 0x3FFFD));
|
|
1665
1660
|
module.exports = isFullwidthCodePoint, module.exports.default = isFullwidthCodePoint;
|
|
1666
1661
|
},
|
|
1667
1662
|
"../../../node_modules/.pnpm/patch-console@1.0.0/node_modules/patch-console/build/index.js": function(module, __unused_webpack_exports, __webpack_require__) {
|
|
@@ -1761,7 +1756,7 @@ export const modules = {
|
|
|
1761
1756
|
let width = 0;
|
|
1762
1757
|
for(let i = 0; i < string.length; i++){
|
|
1763
1758
|
let code = string.codePointAt(i);
|
|
1764
|
-
|
|
1759
|
+
!(code <= 0x1F) && (!(code >= 0x7F) || !(code <= 0x9F)) && (!(code >= 0x300) || !(code <= 0x36F)) && (code > 0xFFFF && i++, width += isFullwidthCodePoint(code) ? 2 : 1);
|
|
1765
1760
|
}
|
|
1766
1761
|
return width;
|
|
1767
1762
|
};
|
package/dist/index.cjs
CHANGED
|
@@ -13,7 +13,7 @@ var __webpack_modules__ = {
|
|
|
13
13
|
stream: function(module) {
|
|
14
14
|
module.exports = require("stream");
|
|
15
15
|
},
|
|
16
|
-
"webpack?
|
|
16
|
+
"webpack?70a8": function(module) {
|
|
17
17
|
module.exports = require("webpack");
|
|
18
18
|
},
|
|
19
19
|
"copy-webpack-plugin": function(module) {
|
|
@@ -28,7 +28,7 @@ var __webpack_modules__ = {
|
|
|
28
28
|
"tsconfig-paths-webpack-plugin": function(module) {
|
|
29
29
|
module.exports = import("tsconfig-paths-webpack-plugin");
|
|
30
30
|
},
|
|
31
|
-
"webpack?
|
|
31
|
+
"webpack?fd69": function(module) {
|
|
32
32
|
module.exports = import("webpack");
|
|
33
33
|
}
|
|
34
34
|
}, __webpack_module_cache__ = {};
|
|
@@ -71,7 +71,7 @@ __webpack_require__.m = __webpack_modules__, __webpack_require__.n = function(mo
|
|
|
71
71
|
value: !0
|
|
72
72
|
});
|
|
73
73
|
}, __webpack_require__.nmd = function(module) {
|
|
74
|
-
return module.paths = [],
|
|
74
|
+
return module.paths = [], module.children || (module.children = []), module;
|
|
75
75
|
}, (()=>{
|
|
76
76
|
var installedChunks = {
|
|
77
77
|
980: 1
|
|
@@ -82,341 +82,339 @@ __webpack_require__.m = __webpack_modules__, __webpack_require__.n = function(mo
|
|
|
82
82
|
for(var i = 0; i < chunkIds.length; i++)installedChunks[chunkIds[i]] = 1;
|
|
83
83
|
};
|
|
84
84
|
__webpack_require__.f.require = function(chunkId, promises) {
|
|
85
|
-
|
|
85
|
+
installedChunks[chunkId] || installChunk(require("./" + __webpack_require__.u(chunkId)));
|
|
86
86
|
};
|
|
87
87
|
})();
|
|
88
88
|
var __webpack_exports__ = {};
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
var core_ = __webpack_require__("@rsbuild/core");
|
|
93
|
-
let MultiStats_js_namespaceObject = require("webpack/lib/MultiStats.js");
|
|
94
|
-
var MultiStats_js_default = __webpack_require__.n(MultiStats_js_namespaceObject);
|
|
95
|
-
let external_node_path_namespaceObject = require("node:path"), getInspectOutputPath = (context, inspectOptions)=>{
|
|
96
|
-
if (inspectOptions.outputPath) return (0, external_node_path_namespaceObject.isAbsolute)(inspectOptions.outputPath) ? inspectOptions.outputPath : (0, external_node_path_namespaceObject.join)(context.distPath, inspectOptions.outputPath);
|
|
97
|
-
return (0, external_node_path_namespaceObject.join)(context.distPath, '.rsbuild');
|
|
98
|
-
};
|
|
99
|
-
async function inspectConfig({ helpers, context, pluginManager, rsbuildOptions, bundlerConfigs, inspectOptions = {} }) {
|
|
100
|
-
inspectOptions.mode ? process.env.NODE_ENV = inspectOptions.mode : !process.env.NODE_ENV && (process.env.NODE_ENV = 'development');
|
|
101
|
-
let webpackConfigs = bundlerConfigs || (await initConfigs({
|
|
102
|
-
context,
|
|
103
|
-
pluginManager,
|
|
104
|
-
rsbuildOptions,
|
|
105
|
-
helpers
|
|
106
|
-
})).webpackConfigs, rawBundlerConfigs = webpackConfigs.map((config, index)=>({
|
|
107
|
-
name: config.name || String(index),
|
|
108
|
-
content: helpers.stringifyConfig(config, inspectOptions.verbose)
|
|
109
|
-
})), { rsbuildConfig, rawRsbuildConfig, environmentConfigs, rawEnvironmentConfigs } = helpers.getRsbuildInspectConfig({
|
|
110
|
-
normalizedConfig: context.normalizedConfig,
|
|
111
|
-
inspectOptions,
|
|
112
|
-
pluginManager
|
|
113
|
-
}), outputPath = getInspectOutputPath(context, inspectOptions);
|
|
114
|
-
return inspectOptions.writeToDisk && await helpers.outputInspectConfigFiles({
|
|
115
|
-
rawBundlerConfigs,
|
|
116
|
-
rawEnvironmentConfigs,
|
|
117
|
-
inspectOptions: {
|
|
118
|
-
...inspectOptions,
|
|
119
|
-
outputPath
|
|
120
|
-
},
|
|
121
|
-
configType: 'webpack'
|
|
122
|
-
}), {
|
|
123
|
-
rsbuildConfig: rawRsbuildConfig,
|
|
124
|
-
environmentConfigs: rawEnvironmentConfigs.map((r)=>r.content),
|
|
125
|
-
bundlerConfigs: rawBundlerConfigs.map((r)=>r.content),
|
|
126
|
-
origin: {
|
|
127
|
-
rsbuildConfig,
|
|
128
|
-
environmentConfigs,
|
|
129
|
-
bundlerConfigs: webpackConfigs
|
|
130
|
-
}
|
|
131
|
-
};
|
|
132
|
-
}
|
|
133
|
-
let external_reduce_configs_namespaceObject = require("reduce-configs"), castArray = (arr)=>void 0 === arr ? [] : Array.isArray(arr) ? arr : [
|
|
134
|
-
arr
|
|
135
|
-
];
|
|
136
|
-
async function modifyWebpackChain(context, utils, chain) {
|
|
137
|
-
var _utils_environment_config_tools;
|
|
138
|
-
core_.logger.debug('modify webpack chain');
|
|
139
|
-
let [modifiedChain] = await context.hooks.modifyWebpackChain.callInEnvironment({
|
|
140
|
-
environment: utils.environment.name,
|
|
141
|
-
args: [
|
|
142
|
-
chain,
|
|
143
|
-
utils
|
|
144
|
-
]
|
|
145
|
-
});
|
|
146
|
-
if (null === (_utils_environment_config_tools = utils.environment.config.tools) || void 0 === _utils_environment_config_tools ? void 0 : _utils_environment_config_tools.webpackChain) for (let item of castArray(utils.environment.config.tools.webpackChain))item(modifiedChain, utils);
|
|
147
|
-
return core_.logger.debug('modify webpack chain done'), modifiedChain;
|
|
148
|
-
}
|
|
149
|
-
async function modifyWebpackConfig(context, webpackConfig, utils) {
|
|
150
|
-
var _utils_environment_config_tools;
|
|
151
|
-
core_.logger.debug('modify webpack config');
|
|
152
|
-
let [modifiedConfig] = await context.hooks.modifyWebpackConfig.callInEnvironment({
|
|
153
|
-
environment: utils.environment.name,
|
|
154
|
-
args: [
|
|
155
|
-
webpackConfig,
|
|
156
|
-
utils
|
|
157
|
-
]
|
|
89
|
+
(()=>{
|
|
90
|
+
__webpack_require__.r(__webpack_exports__), __webpack_require__.d(__webpack_exports__, {
|
|
91
|
+
webpackProvider: ()=>webpackProvider
|
|
158
92
|
});
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
async function getChainUtils(target, environment, helpers) {
|
|
167
|
-
let { default: webpack } = await Promise.resolve().then(__webpack_require__.bind(__webpack_require__, "webpack?7ba0"));
|
|
168
|
-
return {
|
|
169
|
-
...helpers.getChainUtils(target, environment),
|
|
170
|
-
name: ({
|
|
171
|
-
web: 'client',
|
|
172
|
-
node: 'server',
|
|
173
|
-
'web-worker': 'web-worker'
|
|
174
|
-
})[target] || '',
|
|
175
|
-
webpack,
|
|
176
|
-
HtmlWebpackPlugin: helpers.getHTMLPlugin()
|
|
177
|
-
};
|
|
178
|
-
}
|
|
179
|
-
async function generateWebpackConfig({ target, context, environment, helpers }) {
|
|
180
|
-
let chainUtils = await getChainUtils(target, context.environments[environment], helpers), { default: webpack } = await Promise.resolve().then(__webpack_require__.bind(__webpack_require__, "webpack?7ba0")), { BannerPlugin, DefinePlugin, IgnorePlugin, ProvidePlugin, HotModuleReplacementPlugin } = webpack, bundlerChain = await helpers.modifyBundlerChain(context, {
|
|
181
|
-
...chainUtils,
|
|
182
|
-
bundler: {
|
|
183
|
-
BannerPlugin,
|
|
184
|
-
DefinePlugin,
|
|
185
|
-
IgnorePlugin,
|
|
186
|
-
ProvidePlugin,
|
|
187
|
-
HotModuleReplacementPlugin
|
|
188
|
-
}
|
|
189
|
-
}), chain = await modifyWebpackChain(context, chainUtils, bundlerChain), webpackConfig = helpers.chainToConfig(chain), configUtils = await helpers.getConfigUtils(webpackConfig, chainUtils);
|
|
190
|
-
return webpackConfig = await modifyWebpackConfig(context, webpackConfig, configUtils);
|
|
191
|
-
}
|
|
192
|
-
async function initConfigs({ context, pluginManager, rsbuildOptions, helpers }) {
|
|
193
|
-
let normalizedConfig = await helpers.initRsbuildConfig({
|
|
194
|
-
context,
|
|
195
|
-
pluginManager
|
|
196
|
-
}), webpackConfigs = await Promise.all(Object.entries(normalizedConfig.environments).map(([environment, config])=>generateWebpackConfig({
|
|
197
|
-
target: config.output.target,
|
|
93
|
+
var core_ = __webpack_require__("@rsbuild/core");
|
|
94
|
+
let MultiStats_js_namespaceObject = require("webpack/lib/MultiStats.js");
|
|
95
|
+
var MultiStats_js_default = __webpack_require__.n(MultiStats_js_namespaceObject);
|
|
96
|
+
let external_node_path_namespaceObject = require("node:path"), getInspectOutputPath = (context, inspectOptions)=>inspectOptions.outputPath ? (0, external_node_path_namespaceObject.isAbsolute)(inspectOptions.outputPath) ? inspectOptions.outputPath : (0, external_node_path_namespaceObject.join)(context.distPath, inspectOptions.outputPath) : (0, external_node_path_namespaceObject.join)(context.distPath, '.rsbuild');
|
|
97
|
+
async function inspectConfig({ helpers, context, pluginManager, rsbuildOptions, bundlerConfigs, inspectOptions = {} }) {
|
|
98
|
+
inspectOptions.mode ? process.env.NODE_ENV = inspectOptions.mode : process.env.NODE_ENV || (process.env.NODE_ENV = 'development');
|
|
99
|
+
let webpackConfigs = bundlerConfigs || (await initConfigs({
|
|
198
100
|
context,
|
|
199
|
-
|
|
101
|
+
pluginManager,
|
|
102
|
+
rsbuildOptions,
|
|
200
103
|
helpers
|
|
201
|
-
})))
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
104
|
+
})).webpackConfigs, rawBundlerConfigs = webpackConfigs.map((config, index)=>({
|
|
105
|
+
name: config.name || String(index),
|
|
106
|
+
content: helpers.stringifyConfig(config, inspectOptions.verbose)
|
|
107
|
+
})), { rsbuildConfig, rawRsbuildConfig, environmentConfigs, rawEnvironmentConfigs } = helpers.getRsbuildInspectConfig({
|
|
108
|
+
normalizedConfig: context.normalizedConfig,
|
|
109
|
+
inspectOptions,
|
|
110
|
+
pluginManager
|
|
111
|
+
}), outputPath = getInspectOutputPath(context, inspectOptions);
|
|
112
|
+
return inspectOptions.writeToDisk && await helpers.outputInspectConfigFiles({
|
|
113
|
+
rawBundlerConfigs,
|
|
114
|
+
rawEnvironmentConfigs,
|
|
115
|
+
inspectOptions: {
|
|
116
|
+
...inspectOptions,
|
|
117
|
+
outputPath
|
|
118
|
+
},
|
|
119
|
+
configType: 'webpack'
|
|
120
|
+
}), {
|
|
121
|
+
rsbuildConfig: rawRsbuildConfig,
|
|
122
|
+
environmentConfigs: rawEnvironmentConfigs.map((r)=>r.content),
|
|
123
|
+
bundlerConfigs: rawBundlerConfigs.map((r)=>r.content),
|
|
124
|
+
origin: {
|
|
125
|
+
rsbuildConfig,
|
|
126
|
+
environmentConfigs,
|
|
127
|
+
bundlerConfigs: webpackConfigs
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
let external_reduce_configs_namespaceObject = require("reduce-configs"), castArray = (arr)=>void 0 === arr ? [] : Array.isArray(arr) ? arr : [
|
|
132
|
+
arr
|
|
133
|
+
];
|
|
134
|
+
async function modifyWebpackChain(context, utils, chain) {
|
|
135
|
+
var _utils_environment_config_tools;
|
|
136
|
+
core_.logger.debug('modify webpack chain');
|
|
137
|
+
let [modifiedChain] = await context.hooks.modifyWebpackChain.callInEnvironment({
|
|
138
|
+
environment: utils.environment.name,
|
|
139
|
+
args: [
|
|
140
|
+
chain,
|
|
141
|
+
utils
|
|
142
|
+
]
|
|
143
|
+
});
|
|
144
|
+
if (null === (_utils_environment_config_tools = utils.environment.config.tools) || void 0 === _utils_environment_config_tools ? void 0 : _utils_environment_config_tools.webpackChain) for (let item of castArray(utils.environment.config.tools.webpackChain))item(modifiedChain, utils);
|
|
145
|
+
return core_.logger.debug('modify webpack chain done'), modifiedChain;
|
|
146
|
+
}
|
|
147
|
+
async function modifyWebpackConfig(context, webpackConfig, utils) {
|
|
148
|
+
var _utils_environment_config_tools;
|
|
149
|
+
core_.logger.debug('modify webpack config');
|
|
150
|
+
let [modifiedConfig] = await context.hooks.modifyWebpackConfig.callInEnvironment({
|
|
151
|
+
environment: utils.environment.name,
|
|
152
|
+
args: [
|
|
153
|
+
webpackConfig,
|
|
154
|
+
utils
|
|
155
|
+
]
|
|
156
|
+
});
|
|
157
|
+
return (null === (_utils_environment_config_tools = utils.environment.config.tools) || void 0 === _utils_environment_config_tools ? void 0 : _utils_environment_config_tools.webpack) && (modifiedConfig = (0, external_reduce_configs_namespaceObject.reduceConfigsWithContext)({
|
|
158
|
+
initial: modifiedConfig,
|
|
159
|
+
config: utils.environment.config.tools.webpack,
|
|
160
|
+
ctx: utils,
|
|
161
|
+
mergeFn: utils.mergeConfig
|
|
162
|
+
})), core_.logger.debug('modify webpack config done'), modifiedConfig;
|
|
163
|
+
}
|
|
164
|
+
async function getChainUtils(target, environment, helpers) {
|
|
165
|
+
let { default: webpack } = await Promise.resolve().then(__webpack_require__.bind(__webpack_require__, "webpack?fd69"));
|
|
166
|
+
return {
|
|
167
|
+
...helpers.getChainUtils(target, environment),
|
|
168
|
+
name: ({
|
|
169
|
+
web: 'client',
|
|
170
|
+
node: 'server',
|
|
171
|
+
'web-worker': 'web-worker'
|
|
172
|
+
})[target] || '',
|
|
173
|
+
webpack,
|
|
174
|
+
HtmlWebpackPlugin: helpers.getHTMLPlugin()
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
async function generateWebpackConfig({ target, context, environment, helpers }) {
|
|
178
|
+
let chainUtils = await getChainUtils(target, context.environments[environment], helpers), { default: webpack } = await Promise.resolve().then(__webpack_require__.bind(__webpack_require__, "webpack?fd69")), { BannerPlugin, DefinePlugin, IgnorePlugin, ProvidePlugin, HotModuleReplacementPlugin } = webpack, bundlerChain = await helpers.modifyBundlerChain(context, {
|
|
179
|
+
...chainUtils,
|
|
180
|
+
bundler: {
|
|
181
|
+
BannerPlugin,
|
|
182
|
+
DefinePlugin,
|
|
183
|
+
IgnorePlugin,
|
|
184
|
+
ProvidePlugin,
|
|
185
|
+
HotModuleReplacementPlugin
|
|
186
|
+
}
|
|
187
|
+
}), chain = await modifyWebpackChain(context, chainUtils, bundlerChain), webpackConfig = helpers.chainToConfig(chain), configUtils = await helpers.getConfigUtils(webpackConfig, chainUtils);
|
|
188
|
+
return await modifyWebpackConfig(context, webpackConfig, configUtils);
|
|
189
|
+
}
|
|
190
|
+
async function initConfigs({ context, pluginManager, rsbuildOptions, helpers }) {
|
|
191
|
+
let normalizedConfig = await helpers.initRsbuildConfig({
|
|
192
|
+
context,
|
|
193
|
+
pluginManager
|
|
194
|
+
}), webpackConfigs = await Promise.all(Object.entries(normalizedConfig.environments).map(([environment, config])=>generateWebpackConfig({
|
|
195
|
+
target: config.output.target,
|
|
205
196
|
context,
|
|
206
|
-
|
|
207
|
-
inspectOptions: {
|
|
208
|
-
verbose: !0,
|
|
209
|
-
writeToDisk: !0
|
|
210
|
-
},
|
|
211
|
-
rsbuildOptions,
|
|
212
|
-
bundlerConfigs: webpackConfigs,
|
|
197
|
+
environment,
|
|
213
198
|
helpers
|
|
214
|
-
});
|
|
199
|
+
})));
|
|
200
|
+
if ('verbose' === core_.logger.level) {
|
|
201
|
+
let inspect = async ()=>{
|
|
202
|
+
await inspectConfig({
|
|
203
|
+
context,
|
|
204
|
+
pluginManager,
|
|
205
|
+
inspectOptions: {
|
|
206
|
+
verbose: !0,
|
|
207
|
+
writeToDisk: !0
|
|
208
|
+
},
|
|
209
|
+
rsbuildOptions,
|
|
210
|
+
bundlerConfigs: webpackConfigs,
|
|
211
|
+
helpers
|
|
212
|
+
});
|
|
213
|
+
};
|
|
214
|
+
context.hooks.onBeforeBuild.tap(async ({ isFirstCompile })=>{
|
|
215
|
+
isFirstCompile && await inspect();
|
|
216
|
+
}), context.hooks.onAfterStartDevServer.tap(inspect);
|
|
217
|
+
}
|
|
218
|
+
return {
|
|
219
|
+
webpackConfigs
|
|
215
220
|
};
|
|
216
|
-
context.hooks.onBeforeBuild.tap(({ isFirstCompile })=>{
|
|
217
|
-
isFirstCompile && inspect();
|
|
218
|
-
}), context.hooks.onAfterStartDevServer.tap(inspect);
|
|
219
221
|
}
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
}), core_.logger.debug('create compiler done'), {
|
|
251
|
-
compiler,
|
|
252
|
-
webpackConfigs
|
|
253
|
-
};
|
|
254
|
-
}
|
|
255
|
-
let build = async (initOptions, { watch, compiler: customCompiler } = {})=>{
|
|
256
|
-
let compiler, bundlerConfigs;
|
|
257
|
-
let { helpers, context } = initOptions;
|
|
258
|
-
if (customCompiler) compiler = customCompiler;
|
|
259
|
-
else {
|
|
260
|
-
let result = await createCompiler_createCompiler(initOptions);
|
|
261
|
-
compiler = result.compiler, bundlerConfigs = result.webpackConfigs;
|
|
222
|
+
async function createCompiler_createCompiler(options) {
|
|
223
|
+
core_.logger.debug('create compiler');
|
|
224
|
+
let { helpers, context } = options, { webpackConfigs } = await initConfigs(options);
|
|
225
|
+
await context.hooks.onBeforeCreateCompiler.call({
|
|
226
|
+
bundlerConfigs: webpackConfigs,
|
|
227
|
+
environments: context.environments
|
|
228
|
+
});
|
|
229
|
+
let { default: webpack } = await Promise.resolve().then(__webpack_require__.bind(__webpack_require__, "webpack?fd69")), compiler = webpack(1 === webpackConfigs.length ? webpackConfigs[0] : webpackConfigs), done = (stats)=>{
|
|
230
|
+
let statsOptions = helpers.getStatsOptions(compiler), statsJson = stats.toJson({
|
|
231
|
+
moduleTrace: !0,
|
|
232
|
+
children: !0,
|
|
233
|
+
preset: 'errors-warnings',
|
|
234
|
+
...statsOptions
|
|
235
|
+
}), { message, level } = helpers.formatStats(statsJson, stats.hasErrors());
|
|
236
|
+
'error' === level && core_.logger.error(message), 'warning' === level && core_.logger.warn(message);
|
|
237
|
+
};
|
|
238
|
+
return compiler.hooks.done.tap('rsbuild:done', (stats)=>{
|
|
239
|
+
done(stats);
|
|
240
|
+
}), 'dev' === context.command && helpers.registerDevHook({
|
|
241
|
+
compiler,
|
|
242
|
+
context,
|
|
243
|
+
bundlerConfigs: webpackConfigs,
|
|
244
|
+
MultiStatsCtor: MultiStats_js_default()
|
|
245
|
+
}), await context.hooks.onAfterCreateCompiler.call({
|
|
246
|
+
compiler,
|
|
247
|
+
environments: context.environments
|
|
248
|
+
}), core_.logger.debug('create compiler done'), {
|
|
249
|
+
compiler,
|
|
250
|
+
webpackConfigs
|
|
251
|
+
};
|
|
262
252
|
}
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
compiler
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
253
|
+
let build = async (initOptions, { watch, compiler: customCompiler } = {})=>{
|
|
254
|
+
let compiler, bundlerConfigs;
|
|
255
|
+
let { helpers, context } = initOptions;
|
|
256
|
+
if (customCompiler) compiler = customCompiler;
|
|
257
|
+
else {
|
|
258
|
+
let result = await createCompiler_createCompiler(initOptions);
|
|
259
|
+
compiler = result.compiler, bundlerConfigs = result.webpackConfigs;
|
|
260
|
+
}
|
|
261
|
+
if (helpers.registerBuildHook({
|
|
262
|
+
context,
|
|
263
|
+
bundlerConfigs: bundlerConfigs,
|
|
264
|
+
compiler,
|
|
265
|
+
isWatch: !!watch,
|
|
266
|
+
MultiStatsCtor: MultiStats_js_default()
|
|
267
|
+
}), watch) return compiler.watch({}, (err)=>{
|
|
268
|
+
err && core_.logger.error(err);
|
|
269
|
+
}), {
|
|
270
|
+
close: ()=>new Promise((resolve)=>{
|
|
271
|
+
compiler.close(()=>{
|
|
272
|
+
resolve();
|
|
273
|
+
});
|
|
274
|
+
})
|
|
275
|
+
};
|
|
276
|
+
let { stats } = await new Promise((resolve, reject)=>{
|
|
277
|
+
compiler.run((err, stats)=>{
|
|
278
|
+
err ? reject(err) : (null == stats ? void 0 : stats.hasErrors()) ? reject(Error('Webpack build failed!')) : compiler.close((closeErr)=>{
|
|
279
|
+
closeErr && core_.logger.error(closeErr), resolve({
|
|
280
|
+
stats
|
|
281
|
+
});
|
|
283
282
|
});
|
|
284
283
|
});
|
|
285
284
|
});
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
};
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
285
|
+
return {
|
|
286
|
+
stats,
|
|
287
|
+
close: async ()=>{}
|
|
288
|
+
};
|
|
289
|
+
}, external_node_fs_namespaceObject = require("node:fs");
|
|
290
|
+
var external_node_fs_default = __webpack_require__.n(external_node_fs_namespaceObject);
|
|
291
|
+
async function applyTsConfigPathsPlugin({ chain, CHAIN_ID, mainFields, extensions, configFile }) {
|
|
292
|
+
let { TsconfigPathsPlugin } = await Promise.resolve().then(__webpack_require__.bind(__webpack_require__, "tsconfig-paths-webpack-plugin"));
|
|
293
|
+
chain.resolve.plugin(CHAIN_ID.RESOLVE_PLUGIN.TS_CONFIG_PATHS).use(TsconfigPathsPlugin, [
|
|
294
|
+
{
|
|
295
|
+
configFile,
|
|
296
|
+
extensions,
|
|
297
|
+
mainFields: mainFields
|
|
298
|
+
}
|
|
299
|
+
]);
|
|
300
|
+
}
|
|
301
|
+
let getMainFields = (chain, target)=>{
|
|
302
|
+
let mainFields = chain.resolve.mainFields.values();
|
|
303
|
+
return mainFields.length ? mainFields : !function(target) {
|
|
304
|
+
return castArray(target).includes('web') || target.includes('web-worker');
|
|
305
|
+
}(target) ? [
|
|
306
|
+
'module',
|
|
307
|
+
'main'
|
|
308
|
+
] : [
|
|
309
|
+
'browser',
|
|
310
|
+
'module',
|
|
311
|
+
'main'
|
|
312
|
+
];
|
|
313
|
+
}, pluginAdaptor = (helpers)=>({
|
|
314
|
+
name: 'rsbuild-webpack:adaptor',
|
|
315
|
+
setup (api) {
|
|
316
|
+
api.modifyBundlerChain(async (chain, { CHAIN_ID, environment, target })=>{
|
|
317
|
+
let { config, tsconfigPath } = environment, aliasStrategy = config.source.aliasStrategy ?? config.resolve.aliasStrategy;
|
|
318
|
+
tsconfigPath && 'prefer-tsconfig' === aliasStrategy && await applyTsConfigPathsPlugin({
|
|
319
|
+
chain,
|
|
320
|
+
CHAIN_ID,
|
|
321
|
+
configFile: tsconfigPath,
|
|
322
|
+
mainFields: getMainFields(chain, target),
|
|
323
|
+
extensions: chain.resolve.extensions.values()
|
|
324
|
+
});
|
|
325
|
+
let progress = config.dev.progressBar ?? !0;
|
|
326
|
+
if (progress) {
|
|
327
|
+
let { ProgressPlugin } = await Promise.all([
|
|
328
|
+
__webpack_require__.e("997"),
|
|
329
|
+
__webpack_require__.e("739")
|
|
330
|
+
]).then(__webpack_require__.bind(__webpack_require__, "./src/progress/ProgressPlugin.ts"));
|
|
331
|
+
chain.plugin(CHAIN_ID.PLUGIN.PROGRESS).use(ProgressPlugin, [
|
|
332
|
+
{
|
|
333
|
+
id: environment.name,
|
|
334
|
+
prettyTime: helpers.prettyTime,
|
|
335
|
+
...!0 === progress ? {} : progress
|
|
336
|
+
}
|
|
337
|
+
]);
|
|
338
|
+
}
|
|
339
|
+
let { copy } = config.output;
|
|
340
|
+
if (copy) {
|
|
341
|
+
let { default: CopyPlugin } = await Promise.resolve().then(__webpack_require__.bind(__webpack_require__, "copy-webpack-plugin")), options = Array.isArray(copy) ? {
|
|
342
|
+
patterns: copy
|
|
343
|
+
} : copy;
|
|
344
|
+
chain.plugin(CHAIN_ID.PLUGIN.COPY).use(CopyPlugin, [
|
|
345
|
+
options
|
|
346
|
+
]);
|
|
347
|
+
}
|
|
348
|
+
}), api.modifyWebpackConfig(async (config)=>{
|
|
349
|
+
var _config_plugins, _config_plugins1;
|
|
350
|
+
let copyPlugin = null === (_config_plugins = config.plugins) || void 0 === _config_plugins ? void 0 : _config_plugins.find((item)=>(null == item ? void 0 : item.constructor.name) === 'CopyPlugin');
|
|
351
|
+
copyPlugin && copyPlugin.patterns.every((pattern)=>'string' != typeof pattern && pattern.context && !external_node_fs_default().existsSync(pattern.context)) && (config.plugins = null === (_config_plugins1 = config.plugins) || void 0 === _config_plugins1 ? void 0 : _config_plugins1.filter((item)=>(null == item ? void 0 : item.constructor.name) !== 'CopyPlugin'));
|
|
327
352
|
});
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
chain.plugin(CHAIN_ID.PLUGIN.PROGRESS).use(ProgressPlugin, [
|
|
335
|
-
{
|
|
336
|
-
id: environment.name,
|
|
337
|
-
prettyTime: helpers.prettyTime,
|
|
338
|
-
...!0 === progress ? {} : progress
|
|
339
|
-
}
|
|
340
|
-
]);
|
|
341
|
-
}
|
|
342
|
-
let { copy } = config.output;
|
|
343
|
-
if (copy) {
|
|
344
|
-
let { default: CopyPlugin } = await Promise.resolve().then(__webpack_require__.bind(__webpack_require__, "copy-webpack-plugin")), options = Array.isArray(copy) ? {
|
|
345
|
-
patterns: copy
|
|
346
|
-
} : copy;
|
|
347
|
-
chain.plugin(CHAIN_ID.PLUGIN.COPY).use(CopyPlugin, [
|
|
348
|
-
options
|
|
349
|
-
]);
|
|
350
|
-
}
|
|
351
|
-
}), api.modifyWebpackConfig(async (config)=>{
|
|
352
|
-
var _config_plugins, _config_plugins1;
|
|
353
|
-
let copyPlugin = null === (_config_plugins = config.plugins) || void 0 === _config_plugins ? void 0 : _config_plugins.find((item)=>(null == item ? void 0 : item.constructor.name) === 'CopyPlugin');
|
|
354
|
-
copyPlugin && copyPlugin.patterns.every((pattern)=>'string' != typeof pattern && pattern.context && !external_node_fs_default().existsSync(pattern.context)) && (config.plugins = null === (_config_plugins1 = config.plugins) || void 0 === _config_plugins1 ? void 0 : _config_plugins1.filter((item)=>(null == item ? void 0 : item.constructor.name) !== 'CopyPlugin'));
|
|
355
|
-
});
|
|
353
|
+
}
|
|
354
|
+
}), webpackProvider = async ({ context, pluginManager, rsbuildOptions, helpers })=>{
|
|
355
|
+
let { default: cssExtractPlugin } = await Promise.resolve().then(__webpack_require__.bind(__webpack_require__, "mini-css-extract-plugin"));
|
|
356
|
+
if (helpers.setCssExtractPlugin(cssExtractPlugin), helpers.setHTMLPlugin) {
|
|
357
|
+
let { default: htmlPlugin } = await Promise.resolve().then(__webpack_require__.bind(__webpack_require__, "html-webpack-plugin"));
|
|
358
|
+
helpers.setHTMLPlugin(htmlPlugin);
|
|
356
359
|
}
|
|
357
|
-
|
|
358
|
-
let { default: cssExtractPlugin } = await Promise.resolve().then(__webpack_require__.bind(__webpack_require__, "mini-css-extract-plugin"));
|
|
359
|
-
if (helpers.setCssExtractPlugin(cssExtractPlugin), helpers.setHTMLPlugin) {
|
|
360
|
-
let { default: htmlPlugin } = await Promise.resolve().then(__webpack_require__.bind(__webpack_require__, "html-webpack-plugin"));
|
|
361
|
-
helpers.setHTMLPlugin(htmlPlugin);
|
|
362
|
-
}
|
|
363
|
-
let createCompiler = async ()=>(await createCompiler_createCompiler({
|
|
364
|
-
context,
|
|
365
|
-
pluginManager,
|
|
366
|
-
rsbuildOptions,
|
|
367
|
-
helpers
|
|
368
|
-
})).compiler;
|
|
369
|
-
return pluginManager.addPlugins([
|
|
370
|
-
pluginAdaptor(helpers)
|
|
371
|
-
]), {
|
|
372
|
-
bundler: 'webpack',
|
|
373
|
-
createCompiler,
|
|
374
|
-
async initConfigs () {
|
|
375
|
-
let { webpackConfigs } = await initConfigs({
|
|
360
|
+
let createCompiler = async ()=>(await createCompiler_createCompiler({
|
|
376
361
|
context,
|
|
377
362
|
pluginManager,
|
|
378
363
|
rsbuildOptions,
|
|
379
364
|
helpers
|
|
380
|
-
});
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
365
|
+
})).compiler;
|
|
366
|
+
return pluginManager.addPlugins([
|
|
367
|
+
pluginAdaptor(helpers)
|
|
368
|
+
]), {
|
|
369
|
+
bundler: 'webpack',
|
|
370
|
+
createCompiler,
|
|
371
|
+
async initConfigs () {
|
|
372
|
+
let { webpackConfigs } = await initConfigs({
|
|
373
|
+
context,
|
|
374
|
+
pluginManager,
|
|
375
|
+
rsbuildOptions,
|
|
376
|
+
helpers
|
|
377
|
+
});
|
|
378
|
+
return webpackConfigs;
|
|
379
|
+
},
|
|
380
|
+
async createDevServer (options) {
|
|
381
|
+
let config = await helpers.initRsbuildConfig({
|
|
382
|
+
context,
|
|
383
|
+
pluginManager
|
|
384
|
+
});
|
|
385
|
+
return helpers.createDevServer({
|
|
386
|
+
context,
|
|
387
|
+
pluginManager,
|
|
388
|
+
rsbuildOptions
|
|
389
|
+
}, createCompiler, config, options);
|
|
390
|
+
},
|
|
391
|
+
async startDevServer (options) {
|
|
392
|
+
let config = await helpers.initRsbuildConfig({
|
|
393
|
+
context,
|
|
394
|
+
pluginManager
|
|
395
|
+
});
|
|
396
|
+
return (await helpers.createDevServer({
|
|
397
|
+
context,
|
|
398
|
+
pluginManager,
|
|
399
|
+
rsbuildOptions
|
|
400
|
+
}, createCompiler, config, options)).listen();
|
|
401
|
+
},
|
|
402
|
+
build: async (options)=>build({
|
|
403
|
+
context,
|
|
404
|
+
pluginManager,
|
|
405
|
+
rsbuildOptions,
|
|
406
|
+
helpers
|
|
407
|
+
}, options),
|
|
408
|
+
inspectConfig: async (inspectOptions)=>await inspectConfig({
|
|
409
|
+
context,
|
|
410
|
+
pluginManager,
|
|
411
|
+
rsbuildOptions,
|
|
412
|
+
inspectOptions,
|
|
413
|
+
helpers
|
|
414
|
+
})
|
|
415
|
+
};
|
|
418
416
|
};
|
|
419
|
-
};
|
|
417
|
+
})();
|
|
420
418
|
var __webpack_export_target__ = exports;
|
|
421
419
|
for(var __webpack_i__ in __webpack_exports__)__webpack_export_target__[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
422
420
|
__webpack_exports__.__esModule && Object.defineProperty(__webpack_export_target__, '__esModule', {
|
package/dist/index.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import * as
|
|
1
|
+
import * as __WEBPACK_EXTERNAL_MODULE__rsbuild_core_1b356efc__ from "@rsbuild/core";
|
|
2
|
+
import * as __WEBPACK_EXTERNAL_MODULE_node_console_8631dfae__ from "node:console";
|
|
3
3
|
import * as __WEBPACK_EXTERNAL_MODULE_picocolors__ from "picocolors";
|
|
4
4
|
import * as __WEBPACK_EXTERNAL_MODULE_stream__ from "stream";
|
|
5
5
|
import * as __WEBPACK_EXTERNAL_MODULE_webpack__ from "webpack";
|
|
6
|
-
import * as
|
|
7
|
-
import * as
|
|
8
|
-
import * as
|
|
9
|
-
import * as
|
|
6
|
+
import * as __WEBPACK_EXTERNAL_MODULE_webpack_lib_MultiStats_js_a72a7b8d__ from "webpack/lib/MultiStats.js";
|
|
7
|
+
import * as __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__ from "node:path";
|
|
8
|
+
import * as __WEBPACK_EXTERNAL_MODULE_reduce_configs_02786df6__ from "reduce-configs";
|
|
9
|
+
import * as __WEBPACK_EXTERNAL_MODULE_node_fs_5ea92f0c__ from "node:fs";
|
|
10
10
|
var installedChunks, installChunk, __webpack_modules__ = {
|
|
11
11
|
"@rsbuild/core": function(module) {
|
|
12
|
-
module.exports =
|
|
12
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE__rsbuild_core_1b356efc__;
|
|
13
13
|
},
|
|
14
14
|
"node:console": function(module) {
|
|
15
|
-
module.exports =
|
|
15
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE_node_console_8631dfae__;
|
|
16
16
|
},
|
|
17
17
|
picocolors: function(module) {
|
|
18
18
|
module.exports = __WEBPACK_EXTERNAL_MODULE_picocolors__;
|
|
@@ -57,11 +57,11 @@ __webpack_require__.m = __webpack_modules__, __webpack_require__.n = function(mo
|
|
|
57
57
|
}, __webpack_require__.o = function(obj, prop) {
|
|
58
58
|
return Object.prototype.hasOwnProperty.call(obj, prop);
|
|
59
59
|
}, __webpack_require__.nmd = function(module) {
|
|
60
|
-
return module.paths = [],
|
|
60
|
+
return module.paths = [], module.children || (module.children = []), module;
|
|
61
61
|
}, installedChunks = {
|
|
62
62
|
980: 0
|
|
63
63
|
}, installChunk = function(data) {
|
|
64
|
-
var ids = data.ids, modules = data.modules, runtime = data.runtime,
|
|
64
|
+
var moduleId, chunkId, ids = data.ids, modules = data.modules, runtime = data.runtime, i = 0;
|
|
65
65
|
for(moduleId in modules)__webpack_require__.o(modules, moduleId) && (__webpack_require__.m[moduleId] = modules[moduleId]);
|
|
66
66
|
for(runtime && runtime(__webpack_require__); i < ids.length; i++)chunkId = ids[i], __webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId] && installedChunks[chunkId][0](), installedChunks[ids[i]] = 0;
|
|
67
67
|
}, __webpack_require__.f.j = function(chunkId, promises) {
|
|
@@ -84,12 +84,9 @@ __webpack_require__.m = __webpack_modules__, __webpack_require__.n = function(mo
|
|
|
84
84
|
}
|
|
85
85
|
};
|
|
86
86
|
var core_ = __webpack_require__("@rsbuild/core");
|
|
87
|
-
let getInspectOutputPath = (context, inspectOptions)=>
|
|
88
|
-
if (inspectOptions.outputPath) return (0, __WEBPACK_EXTERNAL_MODULE_node_path__.isAbsolute)(inspectOptions.outputPath) ? inspectOptions.outputPath : (0, __WEBPACK_EXTERNAL_MODULE_node_path__.join)(context.distPath, inspectOptions.outputPath);
|
|
89
|
-
return (0, __WEBPACK_EXTERNAL_MODULE_node_path__.join)(context.distPath, '.rsbuild');
|
|
90
|
-
};
|
|
87
|
+
let getInspectOutputPath = (context, inspectOptions)=>inspectOptions.outputPath ? (0, __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__.isAbsolute)(inspectOptions.outputPath) ? inspectOptions.outputPath : (0, __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__.join)(context.distPath, inspectOptions.outputPath) : (0, __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__.join)(context.distPath, '.rsbuild');
|
|
91
88
|
async function inspectConfig({ helpers, context, pluginManager, rsbuildOptions, bundlerConfigs, inspectOptions = {} }) {
|
|
92
|
-
inspectOptions.mode ? process.env.NODE_ENV = inspectOptions.mode :
|
|
89
|
+
inspectOptions.mode ? process.env.NODE_ENV = inspectOptions.mode : process.env.NODE_ENV || (process.env.NODE_ENV = 'development');
|
|
93
90
|
let webpackConfigs = bundlerConfigs || (await initConfigs({
|
|
94
91
|
context,
|
|
95
92
|
pluginManager,
|
|
@@ -148,7 +145,7 @@ async function modifyWebpackConfig(context, webpackConfig, utils) {
|
|
|
148
145
|
utils
|
|
149
146
|
]
|
|
150
147
|
});
|
|
151
|
-
return (null === (_utils_environment_config_tools = utils.environment.config.tools) || void 0 === _utils_environment_config_tools ? void 0 : _utils_environment_config_tools.webpack) && (modifiedConfig = (0,
|
|
148
|
+
return (null === (_utils_environment_config_tools = utils.environment.config.tools) || void 0 === _utils_environment_config_tools ? void 0 : _utils_environment_config_tools.webpack) && (modifiedConfig = (0, __WEBPACK_EXTERNAL_MODULE_reduce_configs_02786df6__.reduceConfigsWithContext)({
|
|
152
149
|
initial: modifiedConfig,
|
|
153
150
|
config: utils.environment.config.tools.webpack,
|
|
154
151
|
ctx: utils,
|
|
@@ -179,7 +176,7 @@ async function generateWebpackConfig({ target, context, environment, helpers })
|
|
|
179
176
|
HotModuleReplacementPlugin
|
|
180
177
|
}
|
|
181
178
|
}), chain = await modifyWebpackChain(context, chainUtils, bundlerChain), webpackConfig = helpers.chainToConfig(chain), configUtils = await helpers.getConfigUtils(webpackConfig, chainUtils);
|
|
182
|
-
return
|
|
179
|
+
return await modifyWebpackConfig(context, webpackConfig, configUtils);
|
|
183
180
|
}
|
|
184
181
|
async function initConfigs({ context, pluginManager, rsbuildOptions, helpers }) {
|
|
185
182
|
let normalizedConfig = await helpers.initRsbuildConfig({
|
|
@@ -192,8 +189,8 @@ async function initConfigs({ context, pluginManager, rsbuildOptions, helpers })
|
|
|
192
189
|
helpers
|
|
193
190
|
})));
|
|
194
191
|
if ('verbose' === core_.logger.level) {
|
|
195
|
-
let inspect = ()=>{
|
|
196
|
-
inspectConfig({
|
|
192
|
+
let inspect = async ()=>{
|
|
193
|
+
await inspectConfig({
|
|
197
194
|
context,
|
|
198
195
|
pluginManager,
|
|
199
196
|
inspectOptions: {
|
|
@@ -205,8 +202,8 @@ async function initConfigs({ context, pluginManager, rsbuildOptions, helpers })
|
|
|
205
202
|
helpers
|
|
206
203
|
});
|
|
207
204
|
};
|
|
208
|
-
context.hooks.onBeforeBuild.tap(({ isFirstCompile })=>{
|
|
209
|
-
isFirstCompile && inspect();
|
|
205
|
+
context.hooks.onBeforeBuild.tap(async ({ isFirstCompile })=>{
|
|
206
|
+
isFirstCompile && await inspect();
|
|
210
207
|
}), context.hooks.onAfterStartDevServer.tap(inspect);
|
|
211
208
|
}
|
|
212
209
|
return {
|
|
@@ -235,7 +232,7 @@ async function createCompiler_createCompiler(options) {
|
|
|
235
232
|
compiler,
|
|
236
233
|
context,
|
|
237
234
|
bundlerConfigs: webpackConfigs,
|
|
238
|
-
MultiStatsCtor:
|
|
235
|
+
MultiStatsCtor: __WEBPACK_EXTERNAL_MODULE_webpack_lib_MultiStats_js_a72a7b8d__.default
|
|
239
236
|
}), await context.hooks.onAfterCreateCompiler.call({
|
|
240
237
|
compiler,
|
|
241
238
|
environments: context.environments
|
|
@@ -257,7 +254,7 @@ let build = async (initOptions, { watch, compiler: customCompiler } = {})=>{
|
|
|
257
254
|
bundlerConfigs: bundlerConfigs,
|
|
258
255
|
compiler,
|
|
259
256
|
isWatch: !!watch,
|
|
260
|
-
MultiStatsCtor:
|
|
257
|
+
MultiStatsCtor: __WEBPACK_EXTERNAL_MODULE_webpack_lib_MultiStats_js_a72a7b8d__.default
|
|
261
258
|
}), watch) return compiler.watch({}, (err)=>{
|
|
262
259
|
err && core_.logger.error(err);
|
|
263
260
|
}), {
|
|
@@ -292,10 +289,8 @@ async function applyTsConfigPathsPlugin({ chain, CHAIN_ID, mainFields, extension
|
|
|
292
289
|
]);
|
|
293
290
|
}
|
|
294
291
|
let getMainFields = (chain, target)=>{
|
|
295
|
-
var target1;
|
|
296
292
|
let mainFields = chain.resolve.mainFields.values();
|
|
297
|
-
|
|
298
|
-
return castArray(target1 = target).includes('web') || target1.includes('web-worker') ? [
|
|
293
|
+
return mainFields.length ? mainFields : castArray(target).includes('web') || target.includes('web-worker') ? [
|
|
299
294
|
'browser',
|
|
300
295
|
'module',
|
|
301
296
|
'main'
|
|
@@ -319,7 +314,7 @@ let getMainFields = (chain, target)=>{
|
|
|
319
314
|
if (progress) {
|
|
320
315
|
let { ProgressPlugin } = await Promise.all([
|
|
321
316
|
__webpack_require__.e("997"),
|
|
322
|
-
__webpack_require__.e("
|
|
317
|
+
__webpack_require__.e("808")
|
|
323
318
|
]).then(__webpack_require__.bind(__webpack_require__, "./src/progress/ProgressPlugin.ts"));
|
|
324
319
|
chain.plugin(CHAIN_ID.PLUGIN.PROGRESS).use(ProgressPlugin, [
|
|
325
320
|
{
|
|
@@ -341,7 +336,7 @@ let getMainFields = (chain, target)=>{
|
|
|
341
336
|
}), api.modifyWebpackConfig(async (config)=>{
|
|
342
337
|
var _config_plugins, _config_plugins1;
|
|
343
338
|
let copyPlugin = null === (_config_plugins = config.plugins) || void 0 === _config_plugins ? void 0 : _config_plugins.find((item)=>(null == item ? void 0 : item.constructor.name) === 'CopyPlugin');
|
|
344
|
-
copyPlugin && copyPlugin.patterns.every((pattern)=>'string' != typeof pattern && pattern.context && !
|
|
339
|
+
copyPlugin && copyPlugin.patterns.every((pattern)=>'string' != typeof pattern && pattern.context && !__WEBPACK_EXTERNAL_MODULE_node_fs_5ea92f0c__.default.existsSync(pattern.context)) && (config.plugins = null === (_config_plugins1 = config.plugins) || void 0 === _config_plugins1 ? void 0 : _config_plugins1.filter((item)=>(null == item ? void 0 : item.constructor.name) !== 'CopyPlugin'));
|
|
345
340
|
});
|
|
346
341
|
}
|
|
347
342
|
}), webpackProvider = async ({ context, pluginManager, rsbuildOptions, helpers })=>{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsbuild/webpack",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0-beta.0",
|
|
4
4
|
"homepage": "https://rsbuild.dev",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -32,13 +32,13 @@
|
|
|
32
32
|
"webpack": "^5.97.1"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@rslib/core": "0.
|
|
36
|
-
"@types/node": "^22.10.
|
|
35
|
+
"@rslib/core": "0.3.0",
|
|
36
|
+
"@types/node": "^22.10.5",
|
|
37
37
|
"ansi-escapes": "4.3.2",
|
|
38
38
|
"cli-truncate": "2.1.0",
|
|
39
39
|
"patch-console": "1.0.0",
|
|
40
40
|
"typescript": "^5.7.2",
|
|
41
|
-
"@rsbuild/core": "1.
|
|
41
|
+
"@rsbuild/core": "1.2.0-beta.0",
|
|
42
42
|
"@scripts/test-helper": "1.0.1"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|