@rsbuild/core 2.0.0-rc.0 → 2.0.0-rc.1

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.
@@ -1,31 +1,3 @@
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
1
  /*!
30
2
  * fill-range <https://github.com/jonschlinkert/fill-range>
31
3
  *
@@ -54,13 +26,6 @@
54
26
  * Released under the MIT License.
55
27
  */
56
28
 
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
29
  /*!
65
30
  * to-regex-range <https://github.com/micromatch/to-regex-range>
66
31
  *
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- export { PLUGIN_CSS_NAME, PLUGIN_SWC_NAME, createLogger, createRsbuild, defaultAllowedOrigins, defineConfig, ensureAssetPrefix, loadConfig, loadEnv, logger, mergeRsbuildConfig, rspack, runCLI, version } from "./552.js";
1
+ export { PLUGIN_CSS_NAME, PLUGIN_SWC_NAME, createLogger, createRsbuild, defaultAllowedOrigins, defineConfig, ensureAssetPrefix, loadConfig, loadEnv, logger, mergeRsbuildConfig, rspack, runCLI, version } from "./863.js";
@@ -1,5 +1,5 @@
1
1
  import { __webpack_require__ } from "./1~rslib-runtime.js";
2
- import "./552.js";
2
+ import "./863.js";
3
3
  __webpack_require__.add({
4
4
  "../../node_modules/.pnpm/launch-editor-middleware@2.13.2/node_modules/launch-editor-middleware/index.js" (module, __unused_rspack_exports, __webpack_require__) {
5
5
  let path = __webpack_require__("path?37f5"), launch = __webpack_require__("../../node_modules/.pnpm/launch-editor@2.13.2/node_modules/launch-editor/index.js");
@@ -1,7 +1,7 @@
1
1
  import { __webpack_require__ } from "./1~rslib-runtime.js";
2
- import "./552.js";
2
+ import "./863.js";
3
3
  __webpack_require__.add({
4
- "../../node_modules/.pnpm/rspack-manifest-plugin@5.2.1_@rspack+core@2.0.0-rc.0_@emnapi+core@1.8.1_@emnapi+runtime_36ca8bbe9cc8ea53288c7dff23b25fc0/node_modules/rspack-manifest-plugin/dist/helpers.js" (__unused_rspack_module, exports, __webpack_require__) {
4
+ "../../node_modules/.pnpm/rspack-manifest-plugin@5.2.1_@rspack+core@2.0.0-rc.1_@emnapi+core@1.9.2_@emnapi+runtime_ae0458ffc4f2907bc50e0834703a6ec7/node_modules/rspack-manifest-plugin/dist/helpers.js" (__unused_rspack_module, exports, __webpack_require__) {
5
5
  exports.transformFiles = exports.reduceChunk = exports.reduceAssets = exports.generateManifest = void 0;
6
6
  let node_path_1 = __webpack_require__("node:path?815c");
7
7
  exports.generateManifest = (compilation, files, { generate, seed = {} })=>generate ? generate(seed, files, Array.from(compilation.entrypoints.entries()).reduce((e, [name, entrypoint])=>Object.assign(e, {
@@ -61,9 +61,9 @@ __webpack_require__.add({
61
61
  'sort'
62
62
  ].filter((fname)=>!!options[fname]).reduce((prev, fname)=>prev[fname](options[fname]), files).map(standardizeFilePaths);
63
63
  },
64
- "../../node_modules/.pnpm/rspack-manifest-plugin@5.2.1_@rspack+core@2.0.0-rc.0_@emnapi+core@1.8.1_@emnapi+runtime_36ca8bbe9cc8ea53288c7dff23b25fc0/node_modules/rspack-manifest-plugin/dist/hooks.js" (__unused_rspack_module, exports, __webpack_require__) {
64
+ "../../node_modules/.pnpm/rspack-manifest-plugin@5.2.1_@rspack+core@2.0.0-rc.1_@emnapi+core@1.9.2_@emnapi+runtime_ae0458ffc4f2907bc50e0834703a6ec7/node_modules/rspack-manifest-plugin/dist/hooks.js" (__unused_rspack_module, exports, __webpack_require__) {
65
65
  exports.getCompilerHooks = exports.emitHook = exports.beforeRunHook = void 0;
66
- let node_fs_1 = __webpack_require__("node:fs?31c0"), node_path_1 = __webpack_require__("node:path?815c"), 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-rc.0_@emnapi+core@1.8.1_@emnapi+runtime_36ca8bbe9cc8ea53288c7dff23b25fc0/node_modules/rspack-manifest-plugin/dist/helpers.js"), compilerHookMap = new WeakMap(), getCompilerHooks = (compiler)=>{
66
+ let node_fs_1 = __webpack_require__("node:fs?31c0"), node_path_1 = __webpack_require__("node:path?815c"), 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-rc.1_@emnapi+core@1.9.2_@emnapi+runtime_ae0458ffc4f2907bc50e0834703a6ec7/node_modules/rspack-manifest-plugin/dist/helpers.js"), compilerHookMap = new WeakMap(), getCompilerHooks = (compiler)=>{
67
67
  let hooks = compilerHookMap.get(compiler);
68
68
  return void 0 === hooks && (hooks = {
69
69
  afterEmit: new lite_tapable_1.SyncWaterfallHook([
@@ -112,9 +112,9 @@ __webpack_require__.add({
112
112
  getCompilerHooks(compiler).afterEmit.call(manifest);
113
113
  };
114
114
  },
115
- "../../node_modules/.pnpm/rspack-manifest-plugin@5.2.1_@rspack+core@2.0.0-rc.0_@emnapi+core@1.8.1_@emnapi+runtime_36ca8bbe9cc8ea53288c7dff23b25fc0/node_modules/rspack-manifest-plugin/dist/index.js" (__unused_rspack_module, exports, __webpack_require__) {
115
+ "../../node_modules/.pnpm/rspack-manifest-plugin@5.2.1_@rspack+core@2.0.0-rc.1_@emnapi+core@1.9.2_@emnapi+runtime_ae0458ffc4f2907bc50e0834703a6ec7/node_modules/rspack-manifest-plugin/dist/index.js" (__unused_rspack_module, exports, __webpack_require__) {
116
116
  exports.RspackManifestPlugin = void 0;
117
- let node_path_1 = __webpack_require__("node:path?815c"), hooks_1 = __webpack_require__("../../node_modules/.pnpm/rspack-manifest-plugin@5.2.1_@rspack+core@2.0.0-rc.0_@emnapi+core@1.8.1_@emnapi+runtime_36ca8bbe9cc8ea53288c7dff23b25fc0/node_modules/rspack-manifest-plugin/dist/hooks.js"), emitCountMap = new Map(), defaults = {
117
+ let node_path_1 = __webpack_require__("node:path?815c"), hooks_1 = __webpack_require__("../../node_modules/.pnpm/rspack-manifest-plugin@5.2.1_@rspack+core@2.0.0-rc.1_@emnapi+core@1.9.2_@emnapi+runtime_ae0458ffc4f2907bc50e0834703a6ec7/node_modules/rspack-manifest-plugin/dist/hooks.js"), emitCountMap = new Map(), defaults = {
118
118
  assetHookStage: 1 / 0,
119
119
  basePath: '',
120
120
  fileName: 'manifest.json',
@@ -683,5 +683,5 @@ __webpack_require__.add({
683
683
  });
684
684
  }
685
685
  });
686
- var RspackManifestPlugin = __webpack_require__("../../node_modules/.pnpm/rspack-manifest-plugin@5.2.1_@rspack+core@2.0.0-rc.0_@emnapi+core@1.8.1_@emnapi+runtime_36ca8bbe9cc8ea53288c7dff23b25fc0/node_modules/rspack-manifest-plugin/dist/index.js").RspackManifestPlugin;
686
+ var RspackManifestPlugin = __webpack_require__("../../node_modules/.pnpm/rspack-manifest-plugin@5.2.1_@rspack+core@2.0.0-rc.1_@emnapi+core@1.9.2_@emnapi+runtime_ae0458ffc4f2907bc50e0834703a6ec7/node_modules/rspack-manifest-plugin/dist/index.js").RspackManifestPlugin;
687
687
  export { RspackManifestPlugin };
package/dist/memfs.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { __webpack_require__ } from "./1~rslib-runtime.js";
2
- import "./552.js";
2
+ import "./863.js";
3
3
  __webpack_require__.add({
4
4
  "../../node_modules/.pnpm/@jsonjoy.com+base64@17.67.0_tslib@2.8.1/node_modules/@jsonjoy.com/base64/lib/constants.js" (__unused_rspack_module, exports) {
5
5
  exports.alphabet = void 0, exports.alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/', 'function' == typeof Buffer && Buffer.from;
package/dist/ws.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { __webpack_require__ } from "./1~rslib-runtime.js";
2
- import "./552.js";
2
+ import "./863.js";
3
3
  __webpack_require__.add({
4
4
  "../../node_modules/.pnpm/ws@8.20.0/node_modules/ws/lib/buffer-util.js" (module, __unused_rspack_exports, __webpack_require__) {
5
5
  let { EMPTY_BUFFER } = __webpack_require__("../../node_modules/.pnpm/ws@8.20.0/node_modules/ws/lib/constants.js"), FastBuffer = Buffer[Symbol.species];
@@ -1,3 +1,3 @@
1
1
  import type { LogLevel, NormalizedClientConfig } from '../types';
2
2
  export declare const registerOverlay: (createFn: (title: string, content: string) => void, clearFn: () => void) => void;
3
- export declare function init(token: string, config: NormalizedClientConfig, serverHost: string, serverPort: number, liveReload: boolean, browserLogs: boolean, logLevel: LogLevel): void;
3
+ export declare function init(token: string, config: NormalizedClientConfig, serverHost: string, serverPort: number, serverBase: string, liveReload: boolean, browserLogs: boolean, logLevel: LogLevel): void;
@@ -1,5 +1,5 @@
1
1
  import { color } from '../../compiled/rslog';
2
- import RspackChain from '../../compiled/rspack-chain/types';
2
+ import { RspackChain } from '../../compiled/rspack-chain/types';
3
3
  import type { FilenameConfig, NormalizedConfig, NormalizedEnvironmentConfig, RsbuildTarget, Rspack } from '../types';
4
4
  export { require } from './vendors';
5
5
  export { color, RspackChain };
@@ -1,4 +1,4 @@
1
- import type RspackChain from '../../compiled/rspack-chain/types';
1
+ import type { RspackChain } from '../../compiled/rspack-chain/types';
2
2
  import type { Rspack } from '../types';
3
3
  export declare const removeLeadingSlash: (s: string) => string;
4
4
  export declare const removeTailingSlash: (s: string) => string;
@@ -1,12 +1,5 @@
1
1
  /**
2
- * This file is used to get/set the global instance for html-plugin and css-extract plugin.
2
+ * This file is used to get the global instance for html-plugin.
3
3
  */
