@rsbuild/core 1.3.13 → 1.3.14
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.
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
(() => {
|
|
2
2
|
var __webpack_modules__ = {
|
|
3
|
-
|
|
3
|
+
9377: (module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
4
4
|
"use strict";
|
|
5
|
-
const loader = __nccwpck_require__(
|
|
5
|
+
const loader = __nccwpck_require__(1667);
|
|
6
6
|
module.exports = loader.default;
|
|
7
7
|
module.exports.defaultGetLocalIdent =
|
|
8
|
-
__nccwpck_require__(
|
|
8
|
+
__nccwpck_require__(9230).defaultGetLocalIdent;
|
|
9
9
|
},
|
|
10
|
-
|
|
10
|
+
1667: (__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
11
11
|
"use strict";
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
13
|
exports["default"] = loader;
|
|
14
14
|
var _postcss = _interopRequireDefault(__nccwpck_require__(9409));
|
|
15
|
-
var _plugins = __nccwpck_require__(
|
|
16
|
-
var _utils = __nccwpck_require__(
|
|
15
|
+
var _plugins = __nccwpck_require__(6800);
|
|
16
|
+
var _utils = __nccwpck_require__(9230);
|
|
17
17
|
function _interopRequireDefault(obj) {
|
|
18
18
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
19
19
|
}
|
|
@@ -236,7 +236,7 @@
|
|
|
236
236
|
callback(null, `${importCode}${moduleCode}${exportCode}`);
|
|
237
237
|
}
|
|
238
238
|
},
|
|
239
|
-
|
|
239
|
+
6800: (__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
240
240
|
"use strict";
|
|
241
241
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
242
242
|
Object.defineProperty(exports, "icssParser", {
|
|
@@ -257,21 +257,21 @@
|
|
|
257
257
|
return _postcssUrlParser.default;
|
|
258
258
|
},
|
|
259
259
|
});
|
|
260
|
-
var _postcssImportParser = _interopRequireDefault(
|
|
261
|
-
|
|
262
|
-
__nccwpck_require__(6712),
|
|
260
|
+
var _postcssImportParser = _interopRequireDefault(
|
|
261
|
+
__nccwpck_require__(5715),
|
|
263
262
|
);
|
|
264
|
-
var
|
|
263
|
+
var _postcssIcssParser = _interopRequireDefault(__nccwpck_require__(126));
|
|
264
|
+
var _postcssUrlParser = _interopRequireDefault(__nccwpck_require__(3737));
|
|
265
265
|
function _interopRequireDefault(obj) {
|
|
266
266
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
267
267
|
}
|
|
268
268
|
},
|
|
269
|
-
|
|
269
|
+
126: (__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
270
270
|
"use strict";
|
|
271
271
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
272
272
|
exports["default"] = void 0;
|
|
273
273
|
var _icssUtils = __nccwpck_require__(4531);
|
|
274
|
-
var _utils = __nccwpck_require__(
|
|
274
|
+
var _utils = __nccwpck_require__(9230);
|
|
275
275
|
const plugin = (options = {}) => ({
|
|
276
276
|
postcssPlugin: "postcss-icss-parser",
|
|
277
277
|
async OnceExit(root) {
|
|
@@ -370,14 +370,14 @@
|
|
|
370
370
|
plugin.postcss = true;
|
|
371
371
|
var _default = (exports["default"] = plugin);
|
|
372
372
|
},
|
|
373
|
-
|
|
373
|
+
5715: (__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
374
374
|
"use strict";
|
|
375
375
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
376
376
|
exports["default"] = void 0;
|
|
377
377
|
var _postcssValueParser = _interopRequireDefault(
|
|
378
378
|
__nccwpck_require__(2948),
|
|
379
379
|
);
|
|
380
|
-
var _utils = __nccwpck_require__(
|
|
380
|
+
var _utils = __nccwpck_require__(9230);
|
|
381
381
|
function _interopRequireDefault(obj) {
|
|
382
382
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
383
383
|
}
|
|
@@ -682,14 +682,14 @@
|
|
|
682
682
|
plugin.postcss = true;
|
|
683
683
|
var _default = (exports["default"] = plugin);
|
|
684
684
|
},
|
|
685
|
-
|
|
685
|
+
3737: (__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
686
686
|
"use strict";
|
|
687
687
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
688
688
|
exports["default"] = void 0;
|
|
689
689
|
var _postcssValueParser = _interopRequireDefault(
|
|
690
690
|
__nccwpck_require__(2948),
|
|
691
691
|
);
|
|
692
|
-
var _utils = __nccwpck_require__(
|
|
692
|
+
var _utils = __nccwpck_require__(9230);
|
|
693
693
|
function _interopRequireDefault(obj) {
|
|
694
694
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
695
695
|
}
|
|
@@ -1032,7 +1032,7 @@
|
|
|
1032
1032
|
plugin.postcss = true;
|
|
1033
1033
|
var _default = (exports["default"] = plugin);
|
|
1034
1034
|
},
|
|
1035
|
-
|
|
1035
|
+
9230: (__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
1036
1036
|
"use strict";
|
|
1037
1037
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1038
1038
|
exports.WEBPACK_IGNORE_COMMENT_REGEXP = void 0;
|
|
@@ -8096,6 +8096,6 @@
|
|
|
8096
8096
|
}
|
|
8097
8097
|
if (typeof __nccwpck_require__ !== "undefined")
|
|
8098
8098
|
__nccwpck_require__.ab = __dirname + "/";
|
|
8099
|
-
var __webpack_exports__ = __nccwpck_require__(
|
|
8099
|
+
var __webpack_exports__ = __nccwpck_require__(9377);
|
|
8100
8100
|
module.exports = __webpack_exports__;
|
|
8101
8101
|
})();
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(() => {
|
|
2
2
|
var __webpack_modules__ = {
|
|
3
|
-
|
|
3
|
+
725: (module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
4
4
|
"use strict";
|
|
5
|
-
const { HtmlWebpackChildCompiler } = __nccwpck_require__(
|
|
5
|
+
const { HtmlWebpackChildCompiler } = __nccwpck_require__(318);
|
|
6
6
|
const compilerMap = new WeakMap();
|
|
7
7
|
class CachedChildCompilation {
|
|
8
8
|
constructor(compiler) {
|
|
@@ -304,7 +304,7 @@
|
|
|
304
304
|
}
|
|
305
305
|
module.exports = { CachedChildCompilation };
|
|
306
306
|
},
|
|
307
|
-
|
|
307
|
+
318: (module) => {
|
|
308
308
|
"use strict";
|
|
309
309
|
class HtmlWebpackChildCompiler {
|
|
310
310
|
constructor(templates) {
|
|
@@ -473,7 +473,7 @@
|
|
|
473
473
|
}
|
|
474
474
|
module.exports = { HtmlWebpackChildCompiler };
|
|
475
475
|
},
|
|
476
|
-
|
|
476
|
+
910: (module) => {
|
|
477
477
|
"use strict";
|
|
478
478
|
module.exports = {};
|
|
479
479
|
module.exports.none = (chunks) => chunks;
|
|
@@ -492,7 +492,7 @@
|
|
|
492
492
|
};
|
|
493
493
|
module.exports.auto = module.exports.none;
|
|
494
494
|
},
|
|
495
|
-
|
|
495
|
+
185: (module) => {
|
|
496
496
|
"use strict";
|
|
497
497
|
module.exports = function (err) {
|
|
498
498
|
return {
|
|
@@ -513,7 +513,7 @@
|
|
|
513
513
|
};
|
|
514
514
|
};
|
|
515
515
|
},
|
|
516
|
-
|
|
516
|
+
312: (module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
517
517
|
"use strict";
|
|
518
518
|
const { AsyncSeriesWaterfallHook } = __nccwpck_require__(408);
|
|
519
519
|
const htmlWebpackPluginHooksMap = new WeakMap();
|
|
@@ -539,7 +539,7 @@
|
|
|
539
539
|
}
|
|
540
540
|
module.exports = { getHtmlRspackPluginHooks };
|
|
541
541
|
},
|
|
542
|
-
|
|
542
|
+
333: (module) => {
|
|
543
543
|
const voidTags = [
|
|
544
544
|
"area",
|
|
545
545
|
"base",
|
|
@@ -607,19 +607,19 @@
|
|
|
607
607
|
htmlTagObjectToString,
|
|
608
608
|
};
|
|
609
609
|
},
|
|
610
|
-
|
|
610
|
+
192: (module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
611
611
|
"use strict";
|
|
612
612
|
const promisify = __nccwpck_require__(23).promisify;
|
|
613
613
|
const vm = __nccwpck_require__(154);
|
|
614
614
|
const fs = __nccwpck_require__(896);
|
|
615
615
|
const path = __nccwpck_require__(928);
|
|
616
|
-
const { CachedChildCompilation } = __nccwpck_require__(
|
|
616
|
+
const { CachedChildCompilation } = __nccwpck_require__(725);
|
|
617
617
|
const { createHtmlTagObject, htmlTagObjectToString, HtmlTagArray } =
|
|
618
|
-
__nccwpck_require__(
|
|
619
|
-
const prettyError = __nccwpck_require__(
|
|
620
|
-
const chunkSorter = __nccwpck_require__(
|
|
618
|
+
__nccwpck_require__(333);
|
|
619
|
+
const prettyError = __nccwpck_require__(185);
|
|
620
|
+
const chunkSorter = __nccwpck_require__(910);
|
|
621
621
|
const getHtmlRspackPluginHooks =
|
|
622
|
-
__nccwpck_require__(
|
|
622
|
+
__nccwpck_require__(312).getHtmlRspackPluginHooks;
|
|
623
623
|
class HtmlRspackPlugin {
|
|
624
624
|
constructor(userOptions = {}) {
|
|
625
625
|
this.version = HtmlRspackPlugin.version;
|
|
@@ -1586,6 +1586,6 @@
|
|
|
1586
1586
|
}
|
|
1587
1587
|
if (typeof __nccwpck_require__ !== "undefined")
|
|
1588
1588
|
__nccwpck_require__.ab = __dirname + "/";
|
|
1589
|
-
var __webpack_exports__ = __nccwpck_require__(
|
|
1589
|
+
var __webpack_exports__ = __nccwpck_require__(192);
|
|
1590
1590
|
module.exports = __webpack_exports__;
|
|
1591
1591
|
})();
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
(() => {
|
|
2
2
|
"use strict";
|
|
3
3
|
var __webpack_modules__ = {
|
|
4
|
-
|
|
5
|
-
module.exports = __nccwpck_require__(
|
|
4
|
+
631: (module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
5
|
+
module.exports = __nccwpck_require__(513)["default"];
|
|
6
6
|
},
|
|
7
|
-
|
|
7
|
+
513: (__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
8
8
|
var __webpack_unused_export__;
|
|
9
9
|
__webpack_unused_export__ = { value: true };
|
|
10
10
|
exports["default"] = loader;
|
|
11
11
|
var _path = _interopRequireDefault(__nccwpck_require__(928));
|
|
12
|
-
var _utils = __nccwpck_require__(
|
|
12
|
+
var _utils = __nccwpck_require__(876);
|
|
13
13
|
function _interopRequireDefault(obj) {
|
|
14
14
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
15
15
|
}
|
|
@@ -179,7 +179,7 @@
|
|
|
179
179
|
callback(null, result.css, map, { ast });
|
|
180
180
|
}
|
|
181
181
|
},
|
|
182
|
-
|
|
182
|
+
876: (module, exports, __nccwpck_require__) => {
|
|
183
183
|
module = __nccwpck_require__.nmd(module);
|
|
184
184
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
185
185
|
exports.exec = exec;
|
|
@@ -716,6 +716,6 @@
|
|
|
716
716
|
})();
|
|
717
717
|
if (typeof __nccwpck_require__ !== "undefined")
|
|
718
718
|
__nccwpck_require__.ab = __dirname + "/";
|
|
719
|
-
var __webpack_exports__ = __nccwpck_require__(
|
|
719
|
+
var __webpack_exports__ = __nccwpck_require__(631);
|
|
720
720
|
module.exports = __webpack_exports__;
|
|
721
721
|
})();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
(() => {
|
|
2
2
|
"use strict";
|
|
3
3
|
var __webpack_modules__ = {
|
|
4
|
-
|
|
4
|
+
685: (__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.transformFiles =
|
|
7
7
|
exports.reduceChunk =
|
|
@@ -120,7 +120,7 @@
|
|
|
120
120
|
.map(standardizeFilePaths);
|
|
121
121
|
exports.transformFiles = transformFiles;
|
|
122
122
|
},
|
|
123
|
-
|
|
123
|
+
440: (__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
124
124
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
125
125
|
exports.normalModuleLoaderHook =
|
|
126
126
|
exports.getCompilerHooks =
|
|
@@ -130,7 +130,7 @@
|
|
|
130
130
|
const fs_1 = __nccwpck_require__(896);
|
|
131
131
|
const path_1 = __nccwpck_require__(928);
|
|
132
132
|
const lite_tapable_1 = __nccwpck_require__(408);
|
|
133
|
-
const helpers_1 = __nccwpck_require__(
|
|
133
|
+
const helpers_1 = __nccwpck_require__(685);
|
|
134
134
|
const compilerHookMap = new WeakMap();
|
|
135
135
|
const getCompilerHooks = (compiler) => {
|
|
136
136
|
let hooks = compilerHookMap.get(compiler);
|
|
@@ -312,7 +312,7 @@
|
|
|
312
312
|
exports.getCompilerHooks =
|
|
313
313
|
void 0;
|
|
314
314
|
const path_1 = __nccwpck_require__(928);
|
|
315
|
-
const hooks_1 = __nccwpck_require__(
|
|
315
|
+
const hooks_1 = __nccwpck_require__(440);
|
|
316
316
|
Object.defineProperty(exports, "getCompilerHooks", {
|
|
317
317
|
enumerable: true,
|
|
318
318
|
get: function () {
|
package/dist/index.cjs
CHANGED
|
@@ -2258,7 +2258,7 @@ for(var __webpack_i__ in (()=>{
|
|
|
2258
2258
|
async function createContext(options, userConfig) {
|
|
2259
2259
|
let { cwd } = options, rootPath = userConfig.root ? getAbsolutePath(cwd, userConfig.root) : cwd, rsbuildConfig = await withDefaultConfig(rootPath, userConfig), cachePath = (0, external_node_path_namespaceObject.join)(rootPath, 'node_modules', '.cache'), specifiedEnvironments = options.environment && options.environment.length > 0 ? options.environment : void 0;
|
|
2260
2260
|
return {
|
|
2261
|
-
version: "1.3.
|
|
2261
|
+
version: "1.3.14",
|
|
2262
2262
|
rootPath,
|
|
2263
2263
|
distPath: '',
|
|
2264
2264
|
cachePath,
|
|
@@ -3060,8 +3060,8 @@ for(var __webpack_i__ in (()=>{
|
|
|
3060
3060
|
return `${val.toFixed(val < 1 ? 2 : 1)} kB`;
|
|
3061
3061
|
}, coloringAssetName = (assetName)=>JS_REGEX.test(assetName) ? index_js_default().cyan(assetName) : CSS_REGEX.test(assetName) ? index_js_default().yellow(assetName) : HTML_REGEX.test(assetName) ? index_js_default().green(assetName) : index_js_default().magenta(assetName), COMPRESSIBLE_REGEX = /\.(?:js|css|html|json|svg|txt|xml|xhtml|wasm|manifest)$/i, isCompressible = (assetName)=>COMPRESSIBLE_REGEX.test(assetName);
|
|
3062
3062
|
async function printFileSizes(options, stats, rootPath, environmentName) {
|
|
3063
|
-
let logs = [];
|
|
3064
|
-
if (!
|
|
3063
|
+
let logs = [], showTotal = !1 !== options.total, showDetail = !1 !== options.detail, exclude = options.exclude ?? excludeAsset;
|
|
3064
|
+
if (!showTotal && !showDetail) return logs;
|
|
3065
3065
|
let formatAsset = async (asset, distPath, distFolder)=>{
|
|
3066
3066
|
let fileName = asset.name.split('?')[0], contents = await external_node_fs_default().promises.readFile(external_node_path_default().join(distPath, fileName)), size = Buffer.byteLength(contents), gzippedSize = options.compressed && isCompressible(fileName) ? await gzipSize(contents) : null, gzipSizeLabel = gzippedSize ? getAssetColor(gzippedSize)(calcFileSize(gzippedSize)) : null;
|
|
3067
3067
|
return {
|
|
@@ -3075,7 +3075,7 @@ for(var __webpack_i__ in (()=>{
|
|
|
3075
3075
|
}, getAssets = async ()=>{
|
|
3076
3076
|
let distPath = stats.compilation.outputOptions.path;
|
|
3077
3077
|
if (!distPath) return [];
|
|
3078
|
-
let
|
|
3078
|
+
let filteredAssets = (stats.toJson({
|
|
3079
3079
|
all: !1,
|
|
3080
3080
|
assets: !0,
|
|
3081
3081
|
cachedAssets: !0,
|
|
@@ -3084,7 +3084,7 @@ for(var __webpack_i__ in (()=>{
|
|
|
3084
3084
|
groupAssetsByChunk: !1,
|
|
3085
3085
|
groupAssetsByExtension: !1,
|
|
3086
3086
|
groupAssetsByEmitStatus: !1
|
|
3087
|
-
})
|
|
3087
|
+
}).assets || []).filter((asset)=>{
|
|
3088
3088
|
let assetInfo = {
|
|
3089
3089
|
name: asset.name,
|
|
3090
3090
|
size: asset.size
|
|
@@ -3096,11 +3096,11 @@ for(var __webpack_i__ in (()=>{
|
|
|
3096
3096
|
if (0 === assets.length) return logs;
|
|
3097
3097
|
logs.push(''), assets.sort((a, b)=>a.size - b.size);
|
|
3098
3098
|
let totalSize = 0, totalGzipSize = 0;
|
|
3099
|
-
for (let asset of assets)totalSize += asset.size, options.compressed && (totalGzipSize += asset.gzippedSize ?? asset.size);
|
|
3100
|
-
let
|
|
3101
|
-
if (
|
|
3102
|
-
let showGzipHeader = !!(options.compressed && assets.some((item)=>null !== item.gzippedSize));
|
|
3103
|
-
logs.push(function(maxFileLength, maxSizeLength, fileHeader, showGzipHeader) {
|
|
3099
|
+
for (let asset of (showTotal = showTotal && !(showDetail && 1 === assets.length), assets))totalSize += asset.size, options.compressed && (totalGzipSize += asset.gzippedSize ?? asset.size);
|
|
3100
|
+
let fileHeader = showDetail ? `File (${environmentName})` : '', totalSizeLabel = showTotal ? showDetail ? 'Total:' : `Total size (${environmentName}):` : '', totalSizeStr = showTotal ? calcFileSize(totalSize) : '';
|
|
3101
|
+
if (showDetail) {
|
|
3102
|
+
let maxFileLength = Math.max(...assets.map((a)=>(a.folder + external_node_path_default().sep + a.name).length), showTotal ? totalSizeLabel.length : 0, fileHeader.length), maxSizeLength = Math.max(...assets.map((a)=>a.sizeLabel.length), totalSizeStr.length), showGzipHeader = !!(options.compressed && assets.some((item)=>null !== item.gzippedSize));
|
|
3103
|
+
for (let asset of (logs.push(function(maxFileLength, maxSizeLength, fileHeader, showGzipHeader) {
|
|
3104
3104
|
let lengths = [
|
|
3105
3105
|
maxFileLength,
|
|
3106
3106
|
maxSizeLength
|
|
@@ -3114,26 +3114,26 @@ for(var __webpack_i__ in (()=>{
|
|
|
3114
3114
|
return length && (curLabel = cur.length < length ? cur + ' '.repeat(length - cur.length) : cur), `${prev + curLabel} `;
|
|
3115
3115
|
}, ' ');
|
|
3116
3116
|
return index_js_default().blue(headerRow);
|
|
3117
|
-
}(maxFileLength, maxSizeLength, fileHeader, showGzipHeader))
|
|
3118
|
-
|
|
3119
|
-
for (let asset of assets){
|
|
3120
|
-
let { sizeLabel } = asset, { name, folder, gzipSizeLabel } = asset, fileNameLength = (folder + external_node_path_default().sep + name).length, sizeLength = sizeLabel.length;
|
|
3121
|
-
if (!1 !== options.detail) {
|
|
3117
|
+
}(maxFileLength, maxSizeLength, fileHeader, showGzipHeader)), assets)){
|
|
3118
|
+
let { sizeLabel } = asset, { name, folder, gzipSizeLabel } = asset, fileNameLength = (folder + external_node_path_default().sep + name).length, sizeLength = sizeLabel.length;
|
|
3122
3119
|
sizeLength < maxSizeLength && (sizeLabel += ' '.repeat(maxSizeLength - sizeLength));
|
|
3123
3120
|
let fileNameLabel = index_js_default().dim(asset.folder + external_node_path_default().sep) + coloringAssetName(asset.name);
|
|
3124
3121
|
fileNameLength < maxFileLength && (fileNameLabel += ' '.repeat(maxFileLength - fileNameLength));
|
|
3125
3122
|
let log = ` ${fileNameLabel} ${sizeLabel}`;
|
|
3126
3123
|
gzipSizeLabel && (log += ` ${gzipSizeLabel}`), logs.push(log);
|
|
3127
3124
|
}
|
|
3128
|
-
|
|
3129
|
-
|
|
3130
|
-
|
|
3131
|
-
|
|
3132
|
-
|
|
3133
|
-
|
|
3134
|
-
|
|
3125
|
+
if (showTotal) {
|
|
3126
|
+
logs.push('');
|
|
3127
|
+
let log = ' ';
|
|
3128
|
+
if (log += ' '.repeat(maxFileLength - totalSizeLabel.length), log += index_js_default().magenta(totalSizeLabel), log += ` ${totalSizeStr}`, options.compressed) {
|
|
3129
|
+
let colorFn = getAssetColor(totalGzipSize / assets.length);
|
|
3130
|
+
log += ' '.repeat(maxSizeLength - totalSizeStr.length), log += ` ${colorFn(calcFileSize(totalGzipSize))}`;
|
|
3131
|
+
}
|
|
3132
|
+
logs.push(log);
|
|
3135
3133
|
}
|
|
3136
|
-
|
|
3134
|
+
} else if (showTotal) {
|
|
3135
|
+
let log = ` ${index_js_default().magenta(totalSizeLabel)} ${totalSizeStr}`;
|
|
3136
|
+
options.compressed && (log += index_js_default().green(` (${calcFileSize(totalGzipSize)} gzipped)`)), logs.push(log);
|
|
3137
3137
|
}
|
|
3138
3138
|
return logs.push(''), logs;
|
|
3139
3139
|
}
|
|
@@ -7507,11 +7507,11 @@ ${section.body}` : section.body).join("\n\n"));
|
|
|
7507
7507
|
}
|
|
7508
7508
|
process.title = 'rsbuild-node';
|
|
7509
7509
|
let { npm_execpath } = process.env;
|
|
7510
|
-
(!npm_execpath || npm_execpath.includes('npx-cli.js') || npm_execpath.includes('.bun')) && console.log(), rslog_index_js_namespaceObject.logger.greet(` Rsbuild v1.3.
|
|
7510
|
+
(!npm_execpath || npm_execpath.includes('npx-cli.js') || npm_execpath.includes('.bun')) && console.log(), rslog_index_js_namespaceObject.logger.greet(` Rsbuild v1.3.14\n`);
|
|
7511
7511
|
try {
|
|
7512
7512
|
!function() {
|
|
7513
7513
|
let cli = cac_dist('rsbuild');
|
|
7514
|
-
cli.help(), cli.version("1.3.
|
|
7514
|
+
cli.help(), cli.version("1.3.14"), applyCommonOptions(cli);
|
|
7515
7515
|
let devCommand = cli.command('', 'starting the dev server').alias('dev'), buildCommand = cli.command('build', 'build the app for production'), previewCommand = cli.command('preview', 'preview the production build locally'), inspectCommand = cli.command('inspect', 'inspect the Rspack and Rsbuild configs');
|
|
7516
7516
|
applyServerOptions(devCommand), applyServerOptions(previewCommand), devCommand.action(async (options)=>{
|
|
7517
7517
|
try {
|
|
@@ -7562,7 +7562,7 @@ ${section.body}` : section.body).join("\n\n"));
|
|
|
7562
7562
|
rslog_index_js_namespaceObject.logger.error('Failed to start Rsbuild CLI.'), rslog_index_js_namespaceObject.logger.error(err);
|
|
7563
7563
|
}
|
|
7564
7564
|
}
|
|
7565
|
-
let src_version = "1.3.
|
|
7565
|
+
let src_version = "1.3.14";
|
|
7566
7566
|
})(), exports.PLUGIN_CSS_NAME = __webpack_exports__.PLUGIN_CSS_NAME, exports.PLUGIN_SWC_NAME = __webpack_exports__.PLUGIN_SWC_NAME, exports.createRsbuild = __webpack_exports__.createRsbuild, exports.defineConfig = __webpack_exports__.defineConfig, exports.ensureAssetPrefix = __webpack_exports__.ensureAssetPrefix, exports.loadConfig = __webpack_exports__.loadConfig, exports.loadEnv = __webpack_exports__.loadEnv, exports.logger = __webpack_exports__.logger, exports.mergeRsbuildConfig = __webpack_exports__.mergeRsbuildConfig, exports.rspack = __webpack_exports__.rspack, exports.runCLI = __webpack_exports__.runCLI, exports.version = __webpack_exports__.version, __webpack_exports__)-1 === [
|
|
7567
7567
|
"PLUGIN_CSS_NAME",
|
|
7568
7568
|
"PLUGIN_SWC_NAME",
|
package/dist/index.js
CHANGED
|
@@ -2117,7 +2117,7 @@ async function updateEnvironmentContext(context, configs) {
|
|
|
2117
2117
|
async function createContext(options, userConfig) {
|
|
2118
2118
|
let { cwd } = options, rootPath = userConfig.root ? getAbsolutePath(cwd, userConfig.root) : cwd, rsbuildConfig = await withDefaultConfig(rootPath, userConfig), cachePath = (0, __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__.join)(rootPath, 'node_modules', '.cache'), specifiedEnvironments = options.environment && options.environment.length > 0 ? options.environment : void 0;
|
|
2119
2119
|
return {
|
|
2120
|
-
version: "1.3.
|
|
2120
|
+
version: "1.3.14",
|
|
2121
2121
|
rootPath,
|
|
2122
2122
|
distPath: '',
|
|
2123
2123
|
cachePath,
|
|
@@ -2916,8 +2916,8 @@ let EXCLUDE_ASSET_REGEX = /\.(?:map|LICENSE\.txt|d\.ts)$/, excludeAsset = (asset
|
|
|
2916
2916
|
return `${val.toFixed(val < 1 ? 2 : 1)} kB`;
|
|
2917
2917
|
}, coloringAssetName = (assetName)=>JS_REGEX.test(assetName) ? __WEBPACK_EXTERNAL_MODULE__compiled_picocolors_index_js_ea7a20e9__.default.cyan(assetName) : CSS_REGEX.test(assetName) ? __WEBPACK_EXTERNAL_MODULE__compiled_picocolors_index_js_ea7a20e9__.default.yellow(assetName) : HTML_REGEX.test(assetName) ? __WEBPACK_EXTERNAL_MODULE__compiled_picocolors_index_js_ea7a20e9__.default.green(assetName) : __WEBPACK_EXTERNAL_MODULE__compiled_picocolors_index_js_ea7a20e9__.default.magenta(assetName), COMPRESSIBLE_REGEX = /\.(?:js|css|html|json|svg|txt|xml|xhtml|wasm|manifest)$/i, isCompressible = (assetName)=>COMPRESSIBLE_REGEX.test(assetName);
|
|
2918
2918
|
async function printFileSizes(options, stats, rootPath, environmentName) {
|
|
2919
|
-
let logs = [];
|
|
2920
|
-
if (!
|
|
2919
|
+
let logs = [], showTotal = !1 !== options.total, showDetail = !1 !== options.detail, exclude = options.exclude ?? excludeAsset;
|
|
2920
|
+
if (!showTotal && !showDetail) return logs;
|
|
2921
2921
|
let formatAsset = async (asset, distPath, distFolder)=>{
|
|
2922
2922
|
let fileName = asset.name.split('?')[0], contents = await __WEBPACK_EXTERNAL_MODULE_node_fs_5ea92f0c__.default.promises.readFile(__WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__.default.join(distPath, fileName)), size = Buffer.byteLength(contents), gzippedSize = options.compressed && isCompressible(fileName) ? await gzipSize(contents) : null, gzipSizeLabel = gzippedSize ? getAssetColor(gzippedSize)(calcFileSize(gzippedSize)) : null;
|
|
2923
2923
|
return {
|
|
@@ -2931,7 +2931,7 @@ async function printFileSizes(options, stats, rootPath, environmentName) {
|
|
|
2931
2931
|
}, getAssets = async ()=>{
|
|
2932
2932
|
let distPath = stats.compilation.outputOptions.path;
|
|
2933
2933
|
if (!distPath) return [];
|
|
2934
|
-
let
|
|
2934
|
+
let filteredAssets = (stats.toJson({
|
|
2935
2935
|
all: !1,
|
|
2936
2936
|
assets: !0,
|
|
2937
2937
|
cachedAssets: !0,
|
|
@@ -2940,7 +2940,7 @@ async function printFileSizes(options, stats, rootPath, environmentName) {
|
|
|
2940
2940
|
groupAssetsByChunk: !1,
|
|
2941
2941
|
groupAssetsByExtension: !1,
|
|
2942
2942
|
groupAssetsByEmitStatus: !1
|
|
2943
|
-
})
|
|
2943
|
+
}).assets || []).filter((asset)=>{
|
|
2944
2944
|
let assetInfo = {
|
|
2945
2945
|
name: asset.name,
|
|
2946
2946
|
size: asset.size
|
|
@@ -2952,11 +2952,11 @@ async function printFileSizes(options, stats, rootPath, environmentName) {
|
|
|
2952
2952
|
if (0 === assets.length) return logs;
|
|
2953
2953
|
logs.push(''), assets.sort((a, b)=>a.size - b.size);
|
|
2954
2954
|
let totalSize = 0, totalGzipSize = 0;
|
|
2955
|
-
for (let asset of assets)totalSize += asset.size, options.compressed && (totalGzipSize += asset.gzippedSize ?? asset.size);
|
|
2956
|
-
let
|
|
2957
|
-
if (
|
|
2958
|
-
let showGzipHeader = !!(options.compressed && assets.some((item)=>null !== item.gzippedSize));
|
|
2959
|
-
logs.push(function(maxFileLength, maxSizeLength, fileHeader, showGzipHeader) {
|
|
2955
|
+
for (let asset of (showTotal = showTotal && !(showDetail && 1 === assets.length), assets))totalSize += asset.size, options.compressed && (totalGzipSize += asset.gzippedSize ?? asset.size);
|
|
2956
|
+
let fileHeader = showDetail ? `File (${environmentName})` : '', totalSizeLabel = showTotal ? showDetail ? 'Total:' : `Total size (${environmentName}):` : '', totalSizeStr = showTotal ? calcFileSize(totalSize) : '';
|
|
2957
|
+
if (showDetail) {
|
|
2958
|
+
let maxFileLength = Math.max(...assets.map((a)=>(a.folder + __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__.default.sep + a.name).length), showTotal ? totalSizeLabel.length : 0, fileHeader.length), maxSizeLength = Math.max(...assets.map((a)=>a.sizeLabel.length), totalSizeStr.length), showGzipHeader = !!(options.compressed && assets.some((item)=>null !== item.gzippedSize));
|
|
2959
|
+
for (let asset of (logs.push(function(maxFileLength, maxSizeLength, fileHeader, showGzipHeader) {
|
|
2960
2960
|
let lengths = [
|
|
2961
2961
|
maxFileLength,
|
|
2962
2962
|
maxSizeLength
|
|
@@ -2970,26 +2970,26 @@ async function printFileSizes(options, stats, rootPath, environmentName) {
|
|
|
2970
2970
|
return length && (curLabel = cur.length < length ? cur + ' '.repeat(length - cur.length) : cur), `${prev + curLabel} `;
|
|
2971
2971
|
}, ' ');
|
|
2972
2972
|
return __WEBPACK_EXTERNAL_MODULE__compiled_picocolors_index_js_ea7a20e9__.default.blue(headerRow);
|
|
2973
|
-
}(maxFileLength, maxSizeLength, fileHeader, showGzipHeader))
|
|
2974
|
-
|
|
2975
|
-
for (let asset of assets){
|
|
2976
|
-
let { sizeLabel } = asset, { name, folder, gzipSizeLabel } = asset, fileNameLength = (folder + __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__.default.sep + name).length, sizeLength = sizeLabel.length;
|
|
2977
|
-
if (!1 !== options.detail) {
|
|
2973
|
+
}(maxFileLength, maxSizeLength, fileHeader, showGzipHeader)), assets)){
|
|
2974
|
+
let { sizeLabel } = asset, { name, folder, gzipSizeLabel } = asset, fileNameLength = (folder + __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__.default.sep + name).length, sizeLength = sizeLabel.length;
|
|
2978
2975
|
sizeLength < maxSizeLength && (sizeLabel += ' '.repeat(maxSizeLength - sizeLength));
|
|
2979
2976
|
let fileNameLabel = __WEBPACK_EXTERNAL_MODULE__compiled_picocolors_index_js_ea7a20e9__.default.dim(asset.folder + __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__.default.sep) + coloringAssetName(asset.name);
|
|
2980
2977
|
fileNameLength < maxFileLength && (fileNameLabel += ' '.repeat(maxFileLength - fileNameLength));
|
|
2981
2978
|
let log = ` ${fileNameLabel} ${sizeLabel}`;
|
|
2982
2979
|
gzipSizeLabel && (log += ` ${gzipSizeLabel}`), logs.push(log);
|
|
2983
2980
|
}
|
|
2984
|
-
|
|
2985
|
-
|
|
2986
|
-
|
|
2987
|
-
|
|
2988
|
-
|
|
2989
|
-
|
|
2990
|
-
|
|
2981
|
+
if (showTotal) {
|
|
2982
|
+
logs.push('');
|
|
2983
|
+
let log = ' ';
|
|
2984
|
+
if (log += ' '.repeat(maxFileLength - totalSizeLabel.length), log += __WEBPACK_EXTERNAL_MODULE__compiled_picocolors_index_js_ea7a20e9__.default.magenta(totalSizeLabel), log += ` ${totalSizeStr}`, options.compressed) {
|
|
2985
|
+
let colorFn = getAssetColor(totalGzipSize / assets.length);
|
|
2986
|
+
log += ' '.repeat(maxSizeLength - totalSizeStr.length), log += ` ${colorFn(calcFileSize(totalGzipSize))}`;
|
|
2987
|
+
}
|
|
2988
|
+
logs.push(log);
|
|
2991
2989
|
}
|
|
2992
|
-
|
|
2990
|
+
} else if (showTotal) {
|
|
2991
|
+
let log = ` ${__WEBPACK_EXTERNAL_MODULE__compiled_picocolors_index_js_ea7a20e9__.default.magenta(totalSizeLabel)} ${totalSizeStr}`;
|
|
2992
|
+
options.compressed && (log += __WEBPACK_EXTERNAL_MODULE__compiled_picocolors_index_js_ea7a20e9__.default.green(` (${calcFileSize(totalGzipSize)} gzipped)`)), logs.push(log);
|
|
2993
2993
|
}
|
|
2994
2994
|
return logs.push(''), logs;
|
|
2995
2995
|
}
|
|
@@ -7342,11 +7342,11 @@ async function runCLI() {
|
|
|
7342
7342
|
}
|
|
7343
7343
|
process.title = 'rsbuild-node';
|
|
7344
7344
|
let { npm_execpath } = process.env;
|
|
7345
|
-
(!npm_execpath || npm_execpath.includes('npx-cli.js') || npm_execpath.includes('.bun')) && console.log(), __WEBPACK_EXTERNAL_MODULE__compiled_rslog_index_js_c302f6e3__.logger.greet(` Rsbuild v1.3.
|
|
7345
|
+
(!npm_execpath || npm_execpath.includes('npx-cli.js') || npm_execpath.includes('.bun')) && console.log(), __WEBPACK_EXTERNAL_MODULE__compiled_rslog_index_js_c302f6e3__.logger.greet(` Rsbuild v1.3.14\n`);
|
|
7346
7346
|
try {
|
|
7347
7347
|
!function() {
|
|
7348
7348
|
let cli = cac_dist('rsbuild');
|
|
7349
|
-
cli.help(), cli.version("1.3.
|
|
7349
|
+
cli.help(), cli.version("1.3.14"), applyCommonOptions(cli);
|
|
7350
7350
|
let devCommand = cli.command('', 'starting the dev server').alias('dev'), buildCommand = cli.command('build', 'build the app for production'), previewCommand = cli.command('preview', 'preview the production build locally'), inspectCommand = cli.command('inspect', 'inspect the Rspack and Rsbuild configs');
|
|
7351
7351
|
applyServerOptions(devCommand), applyServerOptions(previewCommand), devCommand.action(async (options)=>{
|
|
7352
7352
|
try {
|
|
@@ -7397,6 +7397,6 @@ async function runCLI() {
|
|
|
7397
7397
|
__WEBPACK_EXTERNAL_MODULE__compiled_rslog_index_js_c302f6e3__.logger.error('Failed to start Rsbuild CLI.'), __WEBPACK_EXTERNAL_MODULE__compiled_rslog_index_js_c302f6e3__.logger.error(err);
|
|
7398
7398
|
}
|
|
7399
7399
|
}
|
|
7400
|
-
let src_version = "1.3.
|
|
7400
|
+
let src_version = "1.3.14";
|
|
7401
7401
|
var __webpack_exports__logger = __WEBPACK_EXTERNAL_MODULE__compiled_rslog_index_js_c302f6e3__.logger, __webpack_exports__rspack = __WEBPACK_EXTERNAL_MODULE__rspack_core_e0096ff7__.rspack;
|
|
7402
7402
|
export { PLUGIN_CSS_NAME, PLUGIN_SWC_NAME, createRsbuild, defineConfig, ensureAssetPrefix, config_loadConfig as loadConfig, loadEnv, mergeRsbuildConfig, runCLI, src_version as version, __webpack_exports__logger as logger, __webpack_exports__rspack as rspack };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsbuild/core",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.14",
|
|
4
4
|
"description": "The Rspack-based build tool.",
|
|
5
5
|
"homepage": "https://rsbuild.dev",
|
|
6
6
|
"bugs": {
|
|
@@ -46,14 +46,14 @@
|
|
|
46
46
|
"types.d.ts"
|
|
47
47
|
],
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@rspack/core": "1.3.
|
|
49
|
+
"@rspack/core": "1.3.8",
|
|
50
50
|
"@rspack/lite-tapable": "~1.0.1",
|
|
51
51
|
"@swc/helpers": "^0.5.17",
|
|
52
52
|
"core-js": "~3.41.0",
|
|
53
53
|
"jiti": "^2.4.2"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
|
-
"@rslib/core": "0.6.
|
|
56
|
+
"@rslib/core": "0.6.7",
|
|
57
57
|
"@types/connect": "3.4.38",
|
|
58
58
|
"@types/cors": "^2.8.17",
|
|
59
59
|
"@types/node": "^22.15.2",
|