@rsdoctor/core 2.0.3 → 2.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/e.js +8 -4
- package/dist/e.js.LICENSE.txt +1 -1
- package/dist/index.js +10 -5
- package/dist/r.js +44 -30
- package/package.json +8 -14
package/dist/e.js
CHANGED
|
@@ -1965,7 +1965,7 @@ function applyNumberFormatting(value, locale, localeOptions, separator, pad, rou
|
|
|
1965
1965
|
function filesize(arg, { bits = !1, pad = !1, base = -1, round = 2, locale = "", localeOptions = {}, separator = "", spacer = " ", symbols = {}, standard = "", output = STRING, fullform = !1, fullforms = [], exponent = -1, roundingMethod = ROUND, precision = 0 } = {}) {
|
|
1966
1966
|
let p, r, symbolTable, numericValue, valueResult, e = exponent, num, result = [], val = 0, u = "", isBigInt = "bigint" == typeof arg;
|
|
1967
1967
|
if (isNaN(num = Number(arg)) || !isFinite(num)) throw TypeError("Invalid number");
|
|
1968
|
-
let { isDecimal, ceil, actualStandard } = STANDARD_CONFIGS[standard] ? STANDARD_CONFIGS[
|
|
1968
|
+
let { isDecimal, ceil, actualStandard } = STANDARD_CONFIGS[standard1 = (standard1 = standard).toLowerCase()] ? STANDARD_CONFIGS[standard1] : 2 === base ? {
|
|
1969
1969
|
isDecimal: !1,
|
|
1970
1970
|
ceil: 1024,
|
|
1971
1971
|
actualStandard: "iec"
|
|
@@ -2020,7 +2020,10 @@ function filesize(arg, { bits = !1, pad = !1, base = -1, round = 2, locale = "",
|
|
|
2020
2020
|
e
|
|
2021
2021
|
};
|
|
2022
2022
|
}(bigNum, e, isDecimal, bits, ceil, autoExponent) : calculateOptimizedValue(num, e, isDecimal, bits, ceil, autoExponent)).result, e = valueResult.e;
|
|
2023
|
-
let rounded =
|
|
2023
|
+
let rounded = precisionAdjusted > 0 && e > 0 ? {
|
|
2024
|
+
value: val,
|
|
2025
|
+
e
|
|
2026
|
+
} : (val1 = val, (r = 1 === (p = (e2 = e) > 0 && round > 0 ? Math.pow(10, round) : 1) ? roundingFunc(val1) : roundingFunc(val1 * p) / p) === ceil && e2 < 8 && autoExponent && (r = 1, e2++), {
|
|
2024
2027
|
value: r,
|
|
2025
2028
|
e: e2
|
|
2026
2029
|
});
|
|
@@ -2041,7 +2044,7 @@ function filesize(arg, { bits = !1, pad = !1, base = -1, round = 2, locale = "",
|
|
|
2041
2044
|
}
|
|
2042
2045
|
if (output === EXPONENT) return e;
|
|
2043
2046
|
e3 = e, symbolTable = STRINGS_symbol[actualStandard][bits ? "bits" : "bytes"], u = isDecimal && 1 === e3 ? bits ? "kbit" : "kB" : symbolTable[e3], result[1] = u;
|
|
2044
|
-
var num1, e1, precision1, val1, e2, e3, e4 = e;
|
|
2047
|
+
var standard1, num1, e1, precision1, val1, e2, e3, e4 = e;
|
|
2045
2048
|
if (neg && ("string" == typeof result[0] ? result[0] = `-${result[0]}` : 0 === result[0] ? result[0] = "-0" : result[0] = -result[0]), symbols[result[1]] && (result[1] = symbols[result[1]]), numericValue = "string" == typeof result[0] ? parseFloat(result[0]) : result[0], result[0] = applyNumberFormatting(result[0], locale, localeOptions, separator, pad, round, roundingFunc), full) {
|
|
2046
2049
|
let unit, suffix;
|
|
2047
2050
|
unit = bits ? "bit" : BYTE, suffix = 1 === Math.abs(numericValue) ? "" : "s", fullforms[e4] ? result[1] = fullforms[e4] : result[1] = STRINGS_fullform[actualStandard][e4] + unit + suffix;
|
|
@@ -2055,7 +2058,8 @@ function filesize(arg, { bits = !1, pad = !1, base = -1, round = 2, locale = "",
|
|
|
2055
2058
|
unit: u1
|
|
2056
2059
|
} : " " === spacer ? `${result[0]} ${result[1]}` : result.join(spacer);
|
|
2057
2060
|
}
|
|
2058
|
-
|
|
2061
|
+
let lib = rspackRequire("../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/index.js");
|
|
2062
|
+
var lib_default = compatGetDefaultExport(lib);
|
|
2059
2063
|
let loader_filename = fileURLToPath(import.meta.url), loader_dirname = node_path.dirname(loader_filename), loader_require = createRequire(import.meta.url), PATH_QUERY_FRAGMENT_REGEXP = /^((?:\0.|[^?#\0])*)(\?(?:\0.|[^#\0])*)?(#.*)?$/;
|
|
2060
2064
|
function parsePathQueryFragment(str) {
|
|
2061
2065
|
let match = PATH_QUERY_FRAGMENT_REGEXP.exec(str);
|
package/dist/e.js.LICENSE.txt
CHANGED
package/dist/index.js
CHANGED
|
@@ -3172,8 +3172,9 @@ function build(dir, opts = {}) {
|
|
|
3172
3172
|
}));
|
|
3173
3173
|
let cc = null != opts.maxAge && `public,max-age=${opts.maxAge}`;
|
|
3174
3174
|
cc && opts.immutable ? cc += ',immutable' : cc && 0 === opts.maxAge && (cc += ',must-revalidate'), opts.dev || function totalist(dir, callback, pre = '') {
|
|
3175
|
-
|
|
3176
|
-
|
|
3175
|
+
dir = external_path_resolve('.', dir);
|
|
3176
|
+
let arr = readdirSync(dir), i = 0, abs, stats;
|
|
3177
|
+
for(; i < arr.length; i++)abs = external_path_join(dir, arr[i]), (stats = statSync(abs)).isDirectory() ? totalist(abs, callback, external_path_join(pre, arr[i])) : callback(external_path_join(pre, arr[i]), abs, stats);
|
|
3177
3178
|
}(dir, (name, abs, stats)=>{
|
|
3178
3179
|
if (/\.well-known[\\+\/]/.test(name)) ;
|
|
3179
3180
|
else if (!opts.dotfiles && /(^\.|[\\+|\/+]\.)/.test(name)) return;
|
|
@@ -4072,7 +4073,10 @@ function getContentType(req) {
|
|
|
4072
4073
|
function normalizeReadError(error, charset) {
|
|
4073
4074
|
return error instanceof Error && 'status' in error && 'number' == typeof error.status ? charset && 'type' in error && 'encoding.unsupported' === error.type ? createHttpError(415, `unsupported charset "${charset.toUpperCase()}"`, 'charset.unsupported') : error : createHttpError(400, error instanceof Error ? error.message : 'failed to read request body', 'request.invalid');
|
|
4074
4075
|
}
|
|
4075
|
-
|
|
4076
|
+
let lib = rspackRequire("../../node_modules/.pnpm/cors@2.8.6/node_modules/cors/lib/index.js");
|
|
4077
|
+
var lib_default = compatGetDefaultExport(lib);
|
|
4078
|
+
let launch_editor = rspackRequire("../../node_modules/.pnpm/launch-editor@2.14.2/node_modules/launch-editor/index.js");
|
|
4079
|
+
var launch_editor_default = compatGetDefaultExport(launch_editor);
|
|
4076
4080
|
let server_require = createRequire(import.meta.url), OPEN_IN_EDITOR_EDITORS = new Set(SDK.OPEN_IN_EDITOR_EDITORS), LARGE_JSON_BODY_ROUTES = new Set([
|
|
4077
4081
|
SDK.ServerAPI.API.ReportLoader,
|
|
4078
4082
|
SDK.ServerAPI.API.ReportSourceMap
|
|
@@ -4628,7 +4632,8 @@ function findRoot(startDir = process.cwd()) {
|
|
|
4628
4632
|
return firstPkgDir || null;
|
|
4629
4633
|
}
|
|
4630
4634
|
String((date = new Date()).getMonth() + 1).padStart(2, '0'), String(date.getDate()).padStart(2, '0'), date.getFullYear();
|
|
4631
|
-
|
|
4635
|
+
let lib_0 = rspackRequire("../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/index.js");
|
|
4636
|
+
var lib_0_default = compatGetDefaultExport(lib_0);
|
|
4632
4637
|
class SDKCore {
|
|
4633
4638
|
constructor({ name, root }){
|
|
4634
4639
|
this.hooks = {
|
|
@@ -5312,7 +5317,7 @@ class RsdoctorSDKController {
|
|
|
5312
5317
|
return this.slaves.filter((item)=>this.activeSlaves.has(item));
|
|
5313
5318
|
}
|
|
5314
5319
|
}
|
|
5315
|
-
var package_namespaceObject = JSON.parse('{"name":"@rsdoctor/core","version":"2.0.
|
|
5320
|
+
var package_namespaceObject = JSON.parse('{"name":"@rsdoctor/core","version":"2.0.4","repository":{"type":"git","url":"https://github.com/web-infra-dev/rsdoctor","directory":"packages/core"},"license":"MIT","type":"module","exports":{".":"./dist/index.js","./proxy-loader":"./dist/proxy-loader.js"},"main":"dist/index.js","types":"dist/index.d.ts","typesVersions":{"*":{".":["./dist/index.d.ts"],"proxy-loader":["./dist/proxy-loader.d.ts"]}},"files":["dist","static"],"scripts":{"build":"rs lib","dev":"npm run start","start":"rs lib -w","test":"rs test"},"dependencies":{"@rsdoctor/client":"workspace:*","@rsdoctor/shared":"workspace:*","@swc-next/parser":"0.6.1","caniuse-lite":"^1.0.30001826","sirv":"catalog:","source-map":"catalog:"},"devDependencies":{"@babel/code-frame":"7.26.2","@rsbuild/plugin-check-syntax":"catalog:","@rspack/core":"catalog:","@rspack/lite-tapable":"catalog:","@scripts/test-helper":"workspace:*","@swc-next/walker":"0.6.1","@types/babel__code-frame":"7.27.0","@types/cors":"2.8.19","@types/envinfo":"7.8.4","@types/estree":"catalog:","@types/fs-extra":"catalog:","@types/node":"catalog:","@types/semver":"^7.8.0","@types/ws":"^8.18.2","babel-loader":"10.1.1","browserslist-load-config":"^1.0.4","connect-next":"catalog:","cors":"2.8.6","envinfo":"7.21.0","filesize":"catalog:","fs-extra":"catalog:","get-port":"5.1.1","json-stream-stringify":"3.0.1","launch-editor":"^2.14.2","lines-and-columns":"2.0.4","open":"^11.0.4","raw-body":"4.0.0","rslog":"^2.3.0","semver":"^7.8.6","string-loader":"0.0.1","ts-loader":"^9.6.2","typescript":"catalog:","ws":"8.22.1"},"peerDependencies":{"@rspack/core":"^2.0.0"},"peerDependenciesMeta":{"@rspack/core":{"optional":true}},"engines":{"node":"^20.19.0 || >=22.12.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"}}');
|
|
5316
5321
|
let pluginTapName = 'RsdoctorRspackPlugin', pluginTapPostOptions = {
|
|
5317
5322
|
name: pluginTapName,
|
|
5318
5323
|
stage: 999
|
package/dist/r.js
CHANGED
|
@@ -39,7 +39,7 @@ moduleFactories.add({
|
|
|
39
39
|
BrowserslistError.prototype = Error.prototype, module.exports = BrowserslistError;
|
|
40
40
|
},
|
|
41
41
|
"../../node_modules/.pnpm/browserslist@4.28.2/node_modules/browserslist/index.js" (module) {
|
|
42
|
-
var bbm = rspackRequire("../../node_modules/.pnpm/baseline-browser-mapping@2.10.29/node_modules/baseline-browser-mapping/dist/index.cjs"), jsReleases = rspackRequire("../../node_modules/.pnpm/node-releases@2.0.38/node_modules/node-releases/data/processed/envs.json"), agents = __rspack_createRequire_require("caniuse-lite/dist/unpacker/agents").agents, e2c = rspackRequire("../../node_modules/.pnpm/electron-to-chromium@1.5.353/node_modules/electron-to-chromium/versions.js"), jsEOL = rspackRequire("../../node_modules/.pnpm/node-releases@2.0.38/node_modules/node-releases/data/release-schedule/release-schedule.json"), path = __rspack_createRequire_require("path"), BrowserslistError = rspackRequire("../../node_modules/.pnpm/browserslist@4.28.2/node_modules/browserslist/error.js"), env = rspackRequire("../../node_modules/.pnpm/browserslist@4.28.2/node_modules/browserslist/node.js"), parseWithoutCache = rspackRequire("../../node_modules/.pnpm/browserslist@4.28.2/node_modules/browserslist/parse.js"), YEAR = 365.259641 *
|
|
42
|
+
var bbm = rspackRequire("../../node_modules/.pnpm/baseline-browser-mapping@2.10.29/node_modules/baseline-browser-mapping/dist/index.cjs"), jsReleases = rspackRequire("../../node_modules/.pnpm/node-releases@2.0.38/node_modules/node-releases/data/processed/envs.json"), agents = __rspack_createRequire_require("caniuse-lite/dist/unpacker/agents").agents, e2c = rspackRequire("../../node_modules/.pnpm/electron-to-chromium@1.5.353/node_modules/electron-to-chromium/versions.js"), jsEOL = rspackRequire("../../node_modules/.pnpm/node-releases@2.0.38/node_modules/node-releases/data/release-schedule/release-schedule.json"), path = __rspack_createRequire_require("path"), BrowserslistError = rspackRequire("../../node_modules/.pnpm/browserslist@4.28.2/node_modules/browserslist/error.js"), env = rspackRequire("../../node_modules/.pnpm/browserslist@4.28.2/node_modules/browserslist/node.js"), parseWithoutCache = rspackRequire("../../node_modules/.pnpm/browserslist@4.28.2/node_modules/browserslist/parse.js"), YEAR = 365.259641 * 24 * 60 * 60 * 1000;
|
|
43
43
|
function isVersionsMatch(versionA, versionB) {
|
|
44
44
|
return 0 === (versionA + '.').indexOf(versionB + '.');
|
|
45
45
|
}
|
|
@@ -31832,16 +31832,16 @@ makeNamespaceObject(duplicate_package_types_namespaceObject), definePropertyGett
|
|
|
31832
31832
|
J: ()=>types_CheckVersionMap
|
|
31833
31833
|
});
|
|
31834
31834
|
let dist_rspack_createRequire_require = createRequire(import.meta.url);
|
|
31835
|
-
var
|
|
31835
|
+
var dist_webpack_modules_ = {}, dist_webpack_module_cache_ = {};
|
|
31836
31836
|
function dist_webpack_require_(moduleId) {
|
|
31837
|
-
var cachedModule =
|
|
31837
|
+
var cachedModule = dist_webpack_module_cache_[moduleId];
|
|
31838
31838
|
if (void 0 !== cachedModule) return cachedModule.exports;
|
|
31839
|
-
var module =
|
|
31839
|
+
var module = dist_webpack_module_cache_[moduleId] = {
|
|
31840
31840
|
exports: {}
|
|
31841
31841
|
};
|
|
31842
|
-
return
|
|
31842
|
+
return dist_webpack_modules_[moduleId](module, module.exports, dist_webpack_require_), module.exports;
|
|
31843
31843
|
}
|
|
31844
|
-
dist_webpack_require_.m =
|
|
31844
|
+
dist_webpack_require_.m = dist_webpack_modules_, dist_webpack_require_.n = (module)=>{
|
|
31845
31845
|
var getter = module && module.__esModule ? ()=>module.default : ()=>module;
|
|
31846
31846
|
return dist_webpack_require_.d(getter, {
|
|
31847
31847
|
a: getter
|
|
@@ -32663,17 +32663,31 @@ function getPort(expectPort, host) {
|
|
|
32663
32663
|
|
|
32664
32664
|
async function getAvailablePort(expectPort) {
|
|
32665
32665
|
let port = expectPort;
|
|
32666
|
+
let attempts = 0;
|
|
32666
32667
|
while (true) {
|
|
32667
32668
|
try {
|
|
32668
|
-
|
|
32669
|
-
return res;
|
|
32669
|
+
return await getPort(port, ${JSON.stringify(host)});
|
|
32670
32670
|
} catch (error) {
|
|
32671
|
-
port
|
|
32671
|
+
if (port === 0) throw error;
|
|
32672
|
+
if (error.code === 'EACCES') {
|
|
32673
|
+
port = 0;
|
|
32674
|
+
} else if (error.code === 'EADDRINUSE') {
|
|
32675
|
+
attempts++;
|
|
32676
|
+
port = attempts >= 20 || port === 65_535 ? 0 : port + 1;
|
|
32677
|
+
} else {
|
|
32678
|
+
throw error;
|
|
32679
|
+
}
|
|
32672
32680
|
}
|
|
32673
32681
|
}
|
|
32674
32682
|
}
|
|
32675
32683
|
|
|
32676
|
-
getAvailablePort(${port}).then(
|
|
32684
|
+
getAvailablePort(${port}).then(
|
|
32685
|
+
port => process.stdout.write(port.toString()),
|
|
32686
|
+
error => {
|
|
32687
|
+
process.stderr.write(String(error.code || error.message));
|
|
32688
|
+
process.exit(1);
|
|
32689
|
+
},
|
|
32690
|
+
);
|
|
32677
32691
|
})();
|
|
32678
32692
|
`.trim();
|
|
32679
32693
|
};
|
|
@@ -32708,7 +32722,8 @@ async function createServer(port, host = defaultHost) {
|
|
|
32708
32722
|
});
|
|
32709
32723
|
});
|
|
32710
32724
|
}
|
|
32711
|
-
|
|
32725
|
+
let envinfo = rspackRequire("../../node_modules/.pnpm/envinfo@7.21.0/node_modules/envinfo/dist/envinfo.js");
|
|
32726
|
+
var envinfo_default = compatGetDefaultExport(envinfo);
|
|
32712
32727
|
let helpers = envinfo_default().helpers;
|
|
32713
32728
|
envinfo_default().run;
|
|
32714
32729
|
let getCPUInfo = ()=>helpers.getCPUInfo().then((res)=>res[1]), getMemoryInfo = ()=>helpers.getMemoryInfo().then((res)=>res[1]), getNodeVersion = ()=>helpers.getNodeInfo().then((res)=>res[1]), getYarnVersion = ()=>helpers.getYarnInfo().then((res)=>res[1]), getNpmVersion = ()=>helpers.getnpmInfo().then((res)=>res[1]), getPnpmVersion = ()=>helpers.getpnpmInfo().then((res)=>res[1]);
|
|
@@ -32768,8 +32783,9 @@ function transformEsbuildError(err, opt) {
|
|
|
32768
32783
|
}
|
|
32769
32784
|
}
|
|
32770
32785
|
function transformBabelError(err, opt) {
|
|
32786
|
+
var input;
|
|
32771
32787
|
if ('code' in err && 'reasonCode' in err) {
|
|
32772
|
-
let lines, filePath, errorCode = opt?.code ?? err.code ?? 'BABEL', title = err.reasonCode, errorParsed = (filePath = (lines = stripVTControlCharacters(truncateMessage(
|
|
32788
|
+
let lines, filePath, errorCode = opt?.code ?? err.code ?? 'BABEL', title = err.reasonCode, errorParsed = (input = err.message, filePath = (lines = stripVTControlCharacters(truncateMessage(input)).split('\n'))[0].replace(/^([^:]+):.*/, '$1'), {
|
|
32773
32789
|
message: lines[0].replace(/.*: (.*) \(\d+:\d+\)*/, '$1'),
|
|
32774
32790
|
filePath,
|
|
32775
32791
|
lineText: lines.find((line)=>line.startsWith('> '))?.replace(/> \d+ \| /, '') ?? ''
|
|
@@ -33149,11 +33165,11 @@ let normalizeRspackUserOptions = function(config = {}) {
|
|
|
33149
33165
|
output: outputConfig
|
|
33150
33166
|
}, supports = {
|
|
33151
33167
|
parseBundle: defaultBoolean(userSupports.parseBundle, !0),
|
|
33152
|
-
gzip: (assert(void 0 ===
|
|
33153
|
-
gzipLevel: (
|
|
33168
|
+
gzip: (value = userSupports.gzip, assert(void 0 === value || 'boolean' == typeof value || 'object' == typeof value && null !== value && !Array.isArray(value), '`supports.gzip` must be a boolean or an object.'), !1 !== value && {
|
|
33169
|
+
gzipLevel: (gzipLevel = void 0 === (value1 = 'object' == typeof value && null !== value ? value.gzipLevel : void 0) ? 6 : value1, assert('number' == typeof gzipLevel && Number.isInteger(gzipLevel) && gzipLevel >= 0 && gzipLevel <= 9, '`supports.gzip.gzipLevel` must be an integer between 0 and 9.'), gzipLevel)
|
|
33154
33170
|
}),
|
|
33155
|
-
brotli: (assert(void 0 ===
|
|
33156
|
-
brotliLevel: (
|
|
33171
|
+
brotli: (value2 = userSupports.brotli, assert(void 0 === value2 || 'boolean' == typeof value2 || 'object' == typeof value2 && null !== value2 && !Array.isArray(value2), '`supports.brotli` must be a boolean or an object.'), !1 !== value2 && void 0 !== value2 && {
|
|
33172
|
+
brotliLevel: (brotliLevel = void 0 === (value3 = 'object' == typeof value2 && null !== value2 ? value2.brotliLevel : void 0) ? 6 : value3, assert('number' == typeof brotliLevel && Number.isInteger(brotliLevel) && brotliLevel >= 0 && brotliLevel <= 11, '`supports.brotli.brotliLevel` must be an integer between 0 and 11.'), brotliLevel)
|
|
33157
33173
|
})
|
|
33158
33174
|
}, disableClientServer = !!process.env.CI && 'true' !== process.env.RSTEST || userDisableClientServer;
|
|
33159
33175
|
assert('object' == typeof linter), assert('object' == typeof features || Array.isArray(features)), assert('object' == typeof loaderInterceptorOptions), assert('boolean' == typeof disableClientServer), assert('object' == typeof userServer && null !== userServer);
|
|
@@ -33839,17 +33855,12 @@ class InternalLoaderPlugin extends InternalBasePlugin {
|
|
|
33839
33855
|
}), newLoaders = safeCloneDeep(originLoaders);
|
|
33840
33856
|
if ('object' == typeof compiler.options.cache && 'version' in compiler.options.cache && 'string' == typeof compiler.options.cache.version && compiler.options.cache.version.indexOf('next/dist/build') > -1) callback(loaderContext, module || {});
|
|
33841
33857
|
else {
|
|
33842
|
-
let
|
|
33843
|
-
|
|
33844
|
-
|
|
33845
|
-
|
|
33846
|
-
|
|
33847
|
-
|
|
33848
|
-
})), Reflect.set(target, p, _newValue, receiver);
|
|
33849
|
-
},
|
|
33850
|
-
deleteProperty: (target, p)=>Reflect.deleteProperty(target, p)
|
|
33851
|
-
});
|
|
33852
|
-
callback(loaderContext, proxyModule);
|
|
33858
|
+
let hookModule = module || {}, savedLoaders = hookModule.loaders;
|
|
33859
|
+
try {
|
|
33860
|
+
hookModule.loaders = newLoaders, callback(loaderContext, hookModule), Array.isArray(hookModule.loaders) && (newLoaders = hookModule.loaders);
|
|
33861
|
+
} finally{
|
|
33862
|
+
hookModule.loaders = savedLoaders;
|
|
33863
|
+
}
|
|
33853
33864
|
}
|
|
33854
33865
|
isEqual(originLoaders, newLoaders) || (module.loaders = this.getInterceptRules(compiler, newLoaders.map((e)=>({
|
|
33855
33866
|
loader: e.loader,
|
|
@@ -34402,7 +34413,10 @@ let hasConsole = !1, ensureModulesChunksGraphFn = (compiler, _this)=>{
|
|
|
34402
34413
|
}(asset, assets, 'js/css'), map = mapFromAsset;
|
|
34403
34414
|
if (map) {
|
|
34404
34415
|
let outputPath = compilation.options.output?.path;
|
|
34405
|
-
outputPath && 'string' == typeof outputPath && assetName
|
|
34416
|
+
if (outputPath && 'string' == typeof outputPath && assetName) {
|
|
34417
|
+
let mapFileName = assetName.endsWith('.map') ? assetName : `${assetName}.map`;
|
|
34418
|
+
sourceMapPath = external_path_resolve(outputPath, mapFileName);
|
|
34419
|
+
}
|
|
34406
34420
|
} else {
|
|
34407
34421
|
let sourceMapFile = asset.info.related?.sourceMap, sourceMapFileAssetName = sourceMapFile?.replace(/(\.[^.]+)(\.[^.]+)?$/, '$1');
|
|
34408
34422
|
if (sourceMapFile) {
|
|
@@ -34759,12 +34773,12 @@ let loader_performance_optimization_rule = defineRule(()=>({
|
|
|
34759
34773
|
config: void 0
|
|
34760
34774
|
};
|
|
34761
34775
|
if (!config) return;
|
|
34762
|
-
let cwd = config.context || root, nodeModulesPathRegexp = /\/node_modules\//, resultMap = new Map(), loaders = loader.flatMap((el)=>el.loaders);
|
|
34776
|
+
let cwd = config.context || root, nodeModulesPathRegexp = /\/node_modules\//, resultMap = new Map(), loaders = loader.flatMap((el)=>el.loaders), getLoaderCosts = Loader.createLoaderCostsCalculator(loaders);
|
|
34763
34777
|
for (let item of loader){
|
|
34764
34778
|
let { path, ext } = item.resource;
|
|
34765
34779
|
utils_match(ext, extensions) && (nodeModulesPathRegexp.test(path) || !path.startsWith(cwd)) && item.loaders.forEach((el)=>{
|
|
34766
34780
|
if (utils_match(el.loader, ignore)) return;
|
|
34767
|
-
let costs =
|
|
34781
|
+
let costs = getLoaderCosts(el), v = {
|
|
34768
34782
|
...el,
|
|
34769
34783
|
__resource__: item.resource,
|
|
34770
34784
|
__costs__: costs
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsdoctor/core",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.4",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/web-infra-dev/rsdoctor",
|
|
@@ -9,14 +9,8 @@
|
|
|
9
9
|
"license": "MIT",
|
|
10
10
|
"type": "module",
|
|
11
11
|
"exports": {
|
|
12
|
-
".":
|
|
13
|
-
|
|
14
|
-
"default": "./dist/index.js"
|
|
15
|
-
},
|
|
16
|
-
"./proxy-loader": {
|
|
17
|
-
"types": "./dist/proxy-loader.d.ts",
|
|
18
|
-
"default": "./dist/proxy-loader.js"
|
|
19
|
-
}
|
|
12
|
+
".": "./dist/index.js",
|
|
13
|
+
"./proxy-loader": "./dist/proxy-loader.js"
|
|
20
14
|
},
|
|
21
15
|
"main": "dist/index.js",
|
|
22
16
|
"types": "dist/index.d.ts",
|
|
@@ -35,17 +29,17 @@
|
|
|
35
29
|
"static"
|
|
36
30
|
],
|
|
37
31
|
"dependencies": {
|
|
38
|
-
"@rsdoctor/client": "2.0.
|
|
39
|
-
"@rsdoctor/shared": "2.0.
|
|
32
|
+
"@rsdoctor/client": "2.0.4",
|
|
33
|
+
"@rsdoctor/shared": "2.0.4",
|
|
40
34
|
"@swc-next/parser": "0.6.1",
|
|
41
|
-
"caniuse-lite": "^1.0.
|
|
35
|
+
"caniuse-lite": "^1.0.30001826",
|
|
42
36
|
"sirv": "3.0.2",
|
|
43
37
|
"source-map": "^0.8.0"
|
|
44
38
|
},
|
|
45
39
|
"devDependencies": {
|
|
46
40
|
"@babel/code-frame": "7.26.2",
|
|
47
41
|
"@rsbuild/plugin-check-syntax": "^2.1.0",
|
|
48
|
-
"@rspack/core": "^2.3.
|
|
42
|
+
"@rspack/core": "^2.3.2",
|
|
49
43
|
"@rspack/lite-tapable": "^1.3.0",
|
|
50
44
|
"@scripts/test-helper": "0.1.1",
|
|
51
45
|
"@swc-next/walker": "0.6.1",
|
|
@@ -62,7 +56,7 @@
|
|
|
62
56
|
"connect-next": "5.0.0",
|
|
63
57
|
"cors": "2.8.6",
|
|
64
58
|
"envinfo": "7.21.0",
|
|
65
|
-
"filesize": "^11.0.
|
|
59
|
+
"filesize": "^11.0.32",
|
|
66
60
|
"fs-extra": "^11.1.1",
|
|
67
61
|
"get-port": "5.1.1",
|
|
68
62
|
"json-stream-stringify": "3.0.1",
|