@rsbuild/core 1.0.8 → 1.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/compiled/css-loader/index.js +20 -20
- package/compiled/html-rspack-plugin/index.js +14 -14
- package/compiled/postcss-loader/index.js +8 -8
- package/compiled/rspack-chain/index.d.ts +1 -0
- package/compiled/rspack-chain/index.js +67 -67
- package/compiled/rspack-chain/package.json +1 -1
- package/compiled/rspack-manifest-plugin/index.js +4 -4
- package/dist/index.cjs +83 -80
- package/dist/index.js +50 -47
- package/dist-types/server/helper.d.ts +3 -4
- package/package.json +5 -5
package/dist/index.cjs
CHANGED
|
@@ -40,7 +40,7 @@ var __publicField = (obj, key, value) => {
|
|
|
40
40
|
|
|
41
41
|
// ../../node_modules/.pnpm/commander@12.1.0/node_modules/commander/lib/error.js
|
|
42
42
|
var require_error = __commonJS({
|
|
43
|
-
"../../node_modules/.pnpm/commander@12.1.0/node_modules/commander/lib/error.js"(
|
|
43
|
+
"../../node_modules/.pnpm/commander@12.1.0/node_modules/commander/lib/error.js"(exports) {
|
|
44
44
|
"use strict";
|
|
45
45
|
var CommanderError2 = class extends Error {
|
|
46
46
|
/**
|
|
@@ -69,14 +69,14 @@ var require_error = __commonJS({
|
|
|
69
69
|
this.name = this.constructor.name;
|
|
70
70
|
}
|
|
71
71
|
};
|
|
72
|
-
|
|
73
|
-
|
|
72
|
+
exports.CommanderError = CommanderError2;
|
|
73
|
+
exports.InvalidArgumentError = InvalidArgumentError2;
|
|
74
74
|
}
|
|
75
75
|
});
|
|
76
76
|
|
|
77
77
|
// ../../node_modules/.pnpm/commander@12.1.0/node_modules/commander/lib/argument.js
|
|
78
78
|
var require_argument = __commonJS({
|
|
79
|
-
"../../node_modules/.pnpm/commander@12.1.0/node_modules/commander/lib/argument.js"(
|
|
79
|
+
"../../node_modules/.pnpm/commander@12.1.0/node_modules/commander/lib/argument.js"(exports) {
|
|
80
80
|
"use strict";
|
|
81
81
|
var { InvalidArgumentError: InvalidArgumentError2 } = require_error();
|
|
82
82
|
var Argument2 = class {
|
|
@@ -197,14 +197,14 @@ var require_argument = __commonJS({
|
|
|
197
197
|
const nameOutput = arg.name() + (arg.variadic === true ? "..." : "");
|
|
198
198
|
return arg.required ? "<" + nameOutput + ">" : "[" + nameOutput + "]";
|
|
199
199
|
}
|
|
200
|
-
|
|
201
|
-
|
|
200
|
+
exports.Argument = Argument2;
|
|
201
|
+
exports.humanReadableArgName = humanReadableArgName;
|
|
202
202
|
}
|
|
203
203
|
});
|
|
204
204
|
|
|
205
205
|
// ../../node_modules/.pnpm/commander@12.1.0/node_modules/commander/lib/help.js
|
|
206
206
|
var require_help = __commonJS({
|
|
207
|
-
"../../node_modules/.pnpm/commander@12.1.0/node_modules/commander/lib/help.js"(
|
|
207
|
+
"../../node_modules/.pnpm/commander@12.1.0/node_modules/commander/lib/help.js"(exports) {
|
|
208
208
|
"use strict";
|
|
209
209
|
var { humanReadableArgName } = require_argument();
|
|
210
210
|
var Help2 = class {
|
|
@@ -617,13 +617,13 @@ var require_help = __commonJS({
|
|
|
617
617
|
}).join("\n");
|
|
618
618
|
}
|
|
619
619
|
};
|
|
620
|
-
|
|
620
|
+
exports.Help = Help2;
|
|
621
621
|
}
|
|
622
622
|
});
|
|
623
623
|
|
|
624
624
|
// ../../node_modules/.pnpm/commander@12.1.0/node_modules/commander/lib/option.js
|
|
625
625
|
var require_option = __commonJS({
|
|
626
|
-
"../../node_modules/.pnpm/commander@12.1.0/node_modules/commander/lib/option.js"(
|
|
626
|
+
"../../node_modules/.pnpm/commander@12.1.0/node_modules/commander/lib/option.js"(exports) {
|
|
627
627
|
"use strict";
|
|
628
628
|
var { InvalidArgumentError: InvalidArgumentError2 } = require_error();
|
|
629
629
|
var Option2 = class {
|
|
@@ -890,14 +890,14 @@ var require_option = __commonJS({
|
|
|
890
890
|
}
|
|
891
891
|
return { shortFlag, longFlag };
|
|
892
892
|
}
|
|
893
|
-
|
|
894
|
-
|
|
893
|
+
exports.Option = Option2;
|
|
894
|
+
exports.DualOptions = DualOptions;
|
|
895
895
|
}
|
|
896
896
|
});
|
|
897
897
|
|
|
898
898
|
// ../../node_modules/.pnpm/commander@12.1.0/node_modules/commander/lib/suggestSimilar.js
|
|
899
899
|
var require_suggestSimilar = __commonJS({
|
|
900
|
-
"../../node_modules/.pnpm/commander@12.1.0/node_modules/commander/lib/suggestSimilar.js"(
|
|
900
|
+
"../../node_modules/.pnpm/commander@12.1.0/node_modules/commander/lib/suggestSimilar.js"(exports) {
|
|
901
901
|
"use strict";
|
|
902
902
|
var maxDistance = 3;
|
|
903
903
|
function editDistance(a, b) {
|
|
@@ -974,13 +974,13 @@ var require_suggestSimilar = __commonJS({
|
|
|
974
974
|
}
|
|
975
975
|
return "";
|
|
976
976
|
}
|
|
977
|
-
|
|
977
|
+
exports.suggestSimilar = suggestSimilar;
|
|
978
978
|
}
|
|
979
979
|
});
|
|
980
980
|
|
|
981
981
|
// ../../node_modules/.pnpm/commander@12.1.0/node_modules/commander/lib/command.js
|
|
982
982
|
var require_command = __commonJS({
|
|
983
|
-
"../../node_modules/.pnpm/commander@12.1.0/node_modules/commander/lib/command.js"(
|
|
983
|
+
"../../node_modules/.pnpm/commander@12.1.0/node_modules/commander/lib/command.js"(exports) {
|
|
984
984
|
"use strict";
|
|
985
985
|
var EventEmitter = require("events").EventEmitter;
|
|
986
986
|
var childProcess = require("child_process");
|
|
@@ -3049,30 +3049,30 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
3049
3049
|
return arg;
|
|
3050
3050
|
});
|
|
3051
3051
|
}
|
|
3052
|
-
|
|
3052
|
+
exports.Command = Command2;
|
|
3053
3053
|
}
|
|
3054
3054
|
});
|
|
3055
3055
|
|
|
3056
3056
|
// ../../node_modules/.pnpm/commander@12.1.0/node_modules/commander/index.js
|
|
3057
3057
|
var require_commander = __commonJS({
|
|
3058
|
-
"../../node_modules/.pnpm/commander@12.1.0/node_modules/commander/index.js"(
|
|
3058
|
+
"../../node_modules/.pnpm/commander@12.1.0/node_modules/commander/index.js"(exports) {
|
|
3059
3059
|
"use strict";
|
|
3060
3060
|
var { Argument: Argument2 } = require_argument();
|
|
3061
3061
|
var { Command: Command2 } = require_command();
|
|
3062
3062
|
var { CommanderError: CommanderError2, InvalidArgumentError: InvalidArgumentError2 } = require_error();
|
|
3063
3063
|
var { Help: Help2 } = require_help();
|
|
3064
3064
|
var { Option: Option2 } = require_option();
|
|
3065
|
-
|
|
3066
|
-
|
|
3067
|
-
|
|
3068
|
-
|
|
3069
|
-
|
|
3070
|
-
|
|
3071
|
-
|
|
3072
|
-
|
|
3073
|
-
|
|
3074
|
-
|
|
3075
|
-
|
|
3065
|
+
exports.program = new Command2();
|
|
3066
|
+
exports.createCommand = (name) => new Command2(name);
|
|
3067
|
+
exports.createOption = (flags, description) => new Option2(flags, description);
|
|
3068
|
+
exports.createArgument = (name, description) => new Argument2(name, description);
|
|
3069
|
+
exports.Command = Command2;
|
|
3070
|
+
exports.Option = Option2;
|
|
3071
|
+
exports.Argument = Argument2;
|
|
3072
|
+
exports.Help = Help2;
|
|
3073
|
+
exports.CommanderError = CommanderError2;
|
|
3074
|
+
exports.InvalidArgumentError = InvalidArgumentError2;
|
|
3075
|
+
exports.InvalidOptionArgumentError = InvalidArgumentError2;
|
|
3076
3076
|
}
|
|
3077
3077
|
});
|
|
3078
3078
|
|
|
@@ -3103,7 +3103,7 @@ var init_esm = __esm({
|
|
|
3103
3103
|
|
|
3104
3104
|
// ../../node_modules/.pnpm/deepmerge@4.3.1/node_modules/deepmerge/dist/cjs.js
|
|
3105
3105
|
var require_cjs = __commonJS({
|
|
3106
|
-
"../../node_modules/.pnpm/deepmerge@4.3.1/node_modules/deepmerge/dist/cjs.js"(
|
|
3106
|
+
"../../node_modules/.pnpm/deepmerge@4.3.1/node_modules/deepmerge/dist/cjs.js"(exports, module2) {
|
|
3107
3107
|
"use strict";
|
|
3108
3108
|
var isMergeableObject = function isMergeableObject2(value) {
|
|
3109
3109
|
return isNonNullObject(value) && !isSpecial(value);
|
|
@@ -4431,7 +4431,7 @@ var init_config = __esm({
|
|
|
4431
4431
|
|
|
4432
4432
|
// ../../node_modules/.pnpm/dotenv@16.4.5/node_modules/dotenv/package.json
|
|
4433
4433
|
var require_package = __commonJS({
|
|
4434
|
-
"../../node_modules/.pnpm/dotenv@16.4.5/node_modules/dotenv/package.json"(
|
|
4434
|
+
"../../node_modules/.pnpm/dotenv@16.4.5/node_modules/dotenv/package.json"(exports, module2) {
|
|
4435
4435
|
module2.exports = {
|
|
4436
4436
|
name: "dotenv",
|
|
4437
4437
|
version: "16.4.5",
|
|
@@ -4502,7 +4502,7 @@ var require_package = __commonJS({
|
|
|
4502
4502
|
|
|
4503
4503
|
// ../../node_modules/.pnpm/dotenv@16.4.5/node_modules/dotenv/lib/main.js
|
|
4504
4504
|
var require_main = __commonJS({
|
|
4505
|
-
"../../node_modules/.pnpm/dotenv@16.4.5/node_modules/dotenv/lib/main.js"(
|
|
4505
|
+
"../../node_modules/.pnpm/dotenv@16.4.5/node_modules/dotenv/lib/main.js"(exports, module2) {
|
|
4506
4506
|
"use strict";
|
|
4507
4507
|
var fs12 = require("fs");
|
|
4508
4508
|
var path21 = require("path");
|
|
@@ -4511,7 +4511,7 @@ var require_main = __commonJS({
|
|
|
4511
4511
|
var packageJson = require_package();
|
|
4512
4512
|
var version2 = packageJson.version;
|
|
4513
4513
|
var LINE = /(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;
|
|
4514
|
-
function
|
|
4514
|
+
function parse3(src) {
|
|
4515
4515
|
const obj = {};
|
|
4516
4516
|
let lines = src.toString();
|
|
4517
4517
|
lines = lines.replace(/\r\n?/mg, "\n");
|
|
@@ -4754,7 +4754,7 @@ var require_main = __commonJS({
|
|
|
4754
4754
|
_parseVault,
|
|
4755
4755
|
config,
|
|
4756
4756
|
decrypt,
|
|
4757
|
-
parse:
|
|
4757
|
+
parse: parse3,
|
|
4758
4758
|
populate
|
|
4759
4759
|
};
|
|
4760
4760
|
module2.exports.configDotenv = DotenvModule.configDotenv;
|
|
@@ -4770,7 +4770,7 @@ var require_main = __commonJS({
|
|
|
4770
4770
|
|
|
4771
4771
|
// ../../node_modules/.pnpm/dotenv-expand@11.0.6/node_modules/dotenv-expand/lib/main.js
|
|
4772
4772
|
var require_main2 = __commonJS({
|
|
4773
|
-
"../../node_modules/.pnpm/dotenv-expand@11.0.6/node_modules/dotenv-expand/lib/main.js"(
|
|
4773
|
+
"../../node_modules/.pnpm/dotenv-expand@11.0.6/node_modules/dotenv-expand/lib/main.js"(exports, module2) {
|
|
4774
4774
|
"use strict";
|
|
4775
4775
|
var DOTENV_SUBSTITUTION_REGEX = /(\\)?(\$)(?!\()(\{?)([\w.]+)(?::?-((?:\$\{(?:\$\{(?:\$\{[^}]*\}|[^}])*}|[^}])*}|[^}])+))?(\}?)/gi;
|
|
4776
4776
|
function _resolveEscapeSequences(value) {
|
|
@@ -4902,7 +4902,7 @@ var init_loadEnv = __esm({
|
|
|
4902
4902
|
}
|
|
4903
4903
|
});
|
|
4904
4904
|
|
|
4905
|
-
// ../../node_modules/.pnpm/browserslist-load-config@0.
|
|
4905
|
+
// ../../node_modules/.pnpm/browserslist-load-config@0.1.1/node_modules/browserslist-load-config/dist/index.js
|
|
4906
4906
|
function isFile(file) {
|
|
4907
4907
|
if (file in isFileCache) {
|
|
4908
4908
|
return isFileCache[file];
|
|
@@ -4933,9 +4933,12 @@ function parsePackage(file) {
|
|
|
4933
4933
|
);
|
|
4934
4934
|
}
|
|
4935
4935
|
let list = config.browserslist;
|
|
4936
|
-
if (Array.isArray(list)
|
|
4936
|
+
if (Array.isArray(list)) {
|
|
4937
4937
|
list = { defaults: list };
|
|
4938
4938
|
}
|
|
4939
|
+
if (typeof list === "string") {
|
|
4940
|
+
list = parseConfig(list);
|
|
4941
|
+
}
|
|
4939
4942
|
for (const i in list) {
|
|
4940
4943
|
check(list[i]);
|
|
4941
4944
|
}
|
|
@@ -5080,7 +5083,7 @@ function loadConfig2(opts) {
|
|
|
5080
5083
|
}
|
|
5081
5084
|
var import_node_fs4, import_node_path8, BrowserslistError, isFileCache, IS_SECTION, configCache;
|
|
5082
5085
|
var init_dist = __esm({
|
|
5083
|
-
"../../node_modules/.pnpm/browserslist-load-config@0.
|
|
5086
|
+
"../../node_modules/.pnpm/browserslist-load-config@0.1.1/node_modules/browserslist-load-config/dist/index.js"() {
|
|
5084
5087
|
"use strict";
|
|
5085
5088
|
import_node_fs4 = __toESM(require("fs"));
|
|
5086
5089
|
import_node_path8 = __toESM(require("path"));
|
|
@@ -5979,7 +5982,7 @@ async function createContext(options, userConfig, bundlerType) {
|
|
|
5979
5982
|
const rsbuildConfig = await withDefaultConfig(rootPath, userConfig);
|
|
5980
5983
|
const cachePath = (0, import_node_path10.join)(rootPath, "node_modules", ".cache");
|
|
5981
5984
|
return {
|
|
5982
|
-
version: "1.0.
|
|
5985
|
+
version: "1.0.9",
|
|
5983
5986
|
rootPath,
|
|
5984
5987
|
distPath: "",
|
|
5985
5988
|
cachePath,
|
|
@@ -6803,7 +6806,7 @@ async function createCompiler(options) {
|
|
|
6803
6806
|
};
|
|
6804
6807
|
const hasErrors = stats.hasErrors();
|
|
6805
6808
|
if (!hasErrors) {
|
|
6806
|
-
if (
|
|
6809
|
+
if (rspackConfigs.length > 1 && statsJson.children?.length) {
|
|
6807
6810
|
statsJson.children.forEach((c, index) => {
|
|
6808
6811
|
printTime(c, index);
|
|
6809
6812
|
});
|
|
@@ -7277,12 +7280,11 @@ var init_environment = __esm({
|
|
|
7277
7280
|
});
|
|
7278
7281
|
|
|
7279
7282
|
// src/server/middlewares.ts
|
|
7280
|
-
var import_node_path16,
|
|
7283
|
+
var import_node_path16, import_picocolors9, faviconFallbackMiddleware, getStatusCodeColor, getRequestLoggerMiddleware, notFoundMiddleware, isFileExists2, maybeHTMLRequest, postfixRE, getUrlPathname, getHtmlCompletionMiddleware, getHtmlFallbackMiddleware;
|
|
7281
7284
|
var init_middlewares = __esm({
|
|
7282
7285
|
"src/server/middlewares.ts"() {
|
|
7283
7286
|
"use strict";
|
|
7284
7287
|
import_node_path16 = __toESM(require("path"));
|
|
7285
|
-
import_node_url2 = require("url");
|
|
7286
7288
|
import_picocolors9 = __toESM(require("../compiled/picocolors/index.js"));
|
|
7287
7289
|
init_logger();
|
|
7288
7290
|
faviconFallbackMiddleware = (req, res, next) => {
|
|
@@ -7349,21 +7351,17 @@ var init_middlewares = __esm({
|
|
|
7349
7351
|
const { accept } = req.headers;
|
|
7350
7352
|
return typeof accept === "string" && (accept.includes("text/html") || accept.includes("*/*"));
|
|
7351
7353
|
};
|
|
7354
|
+
postfixRE = /[?#].*$/;
|
|
7355
|
+
getUrlPathname = (url2) => {
|
|
7356
|
+
return url2.replace(postfixRE, "");
|
|
7357
|
+
};
|
|
7352
7358
|
getHtmlCompletionMiddleware = ({ distPath, callback, outputFileSystem }) => {
|
|
7353
7359
|
return async (req, res, next) => {
|
|
7354
7360
|
if (!maybeHTMLRequest(req)) {
|
|
7355
7361
|
return next();
|
|
7356
7362
|
}
|
|
7357
7363
|
const url2 = req.url;
|
|
7358
|
-
|
|
7359
|
-
try {
|
|
7360
|
-
pathname = (0, import_node_url2.parse)(url2, false, true).pathname;
|
|
7361
|
-
} catch (err) {
|
|
7362
|
-
import_rslog.logger.error(
|
|
7363
|
-
new Error(`Invalid URL: ${import_picocolors9.default.yellow(url2)}`, { cause: err })
|
|
7364
|
-
);
|
|
7365
|
-
return next();
|
|
7366
|
-
}
|
|
7364
|
+
const pathname = getUrlPathname(url2);
|
|
7367
7365
|
const rewrite = (newUrl) => {
|
|
7368
7366
|
req.url = newUrl;
|
|
7369
7367
|
return callback(req, res, (...args) => {
|
|
@@ -7586,12 +7584,12 @@ var init_proxy = __esm({
|
|
|
7586
7584
|
});
|
|
7587
7585
|
|
|
7588
7586
|
// src/server/getDevMiddlewares.ts
|
|
7589
|
-
var import_node_path17,
|
|
7587
|
+
var import_node_path17, import_node_url2, applySetupMiddlewares, applyDefaultMiddlewares, getMiddlewares;
|
|
7590
7588
|
var init_getDevMiddlewares = __esm({
|
|
7591
7589
|
"src/server/getDevMiddlewares.ts"() {
|
|
7592
7590
|
"use strict";
|
|
7593
7591
|
import_node_path17 = require("path");
|
|
7594
|
-
|
|
7592
|
+
import_node_url2 = __toESM(require("url"));
|
|
7595
7593
|
init_config();
|
|
7596
7594
|
init_logger();
|
|
7597
7595
|
init_middlewares();
|
|
@@ -7629,7 +7627,7 @@ var init_getDevMiddlewares = __esm({
|
|
|
7629
7627
|
}
|
|
7630
7628
|
middlewares.push((req, res, next) => {
|
|
7631
7629
|
res.setHeader("Access-Control-Allow-Origin", "*");
|
|
7632
|
-
const path21 = req.url ?
|
|
7630
|
+
const path21 = req.url ? import_node_url2.default.parse(req.url).pathname : "";
|
|
7633
7631
|
if (path21?.includes("hot-update")) {
|
|
7634
7632
|
res.setHeader("Access-Control-Allow-Credentials", "false");
|
|
7635
7633
|
}
|
|
@@ -7754,7 +7752,7 @@ var init_getDevMiddlewares = __esm({
|
|
|
7754
7752
|
function getURLMessages(urls, routes) {
|
|
7755
7753
|
if (routes.length === 1) {
|
|
7756
7754
|
return urls.map(
|
|
7757
|
-
({ label, url: url2 }) => ` ${
|
|
7755
|
+
({ label, url: url2 }) => ` ${`➜ ${label.padEnd(10)}`}${import_picocolors10.default.cyan(
|
|
7758
7756
|
normalizeUrl(`${url2}${routes[0].pathname}`)
|
|
7759
7757
|
)}
|
|
7760
7758
|
`
|
|
@@ -7766,7 +7764,7 @@ function getURLMessages(urls, routes) {
|
|
|
7766
7764
|
if (index > 0) {
|
|
7767
7765
|
message += "\n";
|
|
7768
7766
|
}
|
|
7769
|
-
message += ` ${
|
|
7767
|
+
message += ` ${`➜ ${label}`}
|
|
7770
7768
|
`;
|
|
7771
7769
|
for (const r of routes) {
|
|
7772
7770
|
message += ` ${import_picocolors10.default.dim("-")} ${import_picocolors10.default.dim(
|
|
@@ -7894,8 +7892,7 @@ var init_helper = __esm({
|
|
|
7894
7892
|
host,
|
|
7895
7893
|
port,
|
|
7896
7894
|
strictPort,
|
|
7897
|
-
tryLimits = 20
|
|
7898
|
-
silent = false
|
|
7895
|
+
tryLimits = 20
|
|
7899
7896
|
}) => {
|
|
7900
7897
|
if (typeof port === "string") {
|
|
7901
7898
|
port = Number.parseInt(port, 10);
|
|
@@ -7931,28 +7928,27 @@ var init_helper = __esm({
|
|
|
7931
7928
|
`Port "${original}" is occupied, please choose another one.`
|
|
7932
7929
|
);
|
|
7933
7930
|
}
|
|
7934
|
-
if (!silent) {
|
|
7935
|
-
import_rslog.logger.info(
|
|
7936
|
-
`Port ${original} is in use, ${import_picocolors10.default.yellow(`using port ${port}.`)}
|
|
7937
|
-
`
|
|
7938
|
-
);
|
|
7939
|
-
}
|
|
7940
7931
|
}
|
|
7941
7932
|
return port;
|
|
7942
7933
|
};
|
|
7943
7934
|
getServerConfig = async ({
|
|
7944
|
-
config
|
|
7945
|
-
getPortSilently
|
|
7935
|
+
config
|
|
7946
7936
|
}) => {
|
|
7947
7937
|
const host = config.server.host || DEFAULT_DEV_HOST;
|
|
7938
|
+
const originalPort = config.server.port || DEFAULT_PORT;
|
|
7948
7939
|
const port = await getPort({
|
|
7949
7940
|
host,
|
|
7950
|
-
port:
|
|
7951
|
-
strictPort: config.server.strictPort || false
|
|
7952
|
-
silent: getPortSilently
|
|
7941
|
+
port: originalPort,
|
|
7942
|
+
strictPort: config.server.strictPort || false
|
|
7953
7943
|
});
|
|
7954
7944
|
const https = Boolean(config.server.https) || false;
|
|
7955
|
-
|
|
7945
|
+
const portTip = port !== originalPort ? `Port ${originalPort} is in use, ${import_picocolors10.default.yellow(`using port ${port}.`)}` : void 0;
|
|
7946
|
+
return {
|
|
7947
|
+
port,
|
|
7948
|
+
host,
|
|
7949
|
+
https,
|
|
7950
|
+
portTip
|
|
7951
|
+
};
|
|
7956
7952
|
};
|
|
7957
7953
|
getIpv4Interfaces = () => {
|
|
7958
7954
|
const interfaces = import_node_os.default.networkInterfaces();
|
|
@@ -8705,9 +8701,8 @@ async function createDevServer(options, createCompiler2, config, {
|
|
|
8705
8701
|
runCompile = true
|
|
8706
8702
|
} = {}) {
|
|
8707
8703
|
import_rslog.logger.debug("create dev server");
|
|
8708
|
-
const { port, host, https } = await getServerConfig({
|
|
8709
|
-
config
|
|
8710
|
-
getPortSilently
|
|
8704
|
+
const { port, host, https, portTip } = await getServerConfig({
|
|
8705
|
+
config
|
|
8711
8706
|
});
|
|
8712
8707
|
const devConfig = formatDevConfig(config.dev, port);
|
|
8713
8708
|
const routes = getRoutes(options.context);
|
|
@@ -8764,6 +8759,9 @@ async function createDevServer(options, createCompiler2, config, {
|
|
|
8764
8759
|
protocol,
|
|
8765
8760
|
printUrls: config.server.printUrls
|
|
8766
8761
|
});
|
|
8762
|
+
if (!getPortSilently && portTip) {
|
|
8763
|
+
import_rslog.logger.info(portTip);
|
|
8764
|
+
}
|
|
8767
8765
|
};
|
|
8768
8766
|
if (runCompile) {
|
|
8769
8767
|
options.context.hooks.onBeforeCreateCompiler.tap(printUrls);
|
|
@@ -11775,7 +11773,7 @@ function determineAsValue({
|
|
|
11775
11773
|
href,
|
|
11776
11774
|
file
|
|
11777
11775
|
}) {
|
|
11778
|
-
const url2 = new
|
|
11776
|
+
const url2 = new import_node_url3.URL(file || href, "https://example.com");
|
|
11779
11777
|
const extension = import_node_path33.default.extname(url2.pathname).slice(1);
|
|
11780
11778
|
if (["css"].includes(extension)) {
|
|
11781
11779
|
return "style";
|
|
@@ -11797,12 +11795,12 @@ function determineAsValue({
|
|
|
11797
11795
|
}
|
|
11798
11796
|
return "script";
|
|
11799
11797
|
}
|
|
11800
|
-
var import_node_path33,
|
|
11798
|
+
var import_node_path33, import_node_url3;
|
|
11801
11799
|
var init_determineAsValue = __esm({
|
|
11802
11800
|
"src/rspack/preload/helpers/determineAsValue.ts"() {
|
|
11803
11801
|
"use strict";
|
|
11804
11802
|
import_node_path33 = __toESM(require("path"));
|
|
11805
|
-
|
|
11803
|
+
import_node_url3 = require("url");
|
|
11806
11804
|
init_constants();
|
|
11807
11805
|
}
|
|
11808
11806
|
});
|
|
@@ -12352,6 +12350,9 @@ function pluginModuleFederation() {
|
|
|
12352
12350
|
return {
|
|
12353
12351
|
name: "rsbuild:module-federation",
|
|
12354
12352
|
setup(api) {
|
|
12353
|
+
if (api.context.bundlerType === "webpack") {
|
|
12354
|
+
return;
|
|
12355
|
+
}
|
|
12355
12356
|
api.modifyRsbuildConfig((config) => {
|
|
12356
12357
|
const { moduleFederation } = config;
|
|
12357
12358
|
if (!moduleFederation?.options) {
|
|
@@ -12806,9 +12807,8 @@ __export(prodServer_exports, {
|
|
|
12806
12807
|
startProdServer: () => startProdServer
|
|
12807
12808
|
});
|
|
12808
12809
|
async function startProdServer(context, config, { getPortSilently } = {}) {
|
|
12809
|
-
const { port, host, https } = await getServerConfig({
|
|
12810
|
-
config
|
|
12811
|
-
getPortSilently
|
|
12810
|
+
const { port, host, https, portTip } = await getServerConfig({
|
|
12811
|
+
config
|
|
12812
12812
|
});
|
|
12813
12813
|
const { default: connect } = await import("../compiled/connect/index.js");
|
|
12814
12814
|
const middlewares = connect();
|
|
@@ -12855,6 +12855,9 @@ async function startProdServer(context, config, { getPortSilently } = {}) {
|
|
|
12855
12855
|
protocol,
|
|
12856
12856
|
printUrls: serverConfig.printUrls
|
|
12857
12857
|
});
|
|
12858
|
+
if (portTip && !getPortSilently) {
|
|
12859
|
+
import_rslog.logger.info(portTip);
|
|
12860
|
+
}
|
|
12858
12861
|
const onClose = async () => {
|
|
12859
12862
|
await Promise.all([server.close(), serverTerminator()]);
|
|
12860
12863
|
};
|
|
@@ -13264,7 +13267,7 @@ var init_init = __esm({
|
|
|
13264
13267
|
|
|
13265
13268
|
// src/cli/commands.ts
|
|
13266
13269
|
function runCli() {
|
|
13267
|
-
program.name("rsbuild").usage("<command> [options]").version("1.0.
|
|
13270
|
+
program.name("rsbuild").usage("<command> [options]").version("1.0.9");
|
|
13268
13271
|
const devCommand = program.command("dev");
|
|
13269
13272
|
const buildCommand = program.command("build");
|
|
13270
13273
|
const previewCommand = program.command("preview");
|
|
@@ -13387,7 +13390,7 @@ function prepareCli() {
|
|
|
13387
13390
|
if (!npm_execpath || npm_execpath.includes("npx-cli.js") || npm_execpath.includes(".bun")) {
|
|
13388
13391
|
console.log();
|
|
13389
13392
|
}
|
|
13390
|
-
import_rslog.logger.greet(` ${`Rsbuild v${"1.0.
|
|
13393
|
+
import_rslog.logger.greet(` ${`Rsbuild v${"1.0.9"}`}
|
|
13391
13394
|
`);
|
|
13392
13395
|
}
|
|
13393
13396
|
var init_prepare = __esm({
|
|
@@ -13471,7 +13474,7 @@ init_logger();
|
|
|
13471
13474
|
init_mergeConfig();
|
|
13472
13475
|
init_helpers();
|
|
13473
13476
|
init_constants();
|
|
13474
|
-
var version = "1.0.
|
|
13477
|
+
var version = "1.0.9";
|
|
13475
13478
|
// Annotate the CommonJS export names for ESM import in node:
|
|
13476
13479
|
0 && (module.exports = {
|
|
13477
13480
|
PLUGIN_CSS_NAME,
|