@rsbuild/core 1.7.0-beta.2 → 1.7.1
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 +2 -8101
- package/compiled/html-rspack-plugin/index.js +14 -14
- package/compiled/memfs/index.js +1 -6145
- package/compiled/postcss/index.js +1 -6058
- package/compiled/postcss-loader/index.js +6 -6
- package/compiled/rspack-manifest-plugin/index.js +4 -4
- package/dist/131.js +26 -71
- package/dist/index.cjs +26 -71
- package/dist-types/server/overlay.d.ts +1 -0
- package/dist-types/types/config.d.ts +5 -5
- package/package.json +4 -4
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
(() => {
|
|
2
2
|
"use strict";
|
|
3
3
|
var __webpack_modules__ = {
|
|
4
|
-
|
|
5
|
-
module.exports = __nccwpck_require__(
|
|
4
|
+
593: (module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
5
|
+
module.exports = __nccwpck_require__(451)["default"];
|
|
6
6
|
},
|
|
7
|
-
|
|
7
|
+
451: (__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__(574);
|
|
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
|
+
574: (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__(593);
|
|
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
|
+
170: (__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
|
+
163: (__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__(170);
|
|
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__(163);
|
|
331
331
|
Object.defineProperty(exports, "getCompilerHooks", {
|
|
332
332
|
enumerable: true,
|
|
333
333
|
get: function () {
|
package/dist/131.js
CHANGED
|
@@ -2661,55 +2661,8 @@ function formatStatsError(stats, root, level = 'error') {
|
|
|
2661
2661
|
if (!message.includes("Can't resolve")) return message;
|
|
2662
2662
|
let matchArray = stripVTControlCharacters(message).match(/Can't resolve '(\w+)'/);
|
|
2663
2663
|
if (!matchArray) return message;
|
|
2664
|
-
let moduleName = matchArray[1]
|
|
2665
|
-
|
|
2666
|
-
'buffer',
|
|
2667
|
-
'child_process',
|
|
2668
|
-
'cluster',
|
|
2669
|
-
'console',
|
|
2670
|
-
'constants',
|
|
2671
|
-
'crypto',
|
|
2672
|
-
'dgram',
|
|
2673
|
-
'diagnostics_channel',
|
|
2674
|
-
'dns',
|
|
2675
|
-
'domain',
|
|
2676
|
-
'events',
|
|
2677
|
-
'fs',
|
|
2678
|
-
'http',
|
|
2679
|
-
'http2',
|
|
2680
|
-
'https',
|
|
2681
|
-
'inspector',
|
|
2682
|
-
'module',
|
|
2683
|
-
'net',
|
|
2684
|
-
'os',
|
|
2685
|
-
'path',
|
|
2686
|
-
'perf_hooks',
|
|
2687
|
-
'process',
|
|
2688
|
-
'punycode',
|
|
2689
|
-
'querystring',
|
|
2690
|
-
'readline',
|
|
2691
|
-
'repl',
|
|
2692
|
-
'stream',
|
|
2693
|
-
'string_decoder',
|
|
2694
|
-
'sys',
|
|
2695
|
-
'timers',
|
|
2696
|
-
'tls',
|
|
2697
|
-
'trace_events',
|
|
2698
|
-
'tty',
|
|
2699
|
-
'url',
|
|
2700
|
-
'util',
|
|
2701
|
-
'v8',
|
|
2702
|
-
'vm',
|
|
2703
|
-
'wasi',
|
|
2704
|
-
'worker_threads',
|
|
2705
|
-
'zlib',
|
|
2706
|
-
'_stream_duplex',
|
|
2707
|
-
'_stream_passthrough',
|
|
2708
|
-
'_stream_readable',
|
|
2709
|
-
'_stream_transform',
|
|
2710
|
-
'_stream_writable'
|
|
2711
|
-
]);
|
|
2712
|
-
return moduleName && nodeBuiltins.has(moduleName) ? getTips(moduleName) : message;
|
|
2664
|
+
let moduleName = matchArray[1];
|
|
2665
|
+
return moduleName && external_node_module_.builtinModules.includes(moduleName) ? getTips(moduleName) : message;
|
|
2713
2666
|
})(message = hintUnknownFiles(message)))).split('\n');
|
|
2714
2667
|
return (message = (lines = lines.filter((line, index, arr)=>0 === index || '' !== line.trim() || line.trim() !== arr[index - 1].trim())).join('\n')).trim();
|
|
2715
2668
|
}
|
|
@@ -3036,7 +2989,7 @@ let OVERRIDE_PATHS = new Set([
|
|
|
3036
2989
|
html: {
|
|
3037
2990
|
meta: {
|
|
3038
2991
|
charset: {
|
|
3039
|
-
charset: '
|
|
2992
|
+
charset: 'utf-8'
|
|
3040
2993
|
},
|
|
3041
2994
|
viewport: 'width=device-width, initial-scale=1.0'
|
|
3042
2995
|
},
|
|
@@ -3383,15 +3336,9 @@ function initPluginAPI({ context, pluginManager }) {
|
|
|
3383
3336
|
return getNormalizedConfig();
|
|
3384
3337
|
}
|
|
3385
3338
|
throw Error(`${color.dim('[rsbuild]')} ${color.yellow('getRsbuildConfig')} get an invalid type param.`);
|
|
3386
|
-
}, exposed =
|
|
3387
|
-
exposed.
|
|
3388
|
-
|
|
3389
|
-
api
|
|
3390
|
-
});
|
|
3391
|
-
}, useExposed = (id)=>{
|
|
3392
|
-
let matched = exposed.find((item)=>item.id === id);
|
|
3393
|
-
if (matched) return matched.api;
|
|
3394
|
-
}, transformId = 0, transformer = {}, processAssetsFns = [], resolveFns = [];
|
|
3339
|
+
}, exposed = new Map(), expose = (id, api)=>{
|
|
3340
|
+
exposed.set(id, api);
|
|
3341
|
+
}, useExposed = (id)=>exposed.get(id), transformId = 0, transformer = {}, processAssetsFns = [], resolveFns = [];
|
|
3395
3342
|
hooks.modifyBundlerChain.tap((chain, { target, environment })=>{
|
|
3396
3343
|
let pluginName = 'RsbuildCorePlugin';
|
|
3397
3344
|
chain.plugin(pluginName).use(class {
|
|
@@ -3609,7 +3556,7 @@ function createPublicContext(context) {
|
|
|
3609
3556
|
async function createContext(options, userConfig) {
|
|
3610
3557
|
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';
|
|
3611
3558
|
return {
|
|
3612
|
-
version: "1.7.
|
|
3559
|
+
version: "1.7.1",
|
|
3613
3560
|
rootPath,
|
|
3614
3561
|
distPath: '',
|
|
3615
3562
|
cachePath,
|
|
@@ -4938,7 +4885,7 @@ async function getTemplate(entryName, config, rootPath) {
|
|
|
4938
4885
|
let mountId;
|
|
4939
4886
|
return {
|
|
4940
4887
|
templatePath: void 0,
|
|
4941
|
-
templateContent: (mountId = config.html.mountId, `<!
|
|
4888
|
+
templateContent: (mountId = config.html.mountId, `<!DOCTYPE html><html><head></head><body><div id="${mountId}"></div></body></html>`)
|
|
4942
4889
|
};
|
|
4943
4890
|
}
|
|
4944
4891
|
let absolutePath = (0, external_node_path_.isAbsolute)(templatePath) ? templatePath : external_node_path_.default.join(rootPath, templatePath);
|
|
@@ -5665,11 +5612,9 @@ function getDefaultSwcConfig({ browserslist, cacheRoot, config, isProd }) {
|
|
|
5665
5612
|
env: {
|
|
5666
5613
|
targets: browserslist
|
|
5667
5614
|
},
|
|
5668
|
-
|
|
5669
|
-
|
|
5670
|
-
|
|
5671
|
-
exportedEnum: isProd
|
|
5672
|
-
}
|
|
5615
|
+
collectTypeScriptInfo: {
|
|
5616
|
+
typeExports: !0,
|
|
5617
|
+
exportedEnum: isProd
|
|
5673
5618
|
}
|
|
5674
5619
|
};
|
|
5675
5620
|
}
|
|
@@ -6345,6 +6290,16 @@ function ansiHTML(text) {
|
|
|
6345
6290
|
});
|
|
6346
6291
|
return ansiCodes.length > 0 && (ret += Array(ansiCodes.length + 1).join('</span>')), ret;
|
|
6347
6292
|
}
|
|
6293
|
+
function formatDisplayPath(filePath, isAbsolute, root) {
|
|
6294
|
+
if (NODE_MODULES_REGEX.test(filePath)) for (let needle of [
|
|
6295
|
+
'/node_modules/',
|
|
6296
|
+
'\\node_modules\\'
|
|
6297
|
+
]){
|
|
6298
|
+
let index = filePath.lastIndexOf(needle);
|
|
6299
|
+
if (-1 !== index) return filePath.slice(index + 1);
|
|
6300
|
+
}
|
|
6301
|
+
return root && isAbsolute ? toRelativePath(root, filePath) : filePath;
|
|
6302
|
+
}
|
|
6348
6303
|
function convertLinksInHtml(text, root) {
|
|
6349
6304
|
let PATH_RE = /(?:\.\.?[/\\]|(file:\/\/\/)?[a-zA-Z]:\\|(file:\/\/)?\/|[A-Za-z0-9._-]+[/\\])[^\s:]*:\d+:\d+/g, URL_RE = /(https?:\/\/(?:[\w-]+\.)+[a-z0-9](?:[\w-.~:/?#[\]@!$&'*+,;=])*)/gi, NODE_INTERNAL_RE = /node:internal[/\\]/, RSPACK_RUNTIME_RE = /webpack\/runtime\//, FILE_URI_WINDOWS_RE = /^file:\/\/\/([A-Za-z]:)/, FILE_URI_UNIX_RE = /^file:\/\//;
|
|
6350
6305
|
return text.split('\n').map((line)=>{
|
|
@@ -6354,8 +6309,8 @@ function convertLinksInHtml(text, root) {
|
|
|
6354
6309
|
if (!file.startsWith('file://')) return file;
|
|
6355
6310
|
let windows = file.replace(FILE_URI_WINDOWS_RE, '$1');
|
|
6356
6311
|
return windows !== file ? windows : file.replace(FILE_URI_UNIX_RE, '');
|
|
6357
|
-
})(file)).includes('</span>') && !file.includes('<span'), filePath = hasClosingSpan ? file.replace('</span>', '') : file, isAbsolute = external_node_path_.default.isAbsolute(filePath), absolutePath = root && !isAbsolute ? external_node_path_.default.join(root, filePath) : filePath,
|
|
6358
|
-
return `<a class="file-link" data-file="${absolutePath}">${
|
|
6312
|
+
})(file)).includes('</span>') && !file.includes('<span'), filePath = hasClosingSpan ? file.replace('</span>', '') : file, isAbsolute = external_node_path_.default.isAbsolute(filePath), absolutePath = root && !isAbsolute ? external_node_path_.default.join(root, filePath) : filePath, displayPath = formatDisplayPath(filePath, isAbsolute, root);
|
|
6313
|
+
return `<a class="file-link" data-file="${absolutePath}">${displayPath}</a>${hasClosingSpan ? '</span>' : ''}`;
|
|
6359
6314
|
});
|
|
6360
6315
|
return replacedLine.replace(URL_RE, (url)=>`<a class="url-link" href="${url}" target="_blank" rel="noopener noreferrer">${url}</a>`);
|
|
6361
6316
|
}).join('\n');
|
|
@@ -9243,7 +9198,7 @@ let applyServerOptions = (command)=>{
|
|
|
9243
9198
|
};
|
|
9244
9199
|
function setupCommands() {
|
|
9245
9200
|
let cli = ((name = "")=>new CAC(name))('rsbuild');
|
|
9246
|
-
cli.version("1.7.
|
|
9201
|
+
cli.version("1.7.1"), 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)', {
|
|
9247
9202
|
default: 'auto'
|
|
9248
9203
|
}).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', {
|
|
9249
9204
|
type: [
|
|
@@ -9312,7 +9267,7 @@ function initNodeEnv() {
|
|
|
9312
9267
|
}
|
|
9313
9268
|
function showGreeting() {
|
|
9314
9269
|
let { npm_execpath, npm_lifecycle_event, NODE_RUN_SCRIPT_NAME } = process.env, isBun = npm_execpath?.includes('.bun');
|
|
9315
|
-
src_logger.greet(`${'npx' === npm_lifecycle_event || isBun || NODE_RUN_SCRIPT_NAME ? '\n' : ''}Rsbuild v1.7.
|
|
9270
|
+
src_logger.greet(`${'npx' === npm_lifecycle_event || isBun || NODE_RUN_SCRIPT_NAME ? '\n' : ''}Rsbuild v1.7.1\n`);
|
|
9316
9271
|
}
|
|
9317
9272
|
function setupLogLevel() {
|
|
9318
9273
|
let logLevelIndex = process.argv.findIndex((item)=>'--log-level' === item || '--logLevel' === item);
|
|
@@ -9333,5 +9288,5 @@ function runCLI() {
|
|
|
9333
9288
|
src_logger.error('Failed to start Rsbuild CLI.'), src_logger.error(err);
|
|
9334
9289
|
}
|
|
9335
9290
|
}
|
|
9336
|
-
let src_version = "1.7.
|
|
9291
|
+
let src_version = "1.7.1";
|
|
9337
9292
|
export { PLUGIN_CSS_NAME, PLUGIN_SWC_NAME, createRsbuild, defaultAllowedOrigins, defineConfig, ensureAssetPrefix, external_node_util_promisify, loadConfig_loadConfig as loadConfig, loadEnv, mergeRsbuildConfig, node_fs, node_os, node_process, rspack_rspack as rspack, runCLI, src_logger as logger, src_version as version };
|
package/dist/index.cjs
CHANGED
|
@@ -2769,55 +2769,8 @@ ${section.body}` : section.body).join("\n\n"));
|
|
|
2769
2769
|
if (!message.includes("Can't resolve")) return message;
|
|
2770
2770
|
let matchArray = (0, external_node_util_.stripVTControlCharacters)(message).match(/Can't resolve '(\w+)'/);
|
|
2771
2771
|
if (!matchArray) return message;
|
|
2772
|
-
let moduleName = matchArray[1]
|
|
2773
|
-
|
|
2774
|
-
'buffer',
|
|
2775
|
-
'child_process',
|
|
2776
|
-
'cluster',
|
|
2777
|
-
'console',
|
|
2778
|
-
'constants',
|
|
2779
|
-
'crypto',
|
|
2780
|
-
'dgram',
|
|
2781
|
-
'diagnostics_channel',
|
|
2782
|
-
'dns',
|
|
2783
|
-
'domain',
|
|
2784
|
-
'events',
|
|
2785
|
-
'fs',
|
|
2786
|
-
'http',
|
|
2787
|
-
'http2',
|
|
2788
|
-
'https',
|
|
2789
|
-
'inspector',
|
|
2790
|
-
'module',
|
|
2791
|
-
'net',
|
|
2792
|
-
'os',
|
|
2793
|
-
'path',
|
|
2794
|
-
'perf_hooks',
|
|
2795
|
-
'process',
|
|
2796
|
-
'punycode',
|
|
2797
|
-
'querystring',
|
|
2798
|
-
'readline',
|
|
2799
|
-
'repl',
|
|
2800
|
-
'stream',
|
|
2801
|
-
'string_decoder',
|
|
2802
|
-
'sys',
|
|
2803
|
-
'timers',
|
|
2804
|
-
'tls',
|
|
2805
|
-
'trace_events',
|
|
2806
|
-
'tty',
|
|
2807
|
-
'url',
|
|
2808
|
-
'util',
|
|
2809
|
-
'v8',
|
|
2810
|
-
'vm',
|
|
2811
|
-
'wasi',
|
|
2812
|
-
'worker_threads',
|
|
2813
|
-
'zlib',
|
|
2814
|
-
'_stream_duplex',
|
|
2815
|
-
'_stream_passthrough',
|
|
2816
|
-
'_stream_readable',
|
|
2817
|
-
'_stream_transform',
|
|
2818
|
-
'_stream_writable'
|
|
2819
|
-
]);
|
|
2820
|
-
return moduleName && nodeBuiltins.has(moduleName) ? getTips(moduleName) : message;
|
|
2772
|
+
let moduleName = matchArray[1];
|
|
2773
|
+
return moduleName && external_node_module_.builtinModules.includes(moduleName) ? getTips(moduleName) : message;
|
|
2821
2774
|
})(message = hintUnknownFiles(message)))).split('\n');
|
|
2822
2775
|
return (message = (lines = lines.filter((line, index, arr)=>0 === index || '' !== line.trim() || line.trim() !== arr[index - 1].trim())).join('\n')).trim();
|
|
2823
2776
|
}
|
|
@@ -3145,7 +3098,7 @@ ${section.body}` : section.body).join("\n\n"));
|
|
|
3145
3098
|
html: {
|
|
3146
3099
|
meta: {
|
|
3147
3100
|
charset: {
|
|
3148
|
-
charset: '
|
|
3101
|
+
charset: 'utf-8'
|
|
3149
3102
|
},
|
|
3150
3103
|
viewport: 'width=device-width, initial-scale=1.0'
|
|
3151
3104
|
},
|
|
@@ -3513,15 +3466,9 @@ ${section.body}` : section.body).join("\n\n"));
|
|
|
3513
3466
|
return getNormalizedConfig();
|
|
3514
3467
|
}
|
|
3515
3468
|
throw Error(`${color.dim('[rsbuild]')} ${color.yellow('getRsbuildConfig')} get an invalid type param.`);
|
|
3516
|
-
}, exposed =
|
|
3517
|
-
exposed.
|
|
3518
|
-
|
|
3519
|
-
api
|
|
3520
|
-
});
|
|
3521
|
-
}, useExposed = (id)=>{
|
|
3522
|
-
let matched = exposed.find((item)=>item.id === id);
|
|
3523
|
-
if (matched) return matched.api;
|
|
3524
|
-
}, transformId = 0, transformer = {}, processAssetsFns = [], resolveFns = [];
|
|
3469
|
+
}, exposed = new Map(), expose = (id, api)=>{
|
|
3470
|
+
exposed.set(id, api);
|
|
3471
|
+
}, useExposed = (id)=>exposed.get(id), transformId = 0, transformer = {}, processAssetsFns = [], resolveFns = [];
|
|
3525
3472
|
hooks.modifyBundlerChain.tap((chain, { target, environment })=>{
|
|
3526
3473
|
let pluginName = 'RsbuildCorePlugin';
|
|
3527
3474
|
chain.plugin(pluginName).use(class {
|
|
@@ -3742,7 +3689,7 @@ ${section.body}` : section.body).join("\n\n"));
|
|
|
3742
3689
|
async function createContext(options, userConfig) {
|
|
3743
3690
|
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';
|
|
3744
3691
|
return {
|
|
3745
|
-
version: "1.7.
|
|
3692
|
+
version: "1.7.1",
|
|
3746
3693
|
rootPath,
|
|
3747
3694
|
distPath: '',
|
|
3748
3695
|
cachePath,
|
|
@@ -5061,7 +5008,7 @@ ${section.body}` : section.body).join("\n\n"));
|
|
|
5061
5008
|
let mountId;
|
|
5062
5009
|
return {
|
|
5063
5010
|
templatePath: void 0,
|
|
5064
|
-
templateContent: (mountId = config.html.mountId, `<!
|
|
5011
|
+
templateContent: (mountId = config.html.mountId, `<!DOCTYPE html><html><head></head><body><div id="${mountId}"></div></body></html>`)
|
|
5065
5012
|
};
|
|
5066
5013
|
}
|
|
5067
5014
|
let absolutePath = (0, external_node_path_.isAbsolute)(templatePath) ? templatePath : external_node_path_default().join(rootPath, templatePath);
|
|
@@ -5786,11 +5733,9 @@ ${section.body}` : section.body).join("\n\n"));
|
|
|
5786
5733
|
env: {
|
|
5787
5734
|
targets: browserslist
|
|
5788
5735
|
},
|
|
5789
|
-
|
|
5790
|
-
|
|
5791
|
-
|
|
5792
|
-
exportedEnum: isProd
|
|
5793
|
-
}
|
|
5736
|
+
collectTypeScriptInfo: {
|
|
5737
|
+
typeExports: !0,
|
|
5738
|
+
exportedEnum: isProd
|
|
5794
5739
|
}
|
|
5795
5740
|
};
|
|
5796
5741
|
}
|
|
@@ -6467,6 +6412,16 @@ init(
|
|
|
6467
6412
|
});
|
|
6468
6413
|
return ansiCodes.length > 0 && (ret += Array(ansiCodes.length + 1).join('</span>')), ret;
|
|
6469
6414
|
}
|
|
6415
|
+
function formatDisplayPath(filePath, isAbsolute, root) {
|
|
6416
|
+
if (NODE_MODULES_REGEX.test(filePath)) for (let needle of [
|
|
6417
|
+
'/node_modules/',
|
|
6418
|
+
'\\node_modules\\'
|
|
6419
|
+
]){
|
|
6420
|
+
let index = filePath.lastIndexOf(needle);
|
|
6421
|
+
if (-1 !== index) return filePath.slice(index + 1);
|
|
6422
|
+
}
|
|
6423
|
+
return root && isAbsolute ? toRelativePath(root, filePath) : filePath;
|
|
6424
|
+
}
|
|
6470
6425
|
function convertLinksInHtml(text, root) {
|
|
6471
6426
|
let PATH_RE = /(?:\.\.?[/\\]|(file:\/\/\/)?[a-zA-Z]:\\|(file:\/\/)?\/|[A-Za-z0-9._-]+[/\\])[^\s:]*:\d+:\d+/g, URL_RE = /(https?:\/\/(?:[\w-]+\.)+[a-z0-9](?:[\w-.~:/?#[\]@!$&'*+,;=])*)/gi, NODE_INTERNAL_RE = /node:internal[/\\]/, RSPACK_RUNTIME_RE = /webpack\/runtime\//, FILE_URI_WINDOWS_RE = /^file:\/\/\/([A-Za-z]:)/, FILE_URI_UNIX_RE = /^file:\/\//;
|
|
6472
6427
|
return text.split('\n').map((line)=>{
|
|
@@ -6476,8 +6431,8 @@ init(
|
|
|
6476
6431
|
if (!file.startsWith('file://')) return file;
|
|
6477
6432
|
let windows = file.replace(FILE_URI_WINDOWS_RE, '$1');
|
|
6478
6433
|
return windows !== file ? windows : file.replace(FILE_URI_UNIX_RE, '');
|
|
6479
|
-
})(file)).includes('</span>') && !file.includes('<span'), filePath = hasClosingSpan ? file.replace('</span>', '') : file, isAbsolute = external_node_path_default().isAbsolute(filePath), absolutePath = root && !isAbsolute ? external_node_path_default().join(root, filePath) : filePath,
|
|
6480
|
-
return `<a class="file-link" data-file="${absolutePath}">${
|
|
6434
|
+
})(file)).includes('</span>') && !file.includes('<span'), filePath = hasClosingSpan ? file.replace('</span>', '') : file, isAbsolute = external_node_path_default().isAbsolute(filePath), absolutePath = root && !isAbsolute ? external_node_path_default().join(root, filePath) : filePath, displayPath = formatDisplayPath(filePath, isAbsolute, root);
|
|
6435
|
+
return `<a class="file-link" data-file="${absolutePath}">${displayPath}</a>${hasClosingSpan ? '</span>' : ''}`;
|
|
6481
6436
|
});
|
|
6482
6437
|
return replacedLine = replacedLine.replace(URL_RE, (url)=>`<a class="url-link" href="${url}" target="_blank" rel="noopener noreferrer">${url}</a>`);
|
|
6483
6438
|
}).join('\n');
|
|
@@ -9376,7 +9331,7 @@ try {
|
|
|
9376
9331
|
};
|
|
9377
9332
|
function setupCommands() {
|
|
9378
9333
|
let cli = ((name = "")=>new CAC(name))('rsbuild');
|
|
9379
|
-
cli.version("1.7.
|
|
9334
|
+
cli.version("1.7.1"), 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)', {
|
|
9380
9335
|
default: 'auto'
|
|
9381
9336
|
}).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', {
|
|
9382
9337
|
type: [
|
|
@@ -9445,7 +9400,7 @@ try {
|
|
|
9445
9400
|
}
|
|
9446
9401
|
function showGreeting() {
|
|
9447
9402
|
let { npm_execpath, npm_lifecycle_event, NODE_RUN_SCRIPT_NAME } = process.env, isBun = npm_execpath?.includes('.bun');
|
|
9448
|
-
src_logger.greet(`${'npx' === npm_lifecycle_event || isBun || NODE_RUN_SCRIPT_NAME ? '\n' : ''}Rsbuild v1.7.
|
|
9403
|
+
src_logger.greet(`${'npx' === npm_lifecycle_event || isBun || NODE_RUN_SCRIPT_NAME ? '\n' : ''}Rsbuild v1.7.1\n`);
|
|
9449
9404
|
}
|
|
9450
9405
|
function setupLogLevel() {
|
|
9451
9406
|
let logLevelIndex = process.argv.findIndex((item)=>'--log-level' === item || '--logLevel' === item);
|
|
@@ -9466,7 +9421,7 @@ try {
|
|
|
9466
9421
|
src_logger.error('Failed to start Rsbuild CLI.'), src_logger.error(err);
|
|
9467
9422
|
}
|
|
9468
9423
|
}
|
|
9469
|
-
let src_version = "1.7.
|
|
9424
|
+
let src_version = "1.7.1";
|
|
9470
9425
|
})(), 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 === [
|
|
9471
9426
|
"PLUGIN_CSS_NAME",
|
|
9472
9427
|
"PLUGIN_SWC_NAME",
|
|
@@ -96,7 +96,7 @@ export type ToolsWebpackConfig = ConfigChainWithContext<WebpackConfig, ModifyWeb
|
|
|
96
96
|
export type ToolsWebpackChainConfig = OneOrMany<(chain: RspackChain, utils: ModifyWebpackChainUtils) => void>;
|
|
97
97
|
export interface ToolsConfig {
|
|
98
98
|
/**
|
|
99
|
-
* Configure bundler config base on [rspack-chain](https://github.com/
|
|
99
|
+
* Configure bundler config base on [rspack-chain](https://github.com/rstackjs/rspack-chain)
|
|
100
100
|
*/
|
|
101
101
|
bundlerChain?: ToolsBundlerChainConfig;
|
|
102
102
|
/**
|
|
@@ -137,7 +137,7 @@ export interface ToolsConfig {
|
|
|
137
137
|
*/
|
|
138
138
|
webpack?: ToolsWebpackConfig;
|
|
139
139
|
/**
|
|
140
|
-
* Configure webpack by [rspack-chain](https://github.com/
|
|
140
|
+
* Configure webpack by [rspack-chain](https://github.com/rstackjs/rspack-chain).
|
|
141
141
|
* @requires webpack
|
|
142
142
|
*/
|
|
143
143
|
webpackChain?: ToolsWebpackChainConfig;
|
|
@@ -1397,7 +1397,7 @@ export interface HtmlConfig {
|
|
|
1397
1397
|
* @default
|
|
1398
1398
|
* ```js
|
|
1399
1399
|
* const defaultMeta = {
|
|
1400
|
-
* charset: { charset: '
|
|
1400
|
+
* charset: { charset: 'utf-8' },
|
|
1401
1401
|
* viewport: 'width=device-width, initial-scale=1.0',
|
|
1402
1402
|
* };
|
|
1403
1403
|
* ```
|
|
@@ -1455,13 +1455,13 @@ export interface HtmlConfig {
|
|
|
1455
1455
|
outputStructure?: OutputStructure;
|
|
1456
1456
|
/**
|
|
1457
1457
|
* Define the path to the HTML template,
|
|
1458
|
-
* corresponding to the `template` config of [html-rspack-plugin](https://github.com/
|
|
1458
|
+
* corresponding to the `template` config of [html-rspack-plugin](https://github.com/rstackjs/html-rspack-plugin).
|
|
1459
1459
|
* @default A built-in HTML template
|
|
1460
1460
|
*/
|
|
1461
1461
|
template?: ChainedHtmlOption<string>;
|
|
1462
1462
|
/**
|
|
1463
1463
|
* Define the parameters in the HTML template,
|
|
1464
|
-
* corresponding to the `templateParameters` config of [html-rspack-plugin](https://github.com/
|
|
1464
|
+
* corresponding to the `templateParameters` config of [html-rspack-plugin](https://github.com/rstackjs/html-rspack-plugin).
|
|
1465
1465
|
*/
|
|
1466
1466
|
templateParameters?: ConfigChainWithContext<Record<string, unknown>, {
|
|
1467
1467
|
entryName: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsbuild/core",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.1",
|
|
4
4
|
"description": "The Rspack-based build tool.",
|
|
5
5
|
"homepage": "https://rsbuild.rs",
|
|
6
6
|
"bugs": {
|
|
@@ -46,16 +46,16 @@
|
|
|
46
46
|
"types.d.ts"
|
|
47
47
|
],
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@rspack/core": "1.7.0
|
|
49
|
+
"@rspack/core": "1.7.0",
|
|
50
50
|
"@rspack/lite-tapable": "~1.1.0",
|
|
51
|
-
"@swc/helpers": "^0.5.
|
|
51
|
+
"@swc/helpers": "^0.5.18",
|
|
52
52
|
"core-js": "~3.47.0",
|
|
53
53
|
"jiti": "^2.6.1"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@jridgewell/remapping": "^2.3.5",
|
|
57
57
|
"@jridgewell/trace-mapping": "^0.3.31",
|
|
58
|
-
"@rslib/core": "0.
|
|
58
|
+
"@rslib/core": "0.19.0",
|
|
59
59
|
"@types/connect": "3.4.38",
|
|
60
60
|
"@types/cors": "^2.8.19",
|
|
61
61
|
"@types/node": "^24.10.4",
|