@rsbuild/core 1.3.5 → 1.3.6
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 +85 -45
- package/dist/index.js +83 -44
- package/dist-types/helpers/exitHook.d.ts +3 -0
- package/dist-types/types/config.d.ts +1 -2
- package/dist-types/types/hooks.d.ts +5 -1
- package/package.json +3 -3
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
(() => {
|
|
2
2
|
var __webpack_modules__ = {
|
|
3
|
-
|
|
3
|
+
7857: (module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
4
4
|
"use strict";
|
|
5
|
-
const loader = __nccwpck_require__(
|
|
5
|
+
const loader = __nccwpck_require__(3827);
|
|
6
6
|
module.exports = loader.default;
|
|
7
7
|
module.exports.defaultGetLocalIdent =
|
|
8
|
-
__nccwpck_require__(
|
|
8
|
+
__nccwpck_require__(9566).defaultGetLocalIdent;
|
|
9
9
|
},
|
|
10
|
-
|
|
10
|
+
3827: (__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__(9568);
|
|
16
|
+
var _utils = __nccwpck_require__(9566);
|
|
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
|
+
9568: (__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__(2675),
|
|
262
262
|
);
|
|
263
263
|
var _postcssIcssParser = _interopRequireDefault(
|
|
264
|
-
__nccwpck_require__(
|
|
264
|
+
__nccwpck_require__(8222),
|
|
265
265
|
);
|
|
266
|
-
var _postcssUrlParser = _interopRequireDefault(__nccwpck_require__(
|
|
266
|
+
var _postcssUrlParser = _interopRequireDefault(__nccwpck_require__(4985));
|
|
267
267
|
function _interopRequireDefault(obj) {
|
|
268
268
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
269
269
|
}
|
|
270
270
|
},
|
|
271
|
-
|
|
271
|
+
8222: (__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__(9566);
|
|
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
|
+
2675: (__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__(9566);
|
|
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
|
+
4985: (__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__(9566);
|
|
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
|
+
9566: (__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__(7857);
|
|
8102
8102
|
module.exports = __webpack_exports__;
|
|
8103
8103
|
})();
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(() => {
|
|
2
2
|
var __webpack_modules__ = {
|
|
3
|
-
|
|
3
|
+
380: (module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
4
4
|
"use strict";
|
|
5
|
-
const { HtmlWebpackChildCompiler } = __nccwpck_require__(
|
|
5
|
+
const { HtmlWebpackChildCompiler } = __nccwpck_require__(265);
|
|
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
|
+
265: (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
|
+
951: (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
|
+
130: (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
|
+
857: (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
|
+
328: (module) => {
|
|
543
543
|
const voidTags = [
|
|
544
544
|
"area",
|
|
545
545
|
"base",
|
|
@@ -607,19 +607,19 @@
|
|
|
607
607
|
htmlTagObjectToString,
|
|
608
608
|
};
|
|
609
609
|
},
|
|
610
|
-
|
|
610
|
+
45: (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__(380);
|
|
617
617
|
const { createHtmlTagObject, htmlTagObjectToString, HtmlTagArray } =
|
|
618
|
-
__nccwpck_require__(
|
|
619
|
-
const prettyError = __nccwpck_require__(
|
|
620
|
-
const chunkSorter = __nccwpck_require__(
|
|
618
|
+
__nccwpck_require__(328);
|
|
619
|
+
const prettyError = __nccwpck_require__(130);
|
|
620
|
+
const chunkSorter = __nccwpck_require__(951);
|
|
621
621
|
const getHtmlRspackPluginHooks =
|
|
622
|
-
__nccwpck_require__(
|
|
622
|
+
__nccwpck_require__(857).getHtmlRspackPluginHooks;
|
|
623
623
|
class HtmlRspackPlugin {
|
|
624
624
|
constructor(userOptions = {}) {
|
|
625
625
|
this.version = HtmlRspackPlugin.version;
|
|
@@ -1586,6 +1586,6 @@
|
|
|
1586
1586
|
}
|
|
1587
1587
|
if (typeof __nccwpck_require__ !== "undefined")
|
|
1588
1588
|
__nccwpck_require__.ab = __dirname + "/";
|
|
1589
|
-
var __webpack_exports__ = __nccwpck_require__(
|
|
1589
|
+
var __webpack_exports__ = __nccwpck_require__(45);
|
|
1590
1590
|
module.exports = __webpack_exports__;
|
|
1591
1591
|
})();
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
(() => {
|
|
2
2
|
"use strict";
|
|
3
3
|
var __webpack_modules__ = {
|
|
4
|
-
|
|
5
|
-
module.exports = __nccwpck_require__(
|
|
4
|
+
342: (module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
5
|
+
module.exports = __nccwpck_require__(716)["default"];
|
|
6
6
|
},
|
|
7
|
-
|
|
7
|
+
716: (__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__(237);
|
|
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
|
+
237: (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__(342);
|
|
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
|
+
207: (__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
|
+
338: (__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__(207);
|
|
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__(338);
|
|
316
316
|
Object.defineProperty(exports, "getCompilerHooks", {
|
|
317
317
|
enumerable: true,
|
|
318
318
|
get: function () {
|
package/dist/index.cjs
CHANGED
|
@@ -102,8 +102,8 @@ var __webpack_modules__ = {
|
|
|
102
102
|
return options;
|
|
103
103
|
};
|
|
104
104
|
},
|
|
105
|
-
"../../node_modules/.pnpm/dotenv@16.
|
|
106
|
-
let fs = __webpack_require__("fs"), path = __webpack_require__("path"), os = __webpack_require__("os"), crypto = __webpack_require__("crypto"), version = __webpack_require__("../../node_modules/.pnpm/dotenv@16.
|
|
105
|
+
"../../node_modules/.pnpm/dotenv@16.5.0/node_modules/dotenv/lib/main.js": function(module, __unused_webpack_exports, __webpack_require__) {
|
|
106
|
+
let fs = __webpack_require__("fs"), path = __webpack_require__("path"), os = __webpack_require__("os"), crypto = __webpack_require__("crypto"), version = __webpack_require__("../../node_modules/.pnpm/dotenv@16.5.0/node_modules/dotenv/package.json").version, LINE = /(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;
|
|
107
107
|
function _debug(message) {
|
|
108
108
|
console.log(`[dotenv@${version}][DEBUG] ${message}`);
|
|
109
109
|
}
|
|
@@ -149,7 +149,7 @@ var __webpack_modules__ = {
|
|
|
149
149
|
};
|
|
150
150
|
},
|
|
151
151
|
_configVault: function(options) {
|
|
152
|
-
|
|
152
|
+
options && options.debug && _debug('Loading env from encrypted .env.vault');
|
|
153
153
|
let parsed = DotenvModule._parseVault(options), processEnv = process.env;
|
|
154
154
|
return options && null != options.processEnv && (processEnv = options.processEnv), DotenvModule.populate(processEnv, parsed, options), {
|
|
155
155
|
parsed
|
|
@@ -959,9 +959,9 @@ var __webpack_modules__ = {
|
|
|
959
959
|
"use strict";
|
|
960
960
|
module.exports = import("node:https");
|
|
961
961
|
},
|
|
962
|
-
"../../node_modules/.pnpm/dotenv@16.
|
|
962
|
+
"../../node_modules/.pnpm/dotenv@16.5.0/node_modules/dotenv/package.json": function(module) {
|
|
963
963
|
"use strict";
|
|
964
|
-
module.exports = JSON.parse('{"name":"dotenv","version":"16.
|
|
964
|
+
module.exports = JSON.parse('{"name":"dotenv","version":"16.5.0","description":"Loads environment variables from .env file","main":"lib/main.js","types":"lib/main.d.ts","exports":{".":{"types":"./lib/main.d.ts","require":"./lib/main.js","default":"./lib/main.js"},"./config":"./config.js","./config.js":"./config.js","./lib/env-options":"./lib/env-options.js","./lib/env-options.js":"./lib/env-options.js","./lib/cli-options":"./lib/cli-options.js","./lib/cli-options.js":"./lib/cli-options.js","./package.json":"./package.json"},"scripts":{"dts-check":"tsc --project tests/types/tsconfig.json","lint":"standard","pretest":"npm run lint && npm run dts-check","test":"tap run --allow-empty-coverage --disable-coverage --timeout=60000","test:coverage":"tap run --show-full-coverage --timeout=60000 --coverage-report=lcov","prerelease":"npm test","release":"standard-version"},"repository":{"type":"git","url":"git://github.com/motdotla/dotenv.git"},"homepage":"https://github.com/motdotla/dotenv#readme","funding":"https://dotenvx.com","keywords":["dotenv","env",".env","environment","variables","config","settings"],"readmeFilename":"README.md","license":"BSD-2-Clause","devDependencies":{"@types/node":"^18.11.3","decache":"^4.6.2","sinon":"^14.0.1","standard":"^17.0.0","standard-version":"^9.5.0","tap":"^19.2.0","typescript":"^4.8.4"},"engines":{"node":">=12"},"browser":{"fs":false}}');
|
|
965
965
|
}
|
|
966
966
|
}, __webpack_module_cache__ = {};
|
|
967
967
|
function __webpack_require__(moduleId) {
|
|
@@ -1031,7 +1031,7 @@ for(var __webpack_i__ in (()=>{
|
|
|
1031
1031
|
let external_node_fs_namespaceObject = require("node:fs");
|
|
1032
1032
|
var external_node_fs_default = __webpack_require__.n(external_node_fs_namespaceObject);
|
|
1033
1033
|
let external_node_path_namespaceObject = require("node:path");
|
|
1034
|
-
var external_node_path_default = __webpack_require__.n(external_node_path_namespaceObject), main = __webpack_require__("../../node_modules/.pnpm/dotenv@16.
|
|
1034
|
+
var external_node_path_default = __webpack_require__.n(external_node_path_namespaceObject), main = __webpack_require__("../../node_modules/.pnpm/dotenv@16.5.0/node_modules/dotenv/lib/main.js"), lib_main = __webpack_require__("../../node_modules/.pnpm/dotenv-expand@12.0.1/node_modules/dotenv-expand/lib/main.js");
|
|
1035
1035
|
let external_node_url_namespaceObject = require("node:url");
|
|
1036
1036
|
var cjs = __webpack_require__("../../node_modules/.pnpm/deepmerge@4.3.1/node_modules/deepmerge/dist/cjs.js"), cjs_default = __webpack_require__.n(cjs);
|
|
1037
1037
|
let index_js_namespaceObject = require("../compiled/picocolors/index.js");
|
|
@@ -1514,7 +1514,7 @@ for(var __webpack_i__ in (()=>{
|
|
|
1514
1514
|
let realKey = key.split('.').slice(2).join('.');
|
|
1515
1515
|
return OVERRIDE_PATHS.includes(realKey);
|
|
1516
1516
|
}
|
|
1517
|
-
return OVERRIDE_PATHS.includes(key);
|
|
1517
|
+
return OVERRIDE_PATHS.includes(key) || key.startsWith('output.filename.');
|
|
1518
1518
|
}, merge = (x, y, path = '')=>{
|
|
1519
1519
|
if (isOverridePath(path)) return y ?? x;
|
|
1520
1520
|
if (void 0 === x) return isPlainObject(y) ? cloneDeep(y) : y;
|
|
@@ -2089,7 +2089,21 @@ for(var __webpack_i__ in (()=>{
|
|
|
2089
2089
|
onEnvironmentDone,
|
|
2090
2090
|
MultiStatsCtor
|
|
2091
2091
|
});
|
|
2092
|
-
},
|
|
2092
|
+
}, external_node_os_namespaceObject = require("node:os");
|
|
2093
|
+
var external_node_os_default = __webpack_require__.n(external_node_os_namespaceObject);
|
|
2094
|
+
let external_node_process_namespaceObject = require("node:process");
|
|
2095
|
+
var external_node_process_default = __webpack_require__.n(external_node_process_namespaceObject);
|
|
2096
|
+
let exitHook_callbacks = new Set(), isCalled = !1, isRegistered = !1;
|
|
2097
|
+
function exit(exitCode, type) {
|
|
2098
|
+
if (!isCalled) {
|
|
2099
|
+
for (let callback of (isCalled = !0, exitHook_callbacks))callback(exitCode);
|
|
2100
|
+
if ('SIGINT' === type) {
|
|
2101
|
+
let listeners = external_node_process_default().listeners('SIGINT');
|
|
2102
|
+
Array.isArray(listeners) && listeners.length <= 1 && external_node_process_default().exit(exitCode);
|
|
2103
|
+
}
|
|
2104
|
+
}
|
|
2105
|
+
}
|
|
2106
|
+
let mapProcessAssetsStage = (compiler, stage)=>{
|
|
2093
2107
|
let { Compilation } = compiler.webpack;
|
|
2094
2108
|
switch(stage){
|
|
2095
2109
|
case 'additional':
|
|
@@ -2207,7 +2221,7 @@ for(var __webpack_i__ in (()=>{
|
|
|
2207
2221
|
async function createContext(options, userConfig) {
|
|
2208
2222
|
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;
|
|
2209
2223
|
return {
|
|
2210
|
-
version: "1.3.
|
|
2224
|
+
version: "1.3.6",
|
|
2211
2225
|
rootPath,
|
|
2212
2226
|
distPath: '',
|
|
2213
2227
|
cachePath,
|
|
@@ -3046,32 +3060,32 @@ for(var __webpack_i__ in (()=>{
|
|
|
3046
3060
|
}, assets = await getAssets();
|
|
3047
3061
|
if (0 === assets.length) return logs;
|
|
3048
3062
|
logs.push(''), assets.sort((a, b)=>a.size - b.size);
|
|
3049
|
-
let
|
|
3063
|
+
let fileHeader = `File (${environmentName})`, maxFileLength = Math.max(...assets.map((a)=>(a.folder + external_node_path_default().sep + a.name).length), fileHeader.length), maxSizeLength = Math.max(...assets.map((a)=>a.sizeLabel.length));
|
|
3050
3064
|
if (!1 !== options.detail) {
|
|
3051
3065
|
let showGzipHeader = !!(options.compressed && assets.some((item)=>null !== item.gzippedSize));
|
|
3052
|
-
logs.push(function(
|
|
3053
|
-
let
|
|
3054
|
-
|
|
3055
|
-
|
|
3066
|
+
logs.push(function(maxFileLength, maxSizeLength, fileHeader, showGzipHeader) {
|
|
3067
|
+
let lengths = [
|
|
3068
|
+
maxFileLength,
|
|
3069
|
+
maxSizeLength
|
|
3056
3070
|
], rowTypes = [
|
|
3057
|
-
|
|
3071
|
+
fileHeader,
|
|
3058
3072
|
'Size'
|
|
3059
3073
|
];
|
|
3060
3074
|
showGzipHeader && rowTypes.push('Gzip');
|
|
3061
3075
|
let headerRow = rowTypes.reduce((prev, cur, index)=>{
|
|
3062
|
-
let length =
|
|
3076
|
+
let length = lengths[index], curLabel = cur;
|
|
3063
3077
|
return length && (curLabel = cur.length < length ? cur + ' '.repeat(length - cur.length) : cur), `${prev + curLabel} `;
|
|
3064
3078
|
}, ' ');
|
|
3065
3079
|
return index_js_default().blue(headerRow);
|
|
3066
|
-
}(
|
|
3080
|
+
}(maxFileLength, maxSizeLength, fileHeader, showGzipHeader));
|
|
3067
3081
|
}
|
|
3068
3082
|
let totalSize = 0, totalGzipSize = 0;
|
|
3069
3083
|
for (let asset of assets){
|
|
3070
3084
|
let { sizeLabel } = asset, { name, folder, gzipSizeLabel } = asset, fileNameLength = (folder + external_node_path_default().sep + name).length, sizeLength = sizeLabel.length;
|
|
3071
3085
|
if (totalSize += asset.size, options.compressed && (totalGzipSize += asset.gzippedSize ?? asset.size), !1 !== options.detail) {
|
|
3072
|
-
sizeLength <
|
|
3086
|
+
sizeLength < maxSizeLength && (sizeLabel += ' '.repeat(maxSizeLength - sizeLength));
|
|
3073
3087
|
let fileNameLabel = index_js_default().dim(asset.folder + external_node_path_default().sep) + coloringAssetName(asset.name);
|
|
3074
|
-
fileNameLength <
|
|
3088
|
+
fileNameLength < maxFileLength && (fileNameLabel += ' '.repeat(maxFileLength - fileNameLength));
|
|
3075
3089
|
let log = ` ${fileNameLabel} ${sizeLabel}`;
|
|
3076
3090
|
gzipSizeLabel && (log += ` ${gzipSizeLabel}`), logs.push(log);
|
|
3077
3091
|
}
|
|
@@ -3725,8 +3739,6 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
3725
3739
|
}
|
|
3726
3740
|
}), external_node_child_process_namespaceObject = require("node:child_process"), external_node_net_namespaceObject = require("node:net");
|
|
3727
3741
|
var external_node_net_default = __webpack_require__.n(external_node_net_namespaceObject);
|
|
3728
|
-
let external_node_os_namespaceObject = require("node:os");
|
|
3729
|
-
var external_node_os_default = __webpack_require__.n(external_node_os_namespaceObject);
|
|
3730
3742
|
let normalizeUrl = (url)=>url.replace(/([^:]\/)\/+/g, '$1'), formatPrefix = (input)=>{
|
|
3731
3743
|
let prefix = input;
|
|
3732
3744
|
if ((null == prefix ? void 0 : prefix.startsWith('./')) && (prefix = prefix.replace('./', '')), !prefix) return '/';
|
|
@@ -4285,7 +4297,7 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
4285
4297
|
let stopProfiler = (output, profileSession)=>{
|
|
4286
4298
|
profileSession && profileSession.post('Profiler.stop', (error, param)=>{
|
|
4287
4299
|
if (error) {
|
|
4288
|
-
rslog_index_js_namespaceObject.logger.error('Failed to generate
|
|
4300
|
+
rslog_index_js_namespaceObject.logger.error('Failed to generate JavaScript CPU profile:', error);
|
|
4289
4301
|
return;
|
|
4290
4302
|
}
|
|
4291
4303
|
external_node_fs_default().writeFileSync(output, JSON.stringify(param.profile));
|
|
@@ -4298,9 +4310,9 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
4298
4310
|
if ('webpack' === api.context.bundlerType) return;
|
|
4299
4311
|
let RSPACK_PROFILE = null === (_process_env_RSPACK_PROFILE = process.env.RSPACK_PROFILE) || void 0 === _process_env_RSPACK_PROFILE ? void 0 : _process_env_RSPACK_PROFILE.toUpperCase();
|
|
4300
4312
|
if (!RSPACK_PROFILE) return;
|
|
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 = ()=>{
|
|
4313
|
+
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 ()=>{
|
|
4302
4314
|
let profileDir = external_node_path_default().join(api.context.distPath, profileDirName), traceFilePath = external_node_path_default().join(profileDir, 'trace.json');
|
|
4303
|
-
|
|
4315
|
+
await isFileExists(profileDir) || await external_node_fs_default().promises.mkdir(profileDir, {
|
|
4304
4316
|
recursive: !0
|
|
4305
4317
|
}), enableProfileTrace && core_default().experiments.globalTrace.register('trace', 'chrome', traceFilePath), enableCPUProfile && ((profileSession = new (external_node_inspector_default()).Session()).connect(), profileSession.post('Profiler.enable'), profileSession.post('Profiler.start'));
|
|
4306
4318
|
};
|
|
@@ -4314,12 +4326,12 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
4314
4326
|
logging: 'verbose',
|
|
4315
4327
|
loggingTrace: !0
|
|
4316
4328
|
});
|
|
4317
|
-
external_node_fs_default().
|
|
4329
|
+
await external_node_fs_default().promises.writeFile(loggingFilePath, JSON.stringify(logging));
|
|
4318
4330
|
}
|
|
4319
4331
|
}), api.onExit(()=>{
|
|
4320
4332
|
enableProfileTrace && core_default().experiments.globalTrace.cleanup();
|
|
4321
4333
|
let profileDir = external_node_path_default().join(api.context.distPath, profileDirName);
|
|
4322
|
-
stopProfiler(external_node_path_default().join(profileDir, 'jscpuprofile.json'), profileSession), rslog_index_js_namespaceObject.logger.info(`
|
|
4334
|
+
stopProfiler(external_node_path_default().join(profileDir, 'jscpuprofile.json'), profileSession), rslog_index_js_namespaceObject.logger.info(`profile files saved to ${index_js_default().cyan(profileDir)}`);
|
|
4323
4335
|
});
|
|
4324
4336
|
}
|
|
4325
4337
|
}), pluginServer = ()=>({
|
|
@@ -4730,7 +4742,6 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
4730
4742
|
async function getConfigUtils(config, chainUtils) {
|
|
4731
4743
|
return {
|
|
4732
4744
|
...chainUtils,
|
|
4733
|
-
rspack: core_namespaceObject.rspack,
|
|
4734
4745
|
mergeConfig: dist.merge,
|
|
4735
4746
|
addRules (rules) {
|
|
4736
4747
|
let ruleArr = castArray(rules);
|
|
@@ -4754,9 +4765,11 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
4754
4765
|
};
|
|
4755
4766
|
}
|
|
4756
4767
|
function getChainUtils(target, environment) {
|
|
4768
|
+
let nodeEnv = getNodeEnv();
|
|
4757
4769
|
return {
|
|
4770
|
+
rspack: core_namespaceObject.rspack,
|
|
4758
4771
|
environment,
|
|
4759
|
-
env:
|
|
4772
|
+
env: nodeEnv,
|
|
4760
4773
|
target,
|
|
4761
4774
|
isDev: 'development' === environment.config.mode,
|
|
4762
4775
|
isProd: 'production' === environment.config.mode,
|
|
@@ -5382,14 +5395,17 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
5382
5395
|
html: function(errors, root) {
|
|
5383
5396
|
let htmlItems = errors.map((item)=>{
|
|
5384
5397
|
var text, text1 = server_ansiHTML((text = item) ? text.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"').replace(/'/g, ''') : ''), root1 = root;
|
|
5385
|
-
let pathRegex = /(?:\.\.?[\/\\]|[a-zA-Z]:\\|\/)[^:]*:\d+:\d+/g;
|
|
5386
|
-
return text1.split('\n').map((line)=>
|
|
5398
|
+
let pathRegex = /(?:\.\.?[\/\\]|[a-zA-Z]:\\|\/)[^:]*:\d+:\d+/g, urlRegex = /(https?:\/\/(?:[\w-]+\.)+[a-z0-9](?:[\w-.~:/?#[\]@!$&'*+,;=])*)/gi;
|
|
5399
|
+
return text1.split('\n').map((line)=>{
|
|
5400
|
+
let replacedLine = line.replace(pathRegex, (file)=>{
|
|
5387
5401
|
let hasClosingSpan = file.includes('</span>') && !file.includes('<span'), filePath = hasClosingSpan ? file.replace('</span>', '') : file, isAbsolute = external_node_path_default().isAbsolute(filePath), absolutePath = root1 && !isAbsolute ? external_node_path_default().join(root1, filePath) : filePath, relativePath = root1 && isAbsolute ? function(base, filepath) {
|
|
5388
5402
|
let relativePath = (0, external_node_path_namespaceObject.relative)(base, filepath);
|
|
5389
5403
|
return '' === relativePath ? `.${external_node_path_namespaceObject.sep}` : relativePath.startsWith('.') ? relativePath : `.${external_node_path_namespaceObject.sep}${relativePath}`;
|
|
5390
5404
|
}(root1, filePath) : filePath;
|
|
5391
5405
|
return `<a class="file-link" data-file="${absolutePath}">${relativePath}</a>${hasClosingSpan ? '</span>' : ''}`;
|
|
5392
|
-
})
|
|
5406
|
+
});
|
|
5407
|
+
return replacedLine = replacedLine.replace(urlRegex, (url)=>`<a class="url-link" href="${url}" target="_blank" rel="noopener noreferrer">${url}</a>`);
|
|
5408
|
+
}).join('\n');
|
|
5393
5409
|
});
|
|
5394
5410
|
return `
|
|
5395
5411
|
<style>
|
|
@@ -5441,9 +5457,9 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
5441
5457
|
.content::-webkit-scrollbar {
|
|
5442
5458
|
display: none;
|
|
5443
5459
|
}
|
|
5444
|
-
.file-link
|
|
5460
|
+
.file-link,
|
|
5461
|
+
.url-link {
|
|
5445
5462
|
cursor: pointer;
|
|
5446
|
-
color: #6eecf7;
|
|
5447
5463
|
text-decoration: underline;
|
|
5448
5464
|
text-underline-offset: 3px;
|
|
5449
5465
|
&:hover {
|
|
@@ -5453,6 +5469,12 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
5453
5469
|
opacity: 0.6;
|
|
5454
5470
|
}
|
|
5455
5471
|
}
|
|
5472
|
+
.file-link {
|
|
5473
|
+
color: #6eecf7;
|
|
5474
|
+
}
|
|
5475
|
+
.url-link {
|
|
5476
|
+
color: #eff986;
|
|
5477
|
+
}
|
|
5456
5478
|
.close {
|
|
5457
5479
|
position: absolute;
|
|
5458
5480
|
top: 27px;
|
|
@@ -6152,23 +6174,29 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
6152
6174
|
[entryName]: res
|
|
6153
6175
|
}), res;
|
|
6154
6176
|
};
|
|
6155
|
-
}, cleanupCallbacks = new Set(), handleTermination = async (
|
|
6177
|
+
}, cleanupCallbacks = new Set(), handleTermination = async (exitCode)=>{
|
|
6156
6178
|
try {
|
|
6157
6179
|
await Promise.all([
|
|
6158
6180
|
...cleanupCallbacks
|
|
6159
6181
|
].map((cb)=>cb()));
|
|
6160
6182
|
} finally{
|
|
6161
|
-
process.exitCode ??= exitCode
|
|
6183
|
+
process.exitCode ??= exitCode, process.exit();
|
|
6162
6184
|
}
|
|
6163
6185
|
}, registerCleanup = (callback)=>{
|
|
6164
6186
|
cleanupCallbacks.add(callback);
|
|
6165
6187
|
}, removeCleanup = (callback)=>{
|
|
6166
6188
|
cleanupCallbacks.delete(callback);
|
|
6167
6189
|
}, shutdownRefCount = 0, setupGracefulShutdown = ()=>{
|
|
6168
|
-
shutdownRefCount
|
|
6169
|
-
let
|
|
6170
|
-
|
|
6171
|
-
|
|
6190
|
+
shutdownRefCount++;
|
|
6191
|
+
let onSigterm = ()=>{
|
|
6192
|
+
handleTermination(external_node_os_namespaceObject.constants.signals.SIGTERM + 128);
|
|
6193
|
+
};
|
|
6194
|
+
process.once('SIGTERM', onSigterm);
|
|
6195
|
+
let isCI = 'true' === process.env.CI, onStdinEnd = ()=>{
|
|
6196
|
+
handleTermination(0);
|
|
6197
|
+
};
|
|
6198
|
+
return isCI || process.stdin.on('end', onStdinEnd), ()=>{
|
|
6199
|
+
!(--shutdownRefCount > 0) && (process.removeListener('SIGTERM', onSigterm), isCI || process.stdin.removeListener('end', onStdinEnd));
|
|
6172
6200
|
};
|
|
6173
6201
|
}, createHttpServer = async ({ serverConfig, middlewares })=>{
|
|
6174
6202
|
if (serverConfig.https) {
|
|
@@ -6930,9 +6958,21 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
6930
6958
|
handler
|
|
6931
6959
|
});
|
|
6932
6960
|
}, onExitListened = !1, onExit = (cb)=>{
|
|
6933
|
-
|
|
6934
|
-
|
|
6935
|
-
|
|
6961
|
+
if (!onExitListened) {
|
|
6962
|
+
var onExit;
|
|
6963
|
+
onExit = (exitCode)=>{
|
|
6964
|
+
hooks.onExit.callBatch({
|
|
6965
|
+
exitCode
|
|
6966
|
+
});
|
|
6967
|
+
}, exitHook_callbacks.add(onExit), isRegistered || (isRegistered = !0, external_node_process_default().on('SIGINT', ()=>{
|
|
6968
|
+
exit(external_node_os_namespaceObject.constants.signals.SIGINT + 128, 'SIGINT');
|
|
6969
|
+
}), external_node_process_default().once('SIGTERM', ()=>{
|
|
6970
|
+
exit(external_node_os_namespaceObject.constants.signals.SIGTERM + 128, 'SIGTERM');
|
|
6971
|
+
}), external_node_process_default().once('exit', (exitCode)=>{
|
|
6972
|
+
exit(exitCode, 'exit');
|
|
6973
|
+
})), onExitListened = !0;
|
|
6974
|
+
}
|
|
6975
|
+
hooks.onExit.tap(cb);
|
|
6936
6976
|
};
|
|
6937
6977
|
return (environment)=>({
|
|
6938
6978
|
context: publicContext,
|
|
@@ -7403,11 +7443,11 @@ ${section.body}` : section.body).join("\n\n"));
|
|
|
7403
7443
|
}
|
|
7404
7444
|
process.title = 'rsbuild-node';
|
|
7405
7445
|
let { npm_execpath } = process.env;
|
|
7406
|
-
(!npm_execpath || npm_execpath.includes('npx-cli.js') || npm_execpath.includes('.bun')) && console.log(), rslog_index_js_namespaceObject.logger.greet(` Rsbuild v1.3.
|
|
7446
|
+
(!npm_execpath || npm_execpath.includes('npx-cli.js') || npm_execpath.includes('.bun')) && console.log(), rslog_index_js_namespaceObject.logger.greet(` Rsbuild v1.3.6\n`);
|
|
7407
7447
|
try {
|
|
7408
7448
|
!function() {
|
|
7409
7449
|
let cli = cac_dist('rsbuild');
|
|
7410
|
-
cli.help(), cli.version("1.3.
|
|
7450
|
+
cli.help(), cli.version("1.3.6"), applyCommonOptions(cli);
|
|
7411
7451
|
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');
|
|
7412
7452
|
applyServerOptions(devCommand), applyServerOptions(previewCommand), devCommand.action(async (options)=>{
|
|
7413
7453
|
try {
|
|
@@ -7458,7 +7498,7 @@ ${section.body}` : section.body).join("\n\n"));
|
|
|
7458
7498
|
rslog_index_js_namespaceObject.logger.error('Failed to start Rsbuild CLI.'), rslog_index_js_namespaceObject.logger.error(err);
|
|
7459
7499
|
}
|
|
7460
7500
|
}
|
|
7461
|
-
let src_rslib_entry_version = "1.3.
|
|
7501
|
+
let src_rslib_entry_version = "1.3.6";
|
|
7462
7502
|
})(), 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 === [
|
|
7463
7503
|
"PLUGIN_CSS_NAME",
|
|
7464
7504
|
"PLUGIN_SWC_NAME",
|
package/dist/index.js
CHANGED
|
@@ -13,13 +13,14 @@ import * as __WEBPACK_EXTERNAL_MODULE__compiled_rslog_index_js_c302f6e3__ from "
|
|
|
13
13
|
import * as __WEBPACK_EXTERNAL_MODULE_node_util_types_ce11fc49__ from "node:util/types";
|
|
14
14
|
import * as __WEBPACK_EXTERNAL_MODULE_node_module_ab9f2194__ from "node:module";
|
|
15
15
|
import * as __WEBPACK_EXTERNAL_MODULE__compiled_rspack_chain_index_js_b67fefbd__ from "../compiled/rspack-chain/index.js";
|
|
16
|
+
import * as __WEBPACK_EXTERNAL_MODULE_node_os_74b4b876__ from "node:os";
|
|
17
|
+
import * as __WEBPACK_EXTERNAL_MODULE_node_process_786449bf__ from "node:process";
|
|
16
18
|
import * as __WEBPACK_EXTERNAL_MODULE_node_util_1b29d436__ from "node:util";
|
|
17
19
|
import * as __WEBPACK_EXTERNAL_MODULE__compiled_mrmime_index_js_86f064ca__ from "../compiled/mrmime/index.js";
|
|
18
20
|
import * as __WEBPACK_EXTERNAL_MODULE_node_crypto_9ba42079__ from "node:crypto";
|
|
19
21
|
import * as __WEBPACK_EXTERNAL_MODULE_node_zlib_a5bb16fc__ from "node:zlib";
|
|
20
22
|
import * as __WEBPACK_EXTERNAL_MODULE_node_child_process_27f17141__ from "node:child_process";
|
|
21
23
|
import * as __WEBPACK_EXTERNAL_MODULE_node_net_0373943e__ from "node:net";
|
|
22
|
-
import * as __WEBPACK_EXTERNAL_MODULE_node_os_74b4b876__ from "node:os";
|
|
23
24
|
import * as __WEBPACK_EXTERNAL_MODULE_node_inspector_dd9822d6__ from "node:inspector";
|
|
24
25
|
import * as __WEBPACK_EXTERNAL_MODULE_node_assert_3e74d44e__ from "node:assert";
|
|
25
26
|
import * as __WEBPACK_EXTERNAL_MODULE_node_readline_91c31510__ from "node:readline";
|
|
@@ -126,8 +127,8 @@ var EsmMode, __webpack_modules__ = {
|
|
|
126
127
|
return options;
|
|
127
128
|
};
|
|
128
129
|
},
|
|
129
|
-
"../../node_modules/.pnpm/dotenv@16.
|
|
130
|
-
let fs = __webpack_require__("fs"), path = __webpack_require__("path"), os = __webpack_require__("os"), crypto = __webpack_require__("crypto"), version = __webpack_require__("../../node_modules/.pnpm/dotenv@16.
|
|
130
|
+
"../../node_modules/.pnpm/dotenv@16.5.0/node_modules/dotenv/lib/main.js": function(module, __unused_webpack_exports, __webpack_require__) {
|
|
131
|
+
let fs = __webpack_require__("fs"), path = __webpack_require__("path"), os = __webpack_require__("os"), crypto = __webpack_require__("crypto"), version = __webpack_require__("../../node_modules/.pnpm/dotenv@16.5.0/node_modules/dotenv/package.json").version, LINE = /(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;
|
|
131
132
|
function _debug(message) {
|
|
132
133
|
console.log(`[dotenv@${version}][DEBUG] ${message}`);
|
|
133
134
|
}
|
|
@@ -173,7 +174,7 @@ var EsmMode, __webpack_modules__ = {
|
|
|
173
174
|
};
|
|
174
175
|
},
|
|
175
176
|
_configVault: function(options) {
|
|
176
|
-
|
|
177
|
+
options && options.debug && _debug('Loading env from encrypted .env.vault');
|
|
177
178
|
let parsed = DotenvModule._parseVault(options), processEnv = process.env;
|
|
178
179
|
return options && null != options.processEnv && (processEnv = options.processEnv), DotenvModule.populate(processEnv, parsed, options), {
|
|
179
180
|
parsed
|
|
@@ -893,8 +894,8 @@ var EsmMode, __webpack_modules__ = {
|
|
|
893
894
|
path: function(module) {
|
|
894
895
|
module.exports = __WEBPACK_EXTERNAL_MODULE_path__;
|
|
895
896
|
},
|
|
896
|
-
"../../node_modules/.pnpm/dotenv@16.
|
|
897
|
-
module.exports = JSON.parse('{"name":"dotenv","version":"16.
|
|
897
|
+
"../../node_modules/.pnpm/dotenv@16.5.0/node_modules/dotenv/package.json": function(module) {
|
|
898
|
+
module.exports = JSON.parse('{"name":"dotenv","version":"16.5.0","description":"Loads environment variables from .env file","main":"lib/main.js","types":"lib/main.d.ts","exports":{".":{"types":"./lib/main.d.ts","require":"./lib/main.js","default":"./lib/main.js"},"./config":"./config.js","./config.js":"./config.js","./lib/env-options":"./lib/env-options.js","./lib/env-options.js":"./lib/env-options.js","./lib/cli-options":"./lib/cli-options.js","./lib/cli-options.js":"./lib/cli-options.js","./package.json":"./package.json"},"scripts":{"dts-check":"tsc --project tests/types/tsconfig.json","lint":"standard","pretest":"npm run lint && npm run dts-check","test":"tap run --allow-empty-coverage --disable-coverage --timeout=60000","test:coverage":"tap run --show-full-coverage --timeout=60000 --coverage-report=lcov","prerelease":"npm test","release":"standard-version"},"repository":{"type":"git","url":"git://github.com/motdotla/dotenv.git"},"homepage":"https://github.com/motdotla/dotenv#readme","funding":"https://dotenvx.com","keywords":["dotenv","env",".env","environment","variables","config","settings"],"readmeFilename":"README.md","license":"BSD-2-Clause","devDependencies":{"@types/node":"^18.11.3","decache":"^4.6.2","sinon":"^14.0.1","standard":"^17.0.0","standard-version":"^9.5.0","tap":"^19.2.0","typescript":"^4.8.4"},"engines":{"node":">=12"},"browser":{"fs":false}}');
|
|
898
899
|
}
|
|
899
900
|
}, __webpack_module_cache__ = {};
|
|
900
901
|
function __webpack_require__(moduleId) {
|
|
@@ -941,7 +942,7 @@ __webpack_require__.r(provider_helpers_namespaceObject), __webpack_require__.d(p
|
|
|
941
942
|
setHTMLPlugin: ()=>setHTMLPlugin,
|
|
942
943
|
stringifyConfig: ()=>stringifyConfig
|
|
943
944
|
});
|
|
944
|
-
var main = __webpack_require__("../../node_modules/.pnpm/dotenv@16.
|
|
945
|
+
var main = __webpack_require__("../../node_modules/.pnpm/dotenv@16.5.0/node_modules/dotenv/lib/main.js"), lib_main = __webpack_require__("../../node_modules/.pnpm/dotenv-expand@12.0.1/node_modules/dotenv-expand/lib/main.js"), cjs = __webpack_require__("../../node_modules/.pnpm/deepmerge@4.3.1/node_modules/deepmerge/dist/cjs.js"), cjs_default = __webpack_require__.n(cjs);
|
|
945
946
|
let constants_filename = (0, __WEBPACK_EXTERNAL_MODULE_node_url_e96de089__.fileURLToPath)(import.meta.url), constants_dirname = (0, __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__.dirname)(constants_filename), ROOT_DIST_DIR = 'dist', LOADER_PATH = (0, __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__.join)(constants_dirname), STATIC_PATH = (0, __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__.join)(constants_dirname, '../static'), COMPILED_PATH = (0, __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__.join)(constants_dirname, '../compiled'), RSBUILD_OUTPUTS_PATH = '.rsbuild', DEFAULT_DEV_HOST = '0.0.0.0', DEFAULT_ASSET_PREFIX = '/', DEFAULT_WEB_BROWSERSLIST = [
|
|
946
947
|
'chrome >= 87',
|
|
947
948
|
'edge >= 88',
|
|
@@ -1414,7 +1415,7 @@ let configCache = {}, OVERRIDE_PATHS = [
|
|
|
1414
1415
|
let realKey = key.split('.').slice(2).join('.');
|
|
1415
1416
|
return OVERRIDE_PATHS.includes(realKey);
|
|
1416
1417
|
}
|
|
1417
|
-
return OVERRIDE_PATHS.includes(key);
|
|
1418
|
+
return OVERRIDE_PATHS.includes(key) || key.startsWith('output.filename.');
|
|
1418
1419
|
}, merge = (x, y, path = '')=>{
|
|
1419
1420
|
if (isOverridePath(path)) return y ?? x;
|
|
1420
1421
|
if (void 0 === x) return isPlainObject(y) ? cloneDeep(y) : y;
|
|
@@ -1989,7 +1990,17 @@ let onBeforeCompile = ({ compiler, beforeCompile, beforeEnvironmentCompiler, isW
|
|
|
1989
1990
|
onEnvironmentDone,
|
|
1990
1991
|
MultiStatsCtor
|
|
1991
1992
|
});
|
|
1992
|
-
},
|
|
1993
|
+
}, exitHook_callbacks = new Set(), isCalled = !1, isRegistered = !1;
|
|
1994
|
+
function exit(exitCode, type) {
|
|
1995
|
+
if (!isCalled) {
|
|
1996
|
+
for (let callback of (isCalled = !0, exitHook_callbacks))callback(exitCode);
|
|
1997
|
+
if ('SIGINT' === type) {
|
|
1998
|
+
let listeners = __WEBPACK_EXTERNAL_MODULE_node_process_786449bf__.default.listeners('SIGINT');
|
|
1999
|
+
Array.isArray(listeners) && listeners.length <= 1 && __WEBPACK_EXTERNAL_MODULE_node_process_786449bf__.default.exit(exitCode);
|
|
2000
|
+
}
|
|
2001
|
+
}
|
|
2002
|
+
}
|
|
2003
|
+
let mapProcessAssetsStage = (compiler, stage)=>{
|
|
1993
2004
|
let { Compilation } = compiler.webpack;
|
|
1994
2005
|
switch(stage){
|
|
1995
2006
|
case 'additional':
|
|
@@ -2107,7 +2118,7 @@ async function updateEnvironmentContext(context, configs) {
|
|
|
2107
2118
|
async function createContext(options, userConfig) {
|
|
2108
2119
|
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;
|
|
2109
2120
|
return {
|
|
2110
|
-
version: "1.3.
|
|
2121
|
+
version: "1.3.6",
|
|
2111
2122
|
rootPath,
|
|
2112
2123
|
distPath: '',
|
|
2113
2124
|
cachePath,
|
|
@@ -2943,32 +2954,32 @@ async function printFileSizes(options, stats, rootPath, environmentName) {
|
|
|
2943
2954
|
}, assets = await getAssets();
|
|
2944
2955
|
if (0 === assets.length) return logs;
|
|
2945
2956
|
logs.push(''), assets.sort((a, b)=>a.size - b.size);
|
|
2946
|
-
let
|
|
2957
|
+
let fileHeader = `File (${environmentName})`, maxFileLength = Math.max(...assets.map((a)=>(a.folder + __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__.default.sep + a.name).length), fileHeader.length), maxSizeLength = Math.max(...assets.map((a)=>a.sizeLabel.length));
|
|
2947
2958
|
if (!1 !== options.detail) {
|
|
2948
2959
|
let showGzipHeader = !!(options.compressed && assets.some((item)=>null !== item.gzippedSize));
|
|
2949
|
-
logs.push(function(
|
|
2950
|
-
let
|
|
2951
|
-
|
|
2952
|
-
|
|
2960
|
+
logs.push(function(maxFileLength, maxSizeLength, fileHeader, showGzipHeader) {
|
|
2961
|
+
let lengths = [
|
|
2962
|
+
maxFileLength,
|
|
2963
|
+
maxSizeLength
|
|
2953
2964
|
], rowTypes = [
|
|
2954
|
-
|
|
2965
|
+
fileHeader,
|
|
2955
2966
|
'Size'
|
|
2956
2967
|
];
|
|
2957
2968
|
showGzipHeader && rowTypes.push('Gzip');
|
|
2958
2969
|
let headerRow = rowTypes.reduce((prev, cur, index)=>{
|
|
2959
|
-
let length =
|
|
2970
|
+
let length = lengths[index], curLabel = cur;
|
|
2960
2971
|
return length && (curLabel = cur.length < length ? cur + ' '.repeat(length - cur.length) : cur), `${prev + curLabel} `;
|
|
2961
2972
|
}, ' ');
|
|
2962
2973
|
return __WEBPACK_EXTERNAL_MODULE__compiled_picocolors_index_js_ea7a20e9__.default.blue(headerRow);
|
|
2963
|
-
}(
|
|
2974
|
+
}(maxFileLength, maxSizeLength, fileHeader, showGzipHeader));
|
|
2964
2975
|
}
|
|
2965
2976
|
let totalSize = 0, totalGzipSize = 0;
|
|
2966
2977
|
for (let asset of assets){
|
|
2967
2978
|
let { sizeLabel } = asset, { name, folder, gzipSizeLabel } = asset, fileNameLength = (folder + __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__.default.sep + name).length, sizeLength = sizeLabel.length;
|
|
2968
2979
|
if (totalSize += asset.size, options.compressed && (totalGzipSize += asset.gzippedSize ?? asset.size), !1 !== options.detail) {
|
|
2969
|
-
sizeLength <
|
|
2980
|
+
sizeLength < maxSizeLength && (sizeLabel += ' '.repeat(maxSizeLength - sizeLength));
|
|
2970
2981
|
let fileNameLabel = __WEBPACK_EXTERNAL_MODULE__compiled_picocolors_index_js_ea7a20e9__.default.dim(asset.folder + __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__.default.sep) + coloringAssetName(asset.name);
|
|
2971
|
-
fileNameLength <
|
|
2982
|
+
fileNameLength < maxFileLength && (fileNameLabel += ' '.repeat(maxFileLength - fileNameLength));
|
|
2972
2983
|
let log = ` ${fileNameLabel} ${sizeLabel}`;
|
|
2973
2984
|
gzipSizeLabel && (log += ` ${gzipSizeLabel}`), logs.push(log);
|
|
2974
2985
|
}
|
|
@@ -4174,7 +4185,7 @@ let resourceHints_generateLinks = (options, rel)=>options.map((option)=>({
|
|
|
4174
4185
|
}), stopProfiler = (output, profileSession)=>{
|
|
4175
4186
|
profileSession && profileSession.post('Profiler.stop', (error, param)=>{
|
|
4176
4187
|
if (error) {
|
|
4177
|
-
__WEBPACK_EXTERNAL_MODULE__compiled_rslog_index_js_c302f6e3__.logger.error('Failed to generate
|
|
4188
|
+
__WEBPACK_EXTERNAL_MODULE__compiled_rslog_index_js_c302f6e3__.logger.error('Failed to generate JavaScript CPU profile:', error);
|
|
4178
4189
|
return;
|
|
4179
4190
|
}
|
|
4180
4191
|
__WEBPACK_EXTERNAL_MODULE_node_fs_5ea92f0c__.default.writeFileSync(output, JSON.stringify(param.profile));
|
|
@@ -4187,9 +4198,9 @@ let resourceHints_generateLinks = (options, rel)=>options.map((option)=>({
|
|
|
4187
4198
|
if ('webpack' === api.context.bundlerType) return;
|
|
4188
4199
|
let RSPACK_PROFILE = null === (_process_env_RSPACK_PROFILE = process.env.RSPACK_PROFILE) || void 0 === _process_env_RSPACK_PROFILE ? void 0 : _process_env_RSPACK_PROFILE.toUpperCase();
|
|
4189
4200
|
if (!RSPACK_PROFILE) return;
|
|
4190
|
-
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 = ()=>{
|
|
4201
|
+
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 ()=>{
|
|
4191
4202
|
let profileDir = __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__.default.join(api.context.distPath, profileDirName), traceFilePath = __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__.default.join(profileDir, 'trace.json');
|
|
4192
|
-
|
|
4203
|
+
await isFileExists(profileDir) || await __WEBPACK_EXTERNAL_MODULE_node_fs_5ea92f0c__.default.promises.mkdir(profileDir, {
|
|
4193
4204
|
recursive: !0
|
|
4194
4205
|
}), enableProfileTrace && __WEBPACK_EXTERNAL_MODULE__rspack_core_e0096ff7__.default.experiments.globalTrace.register('trace', 'chrome', traceFilePath), enableCPUProfile && ((profileSession = new __WEBPACK_EXTERNAL_MODULE_node_inspector_dd9822d6__.default.Session()).connect(), profileSession.post('Profiler.enable'), profileSession.post('Profiler.start'));
|
|
4195
4206
|
};
|
|
@@ -4203,12 +4214,12 @@ let resourceHints_generateLinks = (options, rel)=>options.map((option)=>({
|
|
|
4203
4214
|
logging: 'verbose',
|
|
4204
4215
|
loggingTrace: !0
|
|
4205
4216
|
});
|
|
4206
|
-
__WEBPACK_EXTERNAL_MODULE_node_fs_5ea92f0c__.default.
|
|
4217
|
+
await __WEBPACK_EXTERNAL_MODULE_node_fs_5ea92f0c__.default.promises.writeFile(loggingFilePath, JSON.stringify(logging));
|
|
4207
4218
|
}
|
|
4208
4219
|
}), api.onExit(()=>{
|
|
4209
4220
|
enableProfileTrace && __WEBPACK_EXTERNAL_MODULE__rspack_core_e0096ff7__.default.experiments.globalTrace.cleanup();
|
|
4210
4221
|
let profileDir = __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__.default.join(api.context.distPath, profileDirName);
|
|
4211
|
-
stopProfiler(__WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__.default.join(profileDir, 'jscpuprofile.json'), profileSession), __WEBPACK_EXTERNAL_MODULE__compiled_rslog_index_js_c302f6e3__.logger.info(`
|
|
4222
|
+
stopProfiler(__WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__.default.join(profileDir, 'jscpuprofile.json'), profileSession), __WEBPACK_EXTERNAL_MODULE__compiled_rslog_index_js_c302f6e3__.logger.info(`profile files saved to ${__WEBPACK_EXTERNAL_MODULE__compiled_picocolors_index_js_ea7a20e9__.default.cyan(profileDir)}`);
|
|
4212
4223
|
});
|
|
4213
4224
|
}
|
|
4214
4225
|
}), pluginServer = ()=>({
|
|
@@ -4616,7 +4627,6 @@ async function modifyRspackConfig(context, rspackConfig, chainUtils) {
|
|
|
4616
4627
|
async function getConfigUtils(config, chainUtils) {
|
|
4617
4628
|
return {
|
|
4618
4629
|
...chainUtils,
|
|
4619
|
-
rspack: __WEBPACK_EXTERNAL_MODULE__rspack_core_e0096ff7__.rspack,
|
|
4620
4630
|
mergeConfig: dist.merge,
|
|
4621
4631
|
addRules (rules) {
|
|
4622
4632
|
let ruleArr = castArray(rules);
|
|
@@ -4640,9 +4650,11 @@ async function getConfigUtils(config, chainUtils) {
|
|
|
4640
4650
|
};
|
|
4641
4651
|
}
|
|
4642
4652
|
function getChainUtils(target, environment) {
|
|
4653
|
+
let nodeEnv = getNodeEnv();
|
|
4643
4654
|
return {
|
|
4655
|
+
rspack: __WEBPACK_EXTERNAL_MODULE__rspack_core_e0096ff7__.rspack,
|
|
4644
4656
|
environment,
|
|
4645
|
-
env:
|
|
4657
|
+
env: nodeEnv,
|
|
4646
4658
|
target,
|
|
4647
4659
|
isDev: 'development' === environment.config.mode,
|
|
4648
4660
|
isProd: 'production' === environment.config.mode,
|
|
@@ -5263,14 +5275,17 @@ class SocketServer {
|
|
|
5263
5275
|
html: function(errors, root) {
|
|
5264
5276
|
let htmlItems = errors.map((item)=>{
|
|
5265
5277
|
var text = server_ansiHTML(item ? item.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"').replace(/'/g, ''') : ''), root1 = root;
|
|
5266
|
-
let pathRegex = /(?:\.\.?[\/\\]|[a-zA-Z]:\\|\/)[^:]*:\d+:\d+/g;
|
|
5267
|
-
return text.split('\n').map((line)=>
|
|
5278
|
+
let pathRegex = /(?:\.\.?[\/\\]|[a-zA-Z]:\\|\/)[^:]*:\d+:\d+/g, urlRegex = /(https?:\/\/(?:[\w-]+\.)+[a-z0-9](?:[\w-.~:/?#[\]@!$&'*+,;=])*)/gi;
|
|
5279
|
+
return text.split('\n').map((line)=>{
|
|
5280
|
+
let replacedLine = line.replace(pathRegex, (file)=>{
|
|
5268
5281
|
let hasClosingSpan = file.includes('</span>') && !file.includes('<span'), filePath = hasClosingSpan ? file.replace('</span>', '') : file, isAbsolute = __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__.default.isAbsolute(filePath), absolutePath = root1 && !isAbsolute ? __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__.default.join(root1, filePath) : filePath, relativePath = root1 && isAbsolute ? function(base, filepath) {
|
|
5269
5282
|
let relativePath = (0, __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__.relative)(base, filepath);
|
|
5270
5283
|
return '' === relativePath ? `.${__WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__.sep}` : relativePath.startsWith('.') ? relativePath : `.${__WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__.sep}${relativePath}`;
|
|
5271
5284
|
}(root1, filePath) : filePath;
|
|
5272
5285
|
return `<a class="file-link" data-file="${absolutePath}">${relativePath}</a>${hasClosingSpan ? '</span>' : ''}`;
|
|
5273
|
-
})
|
|
5286
|
+
});
|
|
5287
|
+
return replacedLine.replace(urlRegex, (url)=>`<a class="url-link" href="${url}" target="_blank" rel="noopener noreferrer">${url}</a>`);
|
|
5288
|
+
}).join('\n');
|
|
5274
5289
|
});
|
|
5275
5290
|
return `
|
|
5276
5291
|
<style>
|
|
@@ -5322,9 +5337,9 @@ class SocketServer {
|
|
|
5322
5337
|
.content::-webkit-scrollbar {
|
|
5323
5338
|
display: none;
|
|
5324
5339
|
}
|
|
5325
|
-
.file-link
|
|
5340
|
+
.file-link,
|
|
5341
|
+
.url-link {
|
|
5326
5342
|
cursor: pointer;
|
|
5327
|
-
color: #6eecf7;
|
|
5328
5343
|
text-decoration: underline;
|
|
5329
5344
|
text-underline-offset: 3px;
|
|
5330
5345
|
&:hover {
|
|
@@ -5334,6 +5349,12 @@ class SocketServer {
|
|
|
5334
5349
|
opacity: 0.6;
|
|
5335
5350
|
}
|
|
5336
5351
|
}
|
|
5352
|
+
.file-link {
|
|
5353
|
+
color: #6eecf7;
|
|
5354
|
+
}
|
|
5355
|
+
.url-link {
|
|
5356
|
+
color: #eff986;
|
|
5357
|
+
}
|
|
5337
5358
|
.close {
|
|
5338
5359
|
position: absolute;
|
|
5339
5360
|
top: 27px;
|
|
@@ -6028,23 +6049,29 @@ let runner_run = async ({ bundlePath, ...runnerFactoryOptions })=>new BasicRunne
|
|
|
6028
6049
|
[entryName]: res
|
|
6029
6050
|
}), res;
|
|
6030
6051
|
};
|
|
6031
|
-
}, cleanupCallbacks = new Set(), handleTermination = async (
|
|
6052
|
+
}, cleanupCallbacks = new Set(), handleTermination = async (exitCode)=>{
|
|
6032
6053
|
try {
|
|
6033
6054
|
await Promise.all([
|
|
6034
6055
|
...cleanupCallbacks
|
|
6035
6056
|
].map((cb)=>cb()));
|
|
6036
6057
|
} finally{
|
|
6037
|
-
process.exitCode ??= exitCode
|
|
6058
|
+
process.exitCode ??= exitCode, process.exit();
|
|
6038
6059
|
}
|
|
6039
6060
|
}, registerCleanup = (callback)=>{
|
|
6040
6061
|
cleanupCallbacks.add(callback);
|
|
6041
6062
|
}, removeCleanup = (callback)=>{
|
|
6042
6063
|
cleanupCallbacks.delete(callback);
|
|
6043
6064
|
}, shutdownRefCount = 0, setupGracefulShutdown = ()=>{
|
|
6044
|
-
shutdownRefCount
|
|
6045
|
-
let
|
|
6046
|
-
|
|
6047
|
-
|
|
6065
|
+
shutdownRefCount++;
|
|
6066
|
+
let onSigterm = ()=>{
|
|
6067
|
+
handleTermination(__WEBPACK_EXTERNAL_MODULE_node_os_74b4b876__.constants.signals.SIGTERM + 128);
|
|
6068
|
+
};
|
|
6069
|
+
process.once('SIGTERM', onSigterm);
|
|
6070
|
+
let isCI = 'true' === process.env.CI, onStdinEnd = ()=>{
|
|
6071
|
+
handleTermination(0);
|
|
6072
|
+
};
|
|
6073
|
+
return isCI || process.stdin.on('end', onStdinEnd), ()=>{
|
|
6074
|
+
!(--shutdownRefCount > 0) && (process.removeListener('SIGTERM', onSigterm), isCI || process.stdin.removeListener('end', onStdinEnd));
|
|
6048
6075
|
};
|
|
6049
6076
|
}, createHttpServer = async ({ serverConfig, middlewares })=>{
|
|
6050
6077
|
if (serverConfig.https) {
|
|
@@ -6805,9 +6832,21 @@ async function createRsbuild(options = {}) {
|
|
|
6805
6832
|
handler
|
|
6806
6833
|
});
|
|
6807
6834
|
}, onExitListened = !1, onExit = (cb)=>{
|
|
6808
|
-
|
|
6809
|
-
|
|
6810
|
-
|
|
6835
|
+
if (!onExitListened) {
|
|
6836
|
+
var onExit;
|
|
6837
|
+
onExit = (exitCode)=>{
|
|
6838
|
+
hooks.onExit.callBatch({
|
|
6839
|
+
exitCode
|
|
6840
|
+
});
|
|
6841
|
+
}, exitHook_callbacks.add(onExit), isRegistered || (isRegistered = !0, __WEBPACK_EXTERNAL_MODULE_node_process_786449bf__.default.on('SIGINT', ()=>{
|
|
6842
|
+
exit(__WEBPACK_EXTERNAL_MODULE_node_os_74b4b876__.constants.signals.SIGINT + 128, 'SIGINT');
|
|
6843
|
+
}), __WEBPACK_EXTERNAL_MODULE_node_process_786449bf__.default.once('SIGTERM', ()=>{
|
|
6844
|
+
exit(__WEBPACK_EXTERNAL_MODULE_node_os_74b4b876__.constants.signals.SIGTERM + 128, 'SIGTERM');
|
|
6845
|
+
}), __WEBPACK_EXTERNAL_MODULE_node_process_786449bf__.default.once('exit', (exitCode)=>{
|
|
6846
|
+
exit(exitCode, 'exit');
|
|
6847
|
+
})), onExitListened = !0;
|
|
6848
|
+
}
|
|
6849
|
+
hooks.onExit.tap(cb);
|
|
6811
6850
|
};
|
|
6812
6851
|
return (environment)=>({
|
|
6813
6852
|
context: publicContext,
|
|
@@ -7277,11 +7316,11 @@ async function runCLI() {
|
|
|
7277
7316
|
}
|
|
7278
7317
|
process.title = 'rsbuild-node';
|
|
7279
7318
|
let { npm_execpath } = process.env;
|
|
7280
|
-
(!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.3.
|
|
7319
|
+
(!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.3.6\n`);
|
|
7281
7320
|
try {
|
|
7282
7321
|
!function() {
|
|
7283
7322
|
let cli = cac_dist('rsbuild');
|
|
7284
|
-
cli.help(), cli.version("1.3.
|
|
7323
|
+
cli.help(), cli.version("1.3.6"), applyCommonOptions(cli);
|
|
7285
7324
|
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');
|
|
7286
7325
|
applyServerOptions(devCommand), applyServerOptions(previewCommand), devCommand.action(async (options)=>{
|
|
7287
7326
|
try {
|
|
@@ -7332,6 +7371,6 @@ async function runCLI() {
|
|
|
7332
7371
|
__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);
|
|
7333
7372
|
}
|
|
7334
7373
|
}
|
|
7335
|
-
let src_version = "1.3.
|
|
7374
|
+
let src_version = "1.3.6";
|
|
7336
7375
|
var __webpack_exports__logger = __WEBPACK_EXTERNAL_MODULE__compiled_rslog_index_js_c302f6e3__.logger, __webpack_exports__rspack = __WEBPACK_EXTERNAL_MODULE__rspack_core_e0096ff7__.rspack;
|
|
7337
7376
|
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 };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { IncomingMessage, ServerResponse } from 'node:http';
|
|
2
2
|
import type { SecureServerSessionOptions } from 'node:http2';
|
|
3
3
|
import type { ServerOptions as HttpsServerOptions } from 'node:https';
|
|
4
|
-
import type { Configuration, CopyRspackPluginOptions, Externals, LightningCssMinimizerRspackPluginOptions, ModuleFederationPluginOptions, RuleSetCondition, SwcJsMinimizerRspackPluginOptions, SwcLoaderOptions
|
|
4
|
+
import type { Configuration, CopyRspackPluginOptions, Externals, LightningCssMinimizerRspackPluginOptions, ModuleFederationPluginOptions, RuleSetCondition, SwcJsMinimizerRspackPluginOptions, SwcLoaderOptions } from '@rspack/core';
|
|
5
5
|
import type { ChokidarOptions } from '../../compiled/chokidar/index.js';
|
|
6
6
|
import type cors from '../../compiled/cors/index.js';
|
|
7
7
|
import type { Options as HttpProxyOptions, Filter as ProxyFilter } from '../../compiled/http-proxy-middleware/index.js';
|
|
@@ -33,7 +33,6 @@ export type ModifyRspackConfigUtils = ModifyChainUtils & {
|
|
|
33
33
|
appendPlugins: (plugins: BundlerPluginInstance | BundlerPluginInstance[]) => void;
|
|
34
34
|
removePlugin: (pluginName: string) => void;
|
|
35
35
|
mergeConfig: WebpackMerge;
|
|
36
|
-
rspack: typeof rspack;
|
|
37
36
|
};
|
|
38
37
|
export type ToolsRspackConfig = ConfigChainAsyncWithContext<Rspack.Configuration, ModifyRspackConfigUtils>;
|
|
39
38
|
export type ToolsWebpackConfig = ConfigChainWithContext<WebpackConfig, ModifyWebpackConfigUtils>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { rspack } from '@rspack/core';
|
|
1
2
|
import type { ChainIdentifier } from '..';
|
|
2
3
|
import type RspackChain from '../../compiled/rspack-chain';
|
|
3
4
|
import type { RsbuildDevServer } from '../server/devServer';
|
|
@@ -66,7 +67,9 @@ export type OnAfterCreateCompilerFn<Compiler = Rspack.Compiler | Rspack.MultiCom
|
|
|
66
67
|
compiler: Compiler;
|
|
67
68
|
environments: Record<string, EnvironmentContext>;
|
|
68
69
|
}) => MaybePromise<void>;
|
|
69
|
-
export type OnExitFn = (
|
|
70
|
+
export type OnExitFn = (context: {
|
|
71
|
+
exitCode: number;
|
|
72
|
+
}) => void;
|
|
70
73
|
type HTMLTags = {
|
|
71
74
|
headTags: HtmlBasicTag[];
|
|
72
75
|
bodyTags: HtmlBasicTag[];
|
|
@@ -157,6 +160,7 @@ export type ModifyChainUtils = {
|
|
|
157
160
|
isWebWorker: boolean;
|
|
158
161
|
CHAIN_ID: ChainIdentifier;
|
|
159
162
|
environment: EnvironmentContext;
|
|
163
|
+
rspack: typeof rspack;
|
|
160
164
|
HtmlPlugin: typeof HtmlRspackPlugin;
|
|
161
165
|
};
|
|
162
166
|
interface PluginInstance {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsbuild/core",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.6",
|
|
4
4
|
"description": "The Rspack-based build tool.",
|
|
5
5
|
"homepage": "https://rsbuild.dev",
|
|
6
6
|
"bugs": {
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"types.d.ts"
|
|
47
47
|
],
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@rspack/core": "1.3.
|
|
49
|
+
"@rspack/core": "1.3.4",
|
|
50
50
|
"@rspack/lite-tapable": "~1.0.1",
|
|
51
51
|
"@swc/helpers": "^0.5.15",
|
|
52
52
|
"core-js": "~3.41.0",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"cors": "^2.8.5",
|
|
69
69
|
"css-loader": "7.1.2",
|
|
70
70
|
"deepmerge": "^4.3.1",
|
|
71
|
-
"dotenv": "16.
|
|
71
|
+
"dotenv": "16.5.0",
|
|
72
72
|
"dotenv-expand": "12.0.1",
|
|
73
73
|
"html-rspack-plugin": "6.0.4",
|
|
74
74
|
"http-proxy-middleware": "^2.0.7",
|