@rsbuild/core 2.1.6 → 2.1.7
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 +14 -14
- package/compiled/postcss/index.js +1 -1
- package/compiled/postcss/lib/postcss.d.ts +4 -1
- package/compiled/postcss/package.json +1 -1
- package/compiled/postcss-loader/index.js +6 -6
- package/compiled/rslog/index.d.ts +7 -0
- package/compiled/rslog/package.json +1 -1
- package/dist/711.js +286 -225
- package/dist/http-proxy-middleware.js +8 -8
- package/dist/manifest-plugin.js +6 -6
- package/dist/ws.js +34 -38
- package/dist-types/cli/init.d.ts +1 -2
- package/dist-types/createContext.d.ts +2 -1
- package/dist-types/helpers/restartManager.d.ts +13 -0
- package/dist-types/hooks.d.ts +2 -1
- package/dist-types/index.d.ts +1 -1
- package/dist-types/plugins/minimize.d.ts +2 -2
- package/dist-types/restart.d.ts +10 -15
- package/dist-types/types/config.d.ts +12 -4
- package/dist-types/types/context.d.ts +4 -0
- package/dist-types/types/hooks.d.ts +11 -0
- package/dist-types/types/plugin.d.ts +4 -1
- package/dist-types/types/rsbuild.d.ts +12 -5
- package/package.json +6 -6
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import type { Compiler, MultiCompiler } from '@rspack/core';
|
|
2
|
+
import type { LoadConfigResult } from '../loadConfig';
|
|
2
3
|
import type { LoadEnvOptions } from '../loadEnv';
|
|
3
4
|
import type { Logger } from '../logger';
|
|
4
5
|
import type { RsbuildDevServer } from '../server/devServer';
|
|
5
6
|
import type { StartDevServerResult, StartPreviewServerResult } from '../server/helper';
|
|
6
7
|
import type { NormalizedConfig, NormalizedEnvironmentConfig, RsbuildConfig } from './config';
|
|
7
8
|
import type { RsbuildContext } from './context';
|
|
9
|
+
import type { RestartFn } from './hooks';
|
|
8
10
|
import type { RsbuildPlugin, RsbuildPluginAPI } from './plugin';
|
|
9
11
|
import type { Rspack } from './rspack';
|
|
10
12
|
import type { Falsy } from './utils';
|
|
@@ -90,6 +92,7 @@ export type InspectConfigResult = {
|
|
|
90
92
|
};
|
|
91
93
|
};
|
|
92
94
|
export type CreateCompiler = () => Promise<Compiler | MultiCompiler>;
|
|
95
|
+
type RsbuildConfigInput = RsbuildConfig | LoadConfigResult;
|
|
93
96
|
export type CreateRsbuildOptions = {
|
|
94
97
|
/**
|
|
95
98
|
* The root path of current project.
|
|
@@ -109,18 +112,21 @@ export type CreateRsbuildOptions = {
|
|
|
109
112
|
/**
|
|
110
113
|
* Alias for `config`.
|
|
111
114
|
* This option will be deprecated in the future.
|
|
112
|
-
*/ rsbuildConfig?:
|
|
115
|
+
*/ rsbuildConfig?: RsbuildConfigInput | (() => Promise<RsbuildConfigInput>);
|
|
113
116
|
/**
|
|
114
|
-
* Rsbuild
|
|
117
|
+
* Rsbuild configuration or the result returned by `loadConfig`.
|
|
115
118
|
* Passing a function to load the config asynchronously with custom logic.
|
|
116
|
-
*/ config?:
|
|
119
|
+
*/ config?: RsbuildConfigInput | (() => Promise<RsbuildConfigInput>);
|
|
117
120
|
/**
|
|
118
121
|
* Whether to call `loadEnv` to load environment variables and define them
|
|
119
122
|
* as global variables via `source.define`.
|
|
120
123
|
* @default false
|
|
121
124
|
*/ loadEnv?: boolean | LoadEnvOptions;
|
|
125
|
+
/**
|
|
126
|
+
* Function used to restart the current dev server or watch build.
|
|
127
|
+
*/ restart?: RestartFn;
|
|
122
128
|
};
|
|
123
|
-
export type ResolvedCreateRsbuildOptions = Required<Pick<CreateRsbuildOptions, 'cwd' | 'callerName'>> & Pick<CreateRsbuildOptions, 'loadEnv' | 'environment'> & {
|
|
129
|
+
export type ResolvedCreateRsbuildOptions = Required<Pick<CreateRsbuildOptions, 'cwd' | 'callerName'>> & Pick<CreateRsbuildOptions, 'loadEnv' | 'environment' | 'restart'> & {
|
|
124
130
|
rsbuildConfig: RsbuildConfig;
|
|
125
131
|
};
|
|
126
132
|
export type CreateDevServer = (options?: CreateDevServerOptions) => Promise<RsbuildDevServer>;
|
|
@@ -214,7 +220,7 @@ export type RsbuildInstance = {
|
|
|
214
220
|
* 1. Start a development server that serves your application.
|
|
215
221
|
* 2. Watch for file changes and trigger recompilation.
|
|
216
222
|
*/ startDevServer: StartDevServer;
|
|
217
|
-
} & Pick<RsbuildPluginAPI, 'context' | 'expose' | 'getNormalizedConfig' | 'getRsbuildConfig' | 'isPluginExists' | 'modifyEnvironmentConfig' | 'modifyRsbuildConfig' | 'onAfterBuild' | 'onAfterCreateCompiler' | 'onAfterDevCompile' | 'onAfterEnvironmentCompile' | 'onAfterStartDevServer' | 'onAfterStartPreviewServer' | 'onBeforeBuild' | 'onBeforeCreateCompiler' | 'onBeforeDevCompile' | 'onBeforeEnvironmentCompile' | 'onBeforeStartDevServer' | 'onBeforeStartPreviewServer' | 'onCloseBuild' | 'onCloseDevServer' | 'onDevCompileDone' | 'onExit'>;
|
|
223
|
+
} & Pick<RsbuildPluginAPI, 'context' | 'expose' | 'getNormalizedConfig' | 'getRsbuildConfig' | 'isPluginExists' | 'modifyEnvironmentConfig' | 'modifyRsbuildConfig' | 'onAfterBuild' | 'onAfterCreateCompiler' | 'onAfterDevCompile' | 'onAfterEnvironmentCompile' | 'onAfterStartDevServer' | 'onAfterStartPreviewServer' | 'onBeforeBuild' | 'onBeforeCreateCompiler' | 'onBeforeDevCompile' | 'onBeforeEnvironmentCompile' | 'onBeforeStartDevServer' | 'onBeforeStartPreviewServer' | 'onCloseBuild' | 'onCloseDevServer' | 'onDevCompileDone' | 'onExit' | 'onRestart'>;
|
|
218
224
|
export type RsbuildTarget = 'web' | 'node' | 'web-worker';
|
|
219
225
|
export type RsbuildEntryDescription = Rspack.EntryDescription & {
|
|
220
226
|
/**
|
|
@@ -231,3 +237,4 @@ export type RsbuildStatsItem = Pick<Rspack.StatsCompilation, 'errors' | 'warning
|
|
|
231
237
|
*/ export type RsbuildStats = RsbuildStatsItem & {
|
|
232
238
|
children: RsbuildStatsItem[];
|
|
233
239
|
};
|
|
240
|
+
export { };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsbuild/core",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.7",
|
|
4
4
|
"description": "The Rspack-based build tool.",
|
|
5
5
|
"homepage": "https://rsbuild.rs",
|
|
6
6
|
"bugs": {
|
|
@@ -40,13 +40,13 @@
|
|
|
40
40
|
"registry": "https://registry.npmjs.org/"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@rspack/core": "~2.1.
|
|
43
|
+
"@rspack/core": "~2.1.5",
|
|
44
44
|
"@swc/helpers": "^0.5.23"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@jridgewell/remapping": "^2.3.5",
|
|
48
48
|
"@jridgewell/trace-mapping": "^0.3.31",
|
|
49
|
-
"@rslib/core": "0.
|
|
49
|
+
"@rslib/core": "1.0.0-beta.0",
|
|
50
50
|
"@rstackjs/load-config": "^0.1.2",
|
|
51
51
|
"@types/cors": "^2.8.19",
|
|
52
52
|
"@types/node": "^24.13.3",
|
|
@@ -71,13 +71,13 @@
|
|
|
71
71
|
"mrmime": "^2.0.1",
|
|
72
72
|
"on-finished": "2.4.1",
|
|
73
73
|
"open": "^11.0.0",
|
|
74
|
-
"postcss": "^8.5.
|
|
74
|
+
"postcss": "^8.5.19",
|
|
75
75
|
"postcss-load-config": "6.0.1",
|
|
76
76
|
"postcss-loader": "8.2.1",
|
|
77
77
|
"prebundle": "1.6.5",
|
|
78
78
|
"range-parser": "^1.3.0",
|
|
79
79
|
"reduce-configs": "^2.0.1",
|
|
80
|
-
"rslog": "^2.
|
|
80
|
+
"rslog": "^2.3.0",
|
|
81
81
|
"rspack-chain": "^2.1.1",
|
|
82
82
|
"rspack-manifest-plugin": "5.2.2",
|
|
83
83
|
"rspack-merge": "1.0.1",
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
"style-loader": "^4.0.0",
|
|
87
87
|
"tinyglobby": "^0.2.17",
|
|
88
88
|
"typescript": "^6.0.3",
|
|
89
|
-
"ws": "^8.21.
|
|
89
|
+
"ws": "^8.21.1"
|
|
90
90
|
},
|
|
91
91
|
"peerDependencies": {
|
|
92
92
|
"core-js": ">= 3.0.0"
|