@rsbuild/core 1.4.12 → 1.4.13
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 +18 -18
- package/compiled/launch-editor-middleware/index.js +32 -21
- package/compiled/launch-editor-middleware/package.json +1 -1
- package/compiled/postcss-loader/index.js +6 -6
- package/compiled/rsbuild-dev-middleware/index.js +25 -25
- package/compiled/style-loader/index.js +10 -10
- package/dist/client/hmr.js +8 -1
- package/dist/index.cjs +65 -64
- package/dist/index.js +65 -64
- package/dist-types/constants.d.ts +1 -0
- package/dist-types/rspack-plugins/RsbuildHtmlPlugin.d.ts +1 -0
- package/dist-types/server/compilationMiddleware.d.ts +0 -4
- package/dist-types/server/devServer.d.ts +7 -2
- package/dist-types/server/socketServer.d.ts +24 -7
- package/dist-types/types/config.d.ts +12 -3
- package/package.json +5 -5
|
@@ -15,10 +15,6 @@ export declare const setupServerHooks: ({ compiler, token, callbacks: { onDone,
|
|
|
15
15
|
callbacks: ServerCallbacks;
|
|
16
16
|
}) => void;
|
|
17
17
|
export type CompilationMiddlewareOptions = {
|
|
18
|
-
/**
|
|
19
|
-
* To ensure HMR works, the devMiddleware need inject the HMR client path into page when HMR enable.
|
|
20
|
-
*/
|
|
21
|
-
clientPaths?: string[];
|
|
22
18
|
/**
|
|
23
19
|
* Should trigger when compiler hook called
|
|
24
20
|
*/
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import type { Server } from 'node:http';
|
|
2
2
|
import type { Http2SecureServer } from 'node:http2';
|
|
3
3
|
import type { Connect, CreateCompiler, CreateDevServerOptions, EnvironmentAPI, InternalContext, NormalizedConfig } from '../types';
|
|
4
|
+
import type { SocketMessage } from './socketServer';
|
|
4
5
|
type HTTPServer = Server | Http2SecureServer;
|
|
5
|
-
|
|
6
|
-
|
|
6
|
+
type ExtractSocketMessageData<T extends SocketMessage['type']> = Extract<SocketMessage, {
|
|
7
|
+
type: T;
|
|
8
|
+
}> extends {
|
|
9
|
+
data: infer D;
|
|
10
|
+
} ? D : undefined;
|
|
11
|
+
export type SockWrite = <T extends SocketMessage['type']>(type: T, data?: ExtractSocketMessageData<T>) => void;
|
|
7
12
|
export type RsbuildDevServer = {
|
|
8
13
|
/**
|
|
9
14
|
* The `connect` app instance.
|
|
@@ -1,11 +1,30 @@
|
|
|
1
1
|
import type { IncomingMessage } from 'node:http';
|
|
2
2
|
import type { Socket } from 'node:net';
|
|
3
3
|
import type { DevConfig, EnvironmentContext, Rspack } from '../types';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
export type SocketMessageStaticChanged = {
|
|
5
|
+
type: 'static-changed' | 'content-changed';
|
|
6
|
+
};
|
|
7
|
+
export type SocketMessageHash = {
|
|
8
|
+
type: 'hash';
|
|
9
|
+
data: string;
|
|
10
|
+
};
|
|
11
|
+
export type SocketMessageOk = {
|
|
12
|
+
type: 'ok';
|
|
13
|
+
};
|
|
14
|
+
export type SocketMessageWarnings = {
|
|
15
|
+
type: 'warnings';
|
|
16
|
+
data: {
|
|
17
|
+
text: string[];
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export type SocketMessageErrors = {
|
|
21
|
+
type: 'errors';
|
|
22
|
+
data: {
|
|
23
|
+
text: string[];
|
|
24
|
+
html: string;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
export type SocketMessage = SocketMessageOk | SocketMessageStaticChanged | SocketMessageHash | SocketMessageWarnings | SocketMessageErrors;
|
|
9
28
|
export declare class SocketServer {
|
|
10
29
|
private wsServer;
|
|
11
30
|
private readonly sockets;
|
|
@@ -27,11 +46,9 @@ export declare class SocketServer {
|
|
|
27
46
|
* if not provided, the message will be sent to all sockets
|
|
28
47
|
*/
|
|
29
48
|
sockWrite(message: SocketMessage, token?: string): void;
|
|
30
|
-
private singleWrite;
|
|
31
49
|
close(): Promise<void>;
|
|
32
50
|
private onConnect;
|
|
33
51
|
private getStats;
|
|
34
52
|
private sendStats;
|
|
35
53
|
private send;
|
|
36
54
|
}
|
|
37
|
-
export {};
|
|
@@ -683,7 +683,7 @@ export type DistPathConfig = {
|
|
|
683
683
|
font?: string;
|
|
684
684
|
/**
|
|
685
685
|
* The output directory of HTML files.
|
|
686
|
-
* @default '
|
|
686
|
+
* @default './'
|
|
687
687
|
*/
|
|
688
688
|
html?: string;
|
|
689
689
|
/**
|
|
@@ -706,6 +706,11 @@ export type DistPathConfig = {
|
|
|
706
706
|
* @default 'static/assets'
|
|
707
707
|
*/
|
|
708
708
|
assets?: string;
|
|
709
|
+
/**
|
|
710
|
+
* The output directory of favicon.
|
|
711
|
+
* @default './'
|
|
712
|
+
*/
|
|
713
|
+
favicon?: string;
|
|
709
714
|
};
|
|
710
715
|
export type FilenameConfig = {
|
|
711
716
|
/**
|
|
@@ -1523,6 +1528,10 @@ export type RsbuildConfigMeta = {
|
|
|
1523
1528
|
*/
|
|
1524
1529
|
configFilePath: string;
|
|
1525
1530
|
};
|
|
1531
|
+
/**
|
|
1532
|
+
* Only some dev options can be defined in the environment config
|
|
1533
|
+
*/
|
|
1534
|
+
export type AllowedEnvironmentDevKeys = 'hmr' | 'liveReload' | 'assetPrefix' | 'progressBar' | 'lazyCompilation' | 'writeToDisk';
|
|
1526
1535
|
/**
|
|
1527
1536
|
* The Rsbuild config to run in the specified environment.
|
|
1528
1537
|
* */
|
|
@@ -1530,7 +1539,7 @@ export interface EnvironmentConfig {
|
|
|
1530
1539
|
/**
|
|
1531
1540
|
* Options for local development.
|
|
1532
1541
|
*/
|
|
1533
|
-
dev?: Pick<DevConfig,
|
|
1542
|
+
dev?: Pick<DevConfig, AllowedEnvironmentDevKeys>;
|
|
1534
1543
|
/**
|
|
1535
1544
|
* Options for HTML generation.
|
|
1536
1545
|
*/
|
|
@@ -1618,7 +1627,7 @@ export interface RsbuildConfig extends EnvironmentConfig {
|
|
|
1618
1627
|
export type MergedEnvironmentConfig = {
|
|
1619
1628
|
mode: RsbuildMode;
|
|
1620
1629
|
root: string;
|
|
1621
|
-
dev: Pick<NormalizedDevConfig,
|
|
1630
|
+
dev: Pick<NormalizedDevConfig, AllowedEnvironmentDevKeys>;
|
|
1622
1631
|
html: NormalizedHtmlConfig;
|
|
1623
1632
|
tools: NormalizedToolsConfig;
|
|
1624
1633
|
resolve: NormalizedResolveConfig;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsbuild/core",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.13",
|
|
4
4
|
"description": "The Rspack-based build tool.",
|
|
5
5
|
"homepage": "https://rsbuild.rs",
|
|
6
6
|
"bugs": {
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"@rslib/core": "0.11.0",
|
|
57
57
|
"@types/connect": "3.4.38",
|
|
58
58
|
"@types/cors": "^2.8.19",
|
|
59
|
-
"@types/node": "^22.
|
|
59
|
+
"@types/node": "^22.17.0",
|
|
60
60
|
"@types/on-finished": "2.3.5",
|
|
61
61
|
"@types/webpack-bundle-analyzer": "4.7.0",
|
|
62
62
|
"@types/ws": "^8.18.1",
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"dotenv-expand": "12.0.2",
|
|
71
71
|
"html-rspack-plugin": "6.1.2",
|
|
72
72
|
"http-proxy-middleware": "^2.0.9",
|
|
73
|
-
"launch-editor-middleware": "^2.
|
|
73
|
+
"launch-editor-middleware": "^2.11.0",
|
|
74
74
|
"mrmime": "^2.0.1",
|
|
75
75
|
"on-finished": "2.4.1",
|
|
76
76
|
"open": "^10.2.0",
|
|
@@ -87,8 +87,8 @@
|
|
|
87
87
|
"sirv": "^3.0.1",
|
|
88
88
|
"style-loader": "3.3.4",
|
|
89
89
|
"tinyglobby": "^0.2.14",
|
|
90
|
-
"typescript": "^5.
|
|
91
|
-
"webpack": "^5.
|
|
90
|
+
"typescript": "^5.9.2",
|
|
91
|
+
"webpack": "^5.101.0",
|
|
92
92
|
"webpack-bundle-analyzer": "^4.10.2",
|
|
93
93
|
"webpack-merge": "6.0.1",
|
|
94
94
|
"ws": "^8.18.3"
|