4
- import { rspack } from '@rspack/core';
5
4
  import type { HtmlRspackPlugin, NormalizedEnvironmentConfig } from './types';
6
- /**
7
- * This method is used to override the Rsbuild default html-plugin (html-rspack-plugin).
8
- */
9
- export declare const setHTMLPlugin: (plugin: typeof HtmlRspackPlugin) => void;
10
5
  export declare function getHTMLPlugin(config?: NormalizedEnvironmentConfig): typeof HtmlRspackPlugin;
11
- export declare const setCssExtractPlugin: (plugin: unknown) => void;
12
- export declare const getCssExtractPlugin: () => typeof rspack.CssExtractRspackPlugin;
@@ -4,11 +4,11 @@ import type { CreateCompiler, CreateDevServerOptions, EnvironmentAPI, InternalCo
4
4
  import { type RsbuildServerBase, type StartDevServerResult } from './helper';
5
5
  import type { ServerMessage } from './socketServer';
6
6
  type HTTPServer = Server | Http2SecureServer;
7
- type ExtractSocketMessageData<T extends ServerMessage['type']> = Extract<ServerMessage, {
7
+ type ExtractSocketMessageData<T extends ServerMessage['type']> = 'data' extends keyof Extract<ServerMessage, {
8
8
  type: T;
9
- }> extends {
10
- data: infer D;
11
- } ? D : undefined;
9
+ }> ? Extract<ServerMessage, {
10
+ type: T;
11
+ }>['data'] : undefined;
12
12
  export type SockWrite = <T extends ServerMessage['type']>(type: T, data?: ExtractSocketMessageData<T>) => void;
13
13
  export type RsbuildDevServer = RsbuildServerBase & {
14
14
  /**
@@ -35,7 +35,9 @@ export type RsbuildDevServer = RsbuildServerBase & {
35
35
  /**
36
36
  * Allows middleware to send some message to HMR client, and then the HMR
37
37
  * client will take different actions depending on the message type.
38
- * - `static-changed`: The page will reload.
38
+ * - `full-reload`: The page will reload.
39
+ * - `static-changed`: Alias of `full-reload` for backward compatibility.
40
+ * - `custom`: Send custom messages via `custom` type with optional data to the browser and handle them via HMR events.
39
41
  */
40
42
  sockWrite: SockWrite;
41
43
  };
@@ -1,6 +1,18 @@
1
1
  import type { IncomingMessage } from 'node:http';
2
2
  import type { Socket } from 'node:net';
3
3
  import type { DevConfig, InternalContext, Rspack } from '../types';
4
+ export type ServerMessageFullReload = {
5
+ type: 'full-reload';
6
+ data?: {
7
+ /**
8
+ * If `path` ends with `.html`, only the matching page will reload.
9
+ * The HTML path should be relative to the dev server root and should not
10
+ * include `server.base`. Use `'*'` to reload all pages.
11
+ * @example `/foo.html`
12
+ */
13
+ path?: string;
14
+ };
15
+ };
4
16
  export type ServerMessageStaticChanged = {
5
17
  type: 'static-changed';
6
18
  };
@@ -38,7 +50,7 @@ export type ServerCustomMessage = {
38
50
  data?: any;
39
51
  };
40
52
  };
41
- export type ServerMessage = ServerMessageOk | ServerMessageStaticChanged | ServerMessageHash | ServerMessageWarnings | ServerMessageErrors | ServerMessageResolvedClientError | ServerCustomMessage;
53
+ export type ServerMessage = ServerMessageOk | ServerMessageFullReload | ServerMessageStaticChanged | ServerMessageHash | ServerMessageWarnings | ServerMessageErrors | ServerMessageResolvedClientError | ServerCustomMessage;
42
54
  export type ClientMessageError = {
43
55
  type: 'client-error';
44
56
  id: string;
@@ -6,7 +6,7 @@ import type { CopyRspackPluginOptions, DefinePluginOptions, Externals, Lightning
6
6
  import type { ChokidarOptions } from '../../compiled/chokidar';
7
7
  import type Cors from '../../compiled/cors';
8
8
  import type { Options as HttpProxyOptions, Filter as ProxyFilter } from '../../compiled/http-proxy-middleware';
9
- import type RspackChain from '../../compiled/rspack-chain/types';
9
+ import type { RspackChain } from '../../compiled/rspack-chain/types';
10
10
  import type { FileDescriptor } from '../../compiled/rspack-manifest-plugin';
11
11
  import type { RsbuildDevServer } from '../server/devServer';
12
12
  import type { RsbuildPreviewServer } from '../server/previewServer';
@@ -139,7 +139,7 @@ export type AliasStrategy = 'prefer-tsconfig' | 'prefer-alias';
139
139
  export type Decorators = {
140
140
  /**
141
141
  * Specify the version of decorators to use.
142
- * @default '2022-03'
142
+ * @default '2023-11'
143
143
  */
144
144
  version?: 'legacy' | '2022-03' | '2023-11';
145
145
  };
@@ -1,5 +1,5 @@
1
1
  import type * as Rspack from '@rspack/core';
2
- import type RspackChain from '../../compiled/rspack-chain/types';
2
+ import type { RspackChain } from '../../compiled/rspack-chain/types';
3
3
  import type { TransformHandler } from './plugin';
4
4
  export type { Rspack, RspackChain };
5
5
  declare module '@rspack/core' {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rsbuild/core",
3
- "version": "2.0.0-rc.0",
3
+ "version": "2.0.0-rc.1",
4
4
  "description": "The Rspack-based build tool.",
5
5
  "homepage": "https://rsbuild.rs",
6
6
  "bugs": {
@@ -36,8 +36,8 @@
36
36
  "types.d.ts"
37
37
  ],
38
38
  "dependencies": {
39
- "@rspack/core": "2.0.0-rc.0",
40
- "@swc/helpers": "^0.5.20"
39
+ "@rspack/core": "2.0.0-rc.1",
40
+ "@swc/helpers": "^0.5.21"
41
41
  },
42
42
  "peerDependencies": {
43
43
  "core-js": ">= 3.0.0"
@@ -50,22 +50,22 @@
50
50
  "devDependencies": {
51
51
  "@jridgewell/remapping": "^2.3.5",
52
52
  "@jridgewell/trace-mapping": "^0.3.31",
53
- "@rslib/core": "0.20.1",
53
+ "@rslib/core": "0.20.3",
54
54
  "@types/cors": "^2.8.19",
55
- "@types/node": "^24.12.0",
55
+ "@types/node": "^24.12.2",
56
56
  "@types/on-finished": "2.3.5",
57
57
  "@types/range-parser": "^1.2.7",
58
58
  "@types/ws": "^8.18.1",
59
59
  "browserslist-load-config": "1.0.1",
60
60
  "cac": "^7.0.0",
61
61
  "chokidar": "^5.0.0",
62
- "connect-next": "4.0.0",
62
+ "connect-next": "4.0.1",
63
63
  "cors": "^2.8.6",
64
64
  "css-loader": "7.1.4",
65
65
  "deepmerge": "^4.3.1",
66
66
  "dotenv-expand": "12.0.3",
67
67
  "html-rspack-plugin": "6.1.8",
68
- "http-proxy-middleware": "^3.0.5",
68
+ "http-proxy-middleware": "4.0.0-beta.3",
69
69
  "jiti": "^2.6.1",
70
70
  "launch-editor-middleware": "^2.13.2",
71
71
  "memfs": "^4.57.1",
@@ -77,9 +77,9 @@
77
77
  "postcss-loader": "8.2.1",
78
78
  "prebundle": "1.6.4",
79
79
  "range-parser": "^1.2.1",
80
- "reduce-configs": "^1.1.1",
80
+ "reduce-configs": "^1.1.2",
81
81
  "rslog": "^2.1.1",
82
- "rspack-chain": "^2.0.0-beta.1",
82
+ "rspack-chain": "^2.0.0-rc.1",
83
83
  "rspack-manifest-plugin": "5.2.1",
84
84
  "sirv": "^3.0.2",
85
85
  "stacktrace-parser": "^0.1.11",