@rsbuild/core 1.3.4 → 1.3.6
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/chokidar/index.d.ts +2 -1
- package/compiled/css-loader/index.js +18 -18
- package/compiled/html-rspack-plugin/index.js +14 -14
- package/compiled/http-proxy-middleware/index.d.ts +3 -2
- package/compiled/postcss/lib/at-rule.d.ts +140 -0
- package/compiled/postcss/lib/comment.d.ts +68 -0
- package/compiled/postcss/lib/container.d.ts +480 -0
- package/compiled/postcss/lib/css-syntax-error.d.ts +248 -0
- package/compiled/postcss/lib/declaration.d.ts +151 -0
- package/compiled/postcss/lib/document.d.ts +69 -0
- package/compiled/postcss/lib/fromJSON.d.ts +9 -0
- package/compiled/postcss/lib/input.d.ts +206 -0
- package/compiled/postcss/lib/lazy-result.d.ts +190 -0
- package/compiled/postcss/lib/list.d.ts +60 -0
- package/compiled/postcss/lib/no-work-result.d.ts +46 -0
- package/compiled/postcss/lib/node.d.ts +541 -0
- package/compiled/postcss/lib/parse.d.ts +9 -0
- package/compiled/postcss/lib/postcss.d.ts +458 -0
- package/compiled/postcss/lib/previous-map.d.ts +81 -0
- package/compiled/postcss/lib/processor.d.ts +115 -0
- package/compiled/postcss/lib/result.d.ts +205 -0
- package/compiled/postcss/lib/root.d.ts +87 -0
- package/compiled/postcss/lib/rule.d.ts +126 -0
- package/compiled/postcss/lib/stringifier.d.ts +46 -0
- package/compiled/postcss/lib/stringify.d.ts +9 -0
- package/compiled/postcss/lib/warning.d.ts +147 -0
- package/compiled/postcss/package.json +1 -1
- package/compiled/postcss-loader/index.js +6 -6
- package/compiled/rslog/index.d.ts +2 -1
- package/compiled/rspack-chain/index.js +66 -66
- package/compiled/rspack-chain/package.json +1 -1
- package/compiled/rspack-chain/{index.d.ts → types/index.d.ts} +18 -2
- package/compiled/rspack-manifest-plugin/index.d.ts +2 -1
- package/compiled/rspack-manifest-plugin/index.js +4 -4
- package/compiled/tinyglobby/index.d.ts +2 -1
- package/dist/index.cjs +92 -51
- package/dist/index.js +90 -50
- package/dist-types/configChain.d.ts +1 -1
- package/dist-types/helpers/exitHook.d.ts +3 -0
- package/dist-types/helpers/index.d.ts +1 -1
- package/dist-types/types/config.d.ts +2 -3
- package/dist-types/types/hooks.d.ts +6 -2
- package/dist-types/types/plugin.d.ts +1 -1
- package/dist-types/types/rspack.d.ts +1 -1
- package/dist-types/types/thirdParty.d.ts +2 -2
- package/package.json +6 -6
- package/types.d.ts +8 -8
- package/compiled/postcss/index.d.ts +0 -1
package/dist/index.cjs
CHANGED
|
@@ -102,8 +102,8 @@ var __webpack_modules__ = {
|
|
|
102
102
|
return options;
|
|
103
103
|
};
|
|
104
104
|
},
|
|
105
|
-
"../../node_modules/.pnpm/dotenv@16.
|
|
106
|
-
let fs = __webpack_require__("fs"), path = __webpack_require__("path"), os = __webpack_require__("os"), crypto = __webpack_require__("crypto"), version = __webpack_require__("../../node_modules/.pnpm/dotenv@16.
|
|
105
|
+
"../../node_modules/.pnpm/dotenv@16.5.0/node_modules/dotenv/lib/main.js": function(module, __unused_webpack_exports, __webpack_require__) {
|
|
106
|
+
let fs = __webpack_require__("fs"), path = __webpack_require__("path"), os = __webpack_require__("os"), crypto = __webpack_require__("crypto"), version = __webpack_require__("../../node_modules/.pnpm/dotenv@16.5.0/node_modules/dotenv/package.json").version, LINE = /(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;
|
|
107
107
|
function _debug(message) {
|
|
108
108
|
console.log(`[dotenv@${version}][DEBUG] ${message}`);
|
|
109
109
|
}
|
|
@@ -149,7 +149,7 @@ var __webpack_modules__ = {
|
|
|
149
149
|
};
|
|
150
150
|
},
|
|
151
151
|
_configVault: function(options) {
|
|
152
|
-
|
|
152
|
+
options && options.debug && _debug('Loading env from encrypted .env.vault');
|
|
153
153
|
let parsed = DotenvModule._parseVault(options), processEnv = process.env;
|
|
154
154
|
return options && null != options.processEnv && (processEnv = options.processEnv), DotenvModule.populate(processEnv, parsed, options), {
|
|
155
155
|
parsed
|
|
@@ -959,9 +959,9 @@ var __webpack_modules__ = {
|
|
|
959
959
|
"use strict";
|
|
960
960
|
module.exports = import("node:https");
|
|
961
961
|
},
|
|
962
|
-
"../../node_modules/.pnpm/dotenv@16.
|
|
962
|
+
"../../node_modules/.pnpm/dotenv@16.5.0/node_modules/dotenv/package.json": function(module) {
|
|
963
963
|
"use strict";
|
|
964
|
-
module.exports = JSON.parse('{"name":"dotenv","version":"16.
|
|
964
|
+
module.exports = JSON.parse('{"name":"dotenv","version":"16.5.0","description":"Loads environment variables from .env file","main":"lib/main.js","types":"lib/main.d.ts","exports":{".":{"types":"./lib/main.d.ts","require":"./lib/main.js","default":"./lib/main.js"},"./config":"./config.js","./config.js":"./config.js","./lib/env-options":"./lib/env-options.js","./lib/env-options.js":"./lib/env-options.js","./lib/cli-options":"./lib/cli-options.js","./lib/cli-options.js":"./lib/cli-options.js","./package.json":"./package.json"},"scripts":{"dts-check":"tsc --project tests/types/tsconfig.json","lint":"standard","pretest":"npm run lint && npm run dts-check","test":"tap run --allow-empty-coverage --disable-coverage --timeout=60000","test:coverage":"tap run --show-full-coverage --timeout=60000 --coverage-report=lcov","prerelease":"npm test","release":"standard-version"},"repository":{"type":"git","url":"git://github.com/motdotla/dotenv.git"},"homepage":"https://github.com/motdotla/dotenv#readme","funding":"https://dotenvx.com","keywords":["dotenv","env",".env","environment","variables","config","settings"],"readmeFilename":"README.md","license":"BSD-2-Clause","devDependencies":{"@types/node":"^18.11.3","decache":"^4.6.2","sinon":"^14.0.1","standard":"^17.0.0","standard-version":"^9.5.0","tap":"^19.2.0","typescript":"^4.8.4"},"engines":{"node":">=12"},"browser":{"fs":false}}');
|
|
965
965
|
}
|
|
966
966
|
}, __webpack_module_cache__ = {};
|
|
967
967
|
function __webpack_require__(moduleId) {
|
|
@@ -1031,7 +1031,7 @@ for(var __webpack_i__ in (()=>{
|
|
|
1031
1031
|
let external_node_fs_namespaceObject = require("node:fs");
|
|
1032
1032
|
var external_node_fs_default = __webpack_require__.n(external_node_fs_namespaceObject);
|
|
1033
1033
|
let external_node_path_namespaceObject = require("node:path");
|
|
1034
|
-
var external_node_path_default = __webpack_require__.n(external_node_path_namespaceObject), main = __webpack_require__("../../node_modules/.pnpm/dotenv@16.
|
|
1034
|
+
var external_node_path_default = __webpack_require__.n(external_node_path_namespaceObject), main = __webpack_require__("../../node_modules/.pnpm/dotenv@16.5.0/node_modules/dotenv/lib/main.js"), lib_main = __webpack_require__("../../node_modules/.pnpm/dotenv-expand@12.0.1/node_modules/dotenv-expand/lib/main.js");
|
|
1035
1035
|
let external_node_url_namespaceObject = require("node:url");
|
|
1036
1036
|
var cjs = __webpack_require__("../../node_modules/.pnpm/deepmerge@4.3.1/node_modules/deepmerge/dist/cjs.js"), cjs_default = __webpack_require__.n(cjs);
|
|
1037
1037
|
let index_js_namespaceObject = require("../compiled/picocolors/index.js");
|
|
@@ -1231,7 +1231,7 @@ for(var __webpack_i__ in (()=>{
|
|
|
1231
1231
|
return !verbose && message.includes(innerError) && (message = message.split(innerError)[0]), (message = (message = hintNodePolyfill(message = function(message) {
|
|
1232
1232
|
let hint = 'You may need an appropriate loader to handle this file type.';
|
|
1233
1233
|
if (-1 === message.indexOf(hint)) return message;
|
|
1234
|
-
let createPluginHint = (packageName, keyword)=>`To enable support for ${keyword}, use "${index_js_default().yellow(`@rsbuild/plugin-${packageName}`)}" ${index_js_default().dim(`(https://
|
|
1234
|
+
let createPluginHint = (packageName, keyword)=>`To enable support for ${keyword}, use "${index_js_default().yellow(`@rsbuild/plugin-${packageName}`)}" ${index_js_default().dim(`(https://npmjs.com/package/@rsbuild/plugin-${packageName})`)}.`;
|
|
1235
1235
|
for (let plugin of [
|
|
1236
1236
|
{
|
|
1237
1237
|
test: /File: .+\.s(c|a)ss/,
|
|
@@ -1514,7 +1514,7 @@ for(var __webpack_i__ in (()=>{
|
|
|
1514
1514
|
let realKey = key.split('.').slice(2).join('.');
|
|
1515
1515
|
return OVERRIDE_PATHS.includes(realKey);
|
|
1516
1516
|
}
|
|
1517
|
-
return OVERRIDE_PATHS.includes(key);
|
|
1517
|
+
return OVERRIDE_PATHS.includes(key) || key.startsWith('output.filename.');
|
|
1518
1518
|
}, merge = (x, y, path = '')=>{
|
|
1519
1519
|
if (isOverridePath(path)) return y ?? x;
|
|
1520
1520
|
if (void 0 === x) return isPlainObject(y) ? cloneDeep(y) : y;
|
|
@@ -2089,7 +2089,21 @@ for(var __webpack_i__ in (()=>{
|
|
|
2089
2089
|
onEnvironmentDone,
|
|
2090
2090
|
MultiStatsCtor
|
|
2091
2091
|
});
|
|
2092
|
-
},
|
|
2092
|
+
}, external_node_os_namespaceObject = require("node:os");
|
|
2093
|
+
var external_node_os_default = __webpack_require__.n(external_node_os_namespaceObject);
|
|
2094
|
+
let external_node_process_namespaceObject = require("node:process");
|
|
2095
|
+
var external_node_process_default = __webpack_require__.n(external_node_process_namespaceObject);
|
|
2096
|
+
let exitHook_callbacks = new Set(), isCalled = !1, isRegistered = !1;
|
|
2097
|
+
function exit(exitCode, type) {
|
|
2098
|
+
if (!isCalled) {
|
|
2099
|
+
for (let callback of (isCalled = !0, exitHook_callbacks))callback(exitCode);
|
|
2100
|
+
if ('SIGINT' === type) {
|
|
2101
|
+
let listeners = external_node_process_default().listeners('SIGINT');
|
|
2102
|
+
Array.isArray(listeners) && listeners.length <= 1 && external_node_process_default().exit(exitCode);
|
|
2103
|
+
}
|
|
2104
|
+
}
|
|
2105
|
+
}
|
|
2106
|
+
let mapProcessAssetsStage = (compiler, stage)=>{
|
|
2093
2107
|
let { Compilation } = compiler.webpack;
|
|
2094
2108
|
switch(stage){
|
|
2095
2109
|
case 'additional':
|
|
@@ -2207,7 +2221,7 @@ for(var __webpack_i__ in (()=>{
|
|
|
2207
2221
|
async function createContext(options, userConfig) {
|
|
2208
2222
|
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;
|
|
2209
2223
|
return {
|
|
2210
|
-
version: "1.3.
|
|
2224
|
+
version: "1.3.6",
|
|
2211
2225
|
rootPath,
|
|
2212
2226
|
distPath: '',
|
|
2213
2227
|
cachePath,
|
|
@@ -3046,32 +3060,32 @@ for(var __webpack_i__ in (()=>{
|
|
|
3046
3060
|
}, assets = await getAssets();
|
|
3047
3061
|
if (0 === assets.length) return logs;
|
|
3048
3062
|
logs.push(''), assets.sort((a, b)=>a.size - b.size);
|
|
3049
|
-
let
|
|
3063
|
+
let fileHeader = `File (${environmentName})`, maxFileLength = Math.max(...assets.map((a)=>(a.folder + external_node_path_default().sep + a.name).length), fileHeader.length), maxSizeLength = Math.max(...assets.map((a)=>a.sizeLabel.length));
|
|
3050
3064
|
if (!1 !== options.detail) {
|
|
3051
3065
|
let showGzipHeader = !!(options.compressed && assets.some((item)=>null !== item.gzippedSize));
|
|
3052
|
-
logs.push(function(
|
|
3053
|
-
let
|
|
3054
|
-
|
|
3055
|
-
|
|
3066
|
+
logs.push(function(maxFileLength, maxSizeLength, fileHeader, showGzipHeader) {
|
|
3067
|
+
let lengths = [
|
|
3068
|
+
maxFileLength,
|
|
3069
|
+
maxSizeLength
|
|
3056
3070
|
], rowTypes = [
|
|
3057
|
-
|
|
3071
|
+
fileHeader,
|
|
3058
3072
|
'Size'
|
|
3059
3073
|
];
|
|
3060
3074
|
showGzipHeader && rowTypes.push('Gzip');
|
|
3061
3075
|
let headerRow = rowTypes.reduce((prev, cur, index)=>{
|
|
3062
|
-
let length =
|
|
3076
|
+
let length = lengths[index], curLabel = cur;
|
|
3063
3077
|
return length && (curLabel = cur.length < length ? cur + ' '.repeat(length - cur.length) : cur), `${prev + curLabel} `;
|
|
3064
3078
|
}, ' ');
|
|
3065
3079
|
return index_js_default().blue(headerRow);
|
|
3066
|
-
}(
|
|
3080
|
+
}(maxFileLength, maxSizeLength, fileHeader, showGzipHeader));
|
|
3067
3081
|
}
|
|
3068
3082
|
let totalSize = 0, totalGzipSize = 0;
|
|
3069
3083
|
for (let asset of assets){
|
|
3070
3084
|
let { sizeLabel } = asset, { name, folder, gzipSizeLabel } = asset, fileNameLength = (folder + external_node_path_default().sep + name).length, sizeLength = sizeLabel.length;
|
|
3071
3085
|
if (totalSize += asset.size, options.compressed && (totalGzipSize += asset.gzippedSize ?? asset.size), !1 !== options.detail) {
|
|
3072
|
-
sizeLength <
|
|
3086
|
+
sizeLength < maxSizeLength && (sizeLabel += ' '.repeat(maxSizeLength - sizeLength));
|
|
3073
3087
|
let fileNameLabel = index_js_default().dim(asset.folder + external_node_path_default().sep) + coloringAssetName(asset.name);
|
|
3074
|
-
fileNameLength <
|
|
3088
|
+
fileNameLength < maxFileLength && (fileNameLabel += ' '.repeat(maxFileLength - fileNameLength));
|
|
3075
3089
|
let log = ` ${fileNameLabel} ${sizeLabel}`;
|
|
3076
3090
|
gzipSizeLabel && (log += ` ${gzipSizeLabel}`), logs.push(log);
|
|
3077
3091
|
}
|
|
@@ -3725,8 +3739,6 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
3725
3739
|
}
|
|
3726
3740
|
}), external_node_child_process_namespaceObject = require("node:child_process"), external_node_net_namespaceObject = require("node:net");
|
|
3727
3741
|
var external_node_net_default = __webpack_require__.n(external_node_net_namespaceObject);
|
|
3728
|
-
let external_node_os_namespaceObject = require("node:os");
|
|
3729
|
-
var external_node_os_default = __webpack_require__.n(external_node_os_namespaceObject);
|
|
3730
3742
|
let normalizeUrl = (url)=>url.replace(/([^:]\/)\/+/g, '$1'), formatPrefix = (input)=>{
|
|
3731
3743
|
let prefix = input;
|
|
3732
3744
|
if ((null == prefix ? void 0 : prefix.startsWith('./')) && (prefix = prefix.replace('./', '')), !prefix) return '/';
|
|
@@ -4285,7 +4297,7 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
4285
4297
|
let stopProfiler = (output, profileSession)=>{
|
|
4286
4298
|
profileSession && profileSession.post('Profiler.stop', (error, param)=>{
|
|
4287
4299
|
if (error) {
|
|
4288
|
-
rslog_index_js_namespaceObject.logger.error('Failed to generate
|
|
4300
|
+
rslog_index_js_namespaceObject.logger.error('Failed to generate JavaScript CPU profile:', error);
|
|
4289
4301
|
return;
|
|
4290
4302
|
}
|
|
4291
4303
|
external_node_fs_default().writeFileSync(output, JSON.stringify(param.profile));
|
|
@@ -4298,9 +4310,9 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
4298
4310
|
if ('webpack' === api.context.bundlerType) return;
|
|
4299
4311
|
let RSPACK_PROFILE = null === (_process_env_RSPACK_PROFILE = process.env.RSPACK_PROFILE) || void 0 === _process_env_RSPACK_PROFILE ? void 0 : _process_env_RSPACK_PROFILE.toUpperCase();
|
|
4300
4312
|
if (!RSPACK_PROFILE) return;
|
|
4301
|
-
let timestamp = Date.now(), profileDirName = `rspack-profile-${timestamp}`, enableProfileTrace = 'ALL' === RSPACK_PROFILE || RSPACK_PROFILE.includes('TRACE'), enableCPUProfile = 'ALL' === RSPACK_PROFILE || RSPACK_PROFILE.includes('CPU'), enableLogging = 'ALL' === RSPACK_PROFILE || RSPACK_PROFILE.includes('LOGGING'), onStart = ()=>{
|
|
4313
|
+
let timestamp = Date.now(), profileDirName = `rspack-profile-${timestamp}`, enableProfileTrace = 'ALL' === RSPACK_PROFILE || RSPACK_PROFILE.includes('TRACE'), enableCPUProfile = 'ALL' === RSPACK_PROFILE || RSPACK_PROFILE.includes('CPU'), enableLogging = 'ALL' === RSPACK_PROFILE || RSPACK_PROFILE.includes('LOGGING'), onStart = async ()=>{
|
|
4302
4314
|
let profileDir = external_node_path_default().join(api.context.distPath, profileDirName), traceFilePath = external_node_path_default().join(profileDir, 'trace.json');
|
|
4303
|
-
|
|
4315
|
+
await isFileExists(profileDir) || await external_node_fs_default().promises.mkdir(profileDir, {
|
|
4304
4316
|
recursive: !0
|
|
4305
4317
|
}), enableProfileTrace && core_default().experiments.globalTrace.register('trace', 'chrome', traceFilePath), enableCPUProfile && ((profileSession = new (external_node_inspector_default()).Session()).connect(), profileSession.post('Profiler.enable'), profileSession.post('Profiler.start'));
|
|
4306
4318
|
};
|
|
@@ -4314,12 +4326,12 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
4314
4326
|
logging: 'verbose',
|
|
4315
4327
|
loggingTrace: !0
|
|
4316
4328
|
});
|
|
4317
|
-
external_node_fs_default().
|
|
4329
|
+
await external_node_fs_default().promises.writeFile(loggingFilePath, JSON.stringify(logging));
|
|
4318
4330
|
}
|
|
4319
4331
|
}), api.onExit(()=>{
|
|
4320
4332
|
enableProfileTrace && core_default().experiments.globalTrace.cleanup();
|
|
4321
4333
|
let profileDir = external_node_path_default().join(api.context.distPath, profileDirName);
|
|
4322
|
-
stopProfiler(external_node_path_default().join(profileDir, 'jscpuprofile.json'), profileSession), rslog_index_js_namespaceObject.logger.info(`
|
|
4334
|
+
stopProfiler(external_node_path_default().join(profileDir, 'jscpuprofile.json'), profileSession), rslog_index_js_namespaceObject.logger.info(`profile files saved to ${index_js_default().cyan(profileDir)}`);
|
|
4323
4335
|
});
|
|
4324
4336
|
}
|
|
4325
4337
|
}), pluginServer = ()=>({
|
|
@@ -4730,7 +4742,6 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
4730
4742
|
async function getConfigUtils(config, chainUtils) {
|
|
4731
4743
|
return {
|
|
4732
4744
|
...chainUtils,
|
|
4733
|
-
rspack: core_namespaceObject.rspack,
|
|
4734
4745
|
mergeConfig: dist.merge,
|
|
4735
4746
|
addRules (rules) {
|
|
4736
4747
|
let ruleArr = castArray(rules);
|
|
@@ -4754,9 +4765,11 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
4754
4765
|
};
|
|
4755
4766
|
}
|
|
4756
4767
|
function getChainUtils(target, environment) {
|
|
4768
|
+
let nodeEnv = getNodeEnv();
|
|
4757
4769
|
return {
|
|
4770
|
+
rspack: core_namespaceObject.rspack,
|
|
4758
4771
|
environment,
|
|
4759
|
-
env:
|
|
4772
|
+
env: nodeEnv,
|
|
4760
4773
|
target,
|
|
4761
4774
|
isDev: 'development' === environment.config.mode,
|
|
4762
4775
|
isProd: 'production' === environment.config.mode,
|
|
@@ -5381,14 +5394,18 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
5381
5394
|
text: formattedErrors,
|
|
5382
5395
|
html: function(errors, root) {
|
|
5383
5396
|
let htmlItems = errors.map((item)=>{
|
|
5384
|
-
var text, text1, root1;
|
|
5385
|
-
|
|
5386
|
-
|
|
5387
|
-
|
|
5388
|
-
|
|
5389
|
-
|
|
5390
|
-
|
|
5391
|
-
|
|
5397
|
+
var text, text1 = server_ansiHTML((text = item) ? text.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"').replace(/'/g, ''') : ''), root1 = root;
|
|
5398
|
+
let pathRegex = /(?:\.\.?[\/\\]|[a-zA-Z]:\\|\/)[^:]*:\d+:\d+/g, urlRegex = /(https?:\/\/(?:[\w-]+\.)+[a-z0-9](?:[\w-.~:/?#[\]@!$&'*+,;=])*)/gi;
|
|
5399
|
+
return text1.split('\n').map((line)=>{
|
|
5400
|
+
let replacedLine = line.replace(pathRegex, (file)=>{
|
|
5401
|
+
let hasClosingSpan = file.includes('</span>') && !file.includes('<span'), filePath = hasClosingSpan ? file.replace('</span>', '') : file, isAbsolute = external_node_path_default().isAbsolute(filePath), absolutePath = root1 && !isAbsolute ? external_node_path_default().join(root1, filePath) : filePath, relativePath = root1 && isAbsolute ? function(base, filepath) {
|
|
5402
|
+
let relativePath = (0, external_node_path_namespaceObject.relative)(base, filepath);
|
|
5403
|
+
return '' === relativePath ? `.${external_node_path_namespaceObject.sep}` : relativePath.startsWith('.') ? relativePath : `.${external_node_path_namespaceObject.sep}${relativePath}`;
|
|
5404
|
+
}(root1, filePath) : filePath;
|
|
5405
|
+
return `<a class="file-link" data-file="${absolutePath}">${relativePath}</a>${hasClosingSpan ? '</span>' : ''}`;
|
|
5406
|
+
});
|
|
5407
|
+
return replacedLine = replacedLine.replace(urlRegex, (url)=>`<a class="url-link" href="${url}" target="_blank" rel="noopener noreferrer">${url}</a>`);
|
|
5408
|
+
}).join('\n');
|
|
5392
5409
|
});
|
|
5393
5410
|
return `
|
|
5394
5411
|
<style>
|
|
@@ -5440,9 +5457,9 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
5440
5457
|
.content::-webkit-scrollbar {
|
|
5441
5458
|
display: none;
|
|
5442
5459
|
}
|
|
5443
|
-
.file-link
|
|
5460
|
+
.file-link,
|
|
5461
|
+
.url-link {
|
|
5444
5462
|
cursor: pointer;
|
|
5445
|
-
color: #6eecf7;
|
|
5446
5463
|
text-decoration: underline;
|
|
5447
5464
|
text-underline-offset: 3px;
|
|
5448
5465
|
&:hover {
|
|
@@ -5452,6 +5469,12 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
5452
5469
|
opacity: 0.6;
|
|
5453
5470
|
}
|
|
5454
5471
|
}
|
|
5472
|
+
.file-link {
|
|
5473
|
+
color: #6eecf7;
|
|
5474
|
+
}
|
|
5475
|
+
.url-link {
|
|
5476
|
+
color: #eff986;
|
|
5477
|
+
}
|
|
5455
5478
|
.close {
|
|
5456
5479
|
position: absolute;
|
|
5457
5480
|
top: 27px;
|
|
@@ -6151,23 +6174,29 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
6151
6174
|
[entryName]: res
|
|
6152
6175
|
}), res;
|
|
6153
6176
|
};
|
|
6154
|
-
}, cleanupCallbacks = new Set(), handleTermination = async (
|
|
6177
|
+
}, cleanupCallbacks = new Set(), handleTermination = async (exitCode)=>{
|
|
6155
6178
|
try {
|
|
6156
6179
|
await Promise.all([
|
|
6157
6180
|
...cleanupCallbacks
|
|
6158
6181
|
].map((cb)=>cb()));
|
|
6159
6182
|
} finally{
|
|
6160
|
-
process.exitCode ??= exitCode
|
|
6183
|
+
process.exitCode ??= exitCode, process.exit();
|
|
6161
6184
|
}
|
|
6162
6185
|
}, registerCleanup = (callback)=>{
|
|
6163
6186
|
cleanupCallbacks.add(callback);
|
|
6164
6187
|
}, removeCleanup = (callback)=>{
|
|
6165
6188
|
cleanupCallbacks.delete(callback);
|
|
6166
6189
|
}, shutdownRefCount = 0, setupGracefulShutdown = ()=>{
|
|
6167
|
-
shutdownRefCount
|
|
6168
|
-
let
|
|
6169
|
-
|
|
6170
|
-
|
|
6190
|
+
shutdownRefCount++;
|
|
6191
|
+
let onSigterm = ()=>{
|
|
6192
|
+
handleTermination(external_node_os_namespaceObject.constants.signals.SIGTERM + 128);
|
|
6193
|
+
};
|
|
6194
|
+
process.once('SIGTERM', onSigterm);
|
|
6195
|
+
let isCI = 'true' === process.env.CI, onStdinEnd = ()=>{
|
|
6196
|
+
handleTermination(0);
|
|
6197
|
+
};
|
|
6198
|
+
return isCI || process.stdin.on('end', onStdinEnd), ()=>{
|
|
6199
|
+
!(--shutdownRefCount > 0) && (process.removeListener('SIGTERM', onSigterm), isCI || process.stdin.removeListener('end', onStdinEnd));
|
|
6171
6200
|
};
|
|
6172
6201
|
}, createHttpServer = async ({ serverConfig, middlewares })=>{
|
|
6173
6202
|
if (serverConfig.https) {
|
|
@@ -6929,9 +6958,21 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
6929
6958
|
handler
|
|
6930
6959
|
});
|
|
6931
6960
|
}, onExitListened = !1, onExit = (cb)=>{
|
|
6932
|
-
|
|
6933
|
-
|
|
6934
|
-
|
|
6961
|
+
if (!onExitListened) {
|
|
6962
|
+
var onExit;
|
|
6963
|
+
onExit = (exitCode)=>{
|
|
6964
|
+
hooks.onExit.callBatch({
|
|
6965
|
+
exitCode
|
|
6966
|
+
});
|
|
6967
|
+
}, exitHook_callbacks.add(onExit), isRegistered || (isRegistered = !0, external_node_process_default().on('SIGINT', ()=>{
|
|
6968
|
+
exit(external_node_os_namespaceObject.constants.signals.SIGINT + 128, 'SIGINT');
|
|
6969
|
+
}), external_node_process_default().once('SIGTERM', ()=>{
|
|
6970
|
+
exit(external_node_os_namespaceObject.constants.signals.SIGTERM + 128, 'SIGTERM');
|
|
6971
|
+
}), external_node_process_default().once('exit', (exitCode)=>{
|
|
6972
|
+
exit(exitCode, 'exit');
|
|
6973
|
+
})), onExitListened = !0;
|
|
6974
|
+
}
|
|
6975
|
+
hooks.onExit.tap(cb);
|
|
6935
6976
|
};
|
|
6936
6977
|
return (environment)=>({
|
|
6937
6978
|
context: publicContext,
|
|
@@ -7402,11 +7443,11 @@ ${section.body}` : section.body).join("\n\n"));
|
|
|
7402
7443
|
}
|
|
7403
7444
|
process.title = 'rsbuild-node';
|
|
7404
7445
|
let { npm_execpath } = process.env;
|
|
7405
|
-
(!npm_execpath || npm_execpath.includes('npx-cli.js') || npm_execpath.includes('.bun')) && console.log(), rslog_index_js_namespaceObject.logger.greet(` Rsbuild v1.3.
|
|
7446
|
+
(!npm_execpath || npm_execpath.includes('npx-cli.js') || npm_execpath.includes('.bun')) && console.log(), rslog_index_js_namespaceObject.logger.greet(` Rsbuild v1.3.6\n`);
|
|
7406
7447
|
try {
|
|
7407
7448
|
!function() {
|
|
7408
7449
|
let cli = cac_dist('rsbuild');
|
|
7409
|
-
cli.help(), cli.version("1.3.
|
|
7450
|
+
cli.help(), cli.version("1.3.6"), applyCommonOptions(cli);
|
|
7410
7451
|
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');
|
|
7411
7452
|
applyServerOptions(devCommand), applyServerOptions(previewCommand), devCommand.action(async (options)=>{
|
|
7412
7453
|
try {
|
|
@@ -7457,7 +7498,7 @@ ${section.body}` : section.body).join("\n\n"));
|
|
|
7457
7498
|
rslog_index_js_namespaceObject.logger.error('Failed to start Rsbuild CLI.'), rslog_index_js_namespaceObject.logger.error(err);
|
|
7458
7499
|
}
|
|
7459
7500
|
}
|
|
7460
|
-
let src_rslib_entry_version = "1.3.
|
|
7501
|
+
let src_rslib_entry_version = "1.3.6";
|
|
7461
7502
|
})(), 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 === [
|
|
7462
7503
|
"PLUGIN_CSS_NAME",
|
|
7463
7504
|
"PLUGIN_SWC_NAME",
|