@rsbuild/core 1.2.13 → 1.2.15
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-loader/index.js +6 -6
- package/compiled/rspack-manifest-plugin/index.js +4 -4
- package/dist/index.cjs +34 -17
- package/dist/index.js +34 -17
- package/dist-types/server/gracefulShutdown.d.ts +10 -0
- package/package.json +6 -6
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
(() => {
|
|
2
2
|
var __webpack_modules__ = {
|
|
3
|
-
|
|
3
|
+
306: (module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
4
4
|
"use strict";
|
|
5
|
-
const loader = __nccwpck_require__(
|
|
5
|
+
const loader = __nccwpck_require__(9232);
|
|
6
6
|
module.exports = loader.default;
|
|
7
7
|
module.exports.defaultGetLocalIdent =
|
|
8
|
-
__nccwpck_require__(
|
|
8
|
+
__nccwpck_require__(7193).defaultGetLocalIdent;
|
|
9
9
|
},
|
|
10
|
-
|
|
10
|
+
9232: (__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
11
11
|
"use strict";
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
13
|
exports["default"] = loader;
|
|
14
14
|
var _postcss = _interopRequireDefault(__nccwpck_require__(9409));
|
|
15
|
-
var _plugins = __nccwpck_require__(
|
|
16
|
-
var _utils = __nccwpck_require__(
|
|
15
|
+
var _plugins = __nccwpck_require__(3695);
|
|
16
|
+
var _utils = __nccwpck_require__(7193);
|
|
17
17
|
function _interopRequireDefault(obj) {
|
|
18
18
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
19
19
|
}
|
|
@@ -236,7 +236,7 @@
|
|
|
236
236
|
callback(null, `${importCode}${moduleCode}${exportCode}`);
|
|
237
237
|
}
|
|
238
238
|
},
|
|
239
|
-
|
|
239
|
+
3695: (__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
240
240
|
"use strict";
|
|
241
241
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
242
242
|
Object.defineProperty(exports, "icssParser", {
|
|
@@ -258,22 +258,22 @@
|
|
|
258
258
|
},
|
|
259
259
|
});
|
|
260
260
|
var _postcssImportParser = _interopRequireDefault(
|
|
261
|
-
__nccwpck_require__(
|
|
261
|
+
__nccwpck_require__(7068),
|
|
262
262
|
);
|
|
263
263
|
var _postcssIcssParser = _interopRequireDefault(
|
|
264
|
-
__nccwpck_require__(
|
|
264
|
+
__nccwpck_require__(7113),
|
|
265
265
|
);
|
|
266
|
-
var _postcssUrlParser = _interopRequireDefault(__nccwpck_require__(
|
|
266
|
+
var _postcssUrlParser = _interopRequireDefault(__nccwpck_require__(4400));
|
|
267
267
|
function _interopRequireDefault(obj) {
|
|
268
268
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
269
269
|
}
|
|
270
270
|
},
|
|
271
|
-
|
|
271
|
+
7113: (__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
272
272
|
"use strict";
|
|
273
273
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
274
274
|
exports["default"] = void 0;
|
|
275
275
|
var _icssUtils = __nccwpck_require__(4531);
|
|
276
|
-
var _utils = __nccwpck_require__(
|
|
276
|
+
var _utils = __nccwpck_require__(7193);
|
|
277
277
|
const plugin = (options = {}) => ({
|
|
278
278
|
postcssPlugin: "postcss-icss-parser",
|
|
279
279
|
async OnceExit(root) {
|
|
@@ -372,14 +372,14 @@
|
|
|
372
372
|
plugin.postcss = true;
|
|
373
373
|
var _default = (exports["default"] = plugin);
|
|
374
374
|
},
|
|
375
|
-
|
|
375
|
+
7068: (__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
376
376
|
"use strict";
|
|
377
377
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
378
378
|
exports["default"] = void 0;
|
|
379
379
|
var _postcssValueParser = _interopRequireDefault(
|
|
380
380
|
__nccwpck_require__(2948),
|
|
381
381
|
);
|
|
382
|
-
var _utils = __nccwpck_require__(
|
|
382
|
+
var _utils = __nccwpck_require__(7193);
|
|
383
383
|
function _interopRequireDefault(obj) {
|
|
384
384
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
385
385
|
}
|
|
@@ -684,14 +684,14 @@
|
|
|
684
684
|
plugin.postcss = true;
|
|
685
685
|
var _default = (exports["default"] = plugin);
|
|
686
686
|
},
|
|
687
|
-
|
|
687
|
+
4400: (__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
688
688
|
"use strict";
|
|
689
689
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
690
690
|
exports["default"] = void 0;
|
|
691
691
|
var _postcssValueParser = _interopRequireDefault(
|
|
692
692
|
__nccwpck_require__(2948),
|
|
693
693
|
);
|
|
694
|
-
var _utils = __nccwpck_require__(
|
|
694
|
+
var _utils = __nccwpck_require__(7193);
|
|
695
695
|
function _interopRequireDefault(obj) {
|
|
696
696
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
697
697
|
}
|
|
@@ -1034,7 +1034,7 @@
|
|
|
1034
1034
|
plugin.postcss = true;
|
|
1035
1035
|
var _default = (exports["default"] = plugin);
|
|
1036
1036
|
},
|
|
1037
|
-
|
|
1037
|
+
7193: (__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
1038
1038
|
"use strict";
|
|
1039
1039
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1040
1040
|
exports.WEBPACK_IGNORE_COMMENT_REGEXP = void 0;
|
|
@@ -8098,6 +8098,6 @@
|
|
|
8098
8098
|
}
|
|
8099
8099
|
if (typeof __nccwpck_require__ !== "undefined")
|
|
8100
8100
|
__nccwpck_require__.ab = __dirname + "/";
|
|
8101
|
-
var __webpack_exports__ = __nccwpck_require__(
|
|
8101
|
+
var __webpack_exports__ = __nccwpck_require__(306);
|
|
8102
8102
|
module.exports = __webpack_exports__;
|
|
8103
8103
|
})();
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(() => {
|
|
2
2
|
var __webpack_modules__ = {
|
|
3
|
-
|
|
3
|
+
744: (module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
4
4
|
"use strict";
|
|
5
|
-
const { HtmlWebpackChildCompiler } = __nccwpck_require__(
|
|
5
|
+
const { HtmlWebpackChildCompiler } = __nccwpck_require__(525);
|
|
6
6
|
const compilerMap = new WeakMap();
|
|
7
7
|
class CachedChildCompilation {
|
|
8
8
|
constructor(compiler) {
|
|
@@ -304,7 +304,7 @@
|
|
|
304
304
|
}
|
|
305
305
|
module.exports = { CachedChildCompilation };
|
|
306
306
|
},
|
|
307
|
-
|
|
307
|
+
525: (module) => {
|
|
308
308
|
"use strict";
|
|
309
309
|
class HtmlWebpackChildCompiler {
|
|
310
310
|
constructor(templates) {
|
|
@@ -473,7 +473,7 @@
|
|
|
473
473
|
}
|
|
474
474
|
module.exports = { HtmlWebpackChildCompiler };
|
|
475
475
|
},
|
|
476
|
-
|
|
476
|
+
835: (module) => {
|
|
477
477
|
"use strict";
|
|
478
478
|
module.exports = {};
|
|
479
479
|
module.exports.none = (chunks) => chunks;
|
|
@@ -492,7 +492,7 @@
|
|
|
492
492
|
};
|
|
493
493
|
module.exports.auto = module.exports.none;
|
|
494
494
|
},
|
|
495
|
-
|
|
495
|
+
518: (module) => {
|
|
496
496
|
"use strict";
|
|
497
497
|
module.exports = function (err) {
|
|
498
498
|
return {
|
|
@@ -513,7 +513,7 @@
|
|
|
513
513
|
};
|
|
514
514
|
};
|
|
515
515
|
},
|
|
516
|
-
|
|
516
|
+
621: (module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
517
517
|
"use strict";
|
|
518
518
|
const { AsyncSeriesWaterfallHook } = __nccwpck_require__(408);
|
|
519
519
|
const htmlWebpackPluginHooksMap = new WeakMap();
|
|
@@ -539,7 +539,7 @@
|
|
|
539
539
|
}
|
|
540
540
|
module.exports = { getHtmlRspackPluginHooks };
|
|
541
541
|
},
|
|
542
|
-
|
|
542
|
+
716: (module) => {
|
|
543
543
|
const voidTags = [
|
|
544
544
|
"area",
|
|
545
545
|
"base",
|
|
@@ -607,19 +607,19 @@
|
|
|
607
607
|
htmlTagObjectToString,
|
|
608
608
|
};
|
|
609
609
|
},
|
|
610
|
-
|
|
610
|
+
185: (module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
611
611
|
"use strict";
|
|
612
612
|
const promisify = __nccwpck_require__(23).promisify;
|
|
613
613
|
const vm = __nccwpck_require__(154);
|
|
614
614
|
const fs = __nccwpck_require__(896);
|
|
615
615
|
const path = __nccwpck_require__(928);
|
|
616
|
-
const { CachedChildCompilation } = __nccwpck_require__(
|
|
616
|
+
const { CachedChildCompilation } = __nccwpck_require__(744);
|
|
617
617
|
const { createHtmlTagObject, htmlTagObjectToString, HtmlTagArray } =
|
|
618
|
-
__nccwpck_require__(
|
|
619
|
-
const prettyError = __nccwpck_require__(
|
|
620
|
-
const chunkSorter = __nccwpck_require__(
|
|
618
|
+
__nccwpck_require__(716);
|
|
619
|
+
const prettyError = __nccwpck_require__(518);
|
|
620
|
+
const chunkSorter = __nccwpck_require__(835);
|
|
621
621
|
const getHtmlRspackPluginHooks =
|
|
622
|
-
__nccwpck_require__(
|
|
622
|
+
__nccwpck_require__(621).getHtmlRspackPluginHooks;
|
|
623
623
|
class HtmlRspackPlugin {
|
|
624
624
|
constructor(userOptions = {}) {
|
|
625
625
|
this.version = HtmlRspackPlugin.version;
|
|
@@ -1578,6 +1578,6 @@
|
|
|
1578
1578
|
}
|
|
1579
1579
|
if (typeof __nccwpck_require__ !== "undefined")
|
|
1580
1580
|
__nccwpck_require__.ab = __dirname + "/";
|
|
1581
|
-
var __webpack_exports__ = __nccwpck_require__(
|
|
1581
|
+
var __webpack_exports__ = __nccwpck_require__(185);
|
|
1582
1582
|
module.exports = __webpack_exports__;
|
|
1583
1583
|
})();
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
(() => {
|
|
2
2
|
"use strict";
|
|
3
3
|
var __webpack_modules__ = {
|
|
4
|
-
|
|
5
|
-
module.exports = __nccwpck_require__(
|
|
4
|
+
737: (module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
5
|
+
module.exports = __nccwpck_require__(123)["default"];
|
|
6
6
|
},
|
|
7
|
-
|
|
7
|
+
123: (__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 _path = _interopRequireDefault(__nccwpck_require__(928));
|
|
12
|
-
var _utils = __nccwpck_require__(
|
|
12
|
+
var _utils = __nccwpck_require__(358);
|
|
13
13
|
function _interopRequireDefault(obj) {
|
|
14
14
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
15
15
|
}
|
|
@@ -179,7 +179,7 @@
|
|
|
179
179
|
callback(null, result.css, map, { ast });
|
|
180
180
|
}
|
|
181
181
|
},
|
|
182
|
-
|
|
182
|
+
358: (module, exports, __nccwpck_require__) => {
|
|
183
183
|
module = __nccwpck_require__.nmd(module);
|
|
184
184
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
185
185
|
exports.exec = exec;
|
|
@@ -716,6 +716,6 @@
|
|
|
716
716
|
})();
|
|
717
717
|
if (typeof __nccwpck_require__ !== "undefined")
|
|
718
718
|
__nccwpck_require__.ab = __dirname + "/";
|
|
719
|
-
var __webpack_exports__ = __nccwpck_require__(
|
|
719
|
+
var __webpack_exports__ = __nccwpck_require__(737);
|
|
720
720
|
module.exports = __webpack_exports__;
|
|
721
721
|
})();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
(() => {
|
|
2
2
|
"use strict";
|
|
3
3
|
var __webpack_modules__ = {
|
|
4
|
-
|
|
4
|
+
705: (__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
|
+
964: (__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 fs_1 = __nccwpck_require__(896);
|
|
131
131
|
const path_1 = __nccwpck_require__(928);
|
|
132
132
|
const lite_tapable_1 = __nccwpck_require__(408);
|
|
133
|
-
const helpers_1 = __nccwpck_require__(
|
|
133
|
+
const helpers_1 = __nccwpck_require__(705);
|
|
134
134
|
const compilerHookMap = new WeakMap();
|
|
135
135
|
const getCompilerHooks = (compiler) => {
|
|
136
136
|
let hooks = compilerHookMap.get(compiler);
|
|
@@ -312,7 +312,7 @@
|
|
|
312
312
|
exports.getCompilerHooks =
|
|
313
313
|
void 0;
|
|
314
314
|
const path_1 = __nccwpck_require__(928);
|
|
315
|
-
const hooks_1 = __nccwpck_require__(
|
|
315
|
+
const hooks_1 = __nccwpck_require__(964);
|
|
316
316
|
Object.defineProperty(exports, "getCompilerHooks", {
|
|
317
317
|
enumerable: true,
|
|
318
318
|
get: function () {
|
package/dist/index.cjs
CHANGED
|
@@ -1744,7 +1744,7 @@ var __webpack_exports__ = {};
|
|
|
1744
1744
|
async function createContext(options, userConfig, bundlerType) {
|
|
1745
1745
|
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;
|
|
1746
1746
|
return {
|
|
1747
|
-
version: "1.2.
|
|
1747
|
+
version: "1.2.15",
|
|
1748
1748
|
rootPath,
|
|
1749
1749
|
distPath: '',
|
|
1750
1750
|
cachePath,
|
|
@@ -4664,7 +4664,7 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
4664
4664
|
path: null === (_this_options_client = this.options.client) || void 0 === _this_options_client ? void 0 : _this_options_client.path
|
|
4665
4665
|
}), this.wsServer.on('error', (err)=>{
|
|
4666
4666
|
rslog_index_js_namespaceObject.logger.error(err);
|
|
4667
|
-
}), this.heartbeatTimer = setTimeout(this.checkSockets, 30000), this.wsServer.on('connection', (socket, req)=>{
|
|
4667
|
+
}), this.heartbeatTimer = setTimeout(this.checkSockets, 30000).unref(), this.wsServer.on('connection', (socket, req)=>{
|
|
4668
4668
|
let queryStr = req.url ? req.url.split('?')[1] : '';
|
|
4669
4669
|
this.onConnect(socket, queryStr ? (0, external_node_querystring_namespaceObject.parse)(queryStr) : {});
|
|
4670
4670
|
});
|
|
@@ -4917,7 +4917,7 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
4917
4917
|
constructor(options){
|
|
4918
4918
|
socketServer_define_property(this, "wsServer", void 0), socketServer_define_property(this, "sockets", []), socketServer_define_property(this, "options", void 0), socketServer_define_property(this, "stats", void 0), socketServer_define_property(this, "initialChunks", void 0), socketServer_define_property(this, "heartbeatTimer", null), socketServer_define_property(this, "checkSockets", ()=>{
|
|
4919
4919
|
for (let socket of this.wsServer.clients)socket.isAlive ? (socket.isAlive = !1, socket.ping(()=>{})) : socket.terminate();
|
|
4920
|
-
null !== this.heartbeatTimer && (this.heartbeatTimer = setTimeout(this.checkSockets, 30000));
|
|
4920
|
+
null !== this.heartbeatTimer && (this.heartbeatTimer = setTimeout(this.checkSockets, 30000).unref());
|
|
4921
4921
|
}), this.options = options, this.stats = {}, this.initialChunks = {};
|
|
4922
4922
|
}
|
|
4923
4923
|
}
|
|
@@ -5542,7 +5542,21 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
5542
5542
|
onUpgrade,
|
|
5543
5543
|
middlewares
|
|
5544
5544
|
};
|
|
5545
|
-
},
|
|
5545
|
+
}, cleanupCallbacks = new Set(), handleTermination = async (_, exitCode)=>{
|
|
5546
|
+
try {
|
|
5547
|
+
await Promise.all([
|
|
5548
|
+
...cleanupCallbacks
|
|
5549
|
+
].map((cb)=>cb()));
|
|
5550
|
+
} finally{
|
|
5551
|
+
process.exitCode ??= exitCode ? 128 + exitCode : void 0, process.exit();
|
|
5552
|
+
}
|
|
5553
|
+
}, registerCleanup = (callback)=>{
|
|
5554
|
+
cleanupCallbacks.add(callback);
|
|
5555
|
+
}, removeCleanup = (callback)=>{
|
|
5556
|
+
cleanupCallbacks.delete(callback);
|
|
5557
|
+
}, shutdownRefCount = 0, setupGracefulShutdown = ()=>(shutdownRefCount++, process.once('SIGTERM', handleTermination), 'true' !== process.env.CI && process.stdin.on('end', handleTermination), ()=>{
|
|
5558
|
+
!(--shutdownRefCount > 0) && (process.removeListener('SIGTERM', handleTermination), 0 === process.stdin.listenerCount('end') && process.stdin.removeListener('end', handleTermination));
|
|
5559
|
+
}), createHttpServer = async ({ serverConfig, middlewares })=>{
|
|
5546
5560
|
if (serverConfig.https) {
|
|
5547
5561
|
if (serverConfig.proxy) {
|
|
5548
5562
|
let { createServer } = await Promise.resolve().then(__webpack_require__.bind(__webpack_require__, "node:https"));
|
|
@@ -5563,7 +5577,7 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
5563
5577
|
rslog_index_js_namespaceObject.logger.debug('create dev server');
|
|
5564
5578
|
let { port, host, https, portTip } = await getServerConfig({
|
|
5565
5579
|
config
|
|
5566
|
-
}), devConfig = devServer_formatDevConfig(config.dev, port), routes = getRoutes(options.context), root = options.context.rootPath;
|
|
5580
|
+
}), { middlewareMode } = config.server, devConfig = devServer_formatDevConfig(config.dev, port), routes = getRoutes(options.context), root = options.context.rootPath;
|
|
5567
5581
|
options.context.devServer = {
|
|
5568
5582
|
hostname: host,
|
|
5569
5583
|
port,
|
|
@@ -5613,12 +5627,14 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
5613
5627
|
routes,
|
|
5614
5628
|
config,
|
|
5615
5629
|
clearCache: !0
|
|
5616
|
-
}), closeServer = async ()=>{
|
|
5617
|
-
await options.context.hooks.onCloseDevServer.callBatch(), await Promise.all([
|
|
5630
|
+
}), cleanupGracefulShutdown = middlewareMode ? null : setupGracefulShutdown(), closeServer = async ()=>{
|
|
5631
|
+
removeCleanup(closeServer), null == cleanupGracefulShutdown || cleanupGracefulShutdown(), await options.context.hooks.onCloseDevServer.callBatch(), await Promise.all([
|
|
5618
5632
|
null == devMiddlewares ? void 0 : devMiddlewares.close(),
|
|
5619
5633
|
null == fileWatcher ? void 0 : fileWatcher.close()
|
|
5620
5634
|
]);
|
|
5621
|
-
}
|
|
5635
|
+
};
|
|
5636
|
+
middlewareMode || registerCleanup(closeServer);
|
|
5637
|
+
let beforeCreateCompiler = ()=>{
|
|
5622
5638
|
if (printUrls(), cliShortcutsEnabled) {
|
|
5623
5639
|
let shortcutsOptions = 'boolean' == typeof devConfig.cliShortcuts ? {} : devConfig.cliShortcuts, cleanup = setupCliShortcuts({
|
|
5624
5640
|
openPage,
|
|
@@ -5649,7 +5665,7 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
5649
5665
|
environment
|
|
5650
5666
|
}))
|
|
5651
5667
|
}
|
|
5652
|
-
])), { default: connect } = await Promise.resolve().then(__webpack_require__.bind(__webpack_require__, "../../compiled/connect/index.js")), middlewares = connect(), httpServer =
|
|
5668
|
+
])), { default: connect } = await Promise.resolve().then(__webpack_require__.bind(__webpack_require__, "../../compiled/connect/index.js")), middlewares = connect(), httpServer = middlewareMode ? null : await createHttpServer({
|
|
5653
5669
|
serverConfig: config.server,
|
|
5654
5670
|
middlewares
|
|
5655
5671
|
}), devServerAPI = {
|
|
@@ -5956,12 +5972,14 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
5956
5972
|
protocol,
|
|
5957
5973
|
port,
|
|
5958
5974
|
host
|
|
5959
|
-
}), cliShortcutsEnabled = isCliShortcutsEnabled(config.dev), closeServer = async ()=>{
|
|
5960
|
-
await Promise.all([
|
|
5975
|
+
}), cliShortcutsEnabled = isCliShortcutsEnabled(config.dev), cleanupGracefulShutdown = setupGracefulShutdown(), closeServer = async ()=>{
|
|
5976
|
+
removeCleanup(closeServer), cleanupGracefulShutdown(), await Promise.all([
|
|
5961
5977
|
server.close(),
|
|
5962
5978
|
serverTerminator()
|
|
5963
5979
|
]);
|
|
5964
|
-
}
|
|
5980
|
+
};
|
|
5981
|
+
registerCleanup(closeServer);
|
|
5982
|
+
let printUrls = ()=>printServerURLs({
|
|
5965
5983
|
urls,
|
|
5966
5984
|
port,
|
|
5967
5985
|
routes,
|
|
@@ -6076,8 +6094,7 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
6076
6094
|
strategy: 'custom'
|
|
6077
6095
|
}), config.source.include = [
|
|
6078
6096
|
...config.source.include || [],
|
|
6079
|
-
/@module-federation[\\/]
|
|
6080
|
-
/@module-federation[\\/]runtime/
|
|
6097
|
+
/@module-federation[\\/]/
|
|
6081
6098
|
]);
|
|
6082
6099
|
}), api.modifyBundlerChain(async (chain, { CHAIN_ID, target, environment })=>{
|
|
6083
6100
|
var _config_moduleFederation;
|
|
@@ -6743,12 +6760,12 @@ ${section.body}` : section.body).join("\n\n"));
|
|
|
6743
6760
|
}
|
|
6744
6761
|
}(), process.title = 'rsbuild-node';
|
|
6745
6762
|
let { npm_execpath } = process.env;
|
|
6746
|
-
(!npm_execpath || npm_execpath.includes('npx-cli.js') || npm_execpath.includes('.bun')) && console.log(), rslog_index_js_namespaceObject.logger.greet(` Rsbuild v1.2.
|
|
6763
|
+
(!npm_execpath || npm_execpath.includes('npx-cli.js') || npm_execpath.includes('.bun')) && console.log(), rslog_index_js_namespaceObject.logger.greet(` Rsbuild v1.2.15\n`);
|
|
6747
6764
|
}();
|
|
6748
6765
|
try {
|
|
6749
6766
|
!function() {
|
|
6750
6767
|
let cli = dist('rsbuild');
|
|
6751
|
-
cli.help(), cli.version("1.2.
|
|
6768
|
+
cli.help(), cli.version("1.2.15"), applyCommonOptions(cli);
|
|
6752
6769
|
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');
|
|
6753
6770
|
applyServerOptions(devCommand), applyServerOptions(previewCommand), devCommand.action(async (options)=>{
|
|
6754
6771
|
try {
|
|
@@ -6799,7 +6816,7 @@ ${section.body}` : section.body).join("\n\n"));
|
|
|
6799
6816
|
rslog_index_js_namespaceObject.logger.error('Failed to start Rsbuild CLI.'), rslog_index_js_namespaceObject.logger.error(err);
|
|
6800
6817
|
}
|
|
6801
6818
|
}
|
|
6802
|
-
let src_rslib_entry_version = "1.2.
|
|
6819
|
+
let src_rslib_entry_version = "1.2.15";
|
|
6803
6820
|
})();
|
|
6804
6821
|
var __webpack_export_target__ = exports;
|
|
6805
6822
|
for(var __webpack_i__ in __webpack_exports__)__webpack_export_target__[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
package/dist/index.js
CHANGED
|
@@ -1653,7 +1653,7 @@ async function updateEnvironmentContext(context, configs) {
|
|
|
1653
1653
|
async function createContext(options, userConfig, bundlerType) {
|
|
1654
1654
|
let { cwd } = options, rootPath = userConfig.root ? getAbsolutePath(cwd, userConfig.root) : cwd, rsbuildConfig = await withDefaultConfig(rootPath, userConfig), cachePath = (0, __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__.join)(rootPath, 'node_modules', '.cache'), specifiedEnvironments = options.environment && options.environment.length > 0 ? options.environment : void 0;
|
|
1655
1655
|
return {
|
|
1656
|
-
version: "1.2.
|
|
1656
|
+
version: "1.2.15",
|
|
1657
1657
|
rootPath,
|
|
1658
1658
|
distPath: '',
|
|
1659
1659
|
cachePath,
|
|
@@ -4558,7 +4558,7 @@ class SocketServer {
|
|
|
4558
4558
|
path: null === (_this_options_client = this.options.client) || void 0 === _this_options_client ? void 0 : _this_options_client.path
|
|
4559
4559
|
}), this.wsServer.on('error', (err)=>{
|
|
4560
4560
|
__WEBPACK_EXTERNAL_MODULE__compiled_rslog_index_js_c302f6e3__.logger.error(err);
|
|
4561
|
-
}), this.heartbeatTimer = setTimeout(this.checkSockets, 30000), this.wsServer.on('connection', (socket, req)=>{
|
|
4561
|
+
}), this.heartbeatTimer = setTimeout(this.checkSockets, 30000).unref(), this.wsServer.on('connection', (socket, req)=>{
|
|
4562
4562
|
let queryStr = req.url ? req.url.split('?')[1] : '';
|
|
4563
4563
|
this.onConnect(socket, queryStr ? (0, __WEBPACK_EXTERNAL_MODULE_node_querystring_aeb3c0b4__.parse)(queryStr) : {});
|
|
4564
4564
|
});
|
|
@@ -4811,7 +4811,7 @@ class SocketServer {
|
|
|
4811
4811
|
constructor(options){
|
|
4812
4812
|
socketServer_define_property(this, "wsServer", void 0), socketServer_define_property(this, "sockets", []), socketServer_define_property(this, "options", void 0), socketServer_define_property(this, "stats", void 0), socketServer_define_property(this, "initialChunks", void 0), socketServer_define_property(this, "heartbeatTimer", null), socketServer_define_property(this, "checkSockets", ()=>{
|
|
4813
4813
|
for (let socket of this.wsServer.clients)socket.isAlive ? (socket.isAlive = !1, socket.ping(()=>{})) : socket.terminate();
|
|
4814
|
-
null !== this.heartbeatTimer && (this.heartbeatTimer = setTimeout(this.checkSockets, 30000));
|
|
4814
|
+
null !== this.heartbeatTimer && (this.heartbeatTimer = setTimeout(this.checkSockets, 30000).unref());
|
|
4815
4815
|
}), this.options = options, this.stats = {}, this.initialChunks = {};
|
|
4816
4816
|
}
|
|
4817
4817
|
}
|
|
@@ -5431,7 +5431,21 @@ let runner_run = async ({ bundlePath, ...runnerFactoryOptions })=>new BasicRunne
|
|
|
5431
5431
|
onUpgrade,
|
|
5432
5432
|
middlewares
|
|
5433
5433
|
};
|
|
5434
|
-
},
|
|
5434
|
+
}, cleanupCallbacks = new Set(), handleTermination = async (_, exitCode)=>{
|
|
5435
|
+
try {
|
|
5436
|
+
await Promise.all([
|
|
5437
|
+
...cleanupCallbacks
|
|
5438
|
+
].map((cb)=>cb()));
|
|
5439
|
+
} finally{
|
|
5440
|
+
process.exitCode ??= exitCode ? 128 + exitCode : void 0, process.exit();
|
|
5441
|
+
}
|
|
5442
|
+
}, registerCleanup = (callback)=>{
|
|
5443
|
+
cleanupCallbacks.add(callback);
|
|
5444
|
+
}, removeCleanup = (callback)=>{
|
|
5445
|
+
cleanupCallbacks.delete(callback);
|
|
5446
|
+
}, shutdownRefCount = 0, setupGracefulShutdown = ()=>(shutdownRefCount++, process.once('SIGTERM', handleTermination), 'true' !== process.env.CI && process.stdin.on('end', handleTermination), ()=>{
|
|
5447
|
+
!(--shutdownRefCount > 0) && (process.removeListener('SIGTERM', handleTermination), 0 === process.stdin.listenerCount('end') && process.stdin.removeListener('end', handleTermination));
|
|
5448
|
+
}), createHttpServer = async ({ serverConfig, middlewares })=>{
|
|
5435
5449
|
if (serverConfig.https) {
|
|
5436
5450
|
if (serverConfig.proxy) {
|
|
5437
5451
|
let { createServer } = await import("node:https");
|
|
@@ -5452,7 +5466,7 @@ async function devServer_createDevServer(options, createCompiler, config, { comp
|
|
|
5452
5466
|
__WEBPACK_EXTERNAL_MODULE__compiled_rslog_index_js_c302f6e3__.logger.debug('create dev server');
|
|
5453
5467
|
let { port, host, https, portTip } = await getServerConfig({
|
|
5454
5468
|
config
|
|
5455
|
-
}), devConfig = devServer_formatDevConfig(config.dev, port), routes = getRoutes(options.context), root = options.context.rootPath;
|
|
5469
|
+
}), { middlewareMode } = config.server, devConfig = devServer_formatDevConfig(config.dev, port), routes = getRoutes(options.context), root = options.context.rootPath;
|
|
5456
5470
|
options.context.devServer = {
|
|
5457
5471
|
hostname: host,
|
|
5458
5472
|
port,
|
|
@@ -5502,12 +5516,14 @@ async function devServer_createDevServer(options, createCompiler, config, { comp
|
|
|
5502
5516
|
routes,
|
|
5503
5517
|
config,
|
|
5504
5518
|
clearCache: !0
|
|
5505
|
-
}), closeServer = async ()=>{
|
|
5506
|
-
await options.context.hooks.onCloseDevServer.callBatch(), await Promise.all([
|
|
5519
|
+
}), cleanupGracefulShutdown = middlewareMode ? null : setupGracefulShutdown(), closeServer = async ()=>{
|
|
5520
|
+
removeCleanup(closeServer), null == cleanupGracefulShutdown || cleanupGracefulShutdown(), await options.context.hooks.onCloseDevServer.callBatch(), await Promise.all([
|
|
5507
5521
|
null == devMiddlewares ? void 0 : devMiddlewares.close(),
|
|
5508
5522
|
null == fileWatcher ? void 0 : fileWatcher.close()
|
|
5509
5523
|
]);
|
|
5510
|
-
}
|
|
5524
|
+
};
|
|
5525
|
+
middlewareMode || registerCleanup(closeServer);
|
|
5526
|
+
let beforeCreateCompiler = ()=>{
|
|
5511
5527
|
if (printUrls(), cliShortcutsEnabled) {
|
|
5512
5528
|
let shortcutsOptions = 'boolean' == typeof devConfig.cliShortcuts ? {} : devConfig.cliShortcuts, cleanup = setupCliShortcuts({
|
|
5513
5529
|
openPage,
|
|
@@ -5538,7 +5554,7 @@ async function devServer_createDevServer(options, createCompiler, config, { comp
|
|
|
5538
5554
|
environment
|
|
5539
5555
|
}))
|
|
5540
5556
|
}
|
|
5541
|
-
])), { default: connect } = await import("../compiled/connect/index.js"), middlewares = connect(), httpServer =
|
|
5557
|
+
])), { default: connect } = await import("../compiled/connect/index.js"), middlewares = connect(), httpServer = middlewareMode ? null : await createHttpServer({
|
|
5542
5558
|
serverConfig: config.server,
|
|
5543
5559
|
middlewares
|
|
5544
5560
|
}), devServerAPI = {
|
|
@@ -5845,12 +5861,14 @@ async function startProdServer(context, config, { getPortSilently } = {}) {
|
|
|
5845
5861
|
protocol,
|
|
5846
5862
|
port,
|
|
5847
5863
|
host
|
|
5848
|
-
}), cliShortcutsEnabled = isCliShortcutsEnabled(config.dev), closeServer = async ()=>{
|
|
5849
|
-
await Promise.all([
|
|
5864
|
+
}), cliShortcutsEnabled = isCliShortcutsEnabled(config.dev), cleanupGracefulShutdown = setupGracefulShutdown(), closeServer = async ()=>{
|
|
5865
|
+
removeCleanup(closeServer), cleanupGracefulShutdown(), await Promise.all([
|
|
5850
5866
|
server.close(),
|
|
5851
5867
|
serverTerminator()
|
|
5852
5868
|
]);
|
|
5853
|
-
}
|
|
5869
|
+
};
|
|
5870
|
+
registerCleanup(closeServer);
|
|
5871
|
+
let printUrls = ()=>printServerURLs({
|
|
5854
5872
|
urls,
|
|
5855
5873
|
port,
|
|
5856
5874
|
routes,
|
|
@@ -5965,8 +5983,7 @@ async function applyDefaultPlugins(pluginManager, context) {
|
|
|
5965
5983
|
strategy: 'custom'
|
|
5966
5984
|
}), config.source.include = [
|
|
5967
5985
|
...config.source.include || [],
|
|
5968
|
-
/@module-federation[\\/]
|
|
5969
|
-
/@module-federation[\\/]runtime/
|
|
5986
|
+
/@module-federation[\\/]/
|
|
5970
5987
|
]);
|
|
5971
5988
|
}), api.modifyBundlerChain(async (chain, { CHAIN_ID, target, environment })=>{
|
|
5972
5989
|
var _config_moduleFederation;
|
|
@@ -6631,12 +6648,12 @@ async function runCLI() {
|
|
|
6631
6648
|
}
|
|
6632
6649
|
}(), process.title = 'rsbuild-node';
|
|
6633
6650
|
let { npm_execpath } = process.env;
|
|
6634
|
-
(!npm_execpath || npm_execpath.includes('npx-cli.js') || npm_execpath.includes('.bun')) && console.log(), __WEBPACK_EXTERNAL_MODULE__compiled_rslog_index_js_c302f6e3__.logger.greet(` Rsbuild v1.2.
|
|
6651
|
+
(!npm_execpath || npm_execpath.includes('npx-cli.js') || npm_execpath.includes('.bun')) && console.log(), __WEBPACK_EXTERNAL_MODULE__compiled_rslog_index_js_c302f6e3__.logger.greet(` Rsbuild v1.2.15\n`);
|
|
6635
6652
|
}();
|
|
6636
6653
|
try {
|
|
6637
6654
|
!function() {
|
|
6638
6655
|
let cli = dist('rsbuild');
|
|
6639
|
-
cli.help(), cli.version("1.2.
|
|
6656
|
+
cli.help(), cli.version("1.2.15"), applyCommonOptions(cli);
|
|
6640
6657
|
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');
|
|
6641
6658
|
applyServerOptions(devCommand), applyServerOptions(previewCommand), devCommand.action(async (options)=>{
|
|
6642
6659
|
try {
|
|
@@ -6687,6 +6704,6 @@ async function runCLI() {
|
|
|
6687
6704
|
__WEBPACK_EXTERNAL_MODULE__compiled_rslog_index_js_c302f6e3__.logger.error('Failed to start Rsbuild CLI.'), __WEBPACK_EXTERNAL_MODULE__compiled_rslog_index_js_c302f6e3__.logger.error(err);
|
|
6688
6705
|
}
|
|
6689
6706
|
}
|
|
6690
|
-
let src_version = "1.2.
|
|
6707
|
+
let src_version = "1.2.15";
|
|
6691
6708
|
var __webpack_exports__logger = __WEBPACK_EXTERNAL_MODULE__compiled_rslog_index_js_c302f6e3__.logger, __webpack_exports__rspack = __WEBPACK_EXTERNAL_MODULE__rspack_core_e0096ff7__.rspack;
|
|
6692
6709
|
export { PLUGIN_CSS_NAME, PLUGIN_SWC_NAME, createRsbuild, defineConfig, ensureAssetPrefix, config_loadConfig as loadConfig, loadEnv, mergeRsbuildConfig, runCLI, src_version as version, __webpack_exports__logger as logger, __webpack_exports__rspack as rspack };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Registers a cleanup callback to be executed before process termination
|
|
3
|
+
*/
|
|
4
|
+
export declare const registerCleanup: (callback: () => Promise<void>) => void;
|
|
5
|
+
export declare const removeCleanup: (callback: () => Promise<void>) => void;
|
|
6
|
+
/**
|
|
7
|
+
* Sets up listeners for termination signals and stdin end event
|
|
8
|
+
* This should be called once during application initialization
|
|
9
|
+
*/
|
|
10
|
+
export declare const setupGracefulShutdown: () => (() => void);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsbuild/core",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.15",
|
|
4
4
|
"description": "The Rspack-based build tool.",
|
|
5
5
|
"homepage": "https://rsbuild.dev",
|
|
6
6
|
"bugs": {
|
|
@@ -46,16 +46,16 @@
|
|
|
46
46
|
"types.d.ts"
|
|
47
47
|
],
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@rspack/core": "1.2.
|
|
49
|
+
"@rspack/core": "1.2.7",
|
|
50
50
|
"@rspack/lite-tapable": "~1.0.1",
|
|
51
51
|
"@swc/helpers": "^0.5.15",
|
|
52
|
-
"core-js": "~3.
|
|
52
|
+
"core-js": "~3.41.0",
|
|
53
53
|
"jiti": "^2.4.2"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
|
-
"@rslib/core": "0.5.
|
|
56
|
+
"@rslib/core": "0.5.2",
|
|
57
57
|
"@types/connect": "3.4.38",
|
|
58
|
-
"@types/node": "^22.13.
|
|
58
|
+
"@types/node": "^22.13.8",
|
|
59
59
|
"@types/on-finished": "2.3.4",
|
|
60
60
|
"@types/webpack-bundle-analyzer": "4.7.0",
|
|
61
61
|
"@types/ws": "^8.5.14",
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
"sirv": "^3.0.1",
|
|
89
89
|
"style-loader": "3.3.4",
|
|
90
90
|
"tinyglobby": "^0.2.12",
|
|
91
|
-
"typescript": "^5.
|
|
91
|
+
"typescript": "^5.8.2",
|
|
92
92
|
"webpack": "^5.98.0",
|
|
93
93
|
"webpack-bundle-analyzer": "^4.10.2",
|
|
94
94
|
"webpack-merge": "6.0.1",
|