@rsbuild/core 1.6.11 → 1.6.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/compiled/css-loader/index.js +18 -18
- package/compiled/html-rspack-plugin/index.js +14 -14
- package/compiled/postcss-loader/index.js +6 -6
- package/compiled/rspack-manifest-plugin/index.js +4 -4
- package/dist/131.js +77 -66
- package/dist/index.cjs +80 -70
- package/dist-types/types/config.d.ts +6 -0
- package/package.json +2 -2
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
(() => {
|
|
2
2
|
var __webpack_modules__ = {
|
|
3
|
-
|
|
3
|
+
7653: (module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
4
4
|
"use strict";
|
|
5
|
-
const loader = __nccwpck_require__(
|
|
5
|
+
const loader = __nccwpck_require__(5551);
|
|
6
6
|
module.exports = loader.default;
|
|
7
7
|
module.exports.defaultGetLocalIdent =
|
|
8
|
-
__nccwpck_require__(
|
|
8
|
+
__nccwpck_require__(218).defaultGetLocalIdent;
|
|
9
9
|
},
|
|
10
|
-
|
|
10
|
+
5551: (__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__(1259));
|
|
15
|
-
var _plugins = __nccwpck_require__(
|
|
16
|
-
var _utils = __nccwpck_require__(
|
|
15
|
+
var _plugins = __nccwpck_require__(6644);
|
|
16
|
+
var _utils = __nccwpck_require__(218);
|
|
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
|
+
6644: (__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
240
240
|
"use strict";
|
|
241
241
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
242
242
|
Object.defineProperty(exports, "icssParser", {
|
|
@@ -258,22 +258,22 @@
|
|
|
258
258
|
},
|
|
259
259
|
});
|
|
260
260
|
var _postcssImportParser = _interopRequireDefault(
|
|
261
|
-
__nccwpck_require__(
|
|
261
|
+
__nccwpck_require__(3439),
|
|
262
262
|
);
|
|
263
263
|
var _postcssIcssParser = _interopRequireDefault(
|
|
264
|
-
__nccwpck_require__(
|
|
264
|
+
__nccwpck_require__(8018),
|
|
265
265
|
);
|
|
266
|
-
var _postcssUrlParser = _interopRequireDefault(__nccwpck_require__(
|
|
266
|
+
var _postcssUrlParser = _interopRequireDefault(__nccwpck_require__(5477));
|
|
267
267
|
function _interopRequireDefault(obj) {
|
|
268
268
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
269
269
|
}
|
|
270
270
|
},
|
|
271
|
-
|
|
271
|
+
8018: (__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
272
272
|
"use strict";
|
|
273
273
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
274
274
|
exports["default"] = void 0;
|
|
275
275
|
var _icssUtils = __nccwpck_require__(229);
|
|
276
|
-
var _utils = __nccwpck_require__(
|
|
276
|
+
var _utils = __nccwpck_require__(218);
|
|
277
277
|
const plugin = (options = {}) => ({
|
|
278
278
|
postcssPlugin: "postcss-icss-parser",
|
|
279
279
|
async OnceExit(root) {
|
|
@@ -372,14 +372,14 @@
|
|
|
372
372
|
plugin.postcss = true;
|
|
373
373
|
var _default = (exports["default"] = plugin);
|
|
374
374
|
},
|
|
375
|
-
|
|
375
|
+
3439: (__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
376
376
|
"use strict";
|
|
377
377
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
378
378
|
exports["default"] = void 0;
|
|
379
379
|
var _postcssValueParser = _interopRequireDefault(
|
|
380
380
|
__nccwpck_require__(5245),
|
|
381
381
|
);
|
|
382
|
-
var _utils = __nccwpck_require__(
|
|
382
|
+
var _utils = __nccwpck_require__(218);
|
|
383
383
|
function _interopRequireDefault(obj) {
|
|
384
384
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
385
385
|
}
|
|
@@ -684,14 +684,14 @@
|
|
|
684
684
|
plugin.postcss = true;
|
|
685
685
|
var _default = (exports["default"] = plugin);
|
|
686
686
|
},
|
|
687
|
-
|
|
687
|
+
5477: (__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
688
688
|
"use strict";
|
|
689
689
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
690
690
|
exports["default"] = void 0;
|
|
691
691
|
var _postcssValueParser = _interopRequireDefault(
|
|
692
692
|
__nccwpck_require__(5245),
|
|
693
693
|
);
|
|
694
|
-
var _utils = __nccwpck_require__(
|
|
694
|
+
var _utils = __nccwpck_require__(218);
|
|
695
695
|
function _interopRequireDefault(obj) {
|
|
696
696
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
697
697
|
}
|
|
@@ -1034,7 +1034,7 @@
|
|
|
1034
1034
|
plugin.postcss = true;
|
|
1035
1035
|
var _default = (exports["default"] = plugin);
|
|
1036
1036
|
},
|
|
1037
|
-
|
|
1037
|
+
218: (__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
1038
1038
|
"use strict";
|
|
1039
1039
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1040
1040
|
exports.WEBPACK_IGNORE_COMMENT_REGEXP = void 0;
|
|
@@ -8098,6 +8098,6 @@
|
|
|
8098
8098
|
}
|
|
8099
8099
|
if (typeof __nccwpck_require__ !== "undefined")
|
|
8100
8100
|
__nccwpck_require__.ab = __dirname + "/";
|
|
8101
|
-
var __webpack_exports__ = __nccwpck_require__(
|
|
8101
|
+
var __webpack_exports__ = __nccwpck_require__(7653);
|
|
8102
8102
|
module.exports = __webpack_exports__;
|
|
8103
8103
|
})();
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(() => {
|
|
2
2
|
var __webpack_modules__ = {
|
|
3
|
-
|
|
3
|
+
559: (module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
4
4
|
"use strict";
|
|
5
|
-
const { HtmlWebpackChildCompiler } = __nccwpck_require__(
|
|
5
|
+
const { HtmlWebpackChildCompiler } = __nccwpck_require__(404);
|
|
6
6
|
const compilerMap = new WeakMap();
|
|
7
7
|
class CachedChildCompilation {
|
|
8
8
|
constructor(compiler) {
|
|
@@ -311,7 +311,7 @@
|
|
|
311
311
|
}
|
|
312
312
|
module.exports = { CachedChildCompilation };
|
|
313
313
|
},
|
|
314
|
-
|
|
314
|
+
404: (module) => {
|
|
315
315
|
"use strict";
|
|
316
316
|
class HtmlWebpackChildCompiler {
|
|
317
317
|
constructor(templates) {
|
|
@@ -480,7 +480,7 @@
|
|
|
480
480
|
}
|
|
481
481
|
module.exports = { HtmlWebpackChildCompiler };
|
|
482
482
|
},
|
|
483
|
-
|
|
483
|
+
940: (module) => {
|
|
484
484
|
"use strict";
|
|
485
485
|
module.exports = {};
|
|
486
486
|
module.exports.none = (chunks) => chunks;
|
|
@@ -499,7 +499,7 @@
|
|
|
499
499
|
};
|
|
500
500
|
module.exports.auto = module.exports.none;
|
|
501
501
|
},
|
|
502
|
-
|
|
502
|
+
507: (module) => {
|
|
503
503
|
"use strict";
|
|
504
504
|
module.exports = function (err) {
|
|
505
505
|
return {
|
|
@@ -520,7 +520,7 @@
|
|
|
520
520
|
};
|
|
521
521
|
};
|
|
522
522
|
},
|
|
523
|
-
|
|
523
|
+
786: (module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
524
524
|
"use strict";
|
|
525
525
|
const { AsyncSeriesWaterfallHook } = __nccwpck_require__(408);
|
|
526
526
|
const htmlWebpackPluginHooksMap = new WeakMap();
|
|
@@ -546,7 +546,7 @@
|
|
|
546
546
|
}
|
|
547
547
|
module.exports = { getHtmlRspackPluginHooks };
|
|
548
548
|
},
|
|
549
|
-
|
|
549
|
+
959: (module) => {
|
|
550
550
|
const voidTags = [
|
|
551
551
|
"area",
|
|
552
552
|
"base",
|
|
@@ -614,19 +614,19 @@
|
|
|
614
614
|
htmlTagObjectToString,
|
|
615
615
|
};
|
|
616
616
|
},
|
|
617
|
-
|
|
617
|
+
894: (module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
618
618
|
"use strict";
|
|
619
619
|
const promisify = __nccwpck_require__(23).promisify;
|
|
620
620
|
const vm = __nccwpck_require__(154);
|
|
621
621
|
const fs = __nccwpck_require__(896);
|
|
622
622
|
const path = __nccwpck_require__(928);
|
|
623
|
-
const { CachedChildCompilation } = __nccwpck_require__(
|
|
623
|
+
const { CachedChildCompilation } = __nccwpck_require__(559);
|
|
624
624
|
const { createHtmlTagObject, htmlTagObjectToString, HtmlTagArray } =
|
|
625
|
-
__nccwpck_require__(
|
|
626
|
-
const prettyError = __nccwpck_require__(
|
|
627
|
-
const chunkSorter = __nccwpck_require__(
|
|
625
|
+
__nccwpck_require__(959);
|
|
626
|
+
const prettyError = __nccwpck_require__(507);
|
|
627
|
+
const chunkSorter = __nccwpck_require__(940);
|
|
628
628
|
const getHtmlRspackPluginHooks =
|
|
629
|
-
__nccwpck_require__(
|
|
629
|
+
__nccwpck_require__(786).getHtmlRspackPluginHooks;
|
|
630
630
|
const WITH_PLACEHOLDER = "function __with_placeholder__";
|
|
631
631
|
class HtmlRspackPlugin {
|
|
632
632
|
constructor(userOptions = {}) {
|
|
@@ -1597,6 +1597,6 @@
|
|
|
1597
1597
|
}
|
|
1598
1598
|
if (typeof __nccwpck_require__ !== "undefined")
|
|
1599
1599
|
__nccwpck_require__.ab = __dirname + "/";
|
|
1600
|
-
var __webpack_exports__ = __nccwpck_require__(
|
|
1600
|
+
var __webpack_exports__ = __nccwpck_require__(894);
|
|
1601
1601
|
module.exports = __webpack_exports__;
|
|
1602
1602
|
})();
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
(() => {
|
|
2
2
|
"use strict";
|
|
3
3
|
var __webpack_modules__ = {
|
|
4
|
-
|
|
5
|
-
module.exports = __nccwpck_require__(
|
|
4
|
+
357: (module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
5
|
+
module.exports = __nccwpck_require__(127)["default"];
|
|
6
6
|
},
|
|
7
|
-
|
|
7
|
+
127: (__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 _nodePath = _interopRequireDefault(__nccwpck_require__(760));
|
|
12
|
-
var _utils = __nccwpck_require__(
|
|
12
|
+
var _utils = __nccwpck_require__(802);
|
|
13
13
|
function _interopRequireDefault(e) {
|
|
14
14
|
return e && e.__esModule ? e : { default: e };
|
|
15
15
|
}
|
|
@@ -179,7 +179,7 @@
|
|
|
179
179
|
callback(null, result.css, map, { ast });
|
|
180
180
|
}
|
|
181
181
|
},
|
|
182
|
-
|
|
182
|
+
802: (module, exports, __nccwpck_require__) => {
|
|
183
183
|
module = __nccwpck_require__.nmd(module);
|
|
184
184
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
185
185
|
exports.exec = exec;
|
|
@@ -715,6 +715,6 @@
|
|
|
715
715
|
})();
|
|
716
716
|
if (typeof __nccwpck_require__ !== "undefined")
|
|
717
717
|
__nccwpck_require__.ab = __dirname + "/";
|
|
718
|
-
var __webpack_exports__ = __nccwpck_require__(
|
|
718
|
+
var __webpack_exports__ = __nccwpck_require__(357);
|
|
719
719
|
module.exports = __webpack_exports__;
|
|
720
720
|
})();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
(() => {
|
|
2
2
|
"use strict";
|
|
3
3
|
var __webpack_modules__ = {
|
|
4
|
-
|
|
4
|
+
38: (__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
|
+
935: (__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 node_fs_1 = __nccwpck_require__(24);
|
|
131
131
|
const node_path_1 = __nccwpck_require__(760);
|
|
132
132
|
const lite_tapable_1 = __nccwpck_require__(408);
|
|
133
|
-
const helpers_1 = __nccwpck_require__(
|
|
133
|
+
const helpers_1 = __nccwpck_require__(38);
|
|
134
134
|
const compilerHookMap = new WeakMap();
|
|
135
135
|
const getCompilerHooks = (compiler) => {
|
|
136
136
|
let hooks = compilerHookMap.get(compiler);
|
|
@@ -327,7 +327,7 @@
|
|
|
327
327
|
exports.getCompilerHooks =
|
|
328
328
|
void 0;
|
|
329
329
|
const node_path_1 = __nccwpck_require__(760);
|
|
330
|
-
const hooks_1 = __nccwpck_require__(
|
|
330
|
+
const hooks_1 = __nccwpck_require__(935);
|
|
331
331
|
Object.defineProperty(exports, "getCompilerHooks", {
|
|
332
332
|
enumerable: true,
|
|
333
333
|
get: function () {
|
package/dist/131.js
CHANGED
|
@@ -2442,7 +2442,15 @@ function hintUnknownFiles(message) {
|
|
|
2442
2442
|
return message;
|
|
2443
2443
|
}
|
|
2444
2444
|
function formatStatsError(stats) {
|
|
2445
|
-
let fileName = resolveFileName(stats), message = `${
|
|
2445
|
+
let fileName = resolveFileName(stats), message = `${((fileName, stats)=>{
|
|
2446
|
+
if (!fileName) return '';
|
|
2447
|
+
let DATA_URI_PREFIX = "data:text/javascript,";
|
|
2448
|
+
if (fileName.startsWith(DATA_URI_PREFIX)) {
|
|
2449
|
+
let snippet = fileName.replace(DATA_URI_PREFIX, '');
|
|
2450
|
+
return snippet.length > 30 && (snippet = `${snippet.slice(0, 30)}...`), `File: ${color.cyan('data-uri virtual module')} ${color.dim(`(${snippet})`)}\n`;
|
|
2451
|
+
}
|
|
2452
|
+
return /:\d+:\d+/.test(fileName) ? `File: ${color.cyan(fileName)}\n` : stats.loc ? `File: ${color.cyan(`${fileName}:${stats.loc}`)}\n` : `File: ${color.cyan(`${fileName}:1:1`)}\n`;
|
|
2453
|
+
})(fileName, stats)}${stats.message}`, verbose = 'verbose' === logger.level;
|
|
2446
2454
|
verbose && (stats.details && (message += `\nDetails: ${stats.details}\n`), stats.stack && (message += `\n${stats.stack}`));
|
|
2447
2455
|
let moduleTrace = formatModuleTrace(stats, fileName);
|
|
2448
2456
|
moduleTrace && (message += moduleTrace);
|
|
@@ -3406,7 +3414,7 @@ function createPublicContext(context) {
|
|
|
3406
3414
|
async function createContext(options, userConfig) {
|
|
3407
3415
|
let { cwd } = options, rootPath = userConfig.root ? ensureAbsolutePath(cwd, userConfig.root) : cwd, rsbuildConfig = await withDefaultConfig(rootPath, userConfig), cachePath = (0, external_node_path_.join)(rootPath, 'node_modules', '.cache'), specifiedEnvironments = options.environment && options.environment.length > 0 ? options.environment : void 0, bundlerType = userConfig.provider ? 'webpack' : 'rspack';
|
|
3408
3416
|
return {
|
|
3409
|
-
version: "1.6.
|
|
3417
|
+
version: "1.6.12",
|
|
3410
3418
|
rootPath,
|
|
3411
3419
|
distPath: '',
|
|
3412
3420
|
cachePath,
|
|
@@ -4984,13 +4992,14 @@ function doesChunkBelongToHtml({ chunk, htmlPluginData }) {
|
|
|
4984
4992
|
}
|
|
4985
4993
|
let isCSSPath = (filePath)=>filePath.endsWith('.css');
|
|
4986
4994
|
function normalizeManifestObjectConfig(manifest) {
|
|
4987
|
-
if ('string' == typeof manifest) return {
|
|
4988
|
-
filename: manifest
|
|
4989
|
-
};
|
|
4990
4995
|
let defaultOptions = {
|
|
4996
|
+
prefix: !0,
|
|
4991
4997
|
filename: 'manifest.json'
|
|
4992
4998
|
};
|
|
4993
|
-
return '
|
|
4999
|
+
return 'string' == typeof manifest ? {
|
|
5000
|
+
...defaultOptions,
|
|
5001
|
+
filename: manifest
|
|
5002
|
+
} : 'boolean' == typeof manifest ? defaultOptions : {
|
|
4994
5003
|
...defaultOptions,
|
|
4995
5004
|
...manifest
|
|
4996
5005
|
};
|
|
@@ -8585,67 +8594,69 @@ try {
|
|
|
8585
8594
|
let { output: { manifest }, dev: { writeToDisk } } = environment.config;
|
|
8586
8595
|
if (!1 === manifest) return;
|
|
8587
8596
|
let manifestOptions = normalizeManifestObjectConfig(manifest), { RspackManifestPlugin } = requireCompiledPackage('rspack-manifest-plugin'), { htmlPaths } = environment, filter = manifestOptions.filter ?? ((file)=>!file.name.endsWith('.LICENSE.txt'));
|
|
8588
|
-
manifestFilenames.set(environment.name, manifestOptions.filename)
|
|
8589
|
-
|
|
8590
|
-
|
|
8591
|
-
|
|
8592
|
-
|
|
8593
|
-
|
|
8594
|
-
|
|
8595
|
-
|
|
8596
|
-
|
|
8597
|
-
|
|
8598
|
-
|
|
8599
|
-
|
|
8600
|
-
|
|
8601
|
-
|
|
8602
|
-
}
|
|
8603
|
-
return file.path;
|
|
8604
|
-
}), manifestEntries = {};
|
|
8605
|
-
for (let [entryName, chunkFiles] of chunkEntries){
|
|
8606
|
-
let assets = new Set(), initialJS = [], initialCSS = [], asyncJS = [], asyncCSS = [];
|
|
8607
|
-
if (entries[entryName]) for (let filePath of entries[entryName]){
|
|
8608
|
-
let fileURL = ensureAssetPrefix(filePath, publicPath);
|
|
8609
|
-
isCSSPath(filePath) ? initialCSS.push(fileURL) : initialJS.push(fileURL);
|
|
8610
|
-
}
|
|
8611
|
-
for (let file of chunkFiles){
|
|
8612
|
-
file.isInitial || (isCSSPath(file.path) ? asyncCSS.push(file.path) : asyncJS.push(file.path));
|
|
8613
|
-
let relatedLICENSE = licenseMap.get(file.path);
|
|
8614
|
-
if (relatedLICENSE && assets.add(relatedLICENSE), file.chunk) for (let auxiliaryFile of file.chunk.auxiliaryFiles)assets.add(auxiliaryFile);
|
|
8615
|
-
}
|
|
8616
|
-
let entryManifest = {};
|
|
8617
|
-
assets.size && (entryManifest.assets = Array.from(assets));
|
|
8618
|
-
let htmlPath = files.find((f)=>f.name === htmlPaths[entryName])?.path;
|
|
8619
|
-
htmlPath && (entryManifest.html = [
|
|
8620
|
-
htmlPath
|
|
8621
|
-
]), initialJS.length && (entryManifest.initial = {
|
|
8622
|
-
js: initialJS
|
|
8623
|
-
}), initialCSS.length && (entryManifest.initial = {
|
|
8624
|
-
...entryManifest.initial || {},
|
|
8625
|
-
css: initialCSS
|
|
8626
|
-
}), asyncJS.length && (entryManifest.async = {
|
|
8627
|
-
js: asyncJS
|
|
8628
|
-
}), asyncCSS.length && (entryManifest.async = {
|
|
8629
|
-
...entryManifest.async || {},
|
|
8630
|
-
css: asyncCSS
|
|
8631
|
-
}), manifestEntries[entryName] = entryManifest;
|
|
8597
|
+
manifestFilenames.set(environment.name, manifestOptions.filename);
|
|
8598
|
+
let pluginOptions = {
|
|
8599
|
+
fileName: manifestOptions.filename,
|
|
8600
|
+
filter,
|
|
8601
|
+
writeToFileEmit: isDev && !0 !== writeToDisk,
|
|
8602
|
+
generate: (_seed, files, entries, { compilation })=>{
|
|
8603
|
+
let chunkEntries = new Map(), licenseMap = new Map(), publicPath = getPublicPathFromCompiler(compilation), integrity = {}, allFiles = files.map((file)=>{
|
|
8604
|
+
if (file.integrity && (integrity[file.path] = file.integrity), file.chunk) for (let entryName of recursiveChunkEntryNames(file.chunk))chunkEntries.set(entryName, [
|
|
8605
|
+
file,
|
|
8606
|
+
...chunkEntries.get(entryName) || []
|
|
8607
|
+
]);
|
|
8608
|
+
if (file.path.endsWith('.LICENSE.txt')) {
|
|
8609
|
+
let sourceFilePath = file.path.split('.LICENSE.txt')[0];
|
|
8610
|
+
licenseMap.set(sourceFilePath, file.path);
|
|
8632
8611
|
}
|
|
8633
|
-
|
|
8634
|
-
|
|
8635
|
-
|
|
8636
|
-
|
|
8637
|
-
|
|
8638
|
-
|
|
8639
|
-
|
|
8640
|
-
files,
|
|
8641
|
-
manifestData
|
|
8642
|
-
});
|
|
8643
|
-
if (isObject(generatedManifest)) return environment.manifest = generatedManifest, generatedManifest;
|
|
8644
|
-
throw Error(`${color.dim('[rsbuild:manifest]')} \`manifest.generate\` function must return a valid manifest object.`);
|
|
8612
|
+
return file.path;
|
|
8613
|
+
}), manifestEntries = {};
|
|
8614
|
+
for (let [entryName, chunkFiles] of chunkEntries){
|
|
8615
|
+
let assets = new Set(), initialJS = [], initialCSS = [], asyncJS = [], asyncCSS = [];
|
|
8616
|
+
if (entries[entryName]) for (let filePath of entries[entryName]){
|
|
8617
|
+
let fileURL = manifestOptions.prefix ? ensureAssetPrefix(filePath, publicPath) : filePath;
|
|
8618
|
+
isCSSPath(filePath) ? initialCSS.push(fileURL) : initialJS.push(fileURL);
|
|
8645
8619
|
}
|
|
8646
|
-
|
|
8620
|
+
for (let file of chunkFiles){
|
|
8621
|
+
file.isInitial || (isCSSPath(file.path) ? asyncCSS.push(file.path) : asyncJS.push(file.path));
|
|
8622
|
+
let relatedLICENSE = licenseMap.get(file.path);
|
|
8623
|
+
if (relatedLICENSE && assets.add(relatedLICENSE), file.chunk) for (let auxiliaryFile of file.chunk.auxiliaryFiles)assets.add(auxiliaryFile);
|
|
8624
|
+
}
|
|
8625
|
+
let entryManifest = {};
|
|
8626
|
+
assets.size && (entryManifest.assets = Array.from(assets));
|
|
8627
|
+
let htmlPath = files.find((f)=>f.name === htmlPaths[entryName])?.path;
|
|
8628
|
+
htmlPath && (entryManifest.html = [
|
|
8629
|
+
htmlPath
|
|
8630
|
+
]), initialJS.length && (entryManifest.initial = {
|
|
8631
|
+
js: initialJS
|
|
8632
|
+
}), initialCSS.length && (entryManifest.initial = {
|
|
8633
|
+
...entryManifest.initial || {},
|
|
8634
|
+
css: initialCSS
|
|
8635
|
+
}), asyncJS.length && (entryManifest.async = {
|
|
8636
|
+
js: asyncJS
|
|
8637
|
+
}), asyncCSS.length && (entryManifest.async = {
|
|
8638
|
+
...entryManifest.async || {},
|
|
8639
|
+
css: asyncCSS
|
|
8640
|
+
}), manifestEntries[entryName] = entryManifest;
|
|
8647
8641
|
}
|
|
8642
|
+
let manifestData = {
|
|
8643
|
+
allFiles,
|
|
8644
|
+
entries: manifestEntries,
|
|
8645
|
+
integrity
|
|
8646
|
+
};
|
|
8647
|
+
if (manifestOptions.generate) {
|
|
8648
|
+
let generatedManifest = manifestOptions.generate({
|
|
8649
|
+
files,
|
|
8650
|
+
manifestData
|
|
8651
|
+
});
|
|
8652
|
+
if (isObject(generatedManifest)) return environment.manifest = generatedManifest, generatedManifest;
|
|
8653
|
+
throw Error(`${color.dim('[rsbuild:manifest]')} \`manifest.generate\` function must return a valid manifest object.`);
|
|
8654
|
+
}
|
|
8655
|
+
return environment.manifest = manifestData, manifestData;
|
|
8648
8656
|
}
|
|
8657
|
+
};
|
|
8658
|
+
manifestOptions.prefix || (pluginOptions.publicPath = ''), chain.plugin(CHAIN_ID.PLUGIN.MANIFEST).use(RspackManifestPlugin, [
|
|
8659
|
+
pluginOptions
|
|
8649
8660
|
]);
|
|
8650
8661
|
}), api.onAfterCreateCompiler(()=>{
|
|
8651
8662
|
if (manifestFilenames.size <= 1) return void manifestFilenames.clear();
|
|
@@ -9047,7 +9058,7 @@ let applyServerOptions = (command)=>{
|
|
|
9047
9058
|
};
|
|
9048
9059
|
function setupCommands() {
|
|
9049
9060
|
let cli = ((name = "")=>new CAC(name))('rsbuild');
|
|
9050
|
-
cli.version("1.6.
|
|
9061
|
+
cli.version("1.6.12"), cli.option('--base <base>', 'Set the base path of the server').option('-c, --config <config>', 'Set the configuration file (relative or absolute path)').option('--config-loader <loader>', 'Set the config file loader (auto | jiti | native)', {
|
|
9051
9062
|
default: 'auto'
|
|
9052
9063
|
}).option('--env-dir <dir>', 'Set the directory for loading `.env` files').option('--env-mode <mode>', 'Set the env mode to load the `.env.[mode]` file').option('--environment <name>', 'Set the environment name(s) to build', {
|
|
9053
9064
|
type: [
|
|
@@ -9116,7 +9127,7 @@ function initNodeEnv() {
|
|
|
9116
9127
|
}
|
|
9117
9128
|
function showGreeting() {
|
|
9118
9129
|
let { npm_execpath, npm_lifecycle_event, NODE_RUN_SCRIPT_NAME } = process.env, isBun = npm_execpath?.includes('.bun');
|
|
9119
|
-
logger.greet(`${'npx' === npm_lifecycle_event || isBun || NODE_RUN_SCRIPT_NAME ? '\n' : ''}Rsbuild v1.6.
|
|
9130
|
+
logger.greet(`${'npx' === npm_lifecycle_event || isBun || NODE_RUN_SCRIPT_NAME ? '\n' : ''}Rsbuild v1.6.12\n`);
|
|
9120
9131
|
}
|
|
9121
9132
|
function setupLogLevel() {
|
|
9122
9133
|
let logLevelIndex = process.argv.findIndex((item)=>'--log-level' === item || '--logLevel' === item);
|
|
@@ -9137,7 +9148,7 @@ function runCLI() {
|
|
|
9137
9148
|
logger.error('Failed to start Rsbuild CLI.'), logger.error(err);
|
|
9138
9149
|
}
|
|
9139
9150
|
}
|
|
9140
|
-
let src_version = "1.6.
|
|
9151
|
+
let src_version = "1.6.12";
|
|
9141
9152
|
import * as __rspack_external_node_module_ab9f2194 from "node:module";
|
|
9142
9153
|
import { createRequire as __rspack_createRequire } from "node:module";
|
|
9143
9154
|
import * as __rspack_external_node_url_e96de089 from "node:url";
|
package/dist/index.cjs
CHANGED
|
@@ -2549,10 +2549,17 @@ ${section.body}` : section.body).join("\n\n"));
|
|
|
2549
2549
|
return message;
|
|
2550
2550
|
}
|
|
2551
2551
|
function formatStatsError(stats) {
|
|
2552
|
-
|
|
2553
|
-
|
|
2552
|
+
let fileName = resolveFileName(stats), message = `${((fileName, stats)=>{
|
|
2553
|
+
if (!fileName) return '';
|
|
2554
|
+
let DATA_URI_PREFIX = "data:text/javascript,";
|
|
2555
|
+
if (fileName.startsWith(DATA_URI_PREFIX)) {
|
|
2556
|
+
let snippet = fileName.replace(DATA_URI_PREFIX, '');
|
|
2557
|
+
return snippet.length > 30 && (snippet = `${snippet.slice(0, 30)}...`), `File: ${color.cyan('data-uri virtual module')} ${color.dim(`(${snippet})`)}\n`;
|
|
2558
|
+
}
|
|
2559
|
+
return /:\d+:\d+/.test(fileName) ? `File: ${color.cyan(fileName)}\n` : stats.loc ? `File: ${color.cyan(`${fileName}:${stats.loc}`)}\n` : `File: ${color.cyan(`${fileName}:1:1`)}\n`;
|
|
2560
|
+
})(fileName, stats)}${stats.message}`, verbose = 'verbose' === logger.level;
|
|
2554
2561
|
verbose && (stats.details && (message += `\nDetails: ${stats.details}\n`), stats.stack && (message += `\n${stats.stack}`));
|
|
2555
|
-
let moduleTrace = formatModuleTrace(stats,
|
|
2562
|
+
let moduleTrace = formatModuleTrace(stats, fileName);
|
|
2556
2563
|
moduleTrace && (message += moduleTrace);
|
|
2557
2564
|
let innerError = '-- inner error --';
|
|
2558
2565
|
!verbose && message.includes(innerError) && (message = message.split(innerError)[0]);
|
|
@@ -3541,7 +3548,7 @@ ${section.body}` : section.body).join("\n\n"));
|
|
|
3541
3548
|
async function createContext(options, userConfig) {
|
|
3542
3549
|
let { cwd } = options, rootPath = userConfig.root ? ensureAbsolutePath(cwd, userConfig.root) : cwd, rsbuildConfig = await withDefaultConfig(rootPath, userConfig), cachePath = (0, external_node_path_.join)(rootPath, 'node_modules', '.cache'), specifiedEnvironments = options.environment && options.environment.length > 0 ? options.environment : void 0, bundlerType = userConfig.provider ? 'webpack' : 'rspack';
|
|
3543
3550
|
return {
|
|
3544
|
-
version: "1.6.
|
|
3551
|
+
version: "1.6.12",
|
|
3545
3552
|
rootPath,
|
|
3546
3553
|
distPath: '',
|
|
3547
3554
|
cachePath,
|
|
@@ -5110,13 +5117,14 @@ ${section.body}` : section.body).join("\n\n"));
|
|
|
5110
5117
|
}
|
|
5111
5118
|
let isCSSPath = (filePath)=>filePath.endsWith('.css');
|
|
5112
5119
|
function normalizeManifestObjectConfig(manifest) {
|
|
5113
|
-
if ('string' == typeof manifest) return {
|
|
5114
|
-
filename: manifest
|
|
5115
|
-
};
|
|
5116
5120
|
let defaultOptions = {
|
|
5121
|
+
prefix: !0,
|
|
5117
5122
|
filename: 'manifest.json'
|
|
5118
5123
|
};
|
|
5119
|
-
return '
|
|
5124
|
+
return 'string' == typeof manifest ? {
|
|
5125
|
+
...defaultOptions,
|
|
5126
|
+
filename: manifest
|
|
5127
|
+
} : 'boolean' == typeof manifest ? defaultOptions : {
|
|
5120
5128
|
...defaultOptions,
|
|
5121
5129
|
...manifest
|
|
5122
5130
|
};
|
|
@@ -8720,67 +8728,69 @@ try {
|
|
|
8720
8728
|
let htmlPaths, manifestOptions, environment1, { output: { manifest }, dev: { writeToDisk } } = environment.config;
|
|
8721
8729
|
if (!1 === manifest) return;
|
|
8722
8730
|
let manifestOptions1 = normalizeManifestObjectConfig(manifest), { RspackManifestPlugin } = requireCompiledPackage('rspack-manifest-plugin'), { htmlPaths: htmlPaths1 } = environment, filter = manifestOptions1.filter ?? ((file)=>!file.name.endsWith('.LICENSE.txt'));
|
|
8723
|
-
manifestFilenames.set(environment.name, manifestOptions1.filename)
|
|
8724
|
-
|
|
8725
|
-
|
|
8726
|
-
|
|
8727
|
-
|
|
8728
|
-
|
|
8729
|
-
|
|
8730
|
-
|
|
8731
|
-
|
|
8732
|
-
|
|
8733
|
-
|
|
8734
|
-
|
|
8735
|
-
|
|
8736
|
-
|
|
8737
|
-
}
|
|
8738
|
-
return file.path;
|
|
8739
|
-
}), manifestEntries = {};
|
|
8740
|
-
for (let [entryName, chunkFiles] of chunkEntries){
|
|
8741
|
-
let assets = new Set(), initialJS = [], initialCSS = [], asyncJS = [], asyncCSS = [];
|
|
8742
|
-
if (entries[entryName]) for (let filePath of entries[entryName]){
|
|
8743
|
-
let fileURL = ensureAssetPrefix(filePath, publicPath);
|
|
8744
|
-
isCSSPath(filePath) ? initialCSS.push(fileURL) : initialJS.push(fileURL);
|
|
8745
|
-
}
|
|
8746
|
-
for (let file of chunkFiles){
|
|
8747
|
-
file.isInitial || (isCSSPath(file.path) ? asyncCSS.push(file.path) : asyncJS.push(file.path));
|
|
8748
|
-
let relatedLICENSE = licenseMap.get(file.path);
|
|
8749
|
-
if (relatedLICENSE && assets.add(relatedLICENSE), file.chunk) for (let auxiliaryFile of file.chunk.auxiliaryFiles)assets.add(auxiliaryFile);
|
|
8750
|
-
}
|
|
8751
|
-
let entryManifest = {};
|
|
8752
|
-
assets.size && (entryManifest.assets = Array.from(assets));
|
|
8753
|
-
let htmlPath = files.find((f)=>f.name === htmlPaths[entryName])?.path;
|
|
8754
|
-
htmlPath && (entryManifest.html = [
|
|
8755
|
-
htmlPath
|
|
8756
|
-
]), initialJS.length && (entryManifest.initial = {
|
|
8757
|
-
js: initialJS
|
|
8758
|
-
}), initialCSS.length && (entryManifest.initial = {
|
|
8759
|
-
...entryManifest.initial || {},
|
|
8760
|
-
css: initialCSS
|
|
8761
|
-
}), asyncJS.length && (entryManifest.async = {
|
|
8762
|
-
js: asyncJS
|
|
8763
|
-
}), asyncCSS.length && (entryManifest.async = {
|
|
8764
|
-
...entryManifest.async || {},
|
|
8765
|
-
css: asyncCSS
|
|
8766
|
-
}), manifestEntries[entryName] = entryManifest;
|
|
8731
|
+
manifestFilenames.set(environment.name, manifestOptions1.filename);
|
|
8732
|
+
let pluginOptions = {
|
|
8733
|
+
fileName: manifestOptions1.filename,
|
|
8734
|
+
filter,
|
|
8735
|
+
writeToFileEmit: isDev && !0 !== writeToDisk,
|
|
8736
|
+
generate: (htmlPaths = htmlPaths1, manifestOptions = manifestOptions1, environment1 = environment, (_seed, files, entries, { compilation })=>{
|
|
8737
|
+
let chunkEntries = new Map(), licenseMap = new Map(), publicPath = getPublicPathFromCompiler(compilation), integrity = {}, allFiles = files.map((file)=>{
|
|
8738
|
+
if (file.integrity && (integrity[file.path] = file.integrity), file.chunk) for (let entryName of recursiveChunkEntryNames(file.chunk))chunkEntries.set(entryName, [
|
|
8739
|
+
file,
|
|
8740
|
+
...chunkEntries.get(entryName) || []
|
|
8741
|
+
]);
|
|
8742
|
+
if (file.path.endsWith('.LICENSE.txt')) {
|
|
8743
|
+
let sourceFilePath = file.path.split('.LICENSE.txt')[0];
|
|
8744
|
+
licenseMap.set(sourceFilePath, file.path);
|
|
8767
8745
|
}
|
|
8768
|
-
|
|
8769
|
-
|
|
8770
|
-
|
|
8771
|
-
|
|
8772
|
-
|
|
8773
|
-
|
|
8774
|
-
|
|
8775
|
-
files,
|
|
8776
|
-
manifestData
|
|
8777
|
-
});
|
|
8778
|
-
if (isObject(generatedManifest)) return environment1.manifest = generatedManifest, generatedManifest;
|
|
8779
|
-
throw Error(`${color.dim('[rsbuild:manifest]')} \`manifest.generate\` function must return a valid manifest object.`);
|
|
8746
|
+
return file.path;
|
|
8747
|
+
}), manifestEntries = {};
|
|
8748
|
+
for (let [entryName, chunkFiles] of chunkEntries){
|
|
8749
|
+
let assets = new Set(), initialJS = [], initialCSS = [], asyncJS = [], asyncCSS = [];
|
|
8750
|
+
if (entries[entryName]) for (let filePath of entries[entryName]){
|
|
8751
|
+
let fileURL = manifestOptions.prefix ? ensureAssetPrefix(filePath, publicPath) : filePath;
|
|
8752
|
+
isCSSPath(filePath) ? initialCSS.push(fileURL) : initialJS.push(fileURL);
|
|
8780
8753
|
}
|
|
8781
|
-
|
|
8782
|
-
|
|
8783
|
-
|
|
8754
|
+
for (let file of chunkFiles){
|
|
8755
|
+
file.isInitial || (isCSSPath(file.path) ? asyncCSS.push(file.path) : asyncJS.push(file.path));
|
|
8756
|
+
let relatedLICENSE = licenseMap.get(file.path);
|
|
8757
|
+
if (relatedLICENSE && assets.add(relatedLICENSE), file.chunk) for (let auxiliaryFile of file.chunk.auxiliaryFiles)assets.add(auxiliaryFile);
|
|
8758
|
+
}
|
|
8759
|
+
let entryManifest = {};
|
|
8760
|
+
assets.size && (entryManifest.assets = Array.from(assets));
|
|
8761
|
+
let htmlPath = files.find((f)=>f.name === htmlPaths[entryName])?.path;
|
|
8762
|
+
htmlPath && (entryManifest.html = [
|
|
8763
|
+
htmlPath
|
|
8764
|
+
]), initialJS.length && (entryManifest.initial = {
|
|
8765
|
+
js: initialJS
|
|
8766
|
+
}), initialCSS.length && (entryManifest.initial = {
|
|
8767
|
+
...entryManifest.initial || {},
|
|
8768
|
+
css: initialCSS
|
|
8769
|
+
}), asyncJS.length && (entryManifest.async = {
|
|
8770
|
+
js: asyncJS
|
|
8771
|
+
}), asyncCSS.length && (entryManifest.async = {
|
|
8772
|
+
...entryManifest.async || {},
|
|
8773
|
+
css: asyncCSS
|
|
8774
|
+
}), manifestEntries[entryName] = entryManifest;
|
|
8775
|
+
}
|
|
8776
|
+
let manifestData = {
|
|
8777
|
+
allFiles,
|
|
8778
|
+
entries: manifestEntries,
|
|
8779
|
+
integrity
|
|
8780
|
+
};
|
|
8781
|
+
if (manifestOptions.generate) {
|
|
8782
|
+
let generatedManifest = manifestOptions.generate({
|
|
8783
|
+
files,
|
|
8784
|
+
manifestData
|
|
8785
|
+
});
|
|
8786
|
+
if (isObject(generatedManifest)) return environment1.manifest = generatedManifest, generatedManifest;
|
|
8787
|
+
throw Error(`${color.dim('[rsbuild:manifest]')} \`manifest.generate\` function must return a valid manifest object.`);
|
|
8788
|
+
}
|
|
8789
|
+
return environment1.manifest = manifestData, manifestData;
|
|
8790
|
+
})
|
|
8791
|
+
};
|
|
8792
|
+
manifestOptions1.prefix || (pluginOptions.publicPath = ''), chain.plugin(CHAIN_ID.PLUGIN.MANIFEST).use(RspackManifestPlugin, [
|
|
8793
|
+
pluginOptions
|
|
8784
8794
|
]);
|
|
8785
8795
|
}), api.onAfterCreateCompiler(()=>{
|
|
8786
8796
|
if (manifestFilenames.size <= 1) return void manifestFilenames.clear();
|
|
@@ -9182,7 +9192,7 @@ try {
|
|
|
9182
9192
|
};
|
|
9183
9193
|
function setupCommands() {
|
|
9184
9194
|
let cli = ((name = "")=>new CAC(name))('rsbuild');
|
|
9185
|
-
cli.version("1.6.
|
|
9195
|
+
cli.version("1.6.12"), cli.option('--base <base>', 'Set the base path of the server').option('-c, --config <config>', 'Set the configuration file (relative or absolute path)').option('--config-loader <loader>', 'Set the config file loader (auto | jiti | native)', {
|
|
9186
9196
|
default: 'auto'
|
|
9187
9197
|
}).option('--env-dir <dir>', 'Set the directory for loading `.env` files').option('--env-mode <mode>', 'Set the env mode to load the `.env.[mode]` file').option('--environment <name>', 'Set the environment name(s) to build', {
|
|
9188
9198
|
type: [
|
|
@@ -9251,7 +9261,7 @@ try {
|
|
|
9251
9261
|
}
|
|
9252
9262
|
function showGreeting() {
|
|
9253
9263
|
let { npm_execpath, npm_lifecycle_event, NODE_RUN_SCRIPT_NAME } = process.env, isBun = npm_execpath?.includes('.bun');
|
|
9254
|
-
logger.greet(`${'npx' === npm_lifecycle_event || isBun || NODE_RUN_SCRIPT_NAME ? '\n' : ''}Rsbuild v1.6.
|
|
9264
|
+
logger.greet(`${'npx' === npm_lifecycle_event || isBun || NODE_RUN_SCRIPT_NAME ? '\n' : ''}Rsbuild v1.6.12\n`);
|
|
9255
9265
|
}
|
|
9256
9266
|
function setupLogLevel() {
|
|
9257
9267
|
let logLevelIndex = process.argv.findIndex((item)=>'--log-level' === item || '--logLevel' === item);
|
|
@@ -9272,7 +9282,7 @@ try {
|
|
|
9272
9282
|
logger.error('Failed to start Rsbuild CLI.'), logger.error(err);
|
|
9273
9283
|
}
|
|
9274
9284
|
}
|
|
9275
|
-
let src_version = "1.6.
|
|
9285
|
+
let src_version = "1.6.12";
|
|
9276
9286
|
})(), exports.PLUGIN_CSS_NAME = __webpack_exports__.PLUGIN_CSS_NAME, exports.PLUGIN_SWC_NAME = __webpack_exports__.PLUGIN_SWC_NAME, exports.createRsbuild = __webpack_exports__.createRsbuild, exports.defaultAllowedOrigins = __webpack_exports__.defaultAllowedOrigins, 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 === [
|
|
9277
9287
|
"PLUGIN_CSS_NAME",
|
|
9278
9288
|
"PLUGIN_SWC_NAME",
|
|
@@ -999,6 +999,12 @@ export type ManifestObjectConfig = {
|
|
|
999
999
|
* @default (file: FileDescriptor) => !file.name.endsWith('.LICENSE.txt')
|
|
1000
1000
|
*/
|
|
1001
1001
|
filter?: (file: FileDescriptor) => boolean;
|
|
1002
|
+
/**
|
|
1003
|
+
* Controls whether the generated manifest includes the static asset prefix in file paths.
|
|
1004
|
+
* The prefix is taken from `dev.assetPrefix` and `output.assetPrefix`.
|
|
1005
|
+
* @default true
|
|
1006
|
+
*/
|
|
1007
|
+
prefix?: boolean;
|
|
1002
1008
|
};
|
|
1003
1009
|
export type ManifestConfig = string | boolean | ManifestObjectConfig;
|
|
1004
1010
|
export type CleanDistPathObject = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsbuild/core",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.12",
|
|
4
4
|
"description": "The Rspack-based build tool.",
|
|
5
5
|
"homepage": "https://rsbuild.rs",
|
|
6
6
|
"bugs": {
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"types.d.ts"
|
|
47
47
|
],
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@rspack/core": "1.6.
|
|
49
|
+
"@rspack/core": "1.6.6",
|
|
50
50
|
"@rspack/lite-tapable": "~1.1.0",
|
|
51
51
|
"@swc/helpers": "^0.5.17",
|
|
52
52
|
"core-js": "~3.47.0",
|