@rsbuild/core 1.1.3 → 1.1.5
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 +3 -0
- package/compiled/rspack-chain/index.js +69 -66
- package/compiled/rspack-chain/package.json +1 -1
- package/compiled/rspack-manifest-plugin/index.js +4 -4
- package/dist/ignoreCssLoader.mjs +4 -0
- package/dist/index.cjs +213 -224
- package/dist/index.js +104 -93
- package/dist/transformLoader.mjs +21 -0
- package/dist/transformRawLoader.mjs +21 -0
- package/dist-types/config.d.ts +29 -3
- package/dist-types/constants.d.ts +2 -0
- package/dist-types/index.d.ts +1 -1
- package/dist-types/plugins/fileSize.d.ts +3 -3
- package/dist-types/server/compilerDevMiddleware.d.ts +1 -1
- package/dist-types/server/getDevMiddlewares.d.ts +1 -1
- package/dist-types/types/config.d.ts +39 -2
- package/package.json +7 -7
- package/dist/ignoreCssLoader.cjs +0 -46
- package/dist/transformLoader.cjs +0 -63
- package/dist/transformRawLoader.cjs +0 -84
package/dist/index.cjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
let __rslib_import_meta_url__ = 'undefined' == typeof document ? new (require('url'.replace('', ''))).URL('file:' + __filename).href : document.currentScript && document.currentScript.src || new URL('main.js', document.baseURI).href;
|
|
1
2
|
var __webpack_modules__ = {
|
|
2
|
-
"../../node_modules/.pnpm/deepmerge@4.3.1/node_modules/deepmerge/dist/cjs.js": function(
|
|
3
|
+
"../../node_modules/.pnpm/deepmerge@4.3.1/node_modules/deepmerge/dist/cjs.js": function(module) {
|
|
3
4
|
"use strict";
|
|
4
5
|
var isMergeableObject = function(value) {
|
|
5
6
|
return function(value) {
|
|
@@ -54,9 +55,9 @@ var __webpack_modules__ = {
|
|
|
54
55
|
return deepmerge(prev, next, options);
|
|
55
56
|
}, {});
|
|
56
57
|
};
|
|
57
|
-
|
|
58
|
+
module.exports = deepmerge;
|
|
58
59
|
},
|
|
59
|
-
"../../node_modules/.pnpm/dotenv-expand@11.0.7/node_modules/dotenv-expand/lib/main.js": function(
|
|
60
|
+
"../../node_modules/.pnpm/dotenv-expand@11.0.7/node_modules/dotenv-expand/lib/main.js": function(module) {
|
|
60
61
|
"use strict";
|
|
61
62
|
let DOTENV_SUBSTITUTION_REGEX = /(\\)?(\$)(?!\()(\{?)([\w.]+)(?::?-((?:\$\{(?:\$\{(?:\$\{[^}]*\}|[^}])*}|[^}])*}|[^}])+))?(\}?)/gi;
|
|
62
63
|
function interpolate(value, processEnv, parsed) {
|
|
@@ -68,7 +69,7 @@ var __webpack_modules__ = {
|
|
|
68
69
|
return '';
|
|
69
70
|
});
|
|
70
71
|
}
|
|
71
|
-
|
|
72
|
+
module.exports.expand = function(options) {
|
|
72
73
|
let processEnv = process.env;
|
|
73
74
|
for(let key in options && null != options.processEnv && (processEnv = options.processEnv), options.parsed){
|
|
74
75
|
let value = options.parsed[key];
|
|
@@ -78,7 +79,7 @@ var __webpack_modules__ = {
|
|
|
78
79
|
return options;
|
|
79
80
|
};
|
|
80
81
|
},
|
|
81
|
-
"../../node_modules/.pnpm/dotenv@16.4.5/node_modules/dotenv/lib/main.js": function(
|
|
82
|
+
"../../node_modules/.pnpm/dotenv@16.4.5/node_modules/dotenv/lib/main.js": function(module, __unused_webpack_exports, __webpack_require__) {
|
|
82
83
|
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.4.5/node_modules/dotenv/package.json").version, LINE = /(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;
|
|
83
84
|
function _debug(message) {
|
|
84
85
|
console.log(`[dotenv@${version}][DEBUG] ${message}`);
|
|
@@ -229,119 +230,119 @@ var __webpack_modules__ = {
|
|
|
229
230
|
for (let key of Object.keys(parsed))Object.prototype.hasOwnProperty.call(processEnv, key) ? (!0 === override && (processEnv[key] = parsed[key]), debug && (!0 === override ? _debug(`"${key}" is already defined and WAS overwritten`) : _debug(`"${key}" is already defined and was NOT overwritten`))) : processEnv[key] = parsed[key];
|
|
230
231
|
}
|
|
231
232
|
};
|
|
232
|
-
|
|
233
|
+
module.exports.configDotenv = DotenvModule.configDotenv, module.exports._configVault = DotenvModule._configVault, module.exports._parseVault = DotenvModule._parseVault, module.exports.config = DotenvModule.config, module.exports.decrypt = DotenvModule.decrypt, module.exports.parse = DotenvModule.parse, module.exports.populate = DotenvModule.populate, module.exports = DotenvModule;
|
|
233
234
|
},
|
|
234
|
-
|
|
235
|
+
crypto: function(module) {
|
|
235
236
|
"use strict";
|
|
236
|
-
|
|
237
|
+
module.exports = require("crypto");
|
|
237
238
|
},
|
|
238
|
-
|
|
239
|
+
fs: function(module) {
|
|
239
240
|
"use strict";
|
|
240
|
-
|
|
241
|
+
module.exports = require("fs");
|
|
241
242
|
},
|
|
242
|
-
"
|
|
243
|
+
"node:child_process": function(module) {
|
|
243
244
|
"use strict";
|
|
244
|
-
|
|
245
|
+
module.exports = require("node:child_process");
|
|
245
246
|
},
|
|
246
|
-
"
|
|
247
|
+
"node:events": function(module) {
|
|
247
248
|
"use strict";
|
|
248
|
-
|
|
249
|
+
module.exports = require("node:events");
|
|
249
250
|
},
|
|
250
|
-
"
|
|
251
|
+
"node:fs": function(module) {
|
|
251
252
|
"use strict";
|
|
252
|
-
|
|
253
|
+
module.exports = require("node:fs");
|
|
253
254
|
},
|
|
254
|
-
"
|
|
255
|
+
"node:path": function(module) {
|
|
255
256
|
"use strict";
|
|
256
|
-
|
|
257
|
+
module.exports = require("node:path");
|
|
257
258
|
},
|
|
258
|
-
"
|
|
259
|
+
"node:process": function(module) {
|
|
259
260
|
"use strict";
|
|
260
|
-
|
|
261
|
+
module.exports = require("node:process");
|
|
261
262
|
},
|
|
262
|
-
|
|
263
|
+
os: function(module) {
|
|
263
264
|
"use strict";
|
|
264
|
-
|
|
265
|
+
module.exports = require("os");
|
|
265
266
|
},
|
|
266
|
-
|
|
267
|
+
path: function(module) {
|
|
267
268
|
"use strict";
|
|
268
|
-
|
|
269
|
+
module.exports = require("path");
|
|
269
270
|
},
|
|
270
|
-
"../../compiled/
|
|
271
|
+
"../../compiled/chokidar/index.js": function(module) {
|
|
271
272
|
"use strict";
|
|
272
|
-
|
|
273
|
+
module.exports = import("../compiled/chokidar/index.js");
|
|
273
274
|
},
|
|
274
|
-
"../../compiled/
|
|
275
|
+
"../../compiled/connect-history-api-fallback/index.js": function(module) {
|
|
275
276
|
"use strict";
|
|
276
|
-
|
|
277
|
+
module.exports = import("../compiled/connect-history-api-fallback/index.js");
|
|
277
278
|
},
|
|
278
|
-
"../../compiled/
|
|
279
|
+
"../../compiled/connect/index.js": function(module) {
|
|
279
280
|
"use strict";
|
|
280
|
-
|
|
281
|
+
module.exports = import("../compiled/connect/index.js");
|
|
281
282
|
},
|
|
282
|
-
"../../compiled/
|
|
283
|
+
"../../compiled/http-proxy-middleware/index.js": function(module) {
|
|
283
284
|
"use strict";
|
|
284
|
-
|
|
285
|
+
module.exports = import("../compiled/http-proxy-middleware/index.js");
|
|
285
286
|
},
|
|
286
|
-
"
|
|
287
|
+
"../compiled/jiti/index.js": function(module) {
|
|
287
288
|
"use strict";
|
|
288
|
-
|
|
289
|
+
module.exports = import("../compiled/jiti/index.js");
|
|
289
290
|
},
|
|
290
|
-
"../../compiled/
|
|
291
|
+
"../../compiled/launch-editor-middleware/index.js": function(module) {
|
|
291
292
|
"use strict";
|
|
292
|
-
|
|
293
|
+
module.exports = import("../compiled/launch-editor-middleware/index.js");
|
|
293
294
|
},
|
|
294
|
-
"../../compiled/
|
|
295
|
+
"../../compiled/on-finished/index.js": function(module) {
|
|
295
296
|
"use strict";
|
|
296
|
-
|
|
297
|
+
module.exports = import("../compiled/on-finished/index.js");
|
|
297
298
|
},
|
|
298
|
-
|
|
299
|
+
"../../compiled/open/index.js": function(module) {
|
|
299
300
|
"use strict";
|
|
300
|
-
|
|
301
|
+
module.exports = import("../compiled/open/index.js");
|
|
301
302
|
},
|
|
302
|
-
|
|
303
|
+
"../../compiled/postcss-load-config/index.js": function(module) {
|
|
303
304
|
"use strict";
|
|
304
|
-
|
|
305
|
+
module.exports = import("../compiled/postcss-load-config/index.js");
|
|
305
306
|
},
|
|
306
|
-
"
|
|
307
|
+
"../../compiled/rsbuild-dev-middleware/index.js": function(module) {
|
|
307
308
|
"use strict";
|
|
308
|
-
|
|
309
|
+
module.exports = import("../compiled/rsbuild-dev-middleware/index.js");
|
|
309
310
|
},
|
|
310
|
-
"
|
|
311
|
+
"../../compiled/rspack-manifest-plugin/index.js": function(module) {
|
|
311
312
|
"use strict";
|
|
312
|
-
|
|
313
|
+
module.exports = import("../compiled/rspack-manifest-plugin/index.js");
|
|
313
314
|
},
|
|
314
|
-
"
|
|
315
|
+
"../../compiled/sirv/index.js": function(module) {
|
|
315
316
|
"use strict";
|
|
316
|
-
|
|
317
|
+
module.exports = import("../compiled/sirv/index.js");
|
|
317
318
|
},
|
|
318
|
-
"
|
|
319
|
+
"../../compiled/tinyglobby/index.js": function(module) {
|
|
319
320
|
"use strict";
|
|
320
|
-
|
|
321
|
+
module.exports = import("../compiled/tinyglobby/index.js");
|
|
321
322
|
},
|
|
322
|
-
"
|
|
323
|
+
"../../compiled/webpack-bundle-analyzer/index.js": function(module) {
|
|
323
324
|
"use strict";
|
|
324
|
-
|
|
325
|
+
module.exports = import("../compiled/webpack-bundle-analyzer/index.js");
|
|
325
326
|
},
|
|
326
|
-
"
|
|
327
|
+
"../../compiled/webpack-merge/index.js": function(module) {
|
|
327
328
|
"use strict";
|
|
328
|
-
|
|
329
|
+
module.exports = import("../compiled/webpack-merge/index.js");
|
|
329
330
|
},
|
|
330
|
-
"
|
|
331
|
+
"../../compiled/ws/index.js": function(module) {
|
|
331
332
|
"use strict";
|
|
332
|
-
|
|
333
|
+
module.exports = import("../compiled/ws/index.js");
|
|
333
334
|
},
|
|
334
|
-
"node:
|
|
335
|
+
"node:http": function(module) {
|
|
335
336
|
"use strict";
|
|
336
|
-
|
|
337
|
+
module.exports = import("node:http");
|
|
337
338
|
},
|
|
338
|
-
|
|
339
|
+
"node:http2": function(module) {
|
|
339
340
|
"use strict";
|
|
340
|
-
|
|
341
|
+
module.exports = import("node:http2");
|
|
341
342
|
},
|
|
342
|
-
|
|
343
|
+
"node:https": function(module) {
|
|
343
344
|
"use strict";
|
|
344
|
-
|
|
345
|
+
module.exports = import("node:https");
|
|
345
346
|
},
|
|
346
347
|
"../../node_modules/.pnpm/commander@12.1.0/node_modules/commander/index.js": function(__unused_webpack_module, exports1, __webpack_require__) {
|
|
347
348
|
let { Argument } = __webpack_require__("../../node_modules/.pnpm/commander@12.1.0/node_modules/commander/lib/argument.js"), { Command } = __webpack_require__("../../node_modules/.pnpm/commander@12.1.0/node_modules/commander/lib/command.js"), { CommanderError, InvalidArgumentError } = __webpack_require__("../../node_modules/.pnpm/commander@12.1.0/node_modules/commander/lib/error.js"), { Help } = __webpack_require__("../../node_modules/.pnpm/commander@12.1.0/node_modules/commander/lib/help.js"), { Option } = __webpack_require__("../../node_modules/.pnpm/commander@12.1.0/node_modules/commander/lib/option.js");
|
|
@@ -1392,55 +1393,29 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1392
1393
|
}), similar.sort((a, b)=>a.localeCompare(b)), searchingOptions && (similar = similar.map((candidate)=>`--${candidate}`)), similar.length > 1) ? `\n(Did you mean one of ${similar.join(', ')}?)` : 1 === similar.length ? `\n(Did you mean ${similar[0]}?)` : '';
|
|
1393
1394
|
};
|
|
1394
1395
|
},
|
|
1395
|
-
"../../node_modules/.pnpm/dotenv@16.4.5/node_modules/dotenv/package.json": function(
|
|
1396
|
+
"../../node_modules/.pnpm/dotenv@16.4.5/node_modules/dotenv/package.json": function(module) {
|
|
1396
1397
|
"use strict";
|
|
1397
|
-
|
|
1398
|
+
module.exports = JSON.parse('{"name":"dotenv","version":"16.4.5","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","lint-readme":"standard-markdown","pretest":"npm run lint && npm run dts-check","test":"tap tests/*.js --100 -Rspec","test:coverage":"tap --coverage-report=lcov","prerelease":"npm test","release":"standard-version"},"repository":{"type":"git","url":"git://github.com/motdotla/dotenv.git"},"funding":"https://dotenvx.com","keywords":["dotenv","env",".env","environment","variables","config","settings"],"readmeFilename":"README.md","license":"BSD-2-Clause","devDependencies":{"@definitelytyped/dtslint":"^0.0.133","@types/node":"^18.11.3","decache":"^4.6.1","sinon":"^14.0.1","standard":"^17.0.0","standard-markdown":"^7.1.0","standard-version":"^9.5.0","tap":"^16.3.0","tar":"^6.1.11","typescript":"^4.8.4"},"engines":{"node":">=12"},"browser":{"fs":false}}');
|
|
1398
1399
|
}
|
|
1399
1400
|
}, __webpack_module_cache__ = {};
|
|
1400
1401
|
function __webpack_require__(moduleId) {
|
|
1401
1402
|
var cachedModule = __webpack_module_cache__[moduleId];
|
|
1402
1403
|
if (void 0 !== cachedModule) return cachedModule.exports;
|
|
1403
|
-
var
|
|
1404
|
+
var module = __webpack_module_cache__[moduleId] = {
|
|
1404
1405
|
exports: {}
|
|
1405
1406
|
};
|
|
1406
|
-
return __webpack_modules__[moduleId](
|
|
1407
|
+
return __webpack_modules__[moduleId](module, module.exports, __webpack_require__), module.exports;
|
|
1407
1408
|
}
|
|
1408
|
-
__webpack_require__.n = function(
|
|
1409
|
-
var getter =
|
|
1410
|
-
return
|
|
1409
|
+
__webpack_require__.n = function(module) {
|
|
1410
|
+
var getter = module && module.__esModule ? function() {
|
|
1411
|
+
return module.default;
|
|
1411
1412
|
} : function() {
|
|
1412
|
-
return
|
|
1413
|
+
return module;
|
|
1413
1414
|
};
|
|
1414
1415
|
return __webpack_require__.d(getter, {
|
|
1415
1416
|
a: getter
|
|
1416
1417
|
}), getter;
|
|
1417
|
-
}, (
|
|
1418
|
-
var leafPrototypes, getProto = Object.getPrototypeOf ? function(obj) {
|
|
1419
|
-
return Object.getPrototypeOf(obj);
|
|
1420
|
-
} : function(obj) {
|
|
1421
|
-
return obj.__proto__;
|
|
1422
|
-
};
|
|
1423
|
-
__webpack_require__.t = function(value, mode) {
|
|
1424
|
-
if (1 & mode && (value = this(value)), 8 & mode || 'object' == typeof value && value && (4 & mode && value.__esModule || 16 & mode && 'function' == typeof value.then)) return value;
|
|
1425
|
-
var ns = Object.create(null);
|
|
1426
|
-
__webpack_require__.r(ns);
|
|
1427
|
-
var def = {};
|
|
1428
|
-
leafPrototypes = leafPrototypes || [
|
|
1429
|
-
null,
|
|
1430
|
-
getProto({}),
|
|
1431
|
-
getProto([]),
|
|
1432
|
-
getProto(getProto)
|
|
1433
|
-
];
|
|
1434
|
-
for(var current = 2 & mode && value; 'object' == typeof current && !~leafPrototypes.indexOf(current); current = getProto(current))Object.getOwnPropertyNames(current).forEach(function(key) {
|
|
1435
|
-
def[key] = function() {
|
|
1436
|
-
return value[key];
|
|
1437
|
-
};
|
|
1438
|
-
});
|
|
1439
|
-
return def.default = function() {
|
|
1440
|
-
return value;
|
|
1441
|
-
}, __webpack_require__.d(ns, def), ns;
|
|
1442
|
-
};
|
|
1443
|
-
})(), __webpack_require__.d = function(exports1, definition) {
|
|
1418
|
+
}, __webpack_require__.d = function(exports1, definition) {
|
|
1444
1419
|
for(var key in definition)__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key) && Object.defineProperty(exports1, key, {
|
|
1445
1420
|
enumerable: !0,
|
|
1446
1421
|
get: definition[key]
|
|
@@ -1463,7 +1438,7 @@ var __webpack_exports__ = {};
|
|
|
1463
1438
|
createRsbuild: ()=>createRsbuild,
|
|
1464
1439
|
PLUGIN_SWC_NAME: ()=>PLUGIN_SWC_NAME,
|
|
1465
1440
|
loadConfig: ()=>config_loadConfig,
|
|
1466
|
-
version: ()=>
|
|
1441
|
+
version: ()=>src_rslib_entry_version,
|
|
1467
1442
|
PLUGIN_CSS_NAME: ()=>PLUGIN_CSS_NAME,
|
|
1468
1443
|
logger: ()=>rslog_index_js_namespaceObject.logger,
|
|
1469
1444
|
loadEnv: ()=>loadEnv,
|
|
@@ -1498,7 +1473,7 @@ var __webpack_exports__ = {};
|
|
|
1498
1473
|
});
|
|
1499
1474
|
let core_namespaceObject = require("@rspack/core");
|
|
1500
1475
|
var core_default = __webpack_require__.n(core_namespaceObject);
|
|
1501
|
-
let external_node_module_namespaceObject = require("node:module"), pluginHelper_require = (0, external_node_module_namespaceObject.createRequire)(
|
|
1476
|
+
let external_node_module_namespaceObject = require("node:module"), pluginHelper_require = (0, external_node_module_namespaceObject.createRequire)(__rslib_import_meta_url__), setHTMLPlugin = (plugin)=>{
|
|
1502
1477
|
plugin && (pluginHelper_htmlPlugin = plugin);
|
|
1503
1478
|
}, getHTMLPlugin = ()=>(!pluginHelper_htmlPlugin && (pluginHelper_htmlPlugin = pluginHelper_require('../compiled/html-rspack-plugin/index.js')), pluginHelper_htmlPlugin), setCssExtractPlugin = (plugin)=>{
|
|
1504
1479
|
cssExtractPlugin = plugin;
|
|
@@ -1506,7 +1481,9 @@ var __webpack_exports__ = {};
|
|
|
1506
1481
|
var external_node_fs_ = __webpack_require__("node:fs"), external_node_fs_default = __webpack_require__.n(external_node_fs_), external_node_path_ = __webpack_require__("node:path"), external_node_path_default = __webpack_require__.n(external_node_path_), main = __webpack_require__("../../node_modules/.pnpm/dotenv@16.4.5/node_modules/dotenv/lib/main.js"), lib_main = __webpack_require__("../../node_modules/.pnpm/dotenv-expand@11.0.7/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);
|
|
1507
1482
|
let index_js_namespaceObject = require("../compiled/picocolors/index.js");
|
|
1508
1483
|
var index_js_default = __webpack_require__.n(index_js_namespaceObject);
|
|
1509
|
-
let
|
|
1484
|
+
let external_node_url_namespaceObject = require("node:url");
|
|
1485
|
+
var external_node_url_default = __webpack_require__.n(external_node_url_namespaceObject);
|
|
1486
|
+
let constants_filename = (0, external_node_url_namespaceObject.fileURLToPath)(__rslib_import_meta_url__), constants_dirname = (0, external_node_path_.dirname)(constants_filename), ROOT_DIST_DIR = 'dist', LOADER_PATH = (0, external_node_path_.join)(constants_dirname), STATIC_PATH = (0, external_node_path_.join)(constants_dirname, '../static'), COMPILED_PATH = (0, external_node_path_.join)(constants_dirname, '../compiled'), RSBUILD_OUTPUTS_PATH = '.rsbuild', DEFAULT_DEV_HOST = '0.0.0.0', DEFAULT_ASSET_PREFIX = '/', DEFAULT_WEB_BROWSERSLIST = [
|
|
1510
1487
|
'chrome >= 87',
|
|
1511
1488
|
'edge >= 88',
|
|
1512
1489
|
'firefox >= 78',
|
|
@@ -2082,9 +2059,9 @@ var __webpack_exports__ = {};
|
|
|
2082
2059
|
}
|
|
2083
2060
|
let GLOB_REGEX = /[*?{}[\]()!@+|]/, isGlob = (str)=>GLOB_REGEX.test(str);
|
|
2084
2061
|
async function createChokidar(pathOrGlobs, root, options) {
|
|
2085
|
-
let chokidar = await Promise.resolve().then(__webpack_require__.
|
|
2062
|
+
let chokidar = await Promise.resolve().then(__webpack_require__.bind(__webpack_require__, "../../compiled/chokidar/index.js")), watchFiles = new Set(), globPatterns = pathOrGlobs.filter((pathOrGlob)=>!!isGlob(pathOrGlob) || (watchFiles.add(pathOrGlob), !1));
|
|
2086
2063
|
if (globPatterns.length) {
|
|
2087
|
-
let tinyglobby = await Promise.resolve().then(__webpack_require__.
|
|
2064
|
+
let tinyglobby = await Promise.resolve().then(__webpack_require__.bind(__webpack_require__, "../../compiled/tinyglobby/index.js")), { glob } = tinyglobby.default || tinyglobby;
|
|
2088
2065
|
for (let file of (await glob(globPatterns, {
|
|
2089
2066
|
cwd: root,
|
|
2090
2067
|
absolute: !0
|
|
@@ -2099,7 +2076,7 @@ var __webpack_exports__ = {};
|
|
|
2099
2076
|
compileMiddlewareAPI.sockWrite('static-changed');
|
|
2100
2077
|
}), watcher;
|
|
2101
2078
|
}
|
|
2102
|
-
let config_require = (0, external_node_module_namespaceObject.createRequire)(
|
|
2079
|
+
let config_require = (0, external_node_module_namespaceObject.createRequire)(__rslib_import_meta_url__), getDefaultDevConfig = ()=>({
|
|
2103
2080
|
hmr: !0,
|
|
2104
2081
|
liveReload: !0,
|
|
2105
2082
|
assetPrefix: DEFAULT_ASSET_PREFIX,
|
|
@@ -2278,7 +2255,7 @@ var __webpack_exports__ = {};
|
|
|
2278
2255
|
});
|
|
2279
2256
|
watcher.on('add', callback), watcher.on('change', callback), watcher.on('unlink', callback);
|
|
2280
2257
|
}
|
|
2281
|
-
async function config_loadConfig({ cwd = process.cwd(), path, envMode } = {}) {
|
|
2258
|
+
async function config_loadConfig({ cwd = process.cwd(), path, envMode, meta } = {}) {
|
|
2282
2259
|
let configExport;
|
|
2283
2260
|
let configFilePath = resolveConfigPath(cwd, path);
|
|
2284
2261
|
if (!configFilePath) return {
|
|
@@ -2296,8 +2273,8 @@ var __webpack_exports__ = {};
|
|
|
2296
2273
|
}
|
|
2297
2274
|
try {
|
|
2298
2275
|
if (void 0 === configExport) {
|
|
2299
|
-
let { default: jiti } = await Promise.resolve().then(__webpack_require__.
|
|
2300
|
-
configExport = jiti(
|
|
2276
|
+
let { default: jiti } = await Promise.resolve().then(__webpack_require__.bind(__webpack_require__, "../compiled/jiti/index.js"));
|
|
2277
|
+
configExport = jiti(constants_filename, {
|
|
2301
2278
|
esmResolve: !0,
|
|
2302
2279
|
requireCache: !1,
|
|
2303
2280
|
interopDefault: !0
|
|
@@ -2310,7 +2287,8 @@ var __webpack_exports__ = {};
|
|
|
2310
2287
|
let command = process.argv[2], nodeEnv = getNodeEnv(), result = await configExport({
|
|
2311
2288
|
env: nodeEnv,
|
|
2312
2289
|
command,
|
|
2313
|
-
envMode: envMode || nodeEnv
|
|
2290
|
+
envMode: envMode || nodeEnv,
|
|
2291
|
+
meta
|
|
2314
2292
|
});
|
|
2315
2293
|
if (void 0 === result) throw Error('The config function must return a config object.');
|
|
2316
2294
|
return {
|
|
@@ -2743,7 +2721,7 @@ var __webpack_exports__ = {};
|
|
|
2743
2721
|
async function createContext(options, userConfig, bundlerType) {
|
|
2744
2722
|
let { cwd } = options, rootPath = userConfig.root ? getAbsolutePath(cwd, userConfig.root) : cwd, rsbuildConfig = await withDefaultConfig(rootPath, userConfig), cachePath = (0, external_node_path_.join)(rootPath, 'node_modules', '.cache');
|
|
2745
2723
|
return {
|
|
2746
|
-
version: "1.1.
|
|
2724
|
+
version: "1.1.5",
|
|
2747
2725
|
rootPath,
|
|
2748
2726
|
distPath: '',
|
|
2749
2727
|
cachePath,
|
|
@@ -2926,8 +2904,8 @@ var __webpack_exports__ = {};
|
|
|
2926
2904
|
});
|
|
2927
2905
|
}
|
|
2928
2906
|
}), getJsSourceMap = (config)=>{
|
|
2929
|
-
let { sourceMap } = config.output;
|
|
2930
|
-
return
|
|
2907
|
+
let { sourceMap } = config.output, isProd = 'production' === config.mode;
|
|
2908
|
+
return !1 !== sourceMap && (!0 === sourceMap ? isProd ? 'source-map' : 'cheap-module-source-map' : void 0 === sourceMap.js ? !isProd && 'cheap-module-source-map' : sourceMap.js);
|
|
2931
2909
|
}, pluginBasic = ()=>({
|
|
2932
2910
|
name: 'rsbuild:basic',
|
|
2933
2911
|
setup (api) {
|
|
@@ -3031,27 +3009,26 @@ var __webpack_exports__ = {};
|
|
|
3031
3009
|
});
|
|
3032
3010
|
}), api.onBeforeStartDevServer(cleanAll);
|
|
3033
3011
|
}
|
|
3034
|
-
});
|
|
3035
|
-
var dist_isNil = (o)=>null == o, dist_isFunction = (func)=>"function" == typeof func, dist_isObject = (obj)=>null !== obj && "object" == typeof obj, dist_isPlainObject = (obj)=>dist_isObject(obj) && "[object Object]" === Object.prototype.toString.call(obj);
|
|
3012
|
+
}), dist_isNil = (o)=>null == o, dist_isFunction = (func)=>'function' == typeof func, dist_isObject = (obj)=>null !== obj && 'object' == typeof obj, dist_isPlainObject = (obj)=>dist_isObject(obj) && '[object Object]' === Object.prototype.toString.call(obj);
|
|
3036
3013
|
function reduceConfigs({ initial, config, mergeFn = Object.assign }) {
|
|
3037
|
-
return dist_isNil(config) ? initial : dist_isPlainObject(config) ? dist_isPlainObject(initial) ? mergeFn(initial, config) : config : dist_isFunction(config) ? config(initial) ?? initial : Array.isArray(config) ? config.reduce((
|
|
3038
|
-
initial
|
|
3039
|
-
config
|
|
3014
|
+
return dist_isNil(config) ? initial : dist_isPlainObject(config) ? dist_isPlainObject(initial) ? mergeFn(initial, config) : config : dist_isFunction(config) ? config(initial) ?? initial : Array.isArray(config) ? config.reduce((initial, config)=>reduceConfigs({
|
|
3015
|
+
initial,
|
|
3016
|
+
config,
|
|
3040
3017
|
mergeFn
|
|
3041
3018
|
}), initial) : config ?? initial;
|
|
3042
3019
|
}
|
|
3043
3020
|
function reduceConfigsWithContext({ initial, config, ctx, mergeFn = Object.assign }) {
|
|
3044
|
-
return dist_isNil(config) ? initial : dist_isPlainObject(config) ? dist_isPlainObject(initial) ? mergeFn(initial, config) : config : dist_isFunction(config) ? config(initial, ctx) ?? initial : Array.isArray(config) ? config.reduce((
|
|
3045
|
-
initial
|
|
3046
|
-
config
|
|
3021
|
+
return dist_isNil(config) ? initial : dist_isPlainObject(config) ? dist_isPlainObject(initial) ? mergeFn(initial, config) : config : dist_isFunction(config) ? config(initial, ctx) ?? initial : Array.isArray(config) ? config.reduce((initial, config)=>reduceConfigsWithContext({
|
|
3022
|
+
initial,
|
|
3023
|
+
config,
|
|
3047
3024
|
ctx,
|
|
3048
3025
|
mergeFn
|
|
3049
3026
|
}), initial) : config ?? initial;
|
|
3050
3027
|
}
|
|
3051
3028
|
async function reduceConfigsAsyncWithContext({ initial, config, ctx, mergeFn = Object.assign }) {
|
|
3052
|
-
return dist_isNil(config) ? initial : dist_isPlainObject(config) ? dist_isPlainObject(initial) ? mergeFn(initial, config) : config : dist_isFunction(config) ? await config(initial, ctx) ?? initial : Array.isArray(config) ? config.reduce((
|
|
3053
|
-
initial
|
|
3054
|
-
config
|
|
3029
|
+
return dist_isNil(config) ? initial : dist_isPlainObject(config) ? dist_isPlainObject(initial) ? mergeFn(initial, config) : config : dist_isFunction(config) ? await config(initial, ctx) ?? initial : Array.isArray(config) ? config.reduce((initial, config)=>reduceConfigsWithContext({
|
|
3030
|
+
initial,
|
|
3031
|
+
config,
|
|
3055
3032
|
ctx,
|
|
3056
3033
|
mergeFn
|
|
3057
3034
|
}), initial) : config ?? initial;
|
|
@@ -3060,9 +3037,9 @@ var __webpack_exports__ = {};
|
|
|
3060
3037
|
return dist_isNil(config) ? initial : dist_isPlainObject(config) ? dist_isPlainObject(initial) ? mergeFn(initial, config) : config : dist_isFunction(config) ? config({
|
|
3061
3038
|
value: initial,
|
|
3062
3039
|
...ctx
|
|
3063
|
-
}) ?? initial : Array.isArray(config) ? config.reduce((
|
|
3064
|
-
initial
|
|
3065
|
-
config
|
|
3040
|
+
}) ?? initial : Array.isArray(config) ? config.reduce((initial, config)=>reduceConfigsMergeContext({
|
|
3041
|
+
initial,
|
|
3042
|
+
config,
|
|
3066
3043
|
ctx,
|
|
3067
3044
|
mergeFn
|
|
3068
3045
|
}), initial) : config ?? initial;
|
|
@@ -3089,11 +3066,14 @@ var __webpack_exports__ = {};
|
|
|
3089
3066
|
plugins: config.plugins ? [
|
|
3090
3067
|
...config.plugins
|
|
3091
3068
|
] : void 0
|
|
3092
|
-
})
|
|
3069
|
+
}), getCSSSourceMap = (config)=>{
|
|
3070
|
+
let { sourceMap } = config.output;
|
|
3071
|
+
return 'boolean' == typeof sourceMap ? sourceMap : sourceMap.css;
|
|
3072
|
+
};
|
|
3093
3073
|
async function loadUserPostcssrc(root) {
|
|
3094
3074
|
let cached = userPostcssrcCache.get(root);
|
|
3095
3075
|
if (cached) return clonePostCSSConfig(await cached);
|
|
3096
|
-
let { default: postcssrc } = await Promise.resolve().then(__webpack_require__.
|
|
3076
|
+
let { default: postcssrc } = await Promise.resolve().then(__webpack_require__.bind(__webpack_require__, "../../compiled/postcss-load-config/index.js")), promise = postcssrc({}, root).catch((err)=>{
|
|
3097
3077
|
var _err_message;
|
|
3098
3078
|
if (null === (_err_message = err.message) || void 0 === _err_message ? void 0 : _err_message.includes('No PostCSS Config found')) return {};
|
|
3099
3079
|
throw err;
|
|
@@ -3107,7 +3087,7 @@ var __webpack_exports__ = {};
|
|
|
3107
3087
|
initial: {
|
|
3108
3088
|
implementation: getCompiledPath('postcss'),
|
|
3109
3089
|
postcssOptions: userOptions,
|
|
3110
|
-
sourceMap: config
|
|
3090
|
+
sourceMap: getCSSSourceMap(config)
|
|
3111
3091
|
},
|
|
3112
3092
|
config: config.tools.postcss,
|
|
3113
3093
|
ctx: {
|
|
@@ -3146,67 +3126,61 @@ var __webpack_exports__ = {};
|
|
|
3146
3126
|
...cssModules,
|
|
3147
3127
|
localIdentName
|
|
3148
3128
|
},
|
|
3149
|
-
sourceMap: config
|
|
3129
|
+
sourceMap: getCSSSourceMap(config)
|
|
3150
3130
|
},
|
|
3151
3131
|
config: config.tools.cssLoader,
|
|
3152
3132
|
mergeFn: cjs_default()
|
|
3153
3133
|
}), !emitCss);
|
|
3154
|
-
}
|
|
3155
|
-
async function applyCSSRule({ rule, config, context, utils: { target, isProd, CHAIN_ID, environment } }) {
|
|
3156
|
-
let emitCss = config.output.emitCss ?? 'web' === target;
|
|
3157
|
-
if (emitCss) {
|
|
3158
|
-
if (config.output.injectStyles) {
|
|
3159
|
-
let styleLoaderOptions = reduceConfigs({
|
|
3160
|
-
initial: {},
|
|
3161
|
-
config: config.tools.styleLoader
|
|
3162
|
-
});
|
|
3163
|
-
rule.use(CHAIN_ID.USE.STYLE).loader(getCompiledPath('style-loader')).options(styleLoaderOptions);
|
|
3164
|
-
} else rule.use(CHAIN_ID.USE.MINI_CSS_EXTRACT).loader(getCssExtractPlugin().loader).options(config.tools.cssExtract.loaderOptions);
|
|
3165
|
-
} else rule.use(CHAIN_ID.USE.IGNORE_CSS).loader(external_node_path_default().join(LOADER_PATH, 'ignoreCssLoader.cjs'));
|
|
3166
|
-
let importLoaders = 0;
|
|
3167
|
-
if (rule.use(CHAIN_ID.USE.CSS).loader(getCompiledPath('css-loader')), emitCss) {
|
|
3168
|
-
var _postcssLoaderOptions_postcssOptions_plugins, _postcssLoaderOptions_postcssOptions;
|
|
3169
|
-
if ('rspack' === context.bundlerType && !1 !== config.tools.lightningcssLoader) {
|
|
3170
|
-
importLoaders++;
|
|
3171
|
-
let userOptions = !0 === config.tools.lightningcssLoader ? {} : config.tools.lightningcssLoader, initialOptions = {
|
|
3172
|
-
targets: environment.browserslist
|
|
3173
|
-
};
|
|
3174
|
-
'production' === config.mode && config.output.injectStyles && (initialOptions.minify = !0);
|
|
3175
|
-
let loaderOptions = reduceConfigs({
|
|
3176
|
-
initial: initialOptions,
|
|
3177
|
-
config: userOptions
|
|
3178
|
-
});
|
|
3179
|
-
rule.use(CHAIN_ID.USE.LIGHTNINGCSS).loader('builtin:lightningcss-loader').options(loaderOptions);
|
|
3180
|
-
}
|
|
3181
|
-
let postcssLoaderOptions = await getPostcssLoaderOptions({
|
|
3182
|
-
config,
|
|
3183
|
-
root: context.rootPath
|
|
3184
|
-
});
|
|
3185
|
-
('function' == typeof postcssLoaderOptions.postcssOptions || (null === (_postcssLoaderOptions_postcssOptions = postcssLoaderOptions.postcssOptions) || void 0 === _postcssLoaderOptions_postcssOptions ? void 0 : null === (_postcssLoaderOptions_postcssOptions_plugins = _postcssLoaderOptions_postcssOptions.plugins) || void 0 === _postcssLoaderOptions_postcssOptions_plugins ? void 0 : _postcssLoaderOptions_postcssOptions_plugins.length)) && (importLoaders++, rule.use(CHAIN_ID.USE.POSTCSS).loader(getCompiledPath('postcss-loader')).options(postcssLoaderOptions));
|
|
3186
|
-
}
|
|
3187
|
-
let localIdentName = getCSSModulesLocalIdentName(config, isProd), cssLoaderOptions = getCSSLoaderOptions({
|
|
3188
|
-
config,
|
|
3189
|
-
importLoaders,
|
|
3190
|
-
localIdentName,
|
|
3191
|
-
emitCss
|
|
3192
|
-
});
|
|
3193
|
-
rule.use(CHAIN_ID.USE.CSS).options(cssLoaderOptions), rule.merge({
|
|
3194
|
-
sideEffects: !0
|
|
3195
|
-
}), rule.resolve.preferRelative(!0);
|
|
3196
|
-
}
|
|
3197
|
-
let pluginCss = ()=>({
|
|
3134
|
+
}, pluginCss = ()=>({
|
|
3198
3135
|
name: 'rsbuild:css',
|
|
3199
3136
|
setup (api) {
|
|
3200
3137
|
api.modifyBundlerChain({
|
|
3201
3138
|
order: 'pre',
|
|
3202
|
-
handler: async (chain,
|
|
3203
|
-
let rule = chain.module.rule(
|
|
3204
|
-
rule.test(CSS_REGEX).type('javascript/auto')
|
|
3205
|
-
|
|
3206
|
-
|
|
3139
|
+
handler: async (chain, { target, isProd, CHAIN_ID, environment })=>{
|
|
3140
|
+
let rule = chain.module.rule(CHAIN_ID.RULE.CSS), { config } = environment;
|
|
3141
|
+
rule.test(CSS_REGEX).type('javascript/auto').dependency({
|
|
3142
|
+
not: 'url'
|
|
3143
|
+
});
|
|
3144
|
+
let emitCss = config.output.emitCss ?? 'web' === target;
|
|
3145
|
+
if (emitCss) {
|
|
3146
|
+
if (config.output.injectStyles) {
|
|
3147
|
+
let styleLoaderOptions = reduceConfigs({
|
|
3148
|
+
initial: {},
|
|
3149
|
+
config: config.tools.styleLoader
|
|
3150
|
+
});
|
|
3151
|
+
rule.use(CHAIN_ID.USE.STYLE).loader(getCompiledPath('style-loader')).options(styleLoaderOptions);
|
|
3152
|
+
} else rule.use(CHAIN_ID.USE.MINI_CSS_EXTRACT).loader(getCssExtractPlugin().loader).options(config.tools.cssExtract.loaderOptions);
|
|
3153
|
+
} else rule.use(CHAIN_ID.USE.IGNORE_CSS).loader(external_node_path_default().join(LOADER_PATH, 'ignoreCssLoader.mjs'));
|
|
3154
|
+
let importLoaders = 0;
|
|
3155
|
+
if (rule.use(CHAIN_ID.USE.CSS).loader(getCompiledPath('css-loader')), emitCss) {
|
|
3156
|
+
var _postcssLoaderOptions_postcssOptions_plugins, _postcssLoaderOptions_postcssOptions;
|
|
3157
|
+
if ('rspack' === api.context.bundlerType && !1 !== config.tools.lightningcssLoader) {
|
|
3158
|
+
importLoaders++;
|
|
3159
|
+
let userOptions = !0 === config.tools.lightningcssLoader ? {} : config.tools.lightningcssLoader, initialOptions = {
|
|
3160
|
+
targets: environment.browserslist
|
|
3161
|
+
};
|
|
3162
|
+
'production' === config.mode && config.output.injectStyles && (initialOptions.minify = !0);
|
|
3163
|
+
let loaderOptions = reduceConfigs({
|
|
3164
|
+
initial: initialOptions,
|
|
3165
|
+
config: userOptions
|
|
3166
|
+
});
|
|
3167
|
+
rule.use(CHAIN_ID.USE.LIGHTNINGCSS).loader('builtin:lightningcss-loader').options(loaderOptions);
|
|
3168
|
+
}
|
|
3169
|
+
let postcssLoaderOptions = await getPostcssLoaderOptions({
|
|
3170
|
+
config,
|
|
3171
|
+
root: api.context.rootPath
|
|
3172
|
+
});
|
|
3173
|
+
('function' == typeof postcssLoaderOptions.postcssOptions || (null === (_postcssLoaderOptions_postcssOptions = postcssLoaderOptions.postcssOptions) || void 0 === _postcssLoaderOptions_postcssOptions ? void 0 : null === (_postcssLoaderOptions_postcssOptions_plugins = _postcssLoaderOptions_postcssOptions.plugins) || void 0 === _postcssLoaderOptions_postcssOptions_plugins ? void 0 : _postcssLoaderOptions_postcssOptions_plugins.length)) && (importLoaders++, rule.use(CHAIN_ID.USE.POSTCSS).loader(getCompiledPath('postcss-loader')).options(postcssLoaderOptions));
|
|
3174
|
+
}
|
|
3175
|
+
let localIdentName = getCSSModulesLocalIdentName(config, isProd), cssLoaderOptions = getCSSLoaderOptions({
|
|
3207
3176
|
config,
|
|
3208
|
-
|
|
3177
|
+
importLoaders,
|
|
3178
|
+
localIdentName,
|
|
3179
|
+
emitCss
|
|
3209
3180
|
});
|
|
3181
|
+
rule.use(CHAIN_ID.USE.CSS).options(cssLoaderOptions), rule.merge({
|
|
3182
|
+
sideEffects: !0
|
|
3183
|
+
}), rule.resolve.preferRelative(!0);
|
|
3210
3184
|
}
|
|
3211
3185
|
});
|
|
3212
3186
|
}
|
|
@@ -3255,7 +3229,7 @@ var __webpack_exports__ = {};
|
|
|
3255
3229
|
async function gzipSize(input) {
|
|
3256
3230
|
return (await fileSize_gzip(input)).length;
|
|
3257
3231
|
}
|
|
3258
|
-
let
|
|
3232
|
+
let excludeAsset = (asset)=>/\.(?:map|LICENSE\.txt)$/.test(asset.name), getAssetColor = (size)=>size > 300000 ? index_js_default().red : size > 100000 ? index_js_default().yellow : index_js_default().green, calcFileSize = (len)=>{
|
|
3259
3233
|
let val = len / 1000;
|
|
3260
3234
|
return `${val.toFixed(val < 1 ? 2 : 1)} kB`;
|
|
3261
3235
|
}, coloringAssetName = (assetName)=>JS_REGEX.test(assetName) ? index_js_default().cyan(assetName) : CSS_REGEX.test(assetName) ? index_js_default().yellow(assetName) : HTML_REGEX.test(assetName) ? index_js_default().green(assetName) : index_js_default().magenta(assetName);
|
|
@@ -3275,7 +3249,7 @@ var __webpack_exports__ = {};
|
|
|
3275
3249
|
}, getAssets = async ()=>{
|
|
3276
3250
|
let distPath = stats.compilation.outputOptions.path;
|
|
3277
3251
|
if (!distPath) return [];
|
|
3278
|
-
let
|
|
3252
|
+
let origin = stats.toJson({
|
|
3279
3253
|
all: !1,
|
|
3280
3254
|
assets: !0,
|
|
3281
3255
|
cachedAssets: !0,
|
|
@@ -3284,7 +3258,13 @@ var __webpack_exports__ = {};
|
|
|
3284
3258
|
groupAssetsByChunk: !1,
|
|
3285
3259
|
groupAssetsByExtension: !1,
|
|
3286
3260
|
groupAssetsByEmitStatus: !1
|
|
3287
|
-
}).assets.filter((asset)=>
|
|
3261
|
+
}), exclude = options.exclude ?? excludeAsset, filteredAssets = origin.assets.filter((asset)=>{
|
|
3262
|
+
let assetInfo = {
|
|
3263
|
+
name: asset.name,
|
|
3264
|
+
size: asset.size
|
|
3265
|
+
};
|
|
3266
|
+
return !exclude(assetInfo) && (!options.include || options.include(assetInfo));
|
|
3267
|
+
}), distFolder = external_node_path_default().relative(rootPath, distPath);
|
|
3288
3268
|
return Promise.all(filteredAssets.map((asset)=>formatAsset(asset, distPath, distFolder)));
|
|
3289
3269
|
}, assets = await getAssets();
|
|
3290
3270
|
if (0 === assets.length) return logs;
|
|
@@ -3765,8 +3745,6 @@ var __webpack_exports__ = {};
|
|
|
3765
3745
|
function isAsync(chunk) {
|
|
3766
3746
|
return 'canBeInitial' in chunk ? !chunk.canBeInitial() : 'isInitial' in chunk && !chunk.isInitial();
|
|
3767
3747
|
}
|
|
3768
|
-
let external_node_url_namespaceObject = require("node:url");
|
|
3769
|
-
var external_node_url_default = __webpack_require__.n(external_node_url_namespaceObject);
|
|
3770
3748
|
function recursiveChunkEntryNames(chunk) {
|
|
3771
3749
|
let [...chunkGroups] = chunk.groupsIterable;
|
|
3772
3750
|
return [
|
|
@@ -3825,7 +3803,7 @@ var __webpack_exports__ = {};
|
|
|
3825
3803
|
api.modifyBundlerChain(async (chain, { CHAIN_ID, environment })=>{
|
|
3826
3804
|
let { output: { manifest } } = environment.config;
|
|
3827
3805
|
if (!1 === manifest) return;
|
|
3828
|
-
let { RspackManifestPlugin } = await Promise.resolve().then(__webpack_require__.
|
|
3806
|
+
let { RspackManifestPlugin } = await Promise.resolve().then(__webpack_require__.bind(__webpack_require__, "../../compiled/rspack-manifest-plugin/index.js")), { htmlPaths } = environment;
|
|
3829
3807
|
chain.plugin(CHAIN_ID.PLUGIN.MANIFEST).use(RspackManifestPlugin, [
|
|
3830
3808
|
{
|
|
3831
3809
|
fileName: 'string' == typeof manifest ? manifest : 'manifest.json',
|
|
@@ -4021,7 +3999,7 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
4021
3999
|
let trailingSlashBase = addTrailingSlash(base);
|
|
4022
4000
|
return path.startsWith(trailingSlashBase) ? path.slice(trailingSlashBase.length - 1) : path;
|
|
4023
4001
|
}, getRoutes = (context)=>Object.values(context.environments).reduce((prev, environmentContext)=>{
|
|
4024
|
-
let { distPath, config } = environmentContext, distPrefix = external_node_path_.
|
|
4002
|
+
let { distPath, config } = environmentContext, distPrefix = (0, external_node_path_.relative)(context.distPath, distPath).split(external_node_path_.sep).join('/'), routes = formatRoutes(environmentContext.htmlPaths, context.normalizedConfig.server.base, external_node_path_.posix.join(distPrefix, config.output.distPath.html), config.html.outputStructure);
|
|
4025
4003
|
return prev.concat(...routes);
|
|
4026
4004
|
}, []), formatRoutes = (entry, base, distPathPrefix, outputStructure)=>{
|
|
4027
4005
|
let prefix = joinUrlSegments(base, formatPrefix(distPathPrefix));
|
|
@@ -4189,7 +4167,7 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
4189
4167
|
rslog_index_js_namespaceObject.logger.debug('Failed to open start URL with apple script.'), rslog_index_js_namespaceObject.logger.debug(err);
|
|
4190
4168
|
}
|
|
4191
4169
|
try {
|
|
4192
|
-
let { default: open } = await Promise.resolve().then(__webpack_require__.
|
|
4170
|
+
let { default: open } = await Promise.resolve().then(__webpack_require__.bind(__webpack_require__, "../../compiled/open/index.js"));
|
|
4193
4171
|
return await open(url), !0;
|
|
4194
4172
|
} catch (err) {
|
|
4195
4173
|
return rslog_index_js_namespaceObject.logger.error('Failed to open start URL.'), rslog_index_js_namespaceObject.logger.error(err), !1;
|
|
@@ -4522,11 +4500,11 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
4522
4500
|
]);
|
|
4523
4501
|
});
|
|
4524
4502
|
}
|
|
4525
|
-
}), rsdoctor_require = (0, external_node_module_namespaceObject.createRequire)(
|
|
4503
|
+
}), rsdoctor_require = (0, external_node_module_namespaceObject.createRequire)(__rslib_import_meta_url__), pluginRsdoctor = ()=>({
|
|
4526
4504
|
name: 'rsbuild:rsdoctor',
|
|
4527
4505
|
setup (api) {
|
|
4528
4506
|
api.onBeforeCreateCompiler(async ({ bundlerConfigs })=>{
|
|
4529
|
-
let packagePath,
|
|
4507
|
+
let packagePath, module;
|
|
4530
4508
|
if ('true' !== process.env.RSDOCTOR) return;
|
|
4531
4509
|
let isRspack = 'rspack' === api.context.bundlerType, pluginName = isRspack ? 'RsdoctorRspackPlugin' : 'RsdoctorWebpackPlugin', isRsdoctorPlugin = (plugin)=>{
|
|
4532
4510
|
var _plugin_constructor;
|
|
@@ -4548,13 +4526,13 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
4548
4526
|
return;
|
|
4549
4527
|
}
|
|
4550
4528
|
try {
|
|
4551
|
-
|
|
4529
|
+
module = await import(packagePath);
|
|
4552
4530
|
} catch (err) {
|
|
4553
4531
|
rslog_index_js_namespaceObject.logger.error(`\`process.env.RSDOCTOR\` enabled, but failed to load ${index_js_default().bold(index_js_default().yellow(packageName))} module.`);
|
|
4554
4532
|
return;
|
|
4555
4533
|
}
|
|
4556
|
-
if (!!
|
|
4557
|
-
for (let config of bundlerConfigs)config.plugins ||= [], config.plugins.push(new
|
|
4534
|
+
if (!!module && !!module[pluginName]) {
|
|
4535
|
+
for (let config of bundlerConfigs)config.plugins ||= [], config.plugins.push(new module[pluginName]());
|
|
4558
4536
|
rslog_index_js_namespaceObject.logger.info(`${index_js_default().bold(index_js_default().yellow(packageName))} enabled.`);
|
|
4559
4537
|
}
|
|
4560
4538
|
});
|
|
@@ -4671,7 +4649,7 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
4671
4649
|
vendors: {
|
|
4672
4650
|
priority: -9,
|
|
4673
4651
|
test: NODE_MODULES_REGEX,
|
|
4674
|
-
name: (
|
|
4652
|
+
name: (module)=>module ? function(modulePath) {
|
|
4675
4653
|
let handleModuleContext = null == modulePath ? void 0 : modulePath.match(MODULE_PATH_REGEX);
|
|
4676
4654
|
if (!handleModuleContext) return;
|
|
4677
4655
|
let [, scope, name] = handleModuleContext;
|
|
@@ -4680,7 +4658,7 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
4680
4658
|
(scope ?? '').replace('@', ''),
|
|
4681
4659
|
name
|
|
4682
4660
|
].filter(Boolean).join('.');
|
|
4683
|
-
}(
|
|
4661
|
+
}(module.context) : void 0
|
|
4684
4662
|
},
|
|
4685
4663
|
...override.cacheGroups
|
|
4686
4664
|
}
|
|
@@ -4838,14 +4816,16 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
4838
4816
|
}
|
|
4839
4817
|
});
|
|
4840
4818
|
}
|
|
4841
|
-
}), swc_require = (0, external_node_module_namespaceObject.createRequire)(
|
|
4819
|
+
}), swc_require = (0, external_node_module_namespaceObject.createRequire)(__rslib_import_meta_url__), builtinSwcLoaderName = 'builtin:swc-loader', pluginSwc = ()=>({
|
|
4842
4820
|
name: PLUGIN_SWC_NAME,
|
|
4843
4821
|
setup (api) {
|
|
4844
4822
|
api.modifyBundlerChain({
|
|
4845
4823
|
order: 'pre',
|
|
4846
4824
|
handler: async (chain, { CHAIN_ID, isDev, target, environment })=>{
|
|
4847
4825
|
var browserslist, target1;
|
|
4848
|
-
let { config, browserslist: browserslist1 } = environment, cacheRoot = external_node_path_default().join(api.context.cachePath, '.swc'), rule = chain.module.rule(CHAIN_ID.RULE.JS).test(SCRIPT_REGEX).type('javascript/auto')
|
|
4826
|
+
let { config, browserslist: browserslist1 } = environment, cacheRoot = external_node_path_default().join(api.context.cachePath, '.swc'), rule = chain.module.rule(CHAIN_ID.RULE.JS).test(SCRIPT_REGEX).type('javascript/auto').dependency({
|
|
4827
|
+
not: 'url'
|
|
4828
|
+
}), dataUriRule = chain.module.rule(CHAIN_ID.RULE.JS_DATA_URI).mimetype({
|
|
4849
4829
|
or: [
|
|
4850
4830
|
'text/javascript',
|
|
4851
4831
|
'application/javascript'
|
|
@@ -5149,7 +5129,7 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
5149
5129
|
})), rslog_index_js_namespaceObject.logger.debug('modify Rspack config done'), modifiedConfig;
|
|
5150
5130
|
}
|
|
5151
5131
|
async function getConfigUtils(config, chainUtils) {
|
|
5152
|
-
let { merge } = await Promise.resolve().then(__webpack_require__.
|
|
5132
|
+
let { merge } = await Promise.resolve().then(__webpack_require__.bind(__webpack_require__, "../../compiled/webpack-merge/index.js"));
|
|
5153
5133
|
return {
|
|
5154
5134
|
...chainUtils,
|
|
5155
5135
|
rspack: core_namespaceObject.rspack,
|
|
@@ -5418,7 +5398,7 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
5418
5398
|
let { compile, invalid, done } = compiler.hooks;
|
|
5419
5399
|
compile.tap('rsbuild-dev-server', ()=>hookCallbacks.onInvalid(getCompilationId(compiler))), invalid.tap('rsbuild-dev-server', ()=>hookCallbacks.onInvalid(getCompilationId(compiler))), done.tap('rsbuild-dev-server', hookCallbacks.onDone);
|
|
5420
5400
|
}, getDevMiddleware = async (multiCompiler)=>{
|
|
5421
|
-
let { default: rsbuildDevMiddleware } = await Promise.resolve().then(__webpack_require__.
|
|
5401
|
+
let { default: rsbuildDevMiddleware } = await Promise.resolve().then(__webpack_require__.bind(__webpack_require__, "../../compiled/rsbuild-dev-middleware/index.js"));
|
|
5422
5402
|
return (options)=>{
|
|
5423
5403
|
let { clientPaths, clientConfig, callbacks, liveReload, ...restOptions } = options;
|
|
5424
5404
|
return applyToCompiler(multiCompiler, (compiler)=>{
|
|
@@ -5455,7 +5435,7 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
5455
5435
|
}
|
|
5456
5436
|
async prepare() {
|
|
5457
5437
|
var _this_options_client;
|
|
5458
|
-
let { default: ws } = await Promise.resolve().then(__webpack_require__.
|
|
5438
|
+
let { default: ws } = await Promise.resolve().then(__webpack_require__.bind(__webpack_require__, "../../compiled/ws/index.js"));
|
|
5459
5439
|
this.wsServer = new ws.Server({
|
|
5460
5440
|
noServer: !0,
|
|
5461
5441
|
path: null === (_this_options_client = this.options.client) || void 0 === _this_options_client ? void 0 : _this_options_client.path
|
|
@@ -5521,6 +5501,7 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
5521
5501
|
errorDetails: !1,
|
|
5522
5502
|
entrypoints: !0,
|
|
5523
5503
|
children: !0,
|
|
5504
|
+
moduleTrace: !0,
|
|
5524
5505
|
...statsOptions
|
|
5525
5506
|
});
|
|
5526
5507
|
}
|
|
@@ -5577,13 +5558,13 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
5577
5558
|
writable: !0
|
|
5578
5559
|
}) : obj[key] = value, obj;
|
|
5579
5560
|
}
|
|
5580
|
-
let compilerDevMiddleware_require = (0, external_node_module_namespaceObject.createRequire)(
|
|
5561
|
+
let compilerDevMiddleware_require = (0, external_node_module_namespaceObject.createRequire)(__rslib_import_meta_url__), formatDevConfig = (config, environments)=>1 === new Set(Object.values(environments).map((env)=>env.config.dev.writeToDisk)).size ? config : {
|
|
5581
5562
|
...config,
|
|
5582
5563
|
writeToDisk (filePath, compilationName) {
|
|
5583
5564
|
let { writeToDisk } = config;
|
|
5584
5565
|
return compilationName && environments[compilationName] && (writeToDisk = environments[compilationName].config.dev.writeToDisk ?? writeToDisk), 'function' == typeof writeToDisk ? writeToDisk(filePath) : writeToDisk;
|
|
5585
5566
|
}
|
|
5586
|
-
}
|
|
5567
|
+
};
|
|
5587
5568
|
class CompilerDevMiddleware {
|
|
5588
5569
|
async init() {
|
|
5589
5570
|
let devMiddleware = await getDevMiddleware(this.compiler);
|
|
@@ -5592,9 +5573,16 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
5592
5573
|
upgrade(req, sock, head) {
|
|
5593
5574
|
this.socketServer.upgrade(req, sock, head);
|
|
5594
5575
|
}
|
|
5595
|
-
close() {
|
|
5596
|
-
|
|
5597
|
-
|
|
5576
|
+
async close() {
|
|
5577
|
+
this.socketServer.close(), this.middleware && await new Promise((resolve)=>{
|
|
5578
|
+
this.middleware.close(()=>{
|
|
5579
|
+
resolve();
|
|
5580
|
+
});
|
|
5581
|
+
}), await new Promise((resolve)=>{
|
|
5582
|
+
this.compiler.close(()=>{
|
|
5583
|
+
resolve();
|
|
5584
|
+
});
|
|
5585
|
+
});
|
|
5598
5586
|
}
|
|
5599
5587
|
sockWrite(type, data) {
|
|
5600
5588
|
this.socketServer.sockWrite({
|
|
@@ -5713,7 +5701,7 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
5713
5701
|
basic_define_property(this, "_options", void 0), basic_define_property(this, "globalContext", void 0), basic_define_property(this, "baseModuleScope", void 0), basic_define_property(this, "requirers", void 0), this._options = _options, this.globalContext = null, this.baseModuleScope = null, this.requirers = new Map();
|
|
5714
5702
|
}
|
|
5715
5703
|
}
|
|
5716
|
-
let cjs_require = (0, external_node_module_namespaceObject.createRequire)(
|
|
5704
|
+
let cjs_require = (0, external_node_module_namespaceObject.createRequire)(__rslib_import_meta_url__), cjs_define = (...args)=>{
|
|
5717
5705
|
args.pop()();
|
|
5718
5706
|
};
|
|
5719
5707
|
class CommonJsRunner extends BasicRunner {
|
|
@@ -5806,11 +5794,11 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
5806
5794
|
initializeImportMeta: (meta, _)=>{
|
|
5807
5795
|
meta.url = (0, external_node_url_namespaceObject.pathToFileURL)(file.path).href;
|
|
5808
5796
|
},
|
|
5809
|
-
importModuleDynamically: async (specifier,
|
|
5797
|
+
importModuleDynamically: async (specifier, module)=>{
|
|
5810
5798
|
let result = await _require(external_node_path_default().dirname(file.path), specifier, {
|
|
5811
5799
|
esmMode: type_EsmMode.Evaluated
|
|
5812
5800
|
});
|
|
5813
|
-
return await asModule(result,
|
|
5801
|
+
return await asModule(result, module.context);
|
|
5814
5802
|
}
|
|
5815
5803
|
}), esmCache.set(file.path, esm)), context.esmMode === type_EsmMode.Unlinked) ? esm : (async ()=>{
|
|
5816
5804
|
if (await esm.link(async (specifier, referencingModule)=>await asModule(await _require(external_node_path_default().dirname(referencingModule.identifier ? referencingModule.identifier.slice(esmIdentifier.length + 1) : (0, external_node_url_namespaceObject.fileURLToPath)(referencingModule.url)), specifier, {
|
|
@@ -5906,7 +5894,7 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
5906
5894
|
}, faviconFallbackMiddleware = (req, res, next)=>{
|
|
5907
5895
|
'/favicon.ico' === req.url ? (res.statusCode = 204, res.end()) : next();
|
|
5908
5896
|
}, getStatusCodeColor = (status)=>status >= 500 ? index_js_default().red : status >= 400 ? index_js_default().yellow : status >= 300 ? index_js_default().cyan : status >= 200 ? index_js_default().green : (res)=>res, getRequestLoggerMiddleware = async ()=>{
|
|
5909
|
-
let { default: onFinished } = await Promise.resolve().then(__webpack_require__.
|
|
5897
|
+
let { default: onFinished } = await Promise.resolve().then(__webpack_require__.bind(__webpack_require__, "../../compiled/on-finished/index.js"));
|
|
5910
5898
|
return (req, res, next)=>{
|
|
5911
5899
|
let _startAt = process.hrtime();
|
|
5912
5900
|
onFinished(res, ()=>{
|
|
@@ -6041,7 +6029,7 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
6041
6029
|
let handleError = (err)=>rslog_index_js_namespaceObject.logger.error(err);
|
|
6042
6030
|
for (let opts of ret)opts.onError ??= handleError;
|
|
6043
6031
|
return ret;
|
|
6044
|
-
}(proxyOptions), proxyMiddlewares = [], middlewares = [], { createProxyMiddleware: baseMiddleware } = await Promise.resolve().then(__webpack_require__.
|
|
6032
|
+
}(proxyOptions), proxyMiddlewares = [], middlewares = [], { createProxyMiddleware: baseMiddleware } = await Promise.resolve().then(__webpack_require__.bind(__webpack_require__, "../../compiled/http-proxy-middleware/index.js"));
|
|
6045
6033
|
for (let opts of formattedOptions){
|
|
6046
6034
|
let proxyMiddleware = baseMiddleware(opts.context, opts), middleware = async (req, res, next)=>{
|
|
6047
6035
|
let bypassUrl = 'function' == typeof opts.bypass ? opts.bypass(req, res, opts) : null;
|
|
@@ -6084,7 +6072,7 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
6084
6072
|
server.base && '/' !== server.base && middlewares.push(getBaseMiddleware({
|
|
6085
6073
|
base: server.base
|
|
6086
6074
|
}));
|
|
6087
|
-
let { default: launchEditorMiddleware } = await Promise.resolve().then(__webpack_require__.
|
|
6075
|
+
let { default: launchEditorMiddleware } = await Promise.resolve().then(__webpack_require__.bind(__webpack_require__, "../../compiled/launch-editor-middleware/index.js"));
|
|
6088
6076
|
middlewares.push([
|
|
6089
6077
|
'/__open-in-editor',
|
|
6090
6078
|
launchEditorMiddleware()
|
|
@@ -6100,7 +6088,7 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
6100
6088
|
callback: compileMiddlewareAPI.middleware,
|
|
6101
6089
|
outputFileSystem
|
|
6102
6090
|
})), normalizePublicDirs(null == server ? void 0 : server.publicDir))){
|
|
6103
|
-
let { default: sirv } = await Promise.resolve().then(__webpack_require__.
|
|
6091
|
+
let { default: sirv } = await Promise.resolve().then(__webpack_require__.bind(__webpack_require__, "../../compiled/sirv/index.js")), { name } = publicDir, assetMiddleware = sirv((0, external_node_path_.isAbsolute)(name) ? name : (0, external_node_path_.join)(pwd, name), {
|
|
6104
6092
|
etag: !0,
|
|
6105
6093
|
dev: !0
|
|
6106
6094
|
});
|
|
@@ -6112,7 +6100,7 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
6112
6100
|
htmlFallback: server.htmlFallback,
|
|
6113
6101
|
outputFileSystem
|
|
6114
6102
|
})), server.historyApiFallback) {
|
|
6115
|
-
let { default: connectHistoryApiFallback } = await Promise.resolve().then(__webpack_require__.
|
|
6103
|
+
let { default: connectHistoryApiFallback } = await Promise.resolve().then(__webpack_require__.bind(__webpack_require__, "../../compiled/connect-history-api-fallback/index.js")), historyApiFallbackMiddleware = connectHistoryApiFallback(!0 === server.historyApiFallback ? {} : server.historyApiFallback);
|
|
6116
6104
|
middlewares.push(historyApiFallbackMiddleware), (null == compileMiddlewareAPI ? void 0 : compileMiddlewareAPI.middleware) && middlewares.push(compileMiddlewareAPI.middleware);
|
|
6117
6105
|
}
|
|
6118
6106
|
return middlewares.push(faviconFallbackMiddleware), middlewares.push((req, res, next)=>{
|
|
@@ -6137,7 +6125,7 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
6137
6125
|
});
|
|
6138
6126
|
return middlewares.push(...after), {
|
|
6139
6127
|
close: async ()=>{
|
|
6140
|
-
null == compileMiddlewareAPI
|
|
6128
|
+
await (null == compileMiddlewareAPI ? void 0 : compileMiddlewareAPI.close());
|
|
6141
6129
|
},
|
|
6142
6130
|
onUpgrade,
|
|
6143
6131
|
middlewares
|
|
@@ -6145,17 +6133,17 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
6145
6133
|
}, createHttpServer = async ({ serverConfig, middlewares })=>{
|
|
6146
6134
|
if (serverConfig.https) {
|
|
6147
6135
|
if (serverConfig.proxy) {
|
|
6148
|
-
let { createServer } = await Promise.resolve().then(__webpack_require__.
|
|
6136
|
+
let { createServer } = await Promise.resolve().then(__webpack_require__.bind(__webpack_require__, "node:https"));
|
|
6149
6137
|
return createServer(serverConfig.https, middlewares);
|
|
6150
6138
|
}
|
|
6151
|
-
let { createSecureServer } = await Promise.resolve().then(__webpack_require__.
|
|
6139
|
+
let { createSecureServer } = await Promise.resolve().then(__webpack_require__.bind(__webpack_require__, "node:http2"));
|
|
6152
6140
|
return createSecureServer({
|
|
6153
6141
|
allowHTTP1: !0,
|
|
6154
6142
|
maxSessionMemory: 1024,
|
|
6155
6143
|
...serverConfig.https
|
|
6156
6144
|
}, middlewares);
|
|
6157
6145
|
}
|
|
6158
|
-
let { createServer } = await Promise.resolve().then(__webpack_require__.
|
|
6146
|
+
let { createServer } = await Promise.resolve().then(__webpack_require__.bind(__webpack_require__, "node:http"));
|
|
6159
6147
|
return createServer(middlewares);
|
|
6160
6148
|
}, devServer_formatDevConfig = (config, port)=>('<port>' === config.client.port && (config.client.port = String(port)), config);
|
|
6161
6149
|
async function devServer_createDevServer(options, createCompiler, config, { compiler: customCompiler, getPortSilently, runCompile = !0 } = {}) {
|
|
@@ -6267,7 +6255,7 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
6267
6255
|
distPath: options.context.distPath || ROOT_DIST_DIR
|
|
6268
6256
|
},
|
|
6269
6257
|
outputFileSystem
|
|
6270
|
-
}), { default: connect } = await Promise.resolve().then(__webpack_require__.
|
|
6258
|
+
}), { default: connect } = await Promise.resolve().then(__webpack_require__.bind(__webpack_require__, "../../compiled/connect/index.js")), middlewares = connect();
|
|
6271
6259
|
for (let item of devMiddlewares.middlewares)Array.isArray(item) ? middlewares.use(...item) : middlewares.use(item);
|
|
6272
6260
|
let devServerAPI = {
|
|
6273
6261
|
port,
|
|
@@ -6327,6 +6315,7 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
6327
6315
|
let done = (stats)=>{
|
|
6328
6316
|
let statsOptions = getStatsOptions(compiler), statsJson = stats.toJson({
|
|
6329
6317
|
children: !0,
|
|
6318
|
+
moduleTrace: !0,
|
|
6330
6319
|
timings: !0,
|
|
6331
6320
|
preset: 'errors-warnings',
|
|
6332
6321
|
...statsOptions
|
|
@@ -6479,13 +6468,13 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
6479
6468
|
if (base && '/' !== base && this.middlewares.use(getBaseMiddleware({
|
|
6480
6469
|
base
|
|
6481
6470
|
})), await this.applyStaticAssetMiddleware(), historyApiFallback) {
|
|
6482
|
-
let { default: connectHistoryApiFallback } = await Promise.resolve().then(__webpack_require__.
|
|
6471
|
+
let { default: connectHistoryApiFallback } = await Promise.resolve().then(__webpack_require__.bind(__webpack_require__, "../../compiled/connect-history-api-fallback/index.js")), historyApiFallbackMiddleware = connectHistoryApiFallback(!0 === historyApiFallback ? {} : historyApiFallback);
|
|
6483
6472
|
this.middlewares.use(historyApiFallbackMiddleware), await this.applyStaticAssetMiddleware();
|
|
6484
6473
|
}
|
|
6485
6474
|
this.middlewares.use(faviconFallbackMiddleware);
|
|
6486
6475
|
}
|
|
6487
6476
|
async applyStaticAssetMiddleware() {
|
|
6488
|
-
let { output: { path, assetPrefixes }, serverConfig: { htmlFallback } } = this.options, { default: sirv } = await Promise.resolve().then(__webpack_require__.
|
|
6477
|
+
let { output: { path, assetPrefixes }, serverConfig: { htmlFallback } } = this.options, { default: sirv } = await Promise.resolve().then(__webpack_require__.bind(__webpack_require__, "../../compiled/sirv/index.js")), assetMiddleware = sirv(path, {
|
|
6489
6478
|
etag: !0,
|
|
6490
6479
|
dev: !0,
|
|
6491
6480
|
ignores: [
|
|
@@ -6508,7 +6497,7 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
6508
6497
|
async function startProdServer(context, config, { getPortSilently } = {}) {
|
|
6509
6498
|
let { port, host, https, portTip } = await getServerConfig({
|
|
6510
6499
|
config
|
|
6511
|
-
}), { default: connect } = await Promise.resolve().then(__webpack_require__.
|
|
6500
|
+
}), { default: connect } = await Promise.resolve().then(__webpack_require__.bind(__webpack_require__, "../../compiled/connect/index.js")), middlewares = connect(), serverConfig = config.server, server = new RsbuildProdServer({
|
|
6512
6501
|
pwd: context.rootPath,
|
|
6513
6502
|
output: {
|
|
6514
6503
|
path: context.distPath,
|
|
@@ -6626,7 +6615,7 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
6626
6615
|
}), api.modifyBundlerChain(async (chain, { CHAIN_ID, environment })=>{
|
|
6627
6616
|
let { config } = environment;
|
|
6628
6617
|
if (!isUseAnalyzer(config)) return;
|
|
6629
|
-
let { default: BundleAnalyzer } = await Promise.resolve().then(__webpack_require__.
|
|
6618
|
+
let { default: BundleAnalyzer } = await Promise.resolve().then(__webpack_require__.bind(__webpack_require__, "../../compiled/webpack-bundle-analyzer/index.js"));
|
|
6630
6619
|
chain.plugin(CHAIN_ID.PLUGIN.BUNDLE_ANALYZER).use(BundleAnalyzer.BundleAnalyzerPlugin, [
|
|
6631
6620
|
{
|
|
6632
6621
|
analyzerMode: 'static',
|
|
@@ -6829,7 +6818,7 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
6829
6818
|
if (descriptor.targets && !descriptor.targets.includes(target) || descriptor.environments && !descriptor.environments.includes(environment.name)) return;
|
|
6830
6819
|
let rule = chain.module.rule(id);
|
|
6831
6820
|
descriptor.test && rule.test(descriptor.test), descriptor.resourceQuery && rule.resourceQuery(descriptor.resourceQuery), descriptor.layer && rule.layer(descriptor.layer), descriptor.issuerLayer && rule.issuerLayer(descriptor.issuerLayer);
|
|
6832
|
-
let loaderName = descriptor.raw ? 'transformRawLoader.
|
|
6821
|
+
let loaderName = descriptor.raw ? 'transformRawLoader.mjs' : 'transformLoader.mjs', loaderPath = (0, external_node_path_.join)(LOADER_PATH, loaderName);
|
|
6833
6822
|
rule.use(id).loader(loaderPath).options({
|
|
6834
6823
|
id,
|
|
6835
6824
|
getEnvironment: ()=>environment
|
|
@@ -7002,11 +6991,11 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
7002
6991
|
}
|
|
7003
6992
|
}();
|
|
7004
6993
|
let { npm_execpath } = process.env;
|
|
7005
|
-
(!npm_execpath || npm_execpath.includes('npx-cli.js') || npm_execpath.includes('.bun')) && console.log(), rslog_index_js_namespaceObject.logger.greet(` Rsbuild v1.1.
|
|
6994
|
+
(!npm_execpath || npm_execpath.includes('npx-cli.js') || npm_execpath.includes('.bun')) && console.log(), rslog_index_js_namespaceObject.logger.greet(` Rsbuild v1.1.5\n`);
|
|
7006
6995
|
}();
|
|
7007
6996
|
try {
|
|
7008
6997
|
!function() {
|
|
7009
|
-
program.name('rsbuild').usage('<command> [options]').version("1.1.
|
|
6998
|
+
program.name('rsbuild').usage('<command> [options]').version("1.1.5");
|
|
7010
6999
|
let devCommand = program.command('dev'), buildCommand = program.command('build'), previewCommand = program.command('preview'), inspectCommand = program.command('inspect');
|
|
7011
7000
|
[
|
|
7012
7001
|
devCommand,
|
|
@@ -7065,7 +7054,7 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
7065
7054
|
rslog_index_js_namespaceObject.logger.error('Failed to start Rsbuild CLI.'), rslog_index_js_namespaceObject.logger.error(err);
|
|
7066
7055
|
}
|
|
7067
7056
|
}
|
|
7068
|
-
let
|
|
7057
|
+
let src_rslib_entry_version = "1.1.5";
|
|
7069
7058
|
})();
|
|
7070
7059
|
var __webpack_export_target__ = exports;
|
|
7071
7060
|
for(var i in __webpack_exports__)__webpack_export_target__[i] = __webpack_exports__[i];
|