@rsbuild/core 1.3.6 → 1.3.7
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/lib/postcss.d.ts +1 -1
- package/compiled/postcss/lib/previous-map.d.ts +1 -1
- package/compiled/postcss/lib/source-map-js.d.ts +4 -0
- package/compiled/postcss-loader/index.js +6 -6
- package/compiled/rspack-manifest-plugin/index.js +4 -4
- package/compiled/webpack-bundle-analyzer/index.d.ts +1 -1
- package/dist/client/hmr.js +6 -9
- package/dist/client/overlay.js +4 -7
- package/dist/ignoreCssLoader.mjs +2 -2
- package/dist/index.cjs +77 -104
- package/dist/index.js +76 -103
- package/dist/transformLoader.mjs +3 -3
- package/dist/transformRawLoader.mjs +3 -3
- package/dist-types/types/plugin.d.ts +2 -0
- package/dist-types/types/thirdParty.d.ts +1 -0
- package/package.json +5 -5
package/dist/index.cjs
CHANGED
|
@@ -838,7 +838,7 @@ var __webpack_modules__ = {
|
|
|
838
838
|
return k1 < k2 ? -1 : k1 > k2 ? 1 : v1 < v2 ? -1 : +(v1 > v2);
|
|
839
839
|
}
|
|
840
840
|
if (entriesA.sort(cmp), entriesB.sort(cmp), entriesA.length !== entriesB.length) return !1;
|
|
841
|
-
for(var i = 0; i < entriesA.length; i++)if (entriesA[i][0] !== entriesB[i][0] || (null
|
|
841
|
+
for(var i = 0; i < entriesA.length; i++)if (entriesA[i][0] !== entriesB[i][0] || (null == (_a = entriesA[i][1]) ? void 0 : _a.toString()) !== (null == (_b = entriesB[i][1]) ? void 0 : _b.toString())) return !1;
|
|
842
842
|
return !0;
|
|
843
843
|
};
|
|
844
844
|
},
|
|
@@ -1000,7 +1000,7 @@ for(var __webpack_i__ in (()=>{
|
|
|
1000
1000
|
defineConfig: ()=>defineConfig,
|
|
1001
1001
|
mergeRsbuildConfig: ()=>mergeRsbuildConfig,
|
|
1002
1002
|
runCLI: ()=>runCLI,
|
|
1003
|
-
version: ()=>
|
|
1003
|
+
version: ()=>src_version,
|
|
1004
1004
|
PLUGIN_SWC_NAME: ()=>PLUGIN_SWC_NAME,
|
|
1005
1005
|
PLUGIN_CSS_NAME: ()=>PLUGIN_CSS_NAME,
|
|
1006
1006
|
loadConfig: ()=>config_loadConfig,
|
|
@@ -1113,9 +1113,9 @@ for(var __webpack_i__ in (()=>{
|
|
|
1113
1113
|
}, dedupeNestedPaths = (paths)=>paths.sort((p1, p2)=>p2.length > p1.length ? -1 : 1).reduce((prev, curr)=>prev.find((p)=>curr.startsWith(p) || curr === p) ? prev : prev.concat(curr), []), toPosixPath = (filepath)=>'/' === external_node_path_namespaceObject.sep ? filepath : filepath.replace(/\\/g, '/'), isFileSync = (filePath)=>{
|
|
1114
1114
|
try {
|
|
1115
1115
|
var _fs_statSync;
|
|
1116
|
-
return null
|
|
1116
|
+
return null == (_fs_statSync = external_node_fs_default().statSync(filePath, {
|
|
1117
1117
|
throwIfNoEntry: !1
|
|
1118
|
-
}))
|
|
1118
|
+
})) ? void 0 : _fs_statSync.isFile();
|
|
1119
1119
|
} catch (_) {
|
|
1120
1120
|
return !1;
|
|
1121
1121
|
}
|
|
@@ -1131,10 +1131,7 @@ for(var __webpack_i__ in (()=>{
|
|
|
1131
1131
|
}
|
|
1132
1132
|
async function fileExistsByCompilation({ inputFileSystem }, filePath) {
|
|
1133
1133
|
return new Promise((resolve)=>{
|
|
1134
|
-
if (!inputFileSystem)
|
|
1135
|
-
resolve(!1);
|
|
1136
|
-
return;
|
|
1137
|
-
}
|
|
1134
|
+
if (!inputFileSystem) return void resolve(!1);
|
|
1138
1135
|
inputFileSystem.stat(filePath, (err, stats)=>{
|
|
1139
1136
|
err ? resolve(!1) : resolve(!!(null == stats ? void 0 : stats.isFile()));
|
|
1140
1137
|
});
|
|
@@ -1271,18 +1268,18 @@ for(var __webpack_i__ in (()=>{
|
|
|
1271
1268
|
}
|
|
1272
1269
|
function formatStatsMessages(stats, verbose) {
|
|
1273
1270
|
var _stats_errors, _stats_warnings;
|
|
1274
|
-
let formattedErrors = (null
|
|
1271
|
+
let formattedErrors = (null == (_stats_errors = stats.errors) ? void 0 : _stats_errors.map((error)=>formatMessage(error, verbose))) || [];
|
|
1275
1272
|
return {
|
|
1276
1273
|
errors: formattedErrors,
|
|
1277
|
-
warnings: (null
|
|
1274
|
+
warnings: (null == (_stats_warnings = stats.warnings) ? void 0 : _stats_warnings.map((warning)=>formatMessage(warning, verbose))) || []
|
|
1278
1275
|
};
|
|
1279
1276
|
}
|
|
1280
1277
|
let getAllStatsErrors = (statsData)=>{
|
|
1281
1278
|
var _statsData_errors, _statsData_children;
|
|
1282
|
-
return statsData.errorsCount && (null
|
|
1279
|
+
return statsData.errorsCount && (null == (_statsData_errors = statsData.errors) ? void 0 : _statsData_errors.length) === 0 ? null == (_statsData_children = statsData.children) ? void 0 : _statsData_children.reduce((errors, curr)=>errors.concat(curr.errors || []), []) : statsData.errors;
|
|
1283
1280
|
}, getAllStatsWarnings = (statsData)=>{
|
|
1284
1281
|
var _statsData_warnings, _statsData_children;
|
|
1285
|
-
return statsData.warningsCount && (null
|
|
1282
|
+
return statsData.warningsCount && (null == (_statsData_warnings = statsData.warnings) ? void 0 : _statsData_warnings.length) === 0 ? null == (_statsData_children = statsData.children) ? void 0 : _statsData_children.reduce((warnings, curr)=>warnings.concat(curr.warnings || []), []) : statsData.warnings;
|
|
1286
1283
|
};
|
|
1287
1284
|
function getStatsOptions(compiler) {
|
|
1288
1285
|
if (helpers_isMultiCompiler(compiler)) return {
|
|
@@ -1679,7 +1676,7 @@ for(var __webpack_i__ in (()=>{
|
|
|
1679
1676
|
}), withDefaultConfig = async (rootPath, config)=>{
|
|
1680
1677
|
var _merged_server, _config_dev, _config_output;
|
|
1681
1678
|
let merged = mergeRsbuildConfig(createDefaultConfig(), config);
|
|
1682
|
-
if (merged.root ||= rootPath, merged.source ||= {}, (null
|
|
1679
|
+
if (merged.root ||= rootPath, merged.source ||= {}, (null == (_merged_server = merged.server) ? void 0 : _merged_server.base) && ((null == (_config_dev = config.dev) ? void 0 : _config_dev.assetPrefix) === void 0 && (merged.dev ||= {}, merged.dev.assetPrefix = merged.server.base), (null == (_config_output = config.output) ? void 0 : _config_output.assetPrefix) === void 0 && (merged.output ||= {}, merged.output.assetPrefix = merged.server.base)), !merged.source.tsconfigPath) {
|
|
1683
1680
|
let tsconfigPath = (0, external_node_path_namespaceObject.join)(rootPath, 'tsconfig.json');
|
|
1684
1681
|
await isFileExists(tsconfigPath) && (merged.source.tsconfigPath = tsconfigPath);
|
|
1685
1682
|
}
|
|
@@ -1884,7 +1881,7 @@ for(var __webpack_i__ in (()=>{
|
|
|
1884
1881
|
for (let plugin of plugins){
|
|
1885
1882
|
var _removedPlugins_plugin_environment, _removedPlugins_RSBUILD_ALL_ENVIRONMENT_SYMBOL;
|
|
1886
1883
|
let isGlobalPlugin = 'RSBUILD_ALL_ENVIRONMENT_SYMBOL' === plugin.environment;
|
|
1887
|
-
if ((null
|
|
1884
|
+
if ((null == (_removedPlugins_plugin_environment = removedPlugins[plugin.environment]) ? void 0 : _removedPlugins_plugin_environment.includes(plugin.instance.name)) || !isGlobalPlugin && (null == (_removedPlugins_RSBUILD_ALL_ENVIRONMENT_SYMBOL = removedPlugins[RSBUILD_ALL_ENVIRONMENT_SYMBOL]) ? void 0 : _removedPlugins_RSBUILD_ALL_ENVIRONMENT_SYMBOL.includes(plugin.instance.name))) continue;
|
|
1888
1885
|
let { instance, environment } = plugin;
|
|
1889
1886
|
await instance.setup(getPluginAPI(environment));
|
|
1890
1887
|
}
|
|
@@ -2204,7 +2201,7 @@ for(var __webpack_i__ in (()=>{
|
|
|
2204
2201
|
name,
|
|
2205
2202
|
distPath: function(cwd, config) {
|
|
2206
2203
|
var _config_output_distPath, _config_output;
|
|
2207
|
-
return getAbsolutePath(cwd, (null
|
|
2204
|
+
return getAbsolutePath(cwd, (null == (_config_output = config.output) || null == (_config_output_distPath = _config_output.distPath) ? void 0 : _config_output_distPath.root) ?? ROOT_DIST_DIR);
|
|
2208
2205
|
}(context.rootPath, config),
|
|
2209
2206
|
entry,
|
|
2210
2207
|
browserslist,
|
|
@@ -2221,7 +2218,7 @@ for(var __webpack_i__ in (()=>{
|
|
|
2221
2218
|
async function createContext(options, userConfig) {
|
|
2222
2219
|
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;
|
|
2223
2220
|
return {
|
|
2224
|
-
version: "1.3.
|
|
2221
|
+
version: "1.3.7",
|
|
2225
2222
|
rootPath,
|
|
2226
2223
|
distPath: '',
|
|
2227
2224
|
cachePath,
|
|
@@ -2367,7 +2364,7 @@ for(var __webpack_i__ in (()=>{
|
|
|
2367
2364
|
utils
|
|
2368
2365
|
]
|
|
2369
2366
|
});
|
|
2370
|
-
if (null
|
|
2367
|
+
if (null == (_utils_environment_config_tools = utils.environment.config.tools) ? void 0 : _utils_environment_config_tools.bundlerChain) for (let item of castArray(utils.environment.config.tools.bundlerChain))await item(modifiedBundlerChain, utils);
|
|
2371
2368
|
return rslog_index_js_namespaceObject.logger.debug('modify bundler chain done'), modifiedBundlerChain;
|
|
2372
2369
|
}
|
|
2373
2370
|
let configChain_CHAIN_ID = {
|
|
@@ -2542,7 +2539,7 @@ for(var __webpack_i__ in (()=>{
|
|
|
2542
2539
|
}
|
|
2543
2540
|
}), isUseAnalyzer = (config)=>{
|
|
2544
2541
|
var _config_performance;
|
|
2545
|
-
return process.env.BUNDLE_ANALYZE || (null
|
|
2542
|
+
return process.env.BUNDLE_ANALYZE || (null == (_config_performance = config.performance) ? void 0 : _config_performance.bundleAnalyze);
|
|
2546
2543
|
}, external_node_crypto_namespaceObject = require("node:crypto");
|
|
2547
2544
|
var external_node_crypto_default = __webpack_require__.n(external_node_crypto_namespaceObject);
|
|
2548
2545
|
async function validateWebpackCache(cacheDirectory, buildDependencies) {
|
|
@@ -2573,7 +2570,7 @@ for(var __webpack_i__ in (()=>{
|
|
|
2573
2570
|
let { tsconfigPath } = environmentContext;
|
|
2574
2571
|
tsconfigPath && (buildDependencies.tsconfig = [
|
|
2575
2572
|
tsconfigPath
|
|
2576
|
-
]), (null
|
|
2573
|
+
]), (null == (_config__privateMeta = config._privateMeta) ? void 0 : _config__privateMeta.configFilePath) && (buildDependencies.rsbuildConfig = [
|
|
2577
2574
|
config._privateMeta.configFilePath
|
|
2578
2575
|
]), await isFileExists(browserslistConfig) && (buildDependencies.browserslistrc = [
|
|
2579
2576
|
browserslistConfig
|
|
@@ -2655,7 +2652,7 @@ for(var __webpack_i__ in (()=>{
|
|
|
2655
2652
|
return 'auto' === enable ? isDev && !config.dev.writeToDisk ? void 0 : isStrictSubdir(rootPath, distPath) ? {
|
|
2656
2653
|
path: distPath,
|
|
2657
2654
|
keep
|
|
2658
|
-
} :
|
|
2655
|
+
} : (rslog_index_js_namespaceObject.logger.warn('The dist path is not a subdir of root path, Rsbuild will not empty it.'), rslog_index_js_namespaceObject.logger.warn(`Please set ${index_js_default().yellow('`output.cleanDistPath`')} config manually.`), rslog_index_js_namespaceObject.logger.warn(`Current root path: ${index_js_default().dim(rootPath)}`), void rslog_index_js_namespaceObject.logger.warn(`Current dist path: ${index_js_default().dim(distPath)}`)) : !0 === enable ? {
|
|
2659
2656
|
path: distPath,
|
|
2660
2657
|
keep
|
|
2661
2658
|
} : void 0;
|
|
@@ -2821,7 +2818,7 @@ for(var __webpack_i__ in (()=>{
|
|
|
2821
2818
|
if (cached) return clonePostCSSConfig(await cached);
|
|
2822
2819
|
let { default: postcssrc } = await Promise.resolve().then(__webpack_require__.bind(__webpack_require__, "../../compiled/postcss-load-config/index.js")), promise = postcssrc({}, root).catch((err)=>{
|
|
2823
2820
|
var _err_message;
|
|
2824
|
-
if (null
|
|
2821
|
+
if (null == (_err_message = err.message) ? void 0 : _err_message.includes('No PostCSS Config found')) return {};
|
|
2825
2822
|
throw err;
|
|
2826
2823
|
});
|
|
2827
2824
|
return postcssrcCache.set(root, promise), promise.then((config)=>(postcssrcCache.set(root, config), clonePostCSSConfig(config)));
|
|
@@ -2919,7 +2916,7 @@ for(var __webpack_i__ in (()=>{
|
|
|
2919
2916
|
root: api.context.rootPath,
|
|
2920
2917
|
postcssrcCache
|
|
2921
2918
|
});
|
|
2922
|
-
if ('function' == typeof postcssLoaderOptions.postcssOptions || (null
|
|
2919
|
+
if ('function' == typeof postcssLoaderOptions.postcssOptions || (null == (_postcssLoaderOptions_postcssOptions = postcssLoaderOptions.postcssOptions) || null == (_postcssLoaderOptions_postcssOptions_plugins = _postcssLoaderOptions_postcssOptions.plugins) ? void 0 : _postcssLoaderOptions_postcssOptions_plugins.length)) {
|
|
2923
2920
|
importLoaders++;
|
|
2924
2921
|
let postcssLoaderPath = getCompiledPath('postcss-loader');
|
|
2925
2922
|
updateRules((rule)=>{
|
|
@@ -2983,10 +2980,7 @@ for(var __webpack_i__ in (()=>{
|
|
|
2983
2980
|
let pathKey = Object.keys(value).find((key)=>'path' === key.toLowerCase() && value[key] === process.env[key]);
|
|
2984
2981
|
pathKey && rslog_index_js_namespaceObject.logger.warn(index_js_default().yellow(`[rsbuild:config] The "source.define" option includes an object with the key ${JSON.stringify(pathKey)} under "process.env", indicating potential exposure of all environment variables. This can lead to security risks and should be avoided.`));
|
|
2985
2982
|
};
|
|
2986
|
-
if ('object' == typeof value)
|
|
2987
|
-
check(value);
|
|
2988
|
-
return;
|
|
2989
|
-
}
|
|
2983
|
+
if ('object' == typeof value) return check(value);
|
|
2990
2984
|
if ('string' == typeof value) try {
|
|
2991
2985
|
check(JSON.parse(value));
|
|
2992
2986
|
} catch (error) {}
|
|
@@ -3177,7 +3171,7 @@ for(var __webpack_i__ in (()=>{
|
|
|
3177
3171
|
...override
|
|
3178
3172
|
})), applyTagConfig = (data, tagConfig, compilationHash, entryName)=>{
|
|
3179
3173
|
var _tagConfig_tags;
|
|
3180
|
-
if (!(null
|
|
3174
|
+
if (!(null == (_tagConfig_tags = tagConfig.tags) ? void 0 : _tagConfig_tags.length)) return data;
|
|
3181
3175
|
let fromInjectTags = (tags)=>{
|
|
3182
3176
|
let ret = [];
|
|
3183
3177
|
for (let tag of tags){
|
|
@@ -3260,10 +3254,10 @@ for(var __webpack_i__ in (()=>{
|
|
|
3260
3254
|
compiler.hooks.compilation.tap(this.name, (compilation)=>{
|
|
3261
3255
|
getHTMLPlugin().getCompilationHooks(compilation).alterAssetTagGroups.tapPromise(this.name, async (data)=>{
|
|
3262
3256
|
var _data_plugin_options, _data_plugin_options1;
|
|
3263
|
-
let entryName = null
|
|
3257
|
+
let entryName = null == (_data_plugin_options = data.plugin.options) ? void 0 : _data_plugin_options.entryName;
|
|
3264
3258
|
if (!entryName) return data;
|
|
3265
3259
|
let { headTags, bodyTags } = data, { favicon, tagConfig, templateContent } = this.options[entryName];
|
|
3266
|
-
hasTitle(templateContent) || addTitleTag(headTags, null
|
|
3260
|
+
hasTitle(templateContent) || addTitleTag(headTags, null == (_data_plugin_options1 = data.plugin.options) ? void 0 : _data_plugin_options1.title), favicon && await addFavicon(headTags, favicon, compilation, data.publicPath);
|
|
3267
3261
|
let tags = {
|
|
3268
3262
|
headTags: headTags.map(formatBasicTag),
|
|
3269
3263
|
bodyTags: bodyTags.map(formatBasicTag)
|
|
@@ -3433,7 +3427,7 @@ for(var __webpack_i__ in (()=>{
|
|
|
3433
3427
|
let formattedCrossorigin = !0 === crossorigin ? 'anonymous' : crossorigin;
|
|
3434
3428
|
for (let tag of allTags){
|
|
3435
3429
|
var _tag_attrs, _tag_attrs1;
|
|
3436
|
-
("script" === tag.tag && (null
|
|
3430
|
+
("script" === tag.tag && (null == (_tag_attrs = tag.attrs) ? void 0 : _tag_attrs.src) || 'link' === tag.tag && (null == (_tag_attrs1 = tag.attrs) ? void 0 : _tag_attrs1.rel) === 'stylesheet') && (tag.attrs.crossorigin ??= formattedCrossorigin);
|
|
3437
3431
|
}
|
|
3438
3432
|
}
|
|
3439
3433
|
return {
|
|
@@ -3464,7 +3458,7 @@ for(var __webpack_i__ in (()=>{
|
|
|
3464
3458
|
let inlinedAssets = new Set(), getInlinedScriptTag = (publicPath, tag, compilation, scriptTests, config)=>{
|
|
3465
3459
|
var _tag_attrs;
|
|
3466
3460
|
let { assets } = compilation;
|
|
3467
|
-
if (!((null
|
|
3461
|
+
if (!((null == (_tag_attrs = tag.attrs) ? void 0 : _tag_attrs.src) && 'string' == typeof tag.attrs.src)) return tag;
|
|
3468
3462
|
let { src, ...otherAttrs } = tag.attrs, scriptName = publicPath ? src.replace(publicPath, '') : src, asset = assets[scriptName];
|
|
3469
3463
|
if (null == asset) return tag;
|
|
3470
3464
|
let source = asset.source().toString();
|
|
@@ -3486,7 +3480,7 @@ for(var __webpack_i__ in (()=>{
|
|
|
3486
3480
|
}, getInlinedCSSTag = (publicPath, tag, compilation, styleTests, config)=>{
|
|
3487
3481
|
var _tag_attrs;
|
|
3488
3482
|
let { assets } = compilation;
|
|
3489
|
-
if (!((null
|
|
3483
|
+
if (!((null == (_tag_attrs = tag.attrs) ? void 0 : _tag_attrs.href) && 'string' == typeof tag.attrs.href)) return tag;
|
|
3490
3484
|
let linkName = publicPath ? tag.attrs.href.replace(publicPath, '') : tag.attrs.href, asset = assets[linkName];
|
|
3491
3485
|
if (null == asset) return tag;
|
|
3492
3486
|
let source = asset.source().toString();
|
|
@@ -3565,7 +3559,7 @@ for(var __webpack_i__ in (()=>{
|
|
|
3565
3559
|
}
|
|
3566
3560
|
let entryManifest = {};
|
|
3567
3561
|
assets.size && (entryManifest.assets = Array.from(assets));
|
|
3568
|
-
let htmlPath = null
|
|
3562
|
+
let htmlPath = null == (_files_find = files.find((f)=>f.name === htmlPaths[name])) ? void 0 : _files_find.path;
|
|
3569
3563
|
htmlPath && (entryManifest.html = [
|
|
3570
3564
|
htmlPath
|
|
3571
3565
|
]), initialJS.length && (entryManifest.initial = {
|
|
@@ -3728,7 +3722,7 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
3728
3722
|
];
|
|
3729
3723
|
if (nonce) for (let tag of allTags){
|
|
3730
3724
|
var _tag_attrs, _tag_attrs1;
|
|
3731
|
-
("script" === tag.tag || 'style' === tag.tag || 'link' === tag.tag && (null
|
|
3725
|
+
("script" === tag.tag || 'style' === tag.tag || 'link' === tag.tag && (null == (_tag_attrs = tag.attrs) ? void 0 : _tag_attrs.rel) === 'preload' && (null == (_tag_attrs1 = tag.attrs) ? void 0 : _tag_attrs1.as) === "script") && (tag.attrs ??= {}, tag.attrs.nonce = nonce);
|
|
3732
3726
|
}
|
|
3733
3727
|
return {
|
|
3734
3728
|
headTags,
|
|
@@ -3966,11 +3960,11 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
3966
3960
|
api.modifyBundlerChain(async (chain, { CHAIN_ID, isProd, isServer, environment })=>{
|
|
3967
3961
|
let { distPath, config } = environment, publicPath = function({ isProd, config, context }) {
|
|
3968
3962
|
var _context_devServer, _context_devServer1, _context_devServer2;
|
|
3969
|
-
let { dev, output, server } = config, publicPath = DEFAULT_ASSET_PREFIX, port = (null
|
|
3963
|
+
let { dev, output, server } = config, publicPath = DEFAULT_ASSET_PREFIX, port = (null == (_context_devServer = context.devServer) ? void 0 : _context_devServer.port) || server.port || 3000;
|
|
3970
3964
|
if (isProd) 'string' == typeof output.assetPrefix && (publicPath = output.assetPrefix);
|
|
3971
3965
|
else if ('string' == typeof dev.assetPrefix) publicPath = dev.assetPrefix;
|
|
3972
3966
|
else if (!0 === dev.assetPrefix) {
|
|
3973
|
-
let protocol = (null
|
|
3967
|
+
let protocol = (null == (_context_devServer1 = context.devServer) ? void 0 : _context_devServer1.https) ? 'https' : 'http', hostname = (null == (_context_devServer2 = context.devServer) ? void 0 : _context_devServer2.hostname) || DEFAULT_DEV_HOST;
|
|
3974
3968
|
publicPath = hostname === DEFAULT_DEV_HOST ? `${protocol}://localhost:<port>/` : `${protocol}://${hostname}:<port>/`, server.base && '/' !== server.base && (publicPath = urlJoin(publicPath, server.base));
|
|
3975
3969
|
}
|
|
3976
3970
|
return formatPublicPath(replacePortPlaceholder(publicPath, port));
|
|
@@ -4007,7 +4001,7 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
4007
4001
|
var _rsbuildConfig_performance, _config_performance;
|
|
4008
4002
|
let applyBundleAnalyzeConfig = (config)=>{
|
|
4009
4003
|
var _config_performance;
|
|
4010
|
-
(null
|
|
4004
|
+
(null == (_config_performance = config.performance) ? void 0 : _config_performance.bundleAnalyze) ? config.performance.bundleAnalyze = {
|
|
4011
4005
|
generateStatsFile: !0,
|
|
4012
4006
|
...config.performance.bundleAnalyze || {}
|
|
4013
4007
|
} : (config.performance ??= {}, config.performance.bundleAnalyze = {
|
|
@@ -4015,8 +4009,8 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
4015
4009
|
generateStatsFile: !0
|
|
4016
4010
|
});
|
|
4017
4011
|
};
|
|
4018
|
-
if (null
|
|
4019
|
-
else if (rsbuildConfig.environments) for (let config of Object.values(rsbuildConfig.environments))(null
|
|
4012
|
+
if (null == (_rsbuildConfig_performance = rsbuildConfig.performance) ? void 0 : _rsbuildConfig_performance.profile) applyBundleAnalyzeConfig(rsbuildConfig);
|
|
4013
|
+
else if (rsbuildConfig.environments) for (let config of Object.values(rsbuildConfig.environments))(null == (_config_performance = config.performance) ? void 0 : _config_performance.profile) && applyBundleAnalyzeConfig(config);
|
|
4020
4014
|
}
|
|
4021
4015
|
}), api.modifyBundlerChain((chain, { environment })=>{
|
|
4022
4016
|
let { config } = environment, { profile } = config.performance;
|
|
@@ -4136,10 +4130,10 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
4136
4130
|
if ('all-assets' === includeType) {
|
|
4137
4131
|
var _compilation_assetsInfo;
|
|
4138
4132
|
let licenseAssets = [
|
|
4139
|
-
...(null
|
|
4133
|
+
...(null == (_compilation_assetsInfo = compilation.assetsInfo) ? void 0 : _compilation_assetsInfo.values()) || []
|
|
4140
4134
|
].map((info)=>{
|
|
4141
4135
|
var _info_related;
|
|
4142
|
-
return null
|
|
4136
|
+
return null != (_info_related = info.related) && !!_info_related.license && info.related.license;
|
|
4143
4137
|
}).filter(Boolean);
|
|
4144
4138
|
return [
|
|
4145
4139
|
{
|
|
@@ -4194,14 +4188,11 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
4194
4188
|
}
|
|
4195
4189
|
return links;
|
|
4196
4190
|
}(this.options, this.type, compilation, htmlPluginData, this.HTMLCount), htmlPluginData)), getHTMLPlugin().getHooks(compilation).alterAssetTags.tap(`HTML${upperFirst(this.type)}Plugin`, (htmlPluginData)=>{
|
|
4197
|
-
|
|
4198
|
-
|
|
4199
|
-
htmlPluginData.assetTags.
|
|
4200
|
-
|
|
4201
|
-
|
|
4202
|
-
];
|
|
4203
|
-
}
|
|
4204
|
-
return htmlPluginData;
|
|
4191
|
+
var resourceHints, scripts;
|
|
4192
|
+
return this.resourceHints && (htmlPluginData.assetTags.styles = [
|
|
4193
|
+
...this.options.dedupe ? (resourceHints = this.resourceHints, scripts = htmlPluginData.assetTags.scripts, resourceHints.filter((resourceHint)=>!scripts.find((script)=>script.attributes.src === resourceHint.attributes.href))) : this.resourceHints,
|
|
4194
|
+
...htmlPluginData.assetTags.styles
|
|
4195
|
+
]), htmlPluginData;
|
|
4205
4196
|
});
|
|
4206
4197
|
});
|
|
4207
4198
|
}
|
|
@@ -4262,11 +4253,11 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
4262
4253
|
if ('true' !== process.env.RSDOCTOR) return;
|
|
4263
4254
|
let isRspack = 'rspack' === api.context.bundlerType, pluginName = isRspack ? 'RsdoctorRspackPlugin' : 'RsdoctorWebpackPlugin', isRsdoctorPlugin = (plugin)=>{
|
|
4264
4255
|
var _plugin_constructor;
|
|
4265
|
-
return (null == plugin ? void 0 : plugin.isRsdoctorPlugin) === !0 || (null == plugin || null
|
|
4256
|
+
return (null == plugin ? void 0 : plugin.isRsdoctorPlugin) === !0 || (null == plugin || null == (_plugin_constructor = plugin.constructor) ? void 0 : _plugin_constructor.name) === pluginName;
|
|
4266
4257
|
};
|
|
4267
4258
|
for (let config of bundlerConfigs){
|
|
4268
4259
|
var _config_plugins;
|
|
4269
|
-
if (null
|
|
4260
|
+
if (null == (_config_plugins = config.plugins) ? void 0 : _config_plugins.some((plugin)=>isRsdoctorPlugin(plugin))) return;
|
|
4270
4261
|
}
|
|
4271
4262
|
let packageName = isRspack ? '@rsdoctor/rspack-plugin' : '@rsdoctor/webpack-plugin';
|
|
4272
4263
|
try {
|
|
@@ -4296,10 +4287,7 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
4296
4287
|
var external_node_inspector_default = __webpack_require__.n(external_node_inspector_namespaceObject);
|
|
4297
4288
|
let stopProfiler = (output, profileSession)=>{
|
|
4298
4289
|
profileSession && profileSession.post('Profiler.stop', (error, param)=>{
|
|
4299
|
-
if (error)
|
|
4300
|
-
rslog_index_js_namespaceObject.logger.error('Failed to generate JavaScript CPU profile:', error);
|
|
4301
|
-
return;
|
|
4302
|
-
}
|
|
4290
|
+
if (error) return void rslog_index_js_namespaceObject.logger.error('Failed to generate JavaScript CPU profile:', error);
|
|
4303
4291
|
external_node_fs_default().writeFileSync(output, JSON.stringify(param.profile));
|
|
4304
4292
|
});
|
|
4305
4293
|
}, pluginRspackProfile = ()=>({
|
|
@@ -4308,7 +4296,7 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
4308
4296
|
var _process_env_RSPACK_PROFILE;
|
|
4309
4297
|
let profileSession;
|
|
4310
4298
|
if ('webpack' === api.context.bundlerType) return;
|
|
4311
|
-
let RSPACK_PROFILE = null
|
|
4299
|
+
let RSPACK_PROFILE = null == (_process_env_RSPACK_PROFILE = process.env.RSPACK_PROFILE) ? void 0 : _process_env_RSPACK_PROFILE.toUpperCase();
|
|
4312
4300
|
if (!RSPACK_PROFILE) return;
|
|
4313
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 = async ()=>{
|
|
4314
4302
|
let profileDir = external_node_path_default().join(api.context.distPath, profileDirName), traceFilePath = external_node_path_default().join(profileDir, 'trace.json');
|
|
@@ -4342,7 +4330,7 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
4342
4330
|
if (config.server.open) {
|
|
4343
4331
|
var _api_context_devServer;
|
|
4344
4332
|
open_open({
|
|
4345
|
-
https: null
|
|
4333
|
+
https: null == (_api_context_devServer = api.context.devServer) ? void 0 : _api_context_devServer.https,
|
|
4346
4334
|
port,
|
|
4347
4335
|
routes,
|
|
4348
4336
|
config
|
|
@@ -4483,7 +4471,7 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
4483
4471
|
return;
|
|
4484
4472
|
}
|
|
4485
4473
|
let { config } = environment, defaultConfig = {
|
|
4486
|
-
chunks: (null
|
|
4474
|
+
chunks: (null == (_config_moduleFederation = config.moduleFederation) || null == (_config_moduleFederation_options = _config_moduleFederation.options) ? void 0 : _config_moduleFederation_options.exposes) ? 'async' : 'all',
|
|
4487
4475
|
cacheGroups: {}
|
|
4488
4476
|
};
|
|
4489
4477
|
'webpack' === api.context.bundlerType && (defaultConfig.enforceSizeThreshold = 50000);
|
|
@@ -4646,21 +4634,15 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
4646
4634
|
api.modifyBundlerChain({
|
|
4647
4635
|
order: 'pre',
|
|
4648
4636
|
handler: async (chain, { target, environment })=>{
|
|
4649
|
-
if ('node' === target)
|
|
4650
|
-
chain.target('node');
|
|
4651
|
-
return;
|
|
4652
|
-
}
|
|
4637
|
+
if ('node' === target) return void chain.target('node');
|
|
4653
4638
|
let { browserslist } = environment, isDefaultBrowserslist = browserslist.join(',') === DEFAULT_WEB_BROWSERSLIST.join(',');
|
|
4654
|
-
if ('web-worker' === target)
|
|
4655
|
-
|
|
4656
|
-
|
|
4657
|
-
|
|
4658
|
-
|
|
4659
|
-
|
|
4660
|
-
|
|
4661
|
-
]);
|
|
4662
|
-
return;
|
|
4663
|
-
}
|
|
4639
|
+
if ('web-worker' === target) return void chain.target(isDefaultBrowserslist ? [
|
|
4640
|
+
'webworker',
|
|
4641
|
+
'es2017'
|
|
4642
|
+
] : [
|
|
4643
|
+
'webworker',
|
|
4644
|
+
'es5'
|
|
4645
|
+
]);
|
|
4664
4646
|
let esQuery = isDefaultBrowserslist ? 'es2017' : `browserslist:${browserslist.join(',')}`;
|
|
4665
4647
|
chain.target([
|
|
4666
4648
|
'web',
|
|
@@ -4732,7 +4714,7 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
4732
4714
|
rspackConfig,
|
|
4733
4715
|
utils
|
|
4734
4716
|
]
|
|
4735
|
-
}), (null
|
|
4717
|
+
}), (null == (_utils_environment_config_tools = utils.environment.config.tools) ? void 0 : _utils_environment_config_tools.rspack) && (currentConfig = await reduceConfigsAsyncWithContext({
|
|
4736
4718
|
initial: currentConfig,
|
|
4737
4719
|
config: utils.environment.config.tools.rspack,
|
|
4738
4720
|
ctx: utils,
|
|
@@ -4953,7 +4935,7 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
4953
4935
|
envMode: commonOpts.envMode,
|
|
4954
4936
|
loader: commonOpts.configLoader
|
|
4955
4937
|
});
|
|
4956
|
-
return config.dev ||= {}, config.source ||= {}, config.server ||= {}, commonOpts.base && (config.server.base = commonOpts.base), commonOpts.root && (config.root = root), commonOpts.mode && (config.mode = commonOpts.mode), !commonOpts.open || (null
|
|
4938
|
+
return config.dev ||= {}, config.source ||= {}, config.server ||= {}, commonOpts.base && (config.server.base = commonOpts.base), commonOpts.root && (config.root = root), commonOpts.mode && (config.mode = commonOpts.mode), !commonOpts.open || (null == (_config_server = config.server) ? void 0 : _config_server.open) || (config.server.open = commonOpts.open), commonOpts.host && (config.server.host = commonOpts.host), commonOpts.port && (config.server.port = commonOpts.port), void 0 === config.dev.cliShortcuts && (config.dev.cliShortcuts = !0), filePath && (config.dev.watchFiles = [
|
|
4957
4939
|
...config.dev.watchFiles ? castArray(config.dev.watchFiles) : [],
|
|
4958
4940
|
{
|
|
4959
4941
|
paths: filePath,
|
|
@@ -4977,7 +4959,7 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
4977
4959
|
var _config_dev;
|
|
4978
4960
|
if ('dev' !== rsbuild.context.action && !isBuildWatch) return;
|
|
4979
4961
|
let files = [], config = rsbuild.getNormalizedConfig();
|
|
4980
|
-
if (null
|
|
4962
|
+
if (null == (_config_dev = config.dev) ? void 0 : _config_dev.watchFiles) for (let watchFilesConfig of castArray(config.dev.watchFiles)){
|
|
4981
4963
|
if ('reload-server' !== watchFilesConfig.type) continue;
|
|
4982
4964
|
let paths = castArray(watchFilesConfig.paths);
|
|
4983
4965
|
watchFilesConfig.options ? watchFilesForRestart({
|
|
@@ -5158,10 +5140,7 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
5158
5140
|
for (let shortcut of shortcuts)message += ` ${shortcut.description}\n`;
|
|
5159
5141
|
rslog_index_js_namespaceObject.logger.log(message);
|
|
5160
5142
|
}
|
|
5161
|
-
for (let shortcut of shortcuts)if (input === shortcut.key)
|
|
5162
|
-
shortcut.action();
|
|
5163
|
-
return;
|
|
5164
|
-
}
|
|
5143
|
+
for (let shortcut of shortcuts)if (input === shortcut.key) return void shortcut.action();
|
|
5165
5144
|
}), ()=>{
|
|
5166
5145
|
rl.close();
|
|
5167
5146
|
};
|
|
@@ -5285,7 +5264,7 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
5285
5264
|
let { default: ws } = await Promise.resolve().then(__webpack_require__.bind(__webpack_require__, "../../compiled/ws/index.js"));
|
|
5286
5265
|
this.wsServer = new ws.Server({
|
|
5287
5266
|
noServer: !0,
|
|
5288
|
-
path: null
|
|
5267
|
+
path: null == (_this_options_client = this.options.client) ? void 0 : _this_options_client.path
|
|
5289
5268
|
}), this.wsServer.on('error', (err)=>{
|
|
5290
5269
|
rslog_index_js_namespaceObject.logger.error(err);
|
|
5291
5270
|
}), this.heartbeatTimer = setTimeout(this.checkSockets, 30000).unref(), this.wsServer.on('connection', (socket, req)=>{
|
|
@@ -5611,17 +5590,14 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
5611
5590
|
let { devConfig, serverConfig, publicPaths } = this, clientPaths = function(devConfig) {
|
|
5612
5591
|
var _devConfig_client;
|
|
5613
5592
|
let clientPaths = [];
|
|
5614
|
-
return (devConfig.hmr || devConfig.liveReload) && (clientPaths.push(compilationManager_require.resolve('@rsbuild/core/client/hmr')), (null
|
|
5593
|
+
return (devConfig.hmr || devConfig.liveReload) && (clientPaths.push(compilationManager_require.resolve('@rsbuild/core/client/hmr')), (null == (_devConfig_client = devConfig.client) ? void 0 : _devConfig_client.overlay) && clientPaths.push(`${compilationManager_require.resolve('@rsbuild/core/client/overlay')}`)), clientPaths;
|
|
5615
5594
|
}(devConfig), middleware = await getCompilationMiddleware(this.compiler, {
|
|
5616
5595
|
callbacks: {
|
|
5617
5596
|
onInvalid: (compilationId, fileName)=>{
|
|
5618
|
-
if ('string' == typeof fileName && HTML_REGEX.test(fileName)) {
|
|
5619
|
-
|
|
5620
|
-
|
|
5621
|
-
|
|
5622
|
-
});
|
|
5623
|
-
return;
|
|
5624
|
-
}
|
|
5597
|
+
if ('string' == typeof fileName && HTML_REGEX.test(fileName)) return void this.socketServer.sockWrite({
|
|
5598
|
+
type: 'static-changed',
|
|
5599
|
+
compilationId
|
|
5600
|
+
});
|
|
5625
5601
|
this.socketServer.sockWrite({
|
|
5626
5602
|
type: 'invalid',
|
|
5627
5603
|
compilationId
|
|
@@ -5654,10 +5630,7 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
5654
5630
|
return void 0 === size || Number(size) > 1024;
|
|
5655
5631
|
}, gzipMiddleware = ({ level = external_node_zlib_default().constants.Z_BEST_SPEED } = {})=>(req, res, next)=>{
|
|
5656
5632
|
let gzip, writeHeadStatus, accept = req.headers['accept-encoding'], encoding = 'string' == typeof accept && ENCODING_REGEX.test(accept);
|
|
5657
|
-
if ('HEAD' === req.method || !encoding)
|
|
5658
|
-
next();
|
|
5659
|
-
return;
|
|
5660
|
-
}
|
|
5633
|
+
if ('HEAD' === req.method || !encoding) return void next();
|
|
5661
5634
|
let started = !1, { end, write, on, writeHead } = res, listeners = [], start = ()=>{
|
|
5662
5635
|
if (!started) {
|
|
5663
5636
|
if (started = !0, shouldCompress(res)) for (let listener of (res.setHeader('Content-Encoding', 'gzip'), res.removeHeader('Content-Length'), (gzip = external_node_zlib_default().createGzip({
|
|
@@ -5729,7 +5702,7 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
5729
5702
|
}), res.end();
|
|
5730
5703
|
return;
|
|
5731
5704
|
}
|
|
5732
|
-
if (null
|
|
5705
|
+
if (null == (_req_headers_accept = req.headers.accept) ? void 0 : _req_headers_accept.includes('text/html')) {
|
|
5733
5706
|
res.writeHead(404, {
|
|
5734
5707
|
'Content-Type': 'text/html'
|
|
5735
5708
|
}), res.end(`The server is configured with a base URL of ${base} - did you mean to visit <a href="${redirectPath}">${redirectPath}</a> instead?`);
|
|
@@ -5880,7 +5853,7 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
5880
5853
|
environments
|
|
5881
5854
|
})), compilationManager && (middlewares.push(compilationManager.middleware), upgradeEvents.push(compilationManager.socketServer.upgrade), middlewares.push((req, res, next)=>{
|
|
5882
5855
|
var _req_url;
|
|
5883
|
-
(null
|
|
5856
|
+
(null == (_req_url = req.url) ? void 0 : _req_url.endsWith('.hot-update.json')) && 'OPTIONS' !== req.method ? (res.statusCode = 404, res.end()) : next();
|
|
5884
5857
|
})), compilationManager && middlewares.push(getHtmlCompletionMiddleware({
|
|
5885
5858
|
compilationManager,
|
|
5886
5859
|
distPath: context.distPath
|
|
@@ -6069,7 +6042,7 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
6069
6042
|
createRunner() {
|
|
6070
6043
|
var _this__options_compilerOptions_experiments;
|
|
6071
6044
|
super.createRunner(), this.requirers.set('cjs', this.getRequire()), this.requirers.set('esm', this.createEsmRequirer());
|
|
6072
|
-
let outputModule = null
|
|
6045
|
+
let outputModule = null == (_this__options_compilerOptions_experiments = this._options.compilerOptions.experiments) ? void 0 : _this__options_compilerOptions_experiments.outputModule;
|
|
6073
6046
|
this.requirers.set('entry', (currentDirectory, modulePath, context)=>{
|
|
6074
6047
|
let file = this.getFile(modulePath, currentDirectory);
|
|
6075
6048
|
return file ? outputModule && !file.path.endsWith('.cjs') ? this.requirers.get('esm')(currentDirectory, modulePath, {
|
|
@@ -6144,7 +6117,7 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
6144
6117
|
let { chunks: entryChunks = [] } = entrypoints[entryName], files = entryChunks.reduce((prev, entryChunkName)=>{
|
|
6145
6118
|
let chunk = null == chunks ? void 0 : chunks.find((chunk)=>{
|
|
6146
6119
|
var _chunk_names;
|
|
6147
|
-
return chunk.entry && (null
|
|
6120
|
+
return chunk.entry && (null == (_chunk_names = chunk.names) ? void 0 : _chunk_names.includes(String(entryChunkName)));
|
|
6148
6121
|
});
|
|
6149
6122
|
return (null == chunk ? void 0 : chunk.files) ? prev.concat(chunk.files.filter((file)=>!file.endsWith('.css'))) : prev;
|
|
6150
6123
|
}, []);
|
|
@@ -6428,7 +6401,7 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
6428
6401
|
}, hasErrors = stats.hasErrors();
|
|
6429
6402
|
if (!hasErrors) {
|
|
6430
6403
|
var _statsJson_children;
|
|
6431
|
-
isMultiCompiler && (null
|
|
6404
|
+
isMultiCompiler && (null == (_statsJson_children = statsJson.children) ? void 0 : _statsJson_children.length) ? statsJson.children.forEach((c, index)=>{
|
|
6432
6405
|
printTime(c, index);
|
|
6433
6406
|
}) : printTime(statsJson, 0);
|
|
6434
6407
|
}
|
|
@@ -6738,11 +6711,11 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
6738
6711
|
let { moduleFederation } = config;
|
|
6739
6712
|
if (api.isPluginExists('rsbuild:module-federation-enhanced') && (config.server ||= {}, config.server.cors = !0), (null == moduleFederation ? void 0 : moduleFederation.options) && moduleFederation.options.exposes) {
|
|
6740
6713
|
var _config_server, _config_dev_client, _originalConfig_dev, _config_server1;
|
|
6741
|
-
config.dev ||= {}, config.server ||= {}, config.server.cors = !0, (null
|
|
6714
|
+
config.dev ||= {}, config.server ||= {}, config.server.cors = !0, (null == (_config_server = config.server) ? void 0 : _config_server.port) && !(null == (_config_dev_client = config.dev.client) ? void 0 : _config_dev_client.port) && (config.dev.client ||= {}, config.dev.client.port = config.server.port), (null == (_originalConfig_dev = api.getRsbuildConfig('original').dev) ? void 0 : _originalConfig_dev.assetPrefix) === void 0 && config.dev.assetPrefix === (null == (_config_server1 = config.server) ? void 0 : _config_server1.base) && (config.dev.assetPrefix = !0);
|
|
6742
6715
|
}
|
|
6743
6716
|
}), api.modifyEnvironmentConfig((config)=>{
|
|
6744
6717
|
var _config_moduleFederation, _config_performance_chunkSplit, _config_performance;
|
|
6745
|
-
(null
|
|
6718
|
+
(null == (_config_moduleFederation = config.moduleFederation) ? void 0 : _config_moduleFederation.options) && ((null == (_config_performance = config.performance) || null == (_config_performance_chunkSplit = _config_performance.chunkSplit) ? void 0 : _config_performance_chunkSplit.strategy) === 'split-by-experience' && (config.performance.chunkSplit = {
|
|
6746
6719
|
...config.performance.chunkSplit,
|
|
6747
6720
|
strategy: 'custom'
|
|
6748
6721
|
}), config.source.include = [
|
|
@@ -6752,7 +6725,7 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
6752
6725
|
}), api.modifyBundlerChain(async (chain, { CHAIN_ID, target, environment })=>{
|
|
6753
6726
|
var _config_moduleFederation;
|
|
6754
6727
|
let { config } = environment;
|
|
6755
|
-
if (!(null
|
|
6728
|
+
if (!(null == (_config_moduleFederation = config.moduleFederation) ? void 0 : _config_moduleFederation.options) || 'web' !== target) return;
|
|
6756
6729
|
let { options } = config.moduleFederation;
|
|
6757
6730
|
chain.plugin(CHAIN_ID.PLUGIN.MODULE_FEDERATION).use(core_namespaceObject.rspack.container.ModuleFederationPlugin, [
|
|
6758
6731
|
options
|
|
@@ -6782,7 +6755,7 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
6782
6755
|
paths: envs1.filePaths,
|
|
6783
6756
|
type: 'reload-server'
|
|
6784
6757
|
}
|
|
6785
|
-
], null
|
|
6758
|
+
], null == (_config_performance = config1.performance) ? void 0 : _config_performance.buildCache))) {
|
|
6786
6759
|
let { buildCache } = config1.performance;
|
|
6787
6760
|
!0 === buildCache ? config1.performance.buildCache = {
|
|
6788
6761
|
buildDependencies: envs1.filePaths
|
|
@@ -7443,11 +7416,11 @@ ${section.body}` : section.body).join("\n\n"));
|
|
|
7443
7416
|
}
|
|
7444
7417
|
process.title = 'rsbuild-node';
|
|
7445
7418
|
let { npm_execpath } = process.env;
|
|
7446
|
-
(!npm_execpath || npm_execpath.includes('npx-cli.js') || npm_execpath.includes('.bun')) && console.log(), rslog_index_js_namespaceObject.logger.greet(` Rsbuild v1.3.
|
|
7419
|
+
(!npm_execpath || npm_execpath.includes('npx-cli.js') || npm_execpath.includes('.bun')) && console.log(), rslog_index_js_namespaceObject.logger.greet(` Rsbuild v1.3.7\n`);
|
|
7447
7420
|
try {
|
|
7448
7421
|
!function() {
|
|
7449
7422
|
let cli = cac_dist('rsbuild');
|
|
7450
|
-
cli.help(), cli.version("1.3.
|
|
7423
|
+
cli.help(), cli.version("1.3.7"), applyCommonOptions(cli);
|
|
7451
7424
|
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');
|
|
7452
7425
|
applyServerOptions(devCommand), applyServerOptions(previewCommand), devCommand.action(async (options)=>{
|
|
7453
7426
|
try {
|
|
@@ -7498,7 +7471,7 @@ ${section.body}` : section.body).join("\n\n"));
|
|
|
7498
7471
|
rslog_index_js_namespaceObject.logger.error('Failed to start Rsbuild CLI.'), rslog_index_js_namespaceObject.logger.error(err);
|
|
7499
7472
|
}
|
|
7500
7473
|
}
|
|
7501
|
-
let
|
|
7474
|
+
let src_version = "1.3.7";
|
|
7502
7475
|
})(), 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 === [
|
|
7503
7476
|
"PLUGIN_CSS_NAME",
|
|
7504
7477
|
"PLUGIN_SWC_NAME",
|