@rsbuild/core 1.2.8 → 1.2.9
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/README.md +10 -2
- package/compiled/css-loader/index.js +18 -18
- package/compiled/postcss-loader/index.js +6 -6
- package/compiled/rsbuild-dev-middleware/index.js +25 -25
- package/compiled/style-loader/index.js +10 -10
- package/dist/index.cjs +76 -48
- package/dist/index.js +76 -48
- package/dist-types/server/devServer.d.ts +11 -6
- package/dist-types/server/getDevMiddlewares.d.ts +4 -0
- package/dist-types/types/hooks.d.ts +1 -1
- package/dist-types/types/plugin.d.ts +63 -8
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -606,38 +606,39 @@ var __webpack_exports__ = {};
|
|
|
606
606
|
return !verbose && message.includes(innerError) && (message = message.split(innerError)[0]), (message = (message = hintNodePolyfill(message = function(message) {
|
|
607
607
|
let hint = 'You may need an appropriate loader to handle this file type.';
|
|
608
608
|
if (-1 === message.indexOf(hint)) return message;
|
|
609
|
+
let createPluginHint = (packageName, keyword)=>`To enable support for ${keyword}, use "${index_js_default().yellow(`@rsbuild/plugin-${packageName}`)}" ${index_js_default().dim(`(https://www.npmjs.com/package/@rsbuild/plugin-${packageName})`)}.`;
|
|
609
610
|
for (let plugin of [
|
|
610
611
|
{
|
|
611
612
|
test: /File: .+\.s(c|a)ss/,
|
|
612
|
-
hint:
|
|
613
|
+
hint: createPluginHint('sass', 'Sass')
|
|
613
614
|
},
|
|
614
615
|
{
|
|
615
616
|
test: /File: .+\.less/,
|
|
616
|
-
hint:
|
|
617
|
+
hint: createPluginHint('less', 'Less')
|
|
617
618
|
},
|
|
618
619
|
{
|
|
619
620
|
test: /File: .+\.styl(us)?/,
|
|
620
|
-
hint:
|
|
621
|
+
hint: createPluginHint('stylus', 'Stylus')
|
|
621
622
|
},
|
|
622
623
|
{
|
|
623
624
|
test: /File: .+\.vue?/,
|
|
624
|
-
hint:
|
|
625
|
+
hint: createPluginHint('vue', 'Vue')
|
|
625
626
|
},
|
|
626
627
|
{
|
|
627
628
|
test: /File: .+\.svelte?/,
|
|
628
|
-
hint:
|
|
629
|
+
hint: createPluginHint('svelte', 'Svelte')
|
|
629
630
|
},
|
|
630
631
|
{
|
|
631
632
|
test: /File: .+\.mdx/,
|
|
632
|
-
hint:
|
|
633
|
+
hint: createPluginHint('mdx', 'MDX')
|
|
633
634
|
},
|
|
634
635
|
{
|
|
635
636
|
test: /File: .+\.toml/,
|
|
636
|
-
hint:
|
|
637
|
+
hint: createPluginHint('toml', 'TOML')
|
|
637
638
|
},
|
|
638
639
|
{
|
|
639
640
|
test: /File: .+\.yaml/,
|
|
640
|
-
hint:
|
|
641
|
+
hint: createPluginHint('yaml', 'YAML')
|
|
641
642
|
}
|
|
642
643
|
])if (plugin.test.test(message)) return message.replace(hint, plugin.hint);
|
|
643
644
|
return message;
|
|
@@ -1434,7 +1435,7 @@ var __webpack_exports__ = {};
|
|
|
1434
1435
|
tap: (handler)=>tapEnvironment({
|
|
1435
1436
|
handler
|
|
1436
1437
|
}),
|
|
1437
|
-
|
|
1438
|
+
callChain: async ({ environment, args: params })=>{
|
|
1438
1439
|
for (let callback of [
|
|
1439
1440
|
...preGroup,
|
|
1440
1441
|
...defaultGroup,
|
|
@@ -1445,6 +1446,19 @@ var __webpack_exports__ = {};
|
|
|
1445
1446
|
void 0 !== result && (params[0] = result);
|
|
1446
1447
|
}
|
|
1447
1448
|
return params;
|
|
1449
|
+
},
|
|
1450
|
+
callBatch: async ({ environment, args: params })=>{
|
|
1451
|
+
let results = [];
|
|
1452
|
+
for (let callback of [
|
|
1453
|
+
...preGroup,
|
|
1454
|
+
...defaultGroup,
|
|
1455
|
+
...postGroup
|
|
1456
|
+
]){
|
|
1457
|
+
if (callback.environment && environment && !isPluginMatchEnvironment(callback.environment, environment)) continue;
|
|
1458
|
+
let result = await callback.handler(...params);
|
|
1459
|
+
results.push(result);
|
|
1460
|
+
}
|
|
1461
|
+
return results;
|
|
1448
1462
|
}
|
|
1449
1463
|
};
|
|
1450
1464
|
}
|
|
@@ -1454,7 +1468,7 @@ var __webpack_exports__ = {};
|
|
|
1454
1468
|
tap: (cb)=>{
|
|
1455
1469
|
isFunction(cb) ? defaultGroup.push(cb) : 'pre' === cb.order ? preGroup.push(cb.handler) : 'post' === cb.order ? postGroup.push(cb.handler) : defaultGroup.push(cb.handler);
|
|
1456
1470
|
},
|
|
1457
|
-
|
|
1471
|
+
callChain: async (...params)=>{
|
|
1458
1472
|
for (let callback of [
|
|
1459
1473
|
...preGroup,
|
|
1460
1474
|
...defaultGroup,
|
|
@@ -1464,6 +1478,18 @@ var __webpack_exports__ = {};
|
|
|
1464
1478
|
void 0 !== result && (params[0] = result);
|
|
1465
1479
|
}
|
|
1466
1480
|
return params;
|
|
1481
|
+
},
|
|
1482
|
+
callBatch: async (...params)=>{
|
|
1483
|
+
let results = [];
|
|
1484
|
+
for (let callback of [
|
|
1485
|
+
...preGroup,
|
|
1486
|
+
...defaultGroup,
|
|
1487
|
+
...postGroup
|
|
1488
|
+
]){
|
|
1489
|
+
let result = await callback(...params);
|
|
1490
|
+
results.push(result);
|
|
1491
|
+
}
|
|
1492
|
+
return results;
|
|
1467
1493
|
}
|
|
1468
1494
|
};
|
|
1469
1495
|
}
|
|
@@ -1501,7 +1527,7 @@ var __webpack_exports__ = {};
|
|
|
1501
1527
|
});
|
|
1502
1528
|
}, registerBuildHook = ({ context, isWatch, compiler, bundlerConfigs, MultiStatsCtor })=>{
|
|
1503
1529
|
let isFirstCompile = !0, environmentList = Object.values(context.environments).reduce((prev, curr)=>(prev[curr.index] = curr, prev), []), onDone = async (stats)=>{
|
|
1504
|
-
let p = context.hooks.onAfterBuild.
|
|
1530
|
+
let p = context.hooks.onAfterBuild.callBatch({
|
|
1505
1531
|
isFirstCompile,
|
|
1506
1532
|
stats,
|
|
1507
1533
|
environments: context.environments,
|
|
@@ -1509,7 +1535,7 @@ var __webpack_exports__ = {};
|
|
|
1509
1535
|
});
|
|
1510
1536
|
isFirstCompile = !1, await p;
|
|
1511
1537
|
}, onEnvironmentDone = async (buildIndex, stats)=>{
|
|
1512
|
-
await context.hooks.onAfterEnvironmentCompile.
|
|
1538
|
+
await context.hooks.onAfterEnvironmentCompile.callBatch({
|
|
1513
1539
|
environment: environmentList[buildIndex].name,
|
|
1514
1540
|
args: [
|
|
1515
1541
|
{
|
|
@@ -1523,13 +1549,13 @@ var __webpack_exports__ = {};
|
|
|
1523
1549
|
};
|
|
1524
1550
|
onBeforeCompile({
|
|
1525
1551
|
compiler,
|
|
1526
|
-
beforeCompile: async ()=>await context.hooks.onBeforeBuild.
|
|
1552
|
+
beforeCompile: async ()=>await context.hooks.onBeforeBuild.callBatch({
|
|
1527
1553
|
bundlerConfigs,
|
|
1528
1554
|
environments: context.environments,
|
|
1529
1555
|
isWatch,
|
|
1530
1556
|
isFirstCompile
|
|
1531
1557
|
}),
|
|
1532
|
-
beforeEnvironmentCompiler: async (buildIndex)=>await context.hooks.onBeforeEnvironmentCompile.
|
|
1558
|
+
beforeEnvironmentCompiler: async (buildIndex)=>await context.hooks.onBeforeEnvironmentCompile.callBatch({
|
|
1533
1559
|
environment: environmentList[buildIndex].name,
|
|
1534
1560
|
args: [
|
|
1535
1561
|
{
|
|
@@ -1549,14 +1575,14 @@ var __webpack_exports__ = {};
|
|
|
1549
1575
|
});
|
|
1550
1576
|
}, registerDevHook = ({ context, compiler, bundlerConfigs, MultiStatsCtor })=>{
|
|
1551
1577
|
let isFirstCompile = !0, environmentList = Object.values(context.environments).reduce((prev, curr)=>(prev[curr.index] = curr, prev), []), onDone = async (stats)=>{
|
|
1552
|
-
let p = context.hooks.onDevCompileDone.
|
|
1578
|
+
let p = context.hooks.onDevCompileDone.callBatch({
|
|
1553
1579
|
isFirstCompile,
|
|
1554
1580
|
stats,
|
|
1555
1581
|
environments: context.environments
|
|
1556
1582
|
});
|
|
1557
1583
|
isFirstCompile = !1, await p;
|
|
1558
1584
|
}, onEnvironmentDone = async (buildIndex, stats)=>{
|
|
1559
|
-
await context.hooks.onAfterEnvironmentCompile.
|
|
1585
|
+
await context.hooks.onAfterEnvironmentCompile.callBatch({
|
|
1560
1586
|
environment: environmentList[buildIndex].name,
|
|
1561
1587
|
args: [
|
|
1562
1588
|
{
|
|
@@ -1570,7 +1596,7 @@ var __webpack_exports__ = {};
|
|
|
1570
1596
|
};
|
|
1571
1597
|
onBeforeCompile({
|
|
1572
1598
|
compiler,
|
|
1573
|
-
beforeEnvironmentCompiler: async (buildIndex)=>await context.hooks.onBeforeEnvironmentCompile.
|
|
1599
|
+
beforeEnvironmentCompiler: async (buildIndex)=>await context.hooks.onBeforeEnvironmentCompile.callBatch({
|
|
1574
1600
|
environment: environmentList[buildIndex].name,
|
|
1575
1601
|
args: [
|
|
1576
1602
|
{
|
|
@@ -1708,7 +1734,7 @@ var __webpack_exports__ = {};
|
|
|
1708
1734
|
async function createContext(options, userConfig, bundlerType) {
|
|
1709
1735
|
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;
|
|
1710
1736
|
return {
|
|
1711
|
-
version: "1.2.
|
|
1737
|
+
version: "1.2.9",
|
|
1712
1738
|
rootPath,
|
|
1713
1739
|
distPath: '',
|
|
1714
1740
|
cachePath,
|
|
@@ -1841,7 +1867,7 @@ var __webpack_exports__ = {};
|
|
|
1841
1867
|
async function modifyBundlerChain(context, utils) {
|
|
1842
1868
|
var _utils_environment_config_tools;
|
|
1843
1869
|
rslog_index_js_namespaceObject.logger.debug('modify bundler chain');
|
|
1844
|
-
let bundlerChain = new (rspack_chain_index_js_default())(), [modifiedBundlerChain] = await context.hooks.modifyBundlerChain.
|
|
1870
|
+
let bundlerChain = new (rspack_chain_index_js_default())(), [modifiedBundlerChain] = await context.hooks.modifyBundlerChain.callChain({
|
|
1845
1871
|
environment: utils.environment.name,
|
|
1846
1872
|
args: [
|
|
1847
1873
|
bundlerChain,
|
|
@@ -3381,7 +3407,7 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
3381
3407
|
api.modifyBundlerChain(async (chain, { CHAIN_ID, target, isProd, isServer, environment })=>{
|
|
3382
3408
|
let { distPath, config } = environment, publicPath = function({ isProd, config, context }) {
|
|
3383
3409
|
var _context_devServer, _context_devServer1, _context_devServer2;
|
|
3384
|
-
let { dev, output, server } = config, publicPath = DEFAULT_ASSET_PREFIX, port = (null === (_context_devServer = context.devServer) || void 0 === _context_devServer ? void 0 : _context_devServer.port) || 3000;
|
|
3410
|
+
let { dev, output, server } = config, publicPath = DEFAULT_ASSET_PREFIX, port = (null === (_context_devServer = context.devServer) || void 0 === _context_devServer ? void 0 : _context_devServer.port) || server.port || 3000;
|
|
3385
3411
|
if (isProd) 'string' == typeof output.assetPrefix && (publicPath = output.assetPrefix);
|
|
3386
3412
|
else if ('string' == typeof dev.assetPrefix) publicPath = dev.assetPrefix;
|
|
3387
3413
|
else if (!0 === dev.assetPrefix) {
|
|
@@ -4197,7 +4223,7 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
4197
4223
|
async function modifyRspackConfig(context, rspackConfig, utils) {
|
|
4198
4224
|
var _utils_environment_config_tools;
|
|
4199
4225
|
rslog_index_js_namespaceObject.logger.debug('modify Rspack config');
|
|
4200
|
-
let [modifiedConfig] = await context.hooks.modifyRspackConfig.
|
|
4226
|
+
let [modifiedConfig] = await context.hooks.modifyRspackConfig.callChain({
|
|
4201
4227
|
environment: utils.environment.name,
|
|
4202
4228
|
args: [
|
|
4203
4229
|
rspackConfig,
|
|
@@ -4275,14 +4301,14 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
4275
4301
|
}
|
|
4276
4302
|
async function modifyRsbuildConfig(context) {
|
|
4277
4303
|
rslog_index_js_namespaceObject.logger.debug('modify Rsbuild config');
|
|
4278
|
-
let [modified] = await context.hooks.modifyRsbuildConfig.
|
|
4304
|
+
let [modified] = await context.hooks.modifyRsbuildConfig.callChain(context.config, {
|
|
4279
4305
|
mergeRsbuildConfig: mergeRsbuildConfig
|
|
4280
4306
|
});
|
|
4281
4307
|
context.config = modified, rslog_index_js_namespaceObject.logger.debug('modify Rsbuild config done');
|
|
4282
4308
|
}
|
|
4283
4309
|
async function modifyEnvironmentConfig(context, config, name) {
|
|
4284
4310
|
rslog_index_js_namespaceObject.logger.debug(`modify Rsbuild environment(${name}) config`);
|
|
4285
|
-
let [modified] = await context.hooks.modifyEnvironmentConfig.
|
|
4311
|
+
let [modified] = await context.hooks.modifyEnvironmentConfig.callChain({
|
|
4286
4312
|
environment: name,
|
|
4287
4313
|
args: [
|
|
4288
4314
|
config,
|
|
@@ -5357,12 +5383,11 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
5357
5383
|
let opts = {
|
|
5358
5384
|
context,
|
|
5359
5385
|
changeOrigin: !0,
|
|
5360
|
-
logLevel: 'warn'
|
|
5386
|
+
logLevel: 'warn',
|
|
5387
|
+
logProvider: ()=>rslog_index_js_namespaceObject.logger
|
|
5361
5388
|
};
|
|
5362
5389
|
'string' == typeof options ? opts.target = options : Object.assign(opts, options), ret.push(opts);
|
|
5363
5390
|
}
|
|
5364
|
-
let handleError = (err)=>rslog_index_js_namespaceObject.logger.error(err);
|
|
5365
|
-
for (let opts of ret)opts.onError ??= handleError;
|
|
5366
5391
|
return ret;
|
|
5367
5392
|
}(proxyOptions), proxyMiddlewares = [], middlewares = [], { createProxyMiddleware: baseMiddleware } = await Promise.resolve().then(__webpack_require__.bind(__webpack_require__, "../../compiled/http-proxy-middleware/index.js"));
|
|
5368
5393
|
for (let opts of formattedOptions){
|
|
@@ -5391,7 +5416,7 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
5391
5416
|
before,
|
|
5392
5417
|
after
|
|
5393
5418
|
};
|
|
5394
|
-
}, applyDefaultMiddlewares = async ({ middlewares, server, compileMiddlewareAPI, output, pwd, outputFileSystem, environments })=>{
|
|
5419
|
+
}, applyDefaultMiddlewares = async ({ middlewares, server, compileMiddlewareAPI, output, pwd, outputFileSystem, environments, postCallbacks })=>{
|
|
5395
5420
|
let upgradeEvents = [];
|
|
5396
5421
|
if (server.compress && middlewares.push(gzipMiddleware()), middlewares.push((req, res, next)=>{
|
|
5397
5422
|
var _parseUrl;
|
|
@@ -5434,6 +5459,7 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
5434
5459
|
});
|
|
5435
5460
|
middlewares.push(assetMiddleware);
|
|
5436
5461
|
}
|
|
5462
|
+
for (let callback of postCallbacks)callback();
|
|
5437
5463
|
if (compileMiddlewareAPI && middlewares.push(getHtmlFallbackMiddleware({
|
|
5438
5464
|
distPath,
|
|
5439
5465
|
callback: compileMiddlewareAPI.middleware,
|
|
@@ -5539,7 +5565,7 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
5539
5565
|
config,
|
|
5540
5566
|
clearCache: !0
|
|
5541
5567
|
}), closeServer = async ()=>{
|
|
5542
|
-
await options.context.hooks.onCloseDevServer.
|
|
5568
|
+
await options.context.hooks.onCloseDevServer.callBatch(), await Promise.all([
|
|
5543
5569
|
null == devMiddlewares ? void 0 : devMiddlewares.close(),
|
|
5544
5570
|
null == fileWatcher ? void 0 : fileWatcher.close()
|
|
5545
5571
|
]);
|
|
@@ -5574,15 +5600,16 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
5574
5600
|
environment
|
|
5575
5601
|
}))
|
|
5576
5602
|
}
|
|
5577
|
-
])), { default: connect } = await Promise.resolve().then(__webpack_require__.bind(__webpack_require__, "../../compiled/connect/index.js")), middlewares = connect(),
|
|
5603
|
+
])), { default: connect } = await Promise.resolve().then(__webpack_require__.bind(__webpack_require__, "../../compiled/connect/index.js")), middlewares = connect(), httpServer = await createHttpServer({
|
|
5604
|
+
serverConfig: config.server,
|
|
5605
|
+
middlewares
|
|
5606
|
+
}), devServerAPI = {
|
|
5578
5607
|
port,
|
|
5579
5608
|
middlewares,
|
|
5580
5609
|
environments: environmentAPI,
|
|
5610
|
+
httpServer,
|
|
5581
5611
|
listen: async ()=>{
|
|
5582
|
-
let
|
|
5583
|
-
serverConfig: config.server,
|
|
5584
|
-
middlewares
|
|
5585
|
-
}), serverTerminator = getServerTerminator(httpServer);
|
|
5612
|
+
let serverTerminator = getServerTerminator(httpServer);
|
|
5586
5613
|
return rslog_index_js_namespaceObject.logger.debug('listen dev server'), options.context.hooks.onCloseDevServer.tap(serverTerminator), new Promise((resolve)=>{
|
|
5587
5614
|
httpServer.listen({
|
|
5588
5615
|
host,
|
|
@@ -5600,7 +5627,7 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
5600
5627
|
});
|
|
5601
5628
|
},
|
|
5602
5629
|
afterListen: async ()=>{
|
|
5603
|
-
await options.context.hooks.onAfterStartDevServer.
|
|
5630
|
+
await options.context.hooks.onAfterStartDevServer.callBatch({
|
|
5604
5631
|
port,
|
|
5605
5632
|
routes,
|
|
5606
5633
|
environments: options.context.environments
|
|
@@ -5612,11 +5639,11 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
5612
5639
|
close: closeServer,
|
|
5613
5640
|
printUrls,
|
|
5614
5641
|
open: openPage
|
|
5615
|
-
}
|
|
5616
|
-
await options.context.hooks.onBeforeStartDevServer.call({
|
|
5642
|
+
}, postCallbacks = (await options.context.hooks.onBeforeStartDevServer.callBatch({
|
|
5617
5643
|
server: devServerAPI,
|
|
5618
5644
|
environments: options.context.environments
|
|
5619
|
-
})
|
|
5645
|
+
})).filter((item)=>'function' == typeof item);
|
|
5646
|
+
runCompile ? options.context.hooks.onBeforeCreateCompiler.tap(beforeCreateCompiler) : beforeCreateCompiler();
|
|
5620
5647
|
let compileMiddlewareAPI = runCompile ? await startCompile() : void 0;
|
|
5621
5648
|
for (let item of (fileWatcher = await setupWatchFiles({
|
|
5622
5649
|
dev: devConfig,
|
|
@@ -5632,14 +5659,15 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
5632
5659
|
output: {
|
|
5633
5660
|
distPath: options.context.distPath || ROOT_DIST_DIR
|
|
5634
5661
|
},
|
|
5635
|
-
outputFileSystem
|
|
5662
|
+
outputFileSystem,
|
|
5663
|
+
postCallbacks
|
|
5636
5664
|
})).middlewares))Array.isArray(item) ? middlewares.use(...item) : middlewares.use(item);
|
|
5637
5665
|
return rslog_index_js_namespaceObject.logger.debug('create dev server done'), devServerAPI;
|
|
5638
5666
|
}
|
|
5639
5667
|
async function createCompiler_createCompiler(options) {
|
|
5640
5668
|
rslog_index_js_namespaceObject.logger.debug('create compiler');
|
|
5641
5669
|
let { context } = options, { rspackConfigs } = await initConfigs(options);
|
|
5642
|
-
if (await context.hooks.onBeforeCreateCompiler.
|
|
5670
|
+
if (await context.hooks.onBeforeCreateCompiler.callBatch({
|
|
5643
5671
|
bundlerConfigs: rspackConfigs,
|
|
5644
5672
|
environments: context.environments
|
|
5645
5673
|
}), !await isSatisfyRspackVersion(core_namespaceObject.rspack.rspackVersion)) throw Error(`[rsbuild] The current Rspack version does not meet the requirements, the minimum supported version of Rspack is ${index_js_default().green(rspackMinVersion)}`);
|
|
@@ -5678,7 +5706,7 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
5678
5706
|
compiler,
|
|
5679
5707
|
bundlerConfigs: rspackConfigs,
|
|
5680
5708
|
MultiStatsCtor: core_namespaceObject.rspack.MultiStats
|
|
5681
|
-
}), await context.hooks.onAfterCreateCompiler.
|
|
5709
|
+
}), await context.hooks.onAfterCreateCompiler.callBatch({
|
|
5682
5710
|
compiler,
|
|
5683
5711
|
environments: context.environments
|
|
5684
5712
|
}), rslog_index_js_namespaceObject.logger.debug('create compiler done'), {
|
|
@@ -5842,7 +5870,7 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
5842
5870
|
},
|
|
5843
5871
|
serverConfig
|
|
5844
5872
|
}, middlewares);
|
|
5845
|
-
await context.hooks.onBeforeStartProdServer.
|
|
5873
|
+
await context.hooks.onBeforeStartProdServer.callBatch();
|
|
5846
5874
|
let httpServer = await createHttpServer({
|
|
5847
5875
|
serverConfig,
|
|
5848
5876
|
middlewares: server.middlewares
|
|
@@ -5853,7 +5881,7 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
5853
5881
|
port
|
|
5854
5882
|
}, async ()=>{
|
|
5855
5883
|
let routes = getRoutes(context);
|
|
5856
|
-
await context.hooks.onAfterStartProdServer.
|
|
5884
|
+
await context.hooks.onAfterStartProdServer.callBatch({
|
|
5857
5885
|
port,
|
|
5858
5886
|
routes,
|
|
5859
5887
|
environments: context.environments
|
|
@@ -5912,7 +5940,7 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
5912
5940
|
pluginFileSize(),
|
|
5913
5941
|
pluginCleanOutput(),
|
|
5914
5942
|
pluginAsset(),
|
|
5915
|
-
pluginHtml((environment)=>async (...args)=>(await context.hooks.modifyHTMLTags.
|
|
5943
|
+
pluginHtml((environment)=>async (...args)=>(await context.hooks.modifyHTMLTags.callChain({
|
|
5916
5944
|
environment,
|
|
5917
5945
|
args
|
|
5918
5946
|
}))[0]),
|
|
@@ -6182,7 +6210,7 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
6182
6210
|
});
|
|
6183
6211
|
}, onExitListened = !1, onExit = (cb)=>{
|
|
6184
6212
|
onExitListened || (process.on('exit', ()=>{
|
|
6185
|
-
hooks.onExit.
|
|
6213
|
+
hooks.onExit.callBatch();
|
|
6186
6214
|
}), onExitListened = !0), hooks.onExit.tap(cb);
|
|
6187
6215
|
};
|
|
6188
6216
|
return (environment)=>({
|
|
@@ -6260,7 +6288,7 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
6260
6288
|
return {
|
|
6261
6289
|
...buildInstance,
|
|
6262
6290
|
close: async ()=>{
|
|
6263
|
-
await context.hooks.onCloseBuild.
|
|
6291
|
+
await context.hooks.onCloseBuild.callBatch(), await buildInstance.close();
|
|
6264
6292
|
}
|
|
6265
6293
|
};
|
|
6266
6294
|
},
|
|
@@ -6655,12 +6683,12 @@ ${section.body}` : section.body).join("\n\n"));
|
|
|
6655
6683
|
}
|
|
6656
6684
|
}(), process.title = 'rsbuild-node';
|
|
6657
6685
|
let { npm_execpath } = process.env;
|
|
6658
|
-
(!npm_execpath || npm_execpath.includes('npx-cli.js') || npm_execpath.includes('.bun')) && console.log(), rslog_index_js_namespaceObject.logger.greet(` Rsbuild v1.2.
|
|
6686
|
+
(!npm_execpath || npm_execpath.includes('npx-cli.js') || npm_execpath.includes('.bun')) && console.log(), rslog_index_js_namespaceObject.logger.greet(` Rsbuild v1.2.9\n`);
|
|
6659
6687
|
}();
|
|
6660
6688
|
try {
|
|
6661
6689
|
!function() {
|
|
6662
6690
|
let cli = dist('rsbuild');
|
|
6663
|
-
cli.help(), cli.version("1.2.
|
|
6691
|
+
cli.help(), cli.version("1.2.9"), applyCommonOptions(cli);
|
|
6664
6692
|
let devCommand = cli.command('dev', 'starting the dev server'), 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');
|
|
6665
6693
|
applyServerOptions(devCommand), applyServerOptions(previewCommand), devCommand.action(async (options)=>{
|
|
6666
6694
|
try {
|
|
@@ -6711,7 +6739,7 @@ ${section.body}` : section.body).join("\n\n"));
|
|
|
6711
6739
|
rslog_index_js_namespaceObject.logger.error('Failed to start Rsbuild CLI.'), rslog_index_js_namespaceObject.logger.error(err);
|
|
6712
6740
|
}
|
|
6713
6741
|
}
|
|
6714
|
-
let src_rslib_entry_version = "1.2.
|
|
6742
|
+
let src_rslib_entry_version = "1.2.9";
|
|
6715
6743
|
})();
|
|
6716
6744
|
var __webpack_export_target__ = exports;
|
|
6717
6745
|
for(var __webpack_i__ in __webpack_exports__)__webpack_export_target__[__webpack_i__] = __webpack_exports__[__webpack_i__];
|