@rsbuild/core 2.2.1 → 2.2.3
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 +2 -2
- package/compiled/css-loader/package.json +1 -1
- package/compiled/html-rspack-plugin/index.js +16 -16
- package/compiled/postcss/index.js +1 -1
- package/compiled/postcss-loader/index.js +6 -6
- package/compiled/style-loader/index.js +10 -10
- package/dist/626.js +49 -38
- package/dist/cors.js +5 -5
- package/dist/http-proxy-middleware.js +4 -4
- package/dist/launch-editor-middleware.js +1 -1
- package/dist/manifest-plugin.js +1 -1
- package/dist/memfs.js +1 -1
- package/dist/open.js +2 -2
- package/dist/range-parser.js +2 -2
- package/dist/server/assets-middleware/middleware.d.ts +5 -0
- package/dist/tinyglobby.js +1 -1
- package/dist/types/config.d.ts +1 -1
- package/dist/types/plugin.d.ts +1 -1
- package/dist/ws.js +2 -2
- package/package.json +5 -5
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
(() => {
|
|
2
2
|
"use strict";
|
|
3
3
|
var __webpack_modules__ = {
|
|
4
|
-
|
|
5
|
-
const loader = __nccwpck_require__(
|
|
4
|
+
511: (module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
5
|
+
const loader = __nccwpck_require__(153);
|
|
6
6
|
module.exports = loader.default;
|
|
7
7
|
},
|
|
8
|
-
|
|
8
|
+
153: (__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
exports["default"] = void 0;
|
|
11
11
|
var _path = _interopRequireDefault(__nccwpck_require__(928));
|
|
12
|
-
var _utils = __nccwpck_require__(
|
|
13
|
-
var _options = _interopRequireDefault(__nccwpck_require__(
|
|
12
|
+
var _utils = __nccwpck_require__(420);
|
|
13
|
+
var _options = _interopRequireDefault(__nccwpck_require__(224));
|
|
14
14
|
function _interopRequireDefault(obj) {
|
|
15
15
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
16
16
|
}
|
|
@@ -95,7 +95,7 @@
|
|
|
95
95
|
};
|
|
96
96
|
var _default = (exports["default"] = loader);
|
|
97
97
|
},
|
|
98
|
-
|
|
98
|
+
790: (module) => {
|
|
99
99
|
function isEqualLocals(a, b, isNamedExport) {
|
|
100
100
|
if ((!a && b) || (a && !b)) {
|
|
101
101
|
return false;
|
|
@@ -121,7 +121,7 @@
|
|
|
121
121
|
}
|
|
122
122
|
module.exports = isEqualLocals;
|
|
123
123
|
},
|
|
124
|
-
|
|
124
|
+
420: (__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
125
125
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
126
126
|
exports.getExportLazyStyleCode = getExportLazyStyleCode;
|
|
127
127
|
exports.getExportStyleCode = getExportStyleCode;
|
|
@@ -142,7 +142,7 @@
|
|
|
142
142
|
exports.getdomAPI = getdomAPI;
|
|
143
143
|
exports.stringifyRequest = stringifyRequest;
|
|
144
144
|
var _path = _interopRequireDefault(__nccwpck_require__(928));
|
|
145
|
-
var _isEqualLocals = _interopRequireDefault(__nccwpck_require__(
|
|
145
|
+
var _isEqualLocals = _interopRequireDefault(__nccwpck_require__(790));
|
|
146
146
|
function _interopRequireDefault(obj) {
|
|
147
147
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
148
148
|
}
|
|
@@ -337,7 +337,7 @@
|
|
|
337
337
|
928: (module) => {
|
|
338
338
|
module.exports = require("path");
|
|
339
339
|
},
|
|
340
|
-
|
|
340
|
+
224: (module) => {
|
|
341
341
|
module.exports = JSON.parse(
|
|
342
342
|
'{"title":"Style Loader options","type":"object","properties":{"injectType":{"description":"Allows to setup how styles will be injected into DOM.","link":"https://github.com/webpack-contrib/style-loader#injecttype","enum":["styleTag","singletonStyleTag","autoStyleTag","lazyStyleTag","lazySingletonStyleTag","lazyAutoStyleTag","linkTag"]},"attributes":{"description":"Adds custom attributes to tag.","link":"https://github.com/webpack-contrib/style-loader#attributes","type":"object"},"insert":{"description":"Inserts `<style>`/`<link>` at the given position.","link":"https://github.com/webpack-contrib/style-loader#insert","type":"string"},"base":{"description":"Sets module ID base for DLLPlugin.","link":"https://github.com/webpack-contrib/style-loader#base","type":"number"},"esModule":{"description":"Use the ES modules syntax.","link":"https://github.com/webpack-contrib/css-loader#esmodule","type":"boolean"},"styleTagTransform":{"description":"Transform tag and css when insert \'style\' tag into the DOM","link":"https://github.com/webpack-contrib/style-loader#styleTagTransform","type":"string"}},"additionalProperties":false}',
|
|
343
343
|
);
|
|
@@ -365,6 +365,6 @@
|
|
|
365
365
|
}
|
|
366
366
|
if (typeof __nccwpck_require__ !== "undefined")
|
|
367
367
|
__nccwpck_require__.ab = __dirname + "/";
|
|
368
|
-
var __webpack_exports__ = __nccwpck_require__(
|
|
368
|
+
var __webpack_exports__ = __nccwpck_require__(511);
|
|
369
369
|
module.exports = __webpack_exports__;
|
|
370
370
|
})();
|
package/dist/626.js
CHANGED
|
@@ -16,7 +16,7 @@ import { __webpack_require__ } from "./rslib-runtime.js";
|
|
|
16
16
|
var superClass, superClass1, __rspack_import_meta_filename__ = __rspack_fileURLToPath(import.meta.url);
|
|
17
17
|
let __rspack_createRequire_require = __rspack_createRequire(import.meta.url);
|
|
18
18
|
__webpack_require__.add({
|
|
19
|
-
"
|
|
19
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/deepmerge/4.3.1/56471899410038644780b3527c5076e78d3f57091a0da3ac0daf6d994929353d/node_modules/deepmerge/dist/cjs.js" (module) {
|
|
20
20
|
var isMergeableObject = function isMergeableObject(value) {
|
|
21
21
|
return isNonNullObject(value) && !isSpecial(value);
|
|
22
22
|
};
|
|
@@ -85,7 +85,7 @@ __webpack_require__.add({
|
|
|
85
85
|
}, {});
|
|
86
86
|
}, module.exports = deepmerge;
|
|
87
87
|
},
|
|
88
|
-
"
|
|
88
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/dotenv-expand/13.0.0/1d3d360f4c41ed89366b79ec2c361d16e6aee7ab6c47163ea4f3718f7f78cc4c/node_modules/dotenv-expand/lib/main.js" (module) {
|
|
89
89
|
function _resolveEscapeSequences(value) {
|
|
90
90
|
return value.replace(/\\\$/g, '$');
|
|
91
91
|
}
|
|
@@ -118,7 +118,7 @@ __webpack_require__.add({
|
|
|
118
118
|
}
|
|
119
119
|
module.exports.f = expand;
|
|
120
120
|
},
|
|
121
|
-
"
|
|
121
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ee-first/1.1.1/7d7aff2abffb03f454b885edc2f03bd078376c8cde75af0c324753fee26268de/node_modules/ee-first/index.js" (module) {
|
|
122
122
|
function listener(event, done) {
|
|
123
123
|
return function onevent(arg1) {
|
|
124
124
|
for(var args = Array(arguments.length), i = 0; i < args.length; i++)args[i] = arguments[i];
|
|
@@ -151,7 +151,7 @@ __webpack_require__.add({
|
|
|
151
151
|
return thunk.cancel = cleanup, thunk;
|
|
152
152
|
};
|
|
153
153
|
},
|
|
154
|
-
"
|
|
154
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/lilconfig/3.1.3/8e9a79516bf61f8427342cef50cdad2cdc2572f42288ba8053b88eadfdc0ebef/node_modules/lilconfig/src/index.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
155
155
|
let path = __webpack_require__("path?37f5"), fs = __webpack_require__("fs?cdbd"), os = __webpack_require__("os"), url = __webpack_require__("url?5f07"), fsReadFileAsync = fs.promises.readFile;
|
|
156
156
|
function getDefaultSearchPlaces(name, sync) {
|
|
157
157
|
return [
|
|
@@ -321,9 +321,9 @@ __webpack_require__.add({
|
|
|
321
321
|
};
|
|
322
322
|
};
|
|
323
323
|
},
|
|
324
|
-
"
|
|
324
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/on-finished/2.4.1/cf4b90e733493a0ce70ba421a5b37153ad39360f9513e36b25d2e49f57047a9b/node_modules/on-finished/index.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
325
325
|
module.exports = onFinished, module.exports.isFinished = isFinished;
|
|
326
|
-
var asyncHooks = tryRequireAsyncHooks(), first = __webpack_require__("
|
|
326
|
+
var asyncHooks = tryRequireAsyncHooks(), first = __webpack_require__("../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ee-first/1.1.1/7d7aff2abffb03f454b885edc2f03bd078376c8cde75af0c324753fee26268de/node_modules/ee-first/index.js"), defer = 'function' == typeof setImmediate ? setImmediate : function(fn) {
|
|
327
327
|
process.nextTick(fn.bind.apply(fn, arguments));
|
|
328
328
|
};
|
|
329
329
|
function onFinished(msg, listener) {
|
|
@@ -387,8 +387,8 @@ __webpack_require__.add({
|
|
|
387
387
|
return (asyncHooks.AsyncResource && (res = new asyncHooks.AsyncResource(fn.name || 'bound-anonymous-fn')), res && res.runInAsyncScope) ? res.runInAsyncScope.bind(res, fn, null) : fn;
|
|
388
388
|
}
|
|
389
389
|
},
|
|
390
|
-
"
|
|
391
|
-
let yaml, { resolve } = __webpack_require__("node:path?815c"), config = __webpack_require__("
|
|
390
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/postcss-load-config/6.0.1/c9e6a20d11428465888ab8b3a063f9903a46c9842bd45d6dfecb2a0964575256/node_modules/postcss-load-config/src/index.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
391
|
+
let yaml, { resolve } = __webpack_require__("node:path?815c"), config = __webpack_require__("../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/lilconfig/3.1.3/8e9a79516bf61f8427342cef50cdad2cdc2572f42288ba8053b88eadfdc0ebef/node_modules/lilconfig/src/index.js"), loadOptions = __webpack_require__("../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/postcss-load-config/6.0.1/c9e6a20d11428465888ab8b3a063f9903a46c9842bd45d6dfecb2a0964575256/node_modules/postcss-load-config/src/options.js"), loadPlugins = __webpack_require__("../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/postcss-load-config/6.0.1/c9e6a20d11428465888ab8b3a063f9903a46c9842bd45d6dfecb2a0964575256/node_modules/postcss-load-config/src/plugins.js"), req = __webpack_require__("../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/postcss-load-config/6.0.1/c9e6a20d11428465888ab8b3a063f9903a46c9842bd45d6dfecb2a0964575256/node_modules/postcss-load-config/src/req.js");
|
|
392
392
|
async function processResult(ctx, result) {
|
|
393
393
|
let obj, file = result.filepath || '', projectConfig = ((obj = result.config) && obj.__esModule ? obj : {
|
|
394
394
|
default: obj
|
|
@@ -461,8 +461,8 @@ __webpack_require__.add({
|
|
|
461
461
|
});
|
|
462
462
|
};
|
|
463
463
|
},
|
|
464
|
-
"
|
|
465
|
-
let req = __webpack_require__("
|
|
464
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/postcss-load-config/6.0.1/c9e6a20d11428465888ab8b3a063f9903a46c9842bd45d6dfecb2a0964575256/node_modules/postcss-load-config/src/options.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
465
|
+
let req = __webpack_require__("../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/postcss-load-config/6.0.1/c9e6a20d11428465888ab8b3a063f9903a46c9842bd45d6dfecb2a0964575256/node_modules/postcss-load-config/src/req.js");
|
|
466
466
|
module.exports = async function options(config, file) {
|
|
467
467
|
if (config.parser && 'string' == typeof config.parser) try {
|
|
468
468
|
config.parser = await req(config.parser, file);
|
|
@@ -482,8 +482,8 @@ __webpack_require__.add({
|
|
|
482
482
|
return config;
|
|
483
483
|
};
|
|
484
484
|
},
|
|
485
|
-
"
|
|
486
|
-
let req = __webpack_require__("
|
|
485
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/postcss-load-config/6.0.1/c9e6a20d11428465888ab8b3a063f9903a46c9842bd45d6dfecb2a0964575256/node_modules/postcss-load-config/src/plugins.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
486
|
+
let req = __webpack_require__("../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/postcss-load-config/6.0.1/c9e6a20d11428465888ab8b3a063f9903a46c9842bd45d6dfecb2a0964575256/node_modules/postcss-load-config/src/req.js");
|
|
487
487
|
async function load(plugin, options, file) {
|
|
488
488
|
try {
|
|
489
489
|
if (null == options || 0 === Object.keys(options).length) return await req(plugin, file);
|
|
@@ -499,7 +499,7 @@ __webpack_require__.add({
|
|
|
499
499
|
}), list;
|
|
500
500
|
};
|
|
501
501
|
},
|
|
502
|
-
"
|
|
502
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/postcss-load-config/6.0.1/c9e6a20d11428465888ab8b3a063f9903a46c9842bd45d6dfecb2a0964575256/node_modules/postcss-load-config/src/req.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
503
503
|
let tsx, jiti, { createRequire } = __webpack_require__("node:module?f56b"), { pathToFileURL } = __webpack_require__("node:url?5295"), TS_EXT_RE = /\.[mc]?ts$/, importError = [];
|
|
504
504
|
module.exports = async function req(name, rootFile = __rspack_import_meta_filename__) {
|
|
505
505
|
let url = createRequire(rootFile).resolve(name);
|
|
@@ -2205,7 +2205,7 @@ class RspackChain extends ChainedMap {
|
|
|
2205
2205
|
]);
|
|
2206
2206
|
}
|
|
2207
2207
|
}
|
|
2208
|
-
let vendors_require = createRequire(import.meta.url), cjs_0 = __webpack_require__("
|
|
2208
|
+
let vendors_require = createRequire(import.meta.url), cjs_0 = __webpack_require__("../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/deepmerge/4.3.1/56471899410038644780b3527c5076e78d3f57091a0da3ac0daf6d994929353d/node_modules/deepmerge/dist/cjs.js");
|
|
2209
2209
|
var cjs_0_default = __webpack_require__.n(cjs_0);
|
|
2210
2210
|
let setNodeEnv = (env)=>{
|
|
2211
2211
|
process.env.NODE_ENV = env;
|
|
@@ -3425,7 +3425,7 @@ function createPublicContext(context) {
|
|
|
3425
3425
|
async function createContext(options, userConfig, logger, loadConfigResult) {
|
|
3426
3426
|
let { cwd } = options, rootPath = userConfig.root ? ensureAbsolutePath(cwd, userConfig.root) : cwd, rsbuildConfig = await withDefaultConfig(rootPath, userConfig), cachePath = join(rootPath, 'node_modules', '.cache'), specifiedEnvironments = options.environment && options.environment.length > 0 ? options.environment : void 0, hooks = initHooks();
|
|
3427
3427
|
return {
|
|
3428
|
-
version: "2.2.
|
|
3428
|
+
version: "2.2.3",
|
|
3429
3429
|
rootPath,
|
|
3430
3430
|
configFile: loadConfigResult?.filePath ?? userConfig._privateMeta?.configFilePath,
|
|
3431
3431
|
configFileDependencies: loadConfigResult?.dependencies ?? userConfig._privateMeta?.configFileDependencies ?? [],
|
|
@@ -4452,7 +4452,7 @@ let RSPACK_BUILD_ERROR = 'Rspack build failed.', build_build = async (initOption
|
|
|
4452
4452
|
await restartWatcher?.close(), await closeBuild();
|
|
4453
4453
|
}
|
|
4454
4454
|
};
|
|
4455
|
-
}, main = __webpack_require__("
|
|
4455
|
+
}, main = __webpack_require__("../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/dotenv-expand/13.0.0/1d3d360f4c41ed89366b79ec2c361d16e6aee7ab6c47163ea4f3718f7f78cc4c/node_modules/dotenv-expand/lib/main.js"), DOTENV_LINE = /(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/gm;
|
|
4456
4456
|
function loadEnv_parse(src) {
|
|
4457
4457
|
let match, obj = {}, lines = src.toString();
|
|
4458
4458
|
for(lines = lines.replace(/\r\n?/gm, '\n'); null != (match = DOTENV_LINE.exec(lines));){
|
|
@@ -5067,7 +5067,7 @@ function parseMinifyOptions(config) {
|
|
|
5067
5067
|
cssOptions: minify.cssOptions
|
|
5068
5068
|
};
|
|
5069
5069
|
}
|
|
5070
|
-
let postcss_load_config_src = __webpack_require__("
|
|
5070
|
+
let postcss_load_config_src = __webpack_require__("../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/postcss-load-config/6.0.1/c9e6a20d11428465888ab8b3a063f9903a46c9842bd45d6dfecb2a0964575256/node_modules/postcss-load-config/src/index.js");
|
|
5071
5071
|
var postcss_load_config_src_default = __webpack_require__.n(postcss_load_config_src);
|
|
5072
5072
|
async function getLightningCSSLoaderOptions(config, targets, minify) {
|
|
5073
5073
|
let userOptions = 'object' == typeof config.tools.lightningcssLoader ? config.tools.lightningcssLoader : {}, initialOptions = {
|
|
@@ -6593,13 +6593,23 @@ async function getFileFromUrl(url, outputFileSystem, context) {
|
|
|
6593
6593
|
if (pathname.includes('\0')) return {
|
|
6594
6594
|
errorCode: 400
|
|
6595
6595
|
};
|
|
6596
|
-
|
|
6596
|
+
let hasUpPath = UP_PATH_REGEXP.test(pathname);
|
|
6597
|
+
if (hasUpPath && UP_PATH_REGEXP.test(node_path.normalize(`./${pathname}`))) return {
|
|
6597
6598
|
errorCode: 403
|
|
6598
6599
|
};
|
|
6599
6600
|
let { environmentList, publicPathnames } = context, distPaths = environmentList.map((env)=>env.distPath), possibleFilenames = new Set();
|
|
6600
6601
|
for (let [index, distPath] of distPaths.entries()){
|
|
6601
6602
|
let prefix = publicPathnames[index];
|
|
6602
|
-
prefix && '/' !== prefix && isUrlPathUnderBase(pathname, prefix)
|
|
6603
|
+
if (prefix && '/' !== prefix && isUrlPathUnderBase(pathname, prefix)) {
|
|
6604
|
+
let candidatePath = node_path.join(distPath, pathname.slice(prefix.length));
|
|
6605
|
+
if (hasUpPath) {
|
|
6606
|
+
let relativePath = node_path.relative(distPath, candidatePath);
|
|
6607
|
+
if (UP_PATH_REGEXP.test(relativePath)) return {
|
|
6608
|
+
errorCode: 403
|
|
6609
|
+
};
|
|
6610
|
+
}
|
|
6611
|
+
possibleFilenames.add(candidatePath);
|
|
6612
|
+
}
|
|
6603
6613
|
}
|
|
6604
6614
|
for (let distPath of distPaths)possibleFilenames.add(node_path.join(distPath, pathname));
|
|
6605
6615
|
for (let filename of possibleFilenames){
|
|
@@ -6644,7 +6654,7 @@ function parseTokenList(str) {
|
|
|
6644
6654
|
}
|
|
6645
6655
|
return start !== end && list.push(str.substring(start, end)), list;
|
|
6646
6656
|
}
|
|
6647
|
-
let on_finished = __webpack_require__("
|
|
6657
|
+
let on_finished = __webpack_require__("../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/on-finished/2.4.1/cf4b90e733493a0ce70ba421a5b37153ad39360f9513e36b25d2e49f57047a9b/node_modules/on-finished/index.js");
|
|
6648
6658
|
var on_finished_default = __webpack_require__.n(on_finished);
|
|
6649
6659
|
function getEtag(stat) {
|
|
6650
6660
|
let mtime = stat.mtime.getTime().toString(16), size = stat.size.toString(16);
|
|
@@ -6754,7 +6764,7 @@ function destroyStream(stream, suppress) {
|
|
|
6754
6764
|
}), 'function' == typeof stream.addListener && suppress && (stream.removeAllListeners('error'), stream.addListener('error', ()=>{}));
|
|
6755
6765
|
}
|
|
6756
6766
|
let parseRangeHeaders = async (value)=>{
|
|
6757
|
-
let { default: rangeParser } = await import("./range-parser.js").then(__webpack_require__.t.bind(__webpack_require__, "
|
|
6767
|
+
let { default: rangeParser } = await import("./range-parser.js").then(__webpack_require__.t.bind(__webpack_require__, "../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/range-parser/1.3.0/d49e5dcb9d0e39475844e240fad8cd1db6a58f4144f7ede43d9755e2fce5babc/node_modules/range-parser/index.js", 23)), [len, rangeHeader] = value.split('|');
|
|
6758
6768
|
return rangeParser(Number(len), rangeHeader, {
|
|
6759
6769
|
combine: !0
|
|
6760
6770
|
});
|
|
@@ -6783,8 +6793,13 @@ function sendError(res, code) {
|
|
|
6783
6793
|
let byteLength = Buffer.byteLength(document);
|
|
6784
6794
|
res.setHeader('Content-Length', byteLength), res.end(document);
|
|
6785
6795
|
}
|
|
6796
|
+
let filterWebEnvironments = (environmentList)=>environmentList.filter((environment)=>isWebTarget(environment.config.output.target));
|
|
6786
6797
|
function createAssetsMiddleware(context, ready, outputFileSystem) {
|
|
6787
|
-
let { logger } = context
|
|
6798
|
+
let { logger } = context, webEnvironments = filterWebEnvironments(context.environmentList), assetContext = {
|
|
6799
|
+
...context,
|
|
6800
|
+
environmentList: webEnvironments,
|
|
6801
|
+
publicPathnames: webEnvironments.map((environment)=>context.publicPathnames[environment.index])
|
|
6802
|
+
};
|
|
6788
6803
|
return async function assetsMiddleware(req, res, next) {
|
|
6789
6804
|
async function goNext() {
|
|
6790
6805
|
return new Promise((resolve)=>{
|
|
@@ -6796,7 +6811,7 @@ function createAssetsMiddleware(context, ready, outputFileSystem) {
|
|
|
6796
6811
|
req.method && 'GET' !== req.method && 'HEAD' !== req.method ? await goNext() : ready(async function processRequest() {
|
|
6797
6812
|
let readStream;
|
|
6798
6813
|
if (!req.url) return void await goNext();
|
|
6799
|
-
let resolved = await getFileFromUrl(req.url, outputFileSystem,
|
|
6814
|
+
let resolved = await getFileFromUrl(req.url, outputFileSystem, assetContext);
|
|
6800
6815
|
if (!resolved) return void await goNext();
|
|
6801
6816
|
if ('errorCode' in resolved) {
|
|
6802
6817
|
403 === resolved.errorCode ? logger.error(`[rsbuild:middleware] Malicious path "${req.url}".`) : 400 === resolved.errorCode && logger.error(`[rsbuild:middleware] Invalid pathname "${req.url}".`), sendError(res, resolved.errorCode);
|
|
@@ -6861,7 +6876,7 @@ function createAssetsMiddleware(context, ready, outputFileSystem) {
|
|
|
6861
6876
|
}
|
|
6862
6877
|
async function setupOutputFileSystem(writeToDisk, compilers) {
|
|
6863
6878
|
if (!0 !== writeToDisk) {
|
|
6864
|
-
let { createFsFromVolume, Volume } = await import("./memfs.js").then(__webpack_require__.t.bind(__webpack_require__, "
|
|
6879
|
+
let { createFsFromVolume, Volume } = await import("./memfs.js").then(__webpack_require__.t.bind(__webpack_require__, "../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/memfs/4.68.2/d8cc16a375363b8e2c9837aec01c984bbb0e063db42b6702d64d750c65cbb1ff/node_modules/memfs/lib/index.js", 23)), outputFileSystem = createFsFromVolume(new Volume());
|
|
6865
6880
|
for (let compiler of compilers)compiler.outputFileSystem = outputFileSystem;
|
|
6866
6881
|
}
|
|
6867
6882
|
let compiler = compilers.find((compiler)=>!!compiler.outputFileSystem);
|
|
@@ -7763,7 +7778,7 @@ async function createProxyMiddleware(proxyOptions, logger) {
|
|
|
7763
7778
|
let applyDefaultMiddlewares = async ({ config, buildManager, context, devServer, middlewares, postCallbacks })=>{
|
|
7764
7779
|
let launchEditorHandlerPromise, upgradeEvents = [], { server } = config, { logger } = context;
|
|
7765
7780
|
if (server.cors) {
|
|
7766
|
-
let { default: corsMiddleware } = await import("./cors.js").then(__webpack_require__.t.bind(__webpack_require__, "
|
|
7781
|
+
let { default: corsMiddleware } = await import("./cors.js").then(__webpack_require__.t.bind(__webpack_require__, "../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/cors/2.8.6/abeeebb4dd5e2293f01aa9f4c01ff28ab19103cfa7a845442d515e16cf051f35/node_modules/cors/lib/index.js", 23));
|
|
7767
7782
|
middlewares.use(corsMiddleware('boolean' == typeof server.cors ? {} : server.cors));
|
|
7768
7783
|
}
|
|
7769
7784
|
let { headers } = server;
|
|
@@ -7784,7 +7799,7 @@ let applyDefaultMiddlewares = async ({ config, buildManager, context, devServer,
|
|
|
7784
7799
|
})), middlewares.use('/__open-in-editor', async (req, res, next)=>{
|
|
7785
7800
|
try {
|
|
7786
7801
|
(await (launchEditorHandlerPromise ??= (async ()=>{
|
|
7787
|
-
let { default: launchEditorMiddleware } = await import("./launch-editor-middleware.js").then(__webpack_require__.t.bind(__webpack_require__, "
|
|
7802
|
+
let { default: launchEditorMiddleware } = await import("./launch-editor-middleware.js").then(__webpack_require__.t.bind(__webpack_require__, "../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/launch-editor-middleware/2.14.1/6d555a60526ad6844dc2673e73b564ffd44ca896ac31b809c7cc243f8e135c00/node_modules/launch-editor-middleware/index.js", 23));
|
|
7788
7803
|
return launchEditorMiddleware();
|
|
7789
7804
|
})()))(req, res, next);
|
|
7790
7805
|
} catch (err) {
|
|
@@ -8423,7 +8438,7 @@ async function devServer_createDevServer(options, createCompiler, config, devSer
|
|
|
8423
8438
|
}), logger.debug('create dev server done'), devServer;
|
|
8424
8439
|
}
|
|
8425
8440
|
async function startPreviewServer(context, config, { getPortSilently } = {}) {
|
|
8426
|
-
let
|
|
8441
|
+
let { logger } = context, { connect } = await import("./connect-next.js"), middlewares = connect(), { port, portTip } = await resolvePort(config), serverConfig = config.server, { host, headers, proxy, historyApiFallback, compress, base, cors } = serverConfig, assetPrefixes = context.environmentList.map((environment)=>environment.config.output.assetPrefix);
|
|
8427
8442
|
context.publicPathnames = getPublicPathnames(assetPrefixes, base);
|
|
8428
8443
|
let protocol = serverConfig.https ? 'https' : 'http', routes = getRoutes(context), urls = await getAddressUrls({
|
|
8429
8444
|
protocol,
|
|
@@ -8467,17 +8482,13 @@ async function startPreviewServer(context, config, { getPortSilently } = {}) {
|
|
|
8467
8482
|
server: previewServer,
|
|
8468
8483
|
environments: context.environments
|
|
8469
8484
|
});
|
|
8470
|
-
let
|
|
8471
|
-
...context,
|
|
8472
|
-
environmentList,
|
|
8473
|
-
publicPathnames: environmentList.map((environment)=>context.publicPathnames[environment.index])
|
|
8474
|
-
}), assetsMiddleware = createAssetsMiddleware(assetContext, (callback)=>callback(), node_fs), htmlMiddlewareOptions = {
|
|
8485
|
+
let webEnvironments = filterWebEnvironments(context.environmentList), assetsMiddleware = createAssetsMiddleware(context, (callback)=>callback(), node_fs), htmlMiddlewareOptions = {
|
|
8475
8486
|
assetsMiddleware,
|
|
8476
|
-
distPaths:
|
|
8487
|
+
distPaths: webEnvironments.map((environment)=>environment.distPath),
|
|
8477
8488
|
outputFileSystem: node_fs
|
|
8478
8489
|
};
|
|
8479
8490
|
if (isVerbose(logger) && middlewares.use(getRequestLoggerMiddleware(logger)), cors) {
|
|
8480
|
-
let { default: corsMiddleware } = await import("./cors.js").then(__webpack_require__.t.bind(__webpack_require__, "
|
|
8491
|
+
let { default: corsMiddleware } = await import("./cors.js").then(__webpack_require__.t.bind(__webpack_require__, "../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/cors/2.8.6/abeeebb4dd5e2293f01aa9f4c01ff28ab19103cfa7a845442d515e16cf051f35/node_modules/cors/lib/index.js", 23));
|
|
8481
8492
|
middlewares.use(corsMiddleware('boolean' == typeof cors ? {} : cors));
|
|
8482
8493
|
}
|
|
8483
8494
|
if (headers && middlewares.use((_req, res, next)=>{
|
|
@@ -9666,7 +9677,7 @@ try {
|
|
|
9666
9677
|
api.modifyBundlerChain(async (chain, { CHAIN_ID, environment, isDev })=>{
|
|
9667
9678
|
let { output: { manifest }, dev: { writeToDisk } } = environment.config;
|
|
9668
9679
|
if (!1 === manifest) return;
|
|
9669
|
-
let manifestOptions = normalizeManifestObjectConfig(manifest), { RspackManifestPlugin } = await import("./manifest-plugin.js").then(__webpack_require__.bind(__webpack_require__, "
|
|
9680
|
+
let manifestOptions = normalizeManifestObjectConfig(manifest), { RspackManifestPlugin } = await import("./manifest-plugin.js").then(__webpack_require__.bind(__webpack_require__, "../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/rspack-manifest-plugin/5.2.2/e1ec5d4691c84b8859f27aa9fc2f39b9334ca010b826474dc51dc2d479e68b43/node_modules/rspack-manifest-plugin/dist/index.js")), { htmlPaths } = environment, filter = manifestOptions.filter ?? ((file)=>!file.name.endsWith('.LICENSE.txt'));
|
|
9670
9681
|
manifestFilenames.set(environment.name, manifestOptions.filename);
|
|
9671
9682
|
let pluginOptions = {
|
|
9672
9683
|
fileName: manifestOptions.filename,
|
|
@@ -10209,7 +10220,7 @@ let applyServerOptions = (command)=>{
|
|
|
10209
10220
|
};
|
|
10210
10221
|
function setupCommands(argv) {
|
|
10211
10222
|
let cli = ((name = "")=>new CAC(name))('rsbuild');
|
|
10212
|
-
cli.version("2.2.
|
|
10223
|
+
cli.version("2.2.3"), cli.option('--base <base>', 'Set the base path of the server').option('-c, --config <config>', 'Set the configuration file (relative or absolute path)').option('--config-loader <loader>', 'Set the config file loader (auto | jiti | native)', {
|
|
10213
10224
|
default: 'auto'
|
|
10214
10225
|
}).option('--dist-path <dir>', 'Set the root directory of output files').option('--source-map', 'Enable source map').option('--env-dir <dir>', 'Set the directory for loading `.env` files').option('--env-mode <mode>', 'Set the env mode to load the `.env.[mode]` file').option('--environment <name>', 'Set the environment name(s) to build', {
|
|
10215
10226
|
type: [
|
|
@@ -10274,7 +10285,7 @@ function setupCommands(argv) {
|
|
|
10274
10285
|
}
|
|
10275
10286
|
function showGreeting() {
|
|
10276
10287
|
let { npm_execpath, npm_lifecycle_event, NODE_RUN_SCRIPT_NAME } = process.env, isBun = npm_execpath?.includes('.bun');
|
|
10277
|
-
src_logger.greet(`${'npx' === npm_lifecycle_event || isBun || NODE_RUN_SCRIPT_NAME ? '\n' : ''}Rsbuild v2.2.
|
|
10288
|
+
src_logger.greet(`${'npx' === npm_lifecycle_event || isBun || NODE_RUN_SCRIPT_NAME ? '\n' : ''}Rsbuild v2.2.3\n`);
|
|
10278
10289
|
}
|
|
10279
10290
|
function setupLogLevel(argv) {
|
|
10280
10291
|
if (argv.length <= 3) return;
|
|
@@ -10296,5 +10307,5 @@ function runCLI({ argv = process.argv } = {}) {
|
|
|
10296
10307
|
src_logger.error('Failed to start Rsbuild CLI.'), src_logger.error(err), process.exit(1);
|
|
10297
10308
|
}
|
|
10298
10309
|
}
|
|
10299
|
-
let src_version = "2.2.
|
|
10310
|
+
let src_version = "2.2.3";
|
|
10300
10311
|
export { PLUGIN_CSS_NAME, PLUGIN_SWC_NAME, core_rspack as rspack, createRsbuild, defaultAllowedOrigins, defineConfig, ensureAssetPrefix, loadConfig_loadConfig as loadConfig, loadEnv, logger_createLogger as createLogger, mergeRsbuildConfig, mrmime_lookup, runCLI, src_logger as logger, src_version as version };
|
package/dist/cors.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/*! LICENSE: cors.js.LICENSE.txt */
|
|
2
2
|
import { __webpack_require__ } from "./rslib-runtime.js";
|
|
3
3
|
__webpack_require__.add({
|
|
4
|
-
"
|
|
4
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/cors/2.8.6/abeeebb4dd5e2293f01aa9f4c01ff28ab19103cfa7a845442d515e16cf051f35/node_modules/cors/lib/index.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
5
5
|
!function() {
|
|
6
6
|
'use strict';
|
|
7
|
-
var assign = __webpack_require__("
|
|
7
|
+
var assign = __webpack_require__("../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/object-assign/4.1.1/7484bb3c3a4836e4c31b8d5f504f6887c20d893fdbd24ec4749135d8d99aad17/node_modules/object-assign/index.js"), vary = __webpack_require__("../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/vary/1.1.2/2d4a2b8719eb32d3ae1a3d3df6c7712e3dd7ac104a75e94ae2fc6072cb890be6/node_modules/vary/index.js"), defaults = {
|
|
8
8
|
origin: '*',
|
|
9
9
|
methods: 'GET,HEAD,PUT,PATCH,POST,DELETE',
|
|
10
10
|
preflightContinue: !1,
|
|
@@ -115,7 +115,7 @@ __webpack_require__.add({
|
|
|
115
115
|
};
|
|
116
116
|
}();
|
|
117
117
|
},
|
|
118
|
-
"
|
|
118
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/object-assign/4.1.1/7484bb3c3a4836e4c31b8d5f504f6887c20d893fdbd24ec4749135d8d99aad17/node_modules/object-assign/index.js" (module) {
|
|
119
119
|
var getOwnPropertySymbols = Object.getOwnPropertySymbols, hasOwnProperty = Object.prototype.hasOwnProperty, propIsEnumerable = Object.prototype.propertyIsEnumerable;
|
|
120
120
|
function toObject(val) {
|
|
121
121
|
if (null == val) throw TypeError('Object.assign cannot be called with null or undefined');
|
|
@@ -150,7 +150,7 @@ __webpack_require__.add({
|
|
|
150
150
|
return to;
|
|
151
151
|
} : Object.assign;
|
|
152
152
|
},
|
|
153
|
-
"
|
|
153
|
+
"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/vary/1.1.2/2d4a2b8719eb32d3ae1a3d3df6c7712e3dd7ac104a75e94ae2fc6072cb890be6/node_modules/vary/index.js" (module) {
|
|
154
154
|
module.exports = vary, module.exports.append = append;
|
|
155
155
|
var FIELD_NAME_REGEXP = /^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;
|
|
156
156
|
function append(header, field) {
|
|
@@ -185,4 +185,4 @@ __webpack_require__.add({
|
|
|
185
185
|
(val = append(Array.isArray(val) ? val.join(', ') : String(val), field)) && res.setHeader('Vary', val);
|
|
186
186
|
}
|
|
187
187
|
}
|
|
188
|
-
}), __webpack_require__("
|
|
188
|
+
}), __webpack_require__("../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/cors/2.8.6/abeeebb4dd5e2293f01aa9f4c01ff28ab19103cfa7a845442d515e16cf051f35/node_modules/cors/lib/index.js");
|