@rsbuild/core 2.0.0-beta.1 → 2.0.0-beta.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/html-rspack-plugin/index.js +15 -15
- package/compiled/html-rspack-plugin/package.json +1 -1
- package/compiled/postcss-loader/index.js +6 -6
- package/compiled/rslog/index.d.ts +1 -1
- package/compiled/rslog/package.json +1 -1
- package/compiled/style-loader/index.js +10 -10
- package/dist/131.js +206 -257
- package/dist/712.js +15 -0
- package/dist/chokidar.js +2 -2
- package/dist/connect.js +12 -23
- package/dist/http-proxy-middleware.js +3480 -0
- package/dist/http-proxy-middleware.js.LICENSE.txt +69 -0
- package/dist/launch-editor-middleware.js +58 -0
- package/dist/manifest-plugin.js +5 -5
- package/dist/open.js +17 -15
- package/dist/rslib-runtime.js +1 -1
- package/dist-types/helpers/color.d.ts +4 -0
- package/dist-types/helpers/index.d.ts +1 -1
- package/dist-types/helpers/vendors.d.ts +0 -1
- package/dist-types/restart.d.ts +1 -1
- package/dist-types/server/assets-middleware/index.d.ts +3 -2
- package/dist-types/server/proxy.d.ts +2 -2
- package/dist-types/server/watchFiles.d.ts +1 -1
- package/dist-types/types/config.d.ts +17 -10
- package/dist-types/types/hooks.d.ts +4 -12
- package/dist-types/types/thirdParty.d.ts +1 -1
- package/package.json +6 -7
- package/compiled/http-proxy-middleware/index.js +0 -6132
- /package/compiled/html-rspack-plugin/{loader.js → htmlLoader.js} +0 -0
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Array of passes.
|
|
3
|
+
*
|
|
4
|
+
* A `pass` is just a function that is executed on `req, res, options`
|
|
5
|
+
* so that you can easily add new checks while still keeping the base
|
|
6
|
+
* flexible.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/*!
|
|
10
|
+
* Array of passes.
|
|
11
|
+
*
|
|
12
|
+
* A `pass` is just a function that is executed on `req, socket, options`
|
|
13
|
+
* so that you can easily add new checks while still keeping the base
|
|
14
|
+
* flexible.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
/*!
|
|
18
|
+
* Caron dimonio, con occhi di bragia
|
|
19
|
+
* loro accennando, tutte le raccoglie;
|
|
20
|
+
* batte col remo qualunque s’adagia
|
|
21
|
+
*
|
|
22
|
+
* Charon the demon, with the eyes of glede,
|
|
23
|
+
* Beckoning to them, collects them all together,
|
|
24
|
+
* Beats with his oar whoever lags behind
|
|
25
|
+
*
|
|
26
|
+
* Dante - The Divine Comedy (Canto III)
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
/*!
|
|
30
|
+
* fill-range <https://github.com/jonschlinkert/fill-range>
|
|
31
|
+
*
|
|
32
|
+
* Copyright (c) 2014-present, Jon Schlinkert.
|
|
33
|
+
* Licensed under the MIT License.
|
|
34
|
+
*/
|
|
35
|
+
|
|
36
|
+
/*!
|
|
37
|
+
* is-extglob <https://github.com/jonschlinkert/is-extglob>
|
|
38
|
+
*
|
|
39
|
+
* Copyright (c) 2014-2016, Jon Schlinkert.
|
|
40
|
+
* Licensed under the MIT License.
|
|
41
|
+
*/
|
|
42
|
+
|
|
43
|
+
/*!
|
|
44
|
+
* is-glob <https://github.com/jonschlinkert/is-glob>
|
|
45
|
+
*
|
|
46
|
+
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
47
|
+
* Released under the MIT License.
|
|
48
|
+
*/
|
|
49
|
+
|
|
50
|
+
/*!
|
|
51
|
+
* is-number <https://github.com/jonschlinkert/is-number>
|
|
52
|
+
*
|
|
53
|
+
* Copyright (c) 2014-present, Jon Schlinkert.
|
|
54
|
+
* Released under the MIT License.
|
|
55
|
+
*/
|
|
56
|
+
|
|
57
|
+
/*!
|
|
58
|
+
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
|
|
59
|
+
*
|
|
60
|
+
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
61
|
+
* Released under the MIT License.
|
|
62
|
+
*/
|
|
63
|
+
|
|
64
|
+
/*!
|
|
65
|
+
* to-regex-range <https://github.com/micromatch/to-regex-range>
|
|
66
|
+
*
|
|
67
|
+
* Copyright (c) 2015-present, Jon Schlinkert.
|
|
68
|
+
* Released under the MIT License.
|
|
69
|
+
*/
|
|
@@ -340,6 +340,64 @@ __webpack_require__.add({
|
|
|
340
340
|
});
|
|
341
341
|
};
|
|
342
342
|
},
|
|
343
|
+
"../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js" (module) {
|
|
344
|
+
let p = process || {}, argv = p.argv || [], env = p.env || {}, isColorSupported = !(env.NO_COLOR || argv.includes("--no-color")) && (!!env.FORCE_COLOR || argv.includes("--color") || "win32" === p.platform || (p.stdout || {}).isTTY && "dumb" !== env.TERM || !!env.CI), formatter = (open, close, replace = open)=>(input)=>{
|
|
345
|
+
let string = "" + input, index = string.indexOf(close, open.length);
|
|
346
|
+
return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
|
|
347
|
+
}, replaceClose = (string, close, replace, index)=>{
|
|
348
|
+
let result = "", cursor = 0;
|
|
349
|
+
do result += string.substring(cursor, index) + replace, cursor = index + close.length, index = string.indexOf(close, cursor);
|
|
350
|
+
while (~index);
|
|
351
|
+
return result + string.substring(cursor);
|
|
352
|
+
}, createColors = (enabled = isColorSupported)=>{
|
|
353
|
+
let f = enabled ? formatter : ()=>String;
|
|
354
|
+
return {
|
|
355
|
+
isColorSupported: enabled,
|
|
356
|
+
reset: f("\x1b[0m", "\x1b[0m"),
|
|
357
|
+
bold: f("\x1b[1m", "\x1b[22m", "\x1b[22m\x1b[1m"),
|
|
358
|
+
dim: f("\x1b[2m", "\x1b[22m", "\x1b[22m\x1b[2m"),
|
|
359
|
+
italic: f("\x1b[3m", "\x1b[23m"),
|
|
360
|
+
underline: f("\x1b[4m", "\x1b[24m"),
|
|
361
|
+
inverse: f("\x1b[7m", "\x1b[27m"),
|
|
362
|
+
hidden: f("\x1b[8m", "\x1b[28m"),
|
|
363
|
+
strikethrough: f("\x1b[9m", "\x1b[29m"),
|
|
364
|
+
black: f("\x1b[30m", "\x1b[39m"),
|
|
365
|
+
red: f("\x1b[31m", "\x1b[39m"),
|
|
366
|
+
green: f("\x1b[32m", "\x1b[39m"),
|
|
367
|
+
yellow: f("\x1b[33m", "\x1b[39m"),
|
|
368
|
+
blue: f("\x1b[34m", "\x1b[39m"),
|
|
369
|
+
magenta: f("\x1b[35m", "\x1b[39m"),
|
|
370
|
+
cyan: f("\x1b[36m", "\x1b[39m"),
|
|
371
|
+
white: f("\x1b[37m", "\x1b[39m"),
|
|
372
|
+
gray: f("\x1b[90m", "\x1b[39m"),
|
|
373
|
+
bgBlack: f("\x1b[40m", "\x1b[49m"),
|
|
374
|
+
bgRed: f("\x1b[41m", "\x1b[49m"),
|
|
375
|
+
bgGreen: f("\x1b[42m", "\x1b[49m"),
|
|
376
|
+
bgYellow: f("\x1b[43m", "\x1b[49m"),
|
|
377
|
+
bgBlue: f("\x1b[44m", "\x1b[49m"),
|
|
378
|
+
bgMagenta: f("\x1b[45m", "\x1b[49m"),
|
|
379
|
+
bgCyan: f("\x1b[46m", "\x1b[49m"),
|
|
380
|
+
bgWhite: f("\x1b[47m", "\x1b[49m"),
|
|
381
|
+
blackBright: f("\x1b[90m", "\x1b[39m"),
|
|
382
|
+
redBright: f("\x1b[91m", "\x1b[39m"),
|
|
383
|
+
greenBright: f("\x1b[92m", "\x1b[39m"),
|
|
384
|
+
yellowBright: f("\x1b[93m", "\x1b[39m"),
|
|
385
|
+
blueBright: f("\x1b[94m", "\x1b[39m"),
|
|
386
|
+
magentaBright: f("\x1b[95m", "\x1b[39m"),
|
|
387
|
+
cyanBright: f("\x1b[96m", "\x1b[39m"),
|
|
388
|
+
whiteBright: f("\x1b[97m", "\x1b[39m"),
|
|
389
|
+
bgBlackBright: f("\x1b[100m", "\x1b[49m"),
|
|
390
|
+
bgRedBright: f("\x1b[101m", "\x1b[49m"),
|
|
391
|
+
bgGreenBright: f("\x1b[102m", "\x1b[49m"),
|
|
392
|
+
bgYellowBright: f("\x1b[103m", "\x1b[49m"),
|
|
393
|
+
bgBlueBright: f("\x1b[104m", "\x1b[49m"),
|
|
394
|
+
bgMagentaBright: f("\x1b[105m", "\x1b[49m"),
|
|
395
|
+
bgCyanBright: f("\x1b[106m", "\x1b[49m"),
|
|
396
|
+
bgWhiteBright: f("\x1b[107m", "\x1b[49m")
|
|
397
|
+
};
|
|
398
|
+
};
|
|
399
|
+
module.exports = createColors(), module.exports.createColors = createColors;
|
|
400
|
+
},
|
|
343
401
|
"../../node_modules/.pnpm/shell-quote@1.8.3/node_modules/shell-quote/index.js" (__unused_rspack_module, exports, __webpack_require__) {
|
|
344
402
|
exports.quote = __webpack_require__("../../node_modules/.pnpm/shell-quote@1.8.3/node_modules/shell-quote/quote.js"), exports.parse = __webpack_require__("../../node_modules/.pnpm/shell-quote@1.8.3/node_modules/shell-quote/parse.js");
|
|
345
403
|
},
|
package/dist/manifest-plugin.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __webpack_require__ } from "./rslib-runtime.js";
|
|
2
2
|
import "./131.js";
|
|
3
3
|
__webpack_require__.add({
|
|
4
|
-
"../../node_modules/.pnpm/rspack-manifest-plugin@5.2.1_@rspack+core@2.0.0-
|
|
4
|
+
"../../node_modules/.pnpm/rspack-manifest-plugin@5.2.1_@rspack+core@2.0.0-beta.0_@module-federation+runtime-tools@0.24.0_@swc+helpers@0.5.18_/node_modules/rspack-manifest-plugin/dist/helpers.js" (__unused_rspack_module, exports, __webpack_require__) {
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: !0
|
|
7
7
|
}), exports.transformFiles = exports.reduceChunk = exports.reduceAssets = exports.generateManifest = void 0;
|
|
@@ -63,11 +63,11 @@ __webpack_require__.add({
|
|
|
63
63
|
'sort'
|
|
64
64
|
].filter((fname)=>!!options[fname]).reduce((prev, fname)=>prev[fname](options[fname]), files).map(standardizeFilePaths);
|
|
65
65
|
},
|
|
66
|
-
"../../node_modules/.pnpm/rspack-manifest-plugin@5.2.1_@rspack+core@2.0.0-
|
|
66
|
+
"../../node_modules/.pnpm/rspack-manifest-plugin@5.2.1_@rspack+core@2.0.0-beta.0_@module-federation+runtime-tools@0.24.0_@swc+helpers@0.5.18_/node_modules/rspack-manifest-plugin/dist/hooks.js" (__unused_rspack_module, exports, __webpack_require__) {
|
|
67
67
|
Object.defineProperty(exports, "__esModule", {
|
|
68
68
|
value: !0
|
|
69
69
|
}), exports.normalModuleLoaderHook = exports.getCompilerHooks = exports.emitHook = exports.beforeRunHook = void 0;
|
|
70
|
-
let node_fs_1 = __webpack_require__("node:fs"), node_path_1 = __webpack_require__("node:path"), lite_tapable_1 = __webpack_require__("../../node_modules/.pnpm/@rspack+lite-tapable@1.1.0/node_modules/@rspack/lite-tapable/dist/index.cjs"), helpers_1 = __webpack_require__("../../node_modules/.pnpm/rspack-manifest-plugin@5.2.1_@rspack+core@2.0.0-
|
|
70
|
+
let node_fs_1 = __webpack_require__("node:fs"), node_path_1 = __webpack_require__("node:path"), lite_tapable_1 = __webpack_require__("../../node_modules/.pnpm/@rspack+lite-tapable@1.1.0/node_modules/@rspack/lite-tapable/dist/index.cjs"), helpers_1 = __webpack_require__("../../node_modules/.pnpm/rspack-manifest-plugin@5.2.1_@rspack+core@2.0.0-beta.0_@module-federation+runtime-tools@0.24.0_@swc+helpers@0.5.18_/node_modules/rspack-manifest-plugin/dist/helpers.js"), compilerHookMap = new WeakMap(), getCompilerHooks = (compiler)=>{
|
|
71
71
|
let hooks = compilerHookMap.get(compiler);
|
|
72
72
|
return void 0 === hooks && (hooks = {
|
|
73
73
|
afterEmit: new lite_tapable_1.SyncWaterfallHook([
|
|
@@ -121,9 +121,9 @@ __webpack_require__.add({
|
|
|
121
121
|
}), emitFile.call(module, file, content, sourceMap));
|
|
122
122
|
};
|
|
123
123
|
},
|
|
124
|
-
"../../node_modules/.pnpm/rspack-manifest-plugin@5.2.1_@rspack+core@2.0.0-
|
|
124
|
+
"../../node_modules/.pnpm/rspack-manifest-plugin@5.2.1_@rspack+core@2.0.0-beta.0_@module-federation+runtime-tools@0.24.0_@swc+helpers@0.5.18_/node_modules/rspack-manifest-plugin/dist/index.js" (__unused_rspack_module, exports, __webpack_require__) {
|
|
125
125
|
exports.RspackManifestPlugin = void 0;
|
|
126
|
-
let node_path_1 = __webpack_require__("node:path"), hooks_1 = __webpack_require__("../../node_modules/.pnpm/rspack-manifest-plugin@5.2.1_@rspack+core@2.0.0-
|
|
126
|
+
let node_path_1 = __webpack_require__("node:path"), hooks_1 = __webpack_require__("../../node_modules/.pnpm/rspack-manifest-plugin@5.2.1_@rspack+core@2.0.0-beta.0_@module-federation+runtime-tools@0.24.0_@swc+helpers@0.5.18_/node_modules/rspack-manifest-plugin/dist/hooks.js"), emitCountMap = new Map(), defaults = {
|
|
127
127
|
assetHookStage: 1 / 0,
|
|
128
128
|
basePath: '',
|
|
129
129
|
fileName: 'manifest.json',
|
package/dist/open.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
let isDockerCached, cachedResult, canAccessPowerShellPromise, mountPoint, defaultMountPoint;
|
|
2
2
|
import { __webpack_require__ } from "./rslib-runtime.js";
|
|
3
3
|
import node_child_process, { execFile } from "node:child_process";
|
|
4
|
-
import {
|
|
4
|
+
import { external_node_util_promisify } from "./131.js";
|
|
5
5
|
import "./743.js";
|
|
6
6
|
import { constants, promises } from "./7.js";
|
|
7
7
|
let external_node_fs_ = __webpack_require__("node:fs");
|
|
@@ -31,15 +31,15 @@ function isInsideContainer() {
|
|
|
31
31
|
}
|
|
32
32
|
})() || isDocker()), cachedResult;
|
|
33
33
|
}
|
|
34
|
-
let isWsl = ()=>{
|
|
35
|
-
if ('linux' !==
|
|
36
|
-
if (
|
|
34
|
+
let external_node_process_ = __webpack_require__("node:process"), external_node_os_ = __webpack_require__("node:os"), isWsl = ()=>{
|
|
35
|
+
if ('linux' !== external_node_process_.default.platform) return !1;
|
|
36
|
+
if (external_node_os_.default.release().toLowerCase().includes('microsoft')) return !isInsideContainer();
|
|
37
37
|
try {
|
|
38
38
|
return !!external_node_fs_.default.readFileSync('/proc/version', 'utf8').toLowerCase().includes('microsoft') && !isInsideContainer();
|
|
39
39
|
} catch {
|
|
40
40
|
return !1;
|
|
41
41
|
}
|
|
42
|
-
}, is_wsl =
|
|
42
|
+
}, is_wsl = external_node_process_.default.env.__IS_WSL_TEST__ ? isWsl : isWsl(), external_node_buffer_ = __webpack_require__("node:buffer"), powershell_utils_execFile = external_node_util_promisify(node_child_process.execFile), powerShellPath = ()=>`${external_node_process_.default.env.SYSTEMROOT || external_node_process_.default.env.windir || String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`, executePowerShell = async (command, options = {})=>{
|
|
43
43
|
let { powerShellPath: psPath, ...execFileOptions } = options, encodedCommand = executePowerShell.encodeCommand(command);
|
|
44
44
|
return powershell_utils_execFile(psPath ?? powerShellPath(), [
|
|
45
45
|
...executePowerShell.argumentsPrefix,
|
|
@@ -123,7 +123,7 @@ function defineLazyProperty(object, propertyName, valueGetter) {
|
|
|
123
123
|
}
|
|
124
124
|
let execFileAsync = external_node_util_promisify(execFile);
|
|
125
125
|
async function defaultBrowserId() {
|
|
126
|
-
if ('darwin' !==
|
|
126
|
+
if ('darwin' !== external_node_process_.default.platform) throw Error('macOS only');
|
|
127
127
|
let { stdout } = await execFileAsync('defaults', [
|
|
128
128
|
'read',
|
|
129
129
|
'com.apple.LaunchServices/com.apple.launchservices.secure',
|
|
@@ -133,7 +133,7 @@ async function defaultBrowserId() {
|
|
|
133
133
|
}
|
|
134
134
|
let run_applescript_execFileAsync = external_node_util_promisify(execFile);
|
|
135
135
|
async function runAppleScript(script, { humanReadableOutput = !0, signal } = {}) {
|
|
136
|
-
if ('darwin' !==
|
|
136
|
+
if ('darwin' !== external_node_process_.default.platform) throw Error('macOS only');
|
|
137
137
|
let execOptions = {};
|
|
138
138
|
signal && (execOptions.signal = signal);
|
|
139
139
|
let { stdout } = await run_applescript_execFileAsync("osascript", [
|
|
@@ -224,20 +224,22 @@ async function defaultBrowser(_execFileAsync = windows_execFileAsync) {
|
|
|
224
224
|
'ProgId'
|
|
225
225
|
]), match = /ProgId\s*REG_SZ\s*(?<id>\S+)/.exec(stdout);
|
|
226
226
|
if (!match) throw new UnknownBrowserError(`Cannot find Windows browser in stdout: ${JSON.stringify(stdout)}`);
|
|
227
|
-
let { id } = match.groups,
|
|
228
|
-
|
|
229
|
-
|
|
227
|
+
let { id } = match.groups, dotIndex = id.lastIndexOf('.'), hyphenIndex = id.lastIndexOf('-'), baseIdByDot = -1 === dotIndex ? void 0 : id.slice(0, dotIndex), baseIdByHyphen = -1 === hyphenIndex ? void 0 : id.slice(0, hyphenIndex);
|
|
228
|
+
return windowsBrowserProgIds[id] ?? windowsBrowserProgIds[baseIdByDot] ?? windowsBrowserProgIds[baseIdByHyphen] ?? {
|
|
229
|
+
name: id,
|
|
230
|
+
id
|
|
231
|
+
};
|
|
230
232
|
}
|
|
231
233
|
let default_browser_execFileAsync = external_node_util_promisify(execFile);
|
|
232
234
|
async function default_browser_defaultBrowser() {
|
|
233
|
-
if ('darwin' ===
|
|
235
|
+
if ('darwin' === external_node_process_.default.platform) {
|
|
234
236
|
let id = await defaultBrowserId();
|
|
235
237
|
return {
|
|
236
238
|
name: await bundleName(id),
|
|
237
239
|
id
|
|
238
240
|
};
|
|
239
241
|
}
|
|
240
|
-
if ('linux' ===
|
|
242
|
+
if ('linux' === external_node_process_.default.platform) {
|
|
241
243
|
let { stdout } = await default_browser_execFileAsync('xdg-mime', [
|
|
242
244
|
'query',
|
|
243
245
|
'default',
|
|
@@ -248,10 +250,10 @@ async function default_browser_defaultBrowser() {
|
|
|
248
250
|
id
|
|
249
251
|
};
|
|
250
252
|
}
|
|
251
|
-
if ('win32' ===
|
|
253
|
+
if ('win32' === external_node_process_.default.platform) return defaultBrowser();
|
|
252
254
|
throw Error('Only macOS, Linux, and Windows are supported');
|
|
253
255
|
}
|
|
254
|
-
let isInSsh = !!(
|
|
256
|
+
let isInSsh = !!(external_node_process_.default.env.SSH_CONNECTION || external_node_process_.default.env.SSH_CLIENT || external_node_process_.default.env.SSH_TTY), external_node_path_ = __webpack_require__("node:path"), external_node_url_ = __webpack_require__("node:url"), fallbackAttemptSymbol = Symbol('fallbackAttempt'), open_dirname = import.meta.url ? external_node_path_.default.dirname((0, external_node_url_.fileURLToPath)(import.meta.url)) : '', localXdgOpenPath = external_node_path_.default.join(open_dirname, 'xdg-open'), { platform: platform, arch: arch } = external_node_process_.default, tryEachApp = async (apps, opener)=>{
|
|
255
257
|
if (0 === apps.length) return;
|
|
256
258
|
let errors = [];
|
|
257
259
|
for (let app of apps)try {
|
|
@@ -338,7 +340,7 @@ let isInSsh = !!(node_process.env.SSH_CONNECTION || node_process.env.SSH_CLIENT
|
|
|
338
340
|
try {
|
|
339
341
|
await promises.access(localXdgOpenPath, constants.X_OK), exeLocalXdgOpen = !0;
|
|
340
342
|
} catch {}
|
|
341
|
-
command =
|
|
343
|
+
command = external_node_process_.default.versions.electron ?? ('android' === platform || !open_dirname || '/' === open_dirname || !exeLocalXdgOpen) ? 'xdg-open' : localXdgOpenPath;
|
|
342
344
|
}
|
|
343
345
|
appArguments.length > 0 && cliArguments.push(...appArguments), options.wait || (childProcessOptions.stdio = 'ignore', childProcessOptions.detached = !0);
|
|
344
346
|
}
|
package/dist/rslib-runtime.js
CHANGED
|
@@ -5,7 +5,7 @@ function __webpack_require__(moduleId) {
|
|
|
5
5
|
var module = __webpack_module_cache__[moduleId] = {
|
|
6
6
|
exports: {}
|
|
7
7
|
};
|
|
8
|
-
return __webpack_modules__[moduleId](module, module.exports, __webpack_require__), module.exports;
|
|
8
|
+
return __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__), module.exports;
|
|
9
9
|
}
|
|
10
10
|
__webpack_require__.m = __webpack_modules__, __webpack_require__.add = function registerModules(modules) {
|
|
11
11
|
Object.assign(__webpack_require__.m, modules);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import color from 'picocolors';
|
|
2
1
|
import RspackChain from '../../compiled/rspack-chain/types';
|
|
3
2
|
import type { FilenameConfig, NormalizedConfig, NormalizedEnvironmentConfig, RsbuildTarget, Rspack } from '../types';
|
|
3
|
+
import { color } from './color';
|
|
4
4
|
export { require } from './vendors';
|
|
5
5
|
export { color, RspackChain };
|
|
6
6
|
export declare const getNodeEnv: () => string;
|
|
@@ -2,7 +2,6 @@ type CompiledPackages = {
|
|
|
2
2
|
ws: typeof import('../../compiled/ws').default;
|
|
3
3
|
'webpack-merge': typeof import('../../compiled/webpack-merge');
|
|
4
4
|
'html-rspack-plugin': typeof import('../../compiled/html-rspack-plugin').default;
|
|
5
|
-
'http-proxy-middleware': typeof import('../../compiled/http-proxy-middleware');
|
|
6
5
|
};
|
|
7
6
|
export declare const require: NodeJS.Require;
|
|
8
7
|
/**
|
package/dist-types/restart.d.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* https://github.com/webpack/webpack-dev-middleware/blob/master/LICENSE
|
|
8
8
|
*/
|
|
9
9
|
import { type Compiler, type MultiCompiler } from '@rspack/core';
|
|
10
|
-
import type { InternalContext, NormalizedConfig, RequestHandler } from '../../types';
|
|
10
|
+
import type { InternalContext, LiveReload, NormalizedConfig, RequestHandler } from '../../types';
|
|
11
11
|
import type { SocketServer } from '../socketServer';
|
|
12
12
|
export type MultiWatching = ReturnType<MultiCompiler['watch']>;
|
|
13
13
|
export type AssetsMiddlewareClose = (callback: (err?: Error | null) => void) => void;
|
|
@@ -16,11 +16,12 @@ export type AssetsMiddleware = RequestHandler & {
|
|
|
16
16
|
close: AssetsMiddlewareClose;
|
|
17
17
|
};
|
|
18
18
|
export declare const isClientCompiler: (compiler: Compiler) => boolean;
|
|
19
|
-
export declare const setupServerHooks: ({ context, compiler, token, socketServer, }: {
|
|
19
|
+
export declare const setupServerHooks: ({ context, compiler, token, socketServer, liveReload, }: {
|
|
20
20
|
context: InternalContext;
|
|
21
21
|
compiler: Compiler;
|
|
22
22
|
token: string;
|
|
23
23
|
socketServer: SocketServer;
|
|
24
|
+
liveReload: LiveReload;
|
|
24
25
|
}) => void;
|
|
25
26
|
/**
|
|
26
27
|
* The assets middleware handles compiler setup for development:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { RequestHandler as Middleware, ProxyConfig } from '../types';
|
|
2
2
|
import { type UpgradeEvent } from './helper';
|
|
3
|
-
export declare function createProxyMiddleware(proxyOptions: ProxyConfig): {
|
|
3
|
+
export declare function createProxyMiddleware(proxyOptions: ProxyConfig): Promise<{
|
|
4
4
|
middlewares: Middleware[];
|
|
5
5
|
upgrade: UpgradeEvent;
|
|
6
|
-
}
|
|
6
|
+
}>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { FSWatcher } from '../../compiled/chokidar
|
|
1
|
+
import type { FSWatcher } from '../../compiled/chokidar';
|
|
2
2
|
import type { ChokidarOptions, NormalizedConfig } from '../types';
|
|
3
3
|
import type { BuildManager } from './buildManager';
|
|
4
4
|
type WatchFilesOptions = {
|
|
@@ -6,8 +6,8 @@ import type { CopyRspackPluginOptions, DefinePluginOptions, Externals, Lightning
|
|
|
6
6
|
import type { CorsOptions } from 'cors';
|
|
7
7
|
import type RspackChain from '../../compiled/rspack-chain/types';
|
|
8
8
|
import type { FileDescriptor } from 'rspack-manifest-plugin';
|
|
9
|
-
import type { ChokidarOptions } from '../../compiled/chokidar
|
|
10
|
-
import type { Options as HttpProxyOptions, Filter as ProxyFilter } from '../../compiled/http-proxy-middleware
|
|
9
|
+
import type { ChokidarOptions } from '../../compiled/chokidar';
|
|
10
|
+
import type { Options as HttpProxyOptions, Filter as ProxyFilter } from '../../compiled/http-proxy-middleware';
|
|
11
11
|
import type { RsbuildDevServer } from '../server/devServer';
|
|
12
12
|
import type { EnvironmentContext, ModifyBundlerChainUtils, ModifyChainUtils, Routes } from './hooks';
|
|
13
13
|
import type { RsbuildPlugins } from './plugin';
|
|
@@ -771,34 +771,34 @@ export type FilenameConfig = {
|
|
|
771
771
|
* The name of the JavaScript files.
|
|
772
772
|
* @default
|
|
773
773
|
* - dev: '[name].js'
|
|
774
|
-
* - prod: '[name].[contenthash:
|
|
774
|
+
* - prod: '[name].[contenthash:10].js'
|
|
775
775
|
*/
|
|
776
776
|
js?: Rspack.Filename;
|
|
777
777
|
/**
|
|
778
778
|
* The name of the CSS files.
|
|
779
779
|
* @default
|
|
780
780
|
* - dev: '[name].css'
|
|
781
|
-
* - prod: '[name].[contenthash:
|
|
781
|
+
* - prod: '[name].[contenthash:10].css'
|
|
782
782
|
*/
|
|
783
783
|
css?: Rspack.CssFilename;
|
|
784
784
|
/**
|
|
785
785
|
* The name of the SVG images.
|
|
786
|
-
* @default '[name].[contenthash:
|
|
786
|
+
* @default '[name].[contenthash:10].svg'
|
|
787
787
|
*/
|
|
788
788
|
svg?: Rspack.AssetModuleFilename;
|
|
789
789
|
/**
|
|
790
790
|
* The name of the font files.
|
|
791
|
-
* @default '[name].[contenthash:
|
|
791
|
+
* @default '[name].[contenthash:10][ext]'
|
|
792
792
|
*/
|
|
793
793
|
font?: Rspack.AssetModuleFilename;
|
|
794
794
|
/**
|
|
795
795
|
* The name of non-SVG images.
|
|
796
|
-
* @default '[name].[contenthash:
|
|
796
|
+
* @default '[name].[contenthash:10][ext]'
|
|
797
797
|
*/
|
|
798
798
|
image?: Rspack.AssetModuleFilename;
|
|
799
799
|
/**
|
|
800
800
|
* The name of media assets, such as video.
|
|
801
|
-
* @default '[name].[contenthash:
|
|
801
|
+
* @default '[name].[contenthash:10][ext]'
|
|
802
802
|
*/
|
|
803
803
|
media?: Rspack.AssetModuleFilename;
|
|
804
804
|
/**
|
|
@@ -808,7 +808,7 @@ export type FilenameConfig = {
|
|
|
808
808
|
wasm?: Rspack.WebassemblyModuleFilename;
|
|
809
809
|
/**
|
|
810
810
|
* The name of other assets, except for above (image, svg, font, html, wasm...)
|
|
811
|
-
* @default '[name].[contenthash:
|
|
811
|
+
* @default '[name].[contenthash:10][ext]'
|
|
812
812
|
*/
|
|
813
813
|
assets?: Rspack.AssetModuleFilename;
|
|
814
814
|
};
|
|
@@ -1576,6 +1576,13 @@ export type CliShortcut = {
|
|
|
1576
1576
|
};
|
|
1577
1577
|
export type WriteToDisk = boolean | ((filename: string) => boolean);
|
|
1578
1578
|
export type BrowserLogsStackTrace = 'summary' | 'full' | 'none';
|
|
1579
|
+
export type LiveReload = boolean | {
|
|
1580
|
+
/**
|
|
1581
|
+
* Whether to trigger a full page reload when the HTML template changes.
|
|
1582
|
+
* @default true
|
|
1583
|
+
*/
|
|
1584
|
+
html?: boolean;
|
|
1585
|
+
};
|
|
1579
1586
|
export interface DevConfig {
|
|
1580
1587
|
/**
|
|
1581
1588
|
* Controls whether to forward browser runtime errors to the terminal. When `true`, the dev
|
|
@@ -1604,7 +1611,7 @@ export interface DevConfig {
|
|
|
1604
1611
|
* Whether to reload the page when file changes are detected.
|
|
1605
1612
|
* @default true
|
|
1606
1613
|
*/
|
|
1607
|
-
liveReload?:
|
|
1614
|
+
liveReload?: LiveReload;
|
|
1608
1615
|
/**
|
|
1609
1616
|
* Set the URL prefix of static assets in development mode,
|
|
1610
1617
|
* similar to the [output.publicPath](https://rspack.rs/config/output#outputpublicpath)
|
|
@@ -253,19 +253,11 @@ export type ModifyChainUtils = {
|
|
|
253
253
|
*/
|
|
254
254
|
HtmlPlugin: typeof HtmlRspackPlugin;
|
|
255
255
|
};
|
|
256
|
-
interface PluginInstance {
|
|
257
|
-
apply: (compiler: any) => void;
|
|
258
|
-
[k: string]: any;
|
|
259
|
-
}
|
|
260
256
|
export type ModifyBundlerChainUtils = ModifyChainUtils & {
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
ProvidePlugin: PluginInstance;
|
|
266
|
-
SourceMapDevToolPlugin: PluginInstance;
|
|
267
|
-
HotModuleReplacementPlugin: PluginInstance;
|
|
268
|
-
};
|
|
257
|
+
/**
|
|
258
|
+
* @deprecated Use `rspack` instead.
|
|
259
|
+
*/
|
|
260
|
+
bundler: typeof rspack;
|
|
269
261
|
};
|
|
270
262
|
export type ModifyBundlerChainFn = (chain: RspackChain, utils: ModifyBundlerChainUtils) => MaybePromise<void>;
|
|
271
263
|
export type CreateAsyncHook<Callback extends (...args: any[]) => any> = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CssExtractRspackLoaderOptions, CssExtractRspackPluginOptions } from '@rspack/core';
|
|
2
2
|
import type Connect from 'connect';
|
|
3
|
-
import type HtmlRspackPlugin from '../../compiled/html-rspack-plugin
|
|
3
|
+
import type HtmlRspackPlugin from '../../compiled/html-rspack-plugin';
|
|
4
4
|
import type { AcceptedPlugin, ProcessOptions } from '../../compiled/postcss';
|
|
5
5
|
import type { Rspack } from './rspack';
|
|
6
6
|
import type { LiteralUnion } from './utils';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsbuild/core",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.3",
|
|
4
4
|
"description": "The Rspack-based build tool.",
|
|
5
5
|
"homepage": "https://rsbuild.rs",
|
|
6
6
|
"bugs": {
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"types.d.ts"
|
|
37
37
|
],
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@rspack/core": "2.0.0-
|
|
39
|
+
"@rspack/core": "2.0.0-beta.0",
|
|
40
40
|
"@swc/helpers": "^0.5.18",
|
|
41
41
|
"jiti": "^2.6.1"
|
|
42
42
|
},
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"@rslib/core": "0.19.4",
|
|
55
55
|
"@types/connect": "3.4.38",
|
|
56
56
|
"@types/cors": "^2.8.19",
|
|
57
|
-
"@types/node": "^24.10.
|
|
57
|
+
"@types/node": "^24.10.10",
|
|
58
58
|
"@types/on-finished": "2.3.5",
|
|
59
59
|
"@types/range-parser": "^1.2.7",
|
|
60
60
|
"@types/ws": "^8.18.1",
|
|
@@ -66,29 +66,28 @@
|
|
|
66
66
|
"css-loader": "7.1.3",
|
|
67
67
|
"deepmerge": "^4.3.1",
|
|
68
68
|
"dotenv-expand": "12.0.3",
|
|
69
|
-
"html-rspack-plugin": "6.1.
|
|
69
|
+
"html-rspack-plugin": "6.1.7",
|
|
70
70
|
"http-proxy-middleware": "^3.0.5",
|
|
71
71
|
"launch-editor-middleware": "^2.12.0",
|
|
72
72
|
"memfs": "^4.56.10",
|
|
73
73
|
"mrmime": "^2.0.1",
|
|
74
74
|
"on-finished": "2.4.1",
|
|
75
75
|
"open": "^11.0.0",
|
|
76
|
-
"picocolors": "^1.1.1",
|
|
77
76
|
"postcss": "^8.5.6",
|
|
78
77
|
"postcss-load-config": "6.0.1",
|
|
79
78
|
"postcss-loader": "8.2.0",
|
|
80
79
|
"prebundle": "1.6.2",
|
|
81
80
|
"range-parser": "^1.2.1",
|
|
82
81
|
"reduce-configs": "^1.1.1",
|
|
83
|
-
"rslog": "^
|
|
82
|
+
"rslog": "^2.0.0",
|
|
84
83
|
"rspack-chain": "^2.0.0-alpha.0",
|
|
85
84
|
"rspack-manifest-plugin": "5.2.1",
|
|
86
85
|
"sirv": "^3.0.2",
|
|
87
86
|
"stacktrace-parser": "^0.1.11",
|
|
88
87
|
"style-loader": "3.3.4",
|
|
88
|
+
"supports-color": "^10.2.2",
|
|
89
89
|
"tinyglobby": "0.2.14",
|
|
90
90
|
"typescript": "^5.9.3",
|
|
91
|
-
"webpack": "^5.104.1",
|
|
92
91
|
"webpack-merge": "6.0.1",
|
|
93
92
|
"ws": "^8.19.0"
|
|
94
93
|
},
|