@rsbuild/core 2.1.7 → 2.1.9
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/cors/index.d.ts +1 -1
- package/compiled/css-loader/index.js +2 -2
- package/compiled/html-rspack-plugin/index.d.ts +1 -1
- package/compiled/html-rspack-plugin/index.js +14 -14
- package/compiled/postcss/index.js +1 -1
- package/compiled/postcss/lib/node.d.ts +2 -2
- package/compiled/postcss/package.json +1 -1
- package/compiled/postcss-loader/index.js +6 -6
- package/dist/{711.js → 626.js} +106 -84
- package/dist/build.d.ts +4 -0
- package/dist/chokidar.js +1 -1046
- package/{dist-types → dist}/cli/commands.d.ts +2 -2
- package/{dist-types → dist}/cli/init.d.ts +2 -2
- package/dist/client/hmr.js +1 -1
- package/dist/client/overlay.js +1 -1
- package/{dist-types → dist}/configChain.d.ts +2 -2
- package/dist/connect-next.js +1 -876
- package/dist/cors.js +1 -1
- package/{dist-types → dist}/createCompiler.d.ts +2 -2
- package/{dist-types → dist}/createContext.d.ts +3 -3
- package/{dist-types → dist}/createRsbuild.d.ts +1 -1
- package/{dist-types → dist}/defaultConfig.d.ts +1 -1
- package/{dist-types → dist}/helpers/compiler.d.ts +1 -1
- package/{dist-types → dist}/helpers/css.d.ts +1 -1
- package/{dist-types → dist}/helpers/format.d.ts +1 -1
- package/{dist-types → dist}/helpers/fs.d.ts +2 -2
- package/{dist-types → dist}/helpers/index.d.ts +4 -4
- package/{dist-types → dist}/helpers/overlayConfig.d.ts +1 -1
- package/{dist-types → dist}/helpers/path.d.ts +1 -1
- package/{dist-types → dist}/helpers/restartManager.d.ts +2 -2
- package/{dist-types → dist}/helpers/stats.d.ts +2 -2
- package/{dist-types → dist}/helpers/url.d.ts +2 -2
- package/{dist-types → dist}/helpers/vendors.d.ts +1 -1
- package/{dist-types → dist}/hooks.d.ts +1 -1
- package/dist/http-proxy-middleware.js +5 -3010
- package/{dist-types → dist}/index.d.ts +14 -14
- package/dist/index.js +1 -1
- package/{dist-types → dist}/initConfigs.d.ts +1 -1
- package/{dist-types → dist}/initPlugins.d.ts +2 -2
- package/{dist-types → dist}/inspectConfig.d.ts +2 -2
- package/dist/launch-editor-middleware.js +1 -544
- package/{dist-types → dist}/loadConfig.d.ts +6 -6
- package/{dist-types → dist}/loader/cssUrlLoader.d.ts +1 -1
- package/{dist-types → dist}/loader/ignoreCssLoader.d.ts +1 -1
- package/{dist-types → dist}/loader/transformLoader.d.ts +1 -1
- package/{dist-types → dist}/loader/transformRawLoader.d.ts +1 -1
- package/{dist-types → dist}/logger.d.ts +1 -1
- package/dist/manifest-plugin.js +1 -692
- package/dist/memfs.js +1 -5695
- package/{dist-types → dist}/mergeConfig.d.ts +1 -1
- package/dist/open.js +2 -439
- package/{dist-types → dist}/pluginHelper.d.ts +1 -1
- package/{dist-types → dist}/pluginManager.d.ts +2 -2
- package/{dist-types → dist}/plugins/appIcon.d.ts +1 -1
- package/{dist-types → dist}/plugins/asset.d.ts +1 -1
- package/{dist-types → dist}/plugins/basic.d.ts +1 -1
- package/dist/plugins/cache.d.ts +2 -0
- package/{dist-types → dist}/plugins/cleanOutput.d.ts +1 -1
- package/{dist-types → dist}/plugins/css.d.ts +1 -1
- package/{dist-types → dist}/plugins/define.d.ts +1 -1
- package/dist/plugins/entry.d.ts +2 -0
- package/{dist-types → dist}/plugins/externals.d.ts +2 -2
- package/{dist-types → dist}/plugins/fileSize.d.ts +1 -1
- package/{dist-types → dist}/plugins/html.d.ts +1 -1
- package/{dist-types → dist}/plugins/inlineChunk.d.ts +1 -1
- package/{dist-types → dist}/plugins/lazyCompilation.d.ts +1 -1
- package/{dist-types → dist}/plugins/manifest.d.ts +1 -1
- package/{dist-types → dist}/plugins/minimize.d.ts +2 -2
- package/{dist-types → dist}/plugins/moduleFederation.d.ts +1 -1
- package/{dist-types → dist}/plugins/nodeAddons.d.ts +1 -1
- package/dist/plugins/nonce.d.ts +2 -0
- package/{dist-types → dist}/plugins/output.d.ts +1 -1
- package/{dist-types → dist}/plugins/progress.d.ts +1 -1
- package/{dist-types → dist}/plugins/resolve.d.ts +1 -1
- package/{dist-types → dist}/plugins/resourceHints.d.ts +1 -1
- package/{dist-types → dist}/plugins/rsdoctor.d.ts +1 -1
- package/{dist-types → dist}/plugins/rspackProfile.d.ts +1 -1
- package/{dist-types → dist}/plugins/server.d.ts +1 -1
- package/{dist-types → dist}/plugins/sourceMap.d.ts +1 -1
- package/{dist-types → dist}/plugins/splitChunks.d.ts +1 -1
- package/dist/plugins/sri.d.ts +2 -0
- package/{dist-types → dist}/plugins/swc.d.ts +1 -1
- package/{dist-types → dist}/plugins/target.d.ts +1 -1
- package/dist/plugins/wasm.d.ts +2 -0
- package/{dist-types → dist}/plugins/worker.d.ts +1 -1
- package/dist/range-parser.js +1 -1
- package/dist/restart.d.ts +15 -0
- package/{dist-types → dist}/rspack-plugins/RsbuildHtmlPlugin.d.ts +1 -1
- package/{dist-types → dist}/rspack-plugins/resource-hints/HtmlResourceHintsPlugin.d.ts +1 -1
- package/{dist-types → dist}/rspack-plugins/resource-hints/doesChunkBelongToHtml.d.ts +1 -1
- package/{dist-types → dist}/rspack-plugins/resource-hints/extractChunks.d.ts +1 -1
- package/{dist-types → dist}/rspackConfig.d.ts +1 -1
- package/{dist-types → dist}/server/assets-middleware/getFileFromUrl.d.ts +1 -1
- package/{dist-types → dist}/server/assets-middleware/index.d.ts +2 -2
- package/{dist-types → dist}/server/assets-middleware/middleware.d.ts +1 -1
- package/{dist-types → dist}/server/assets-middleware/setupOutputFileSystem.d.ts +1 -1
- package/{dist-types → dist}/server/assets-middleware/setupWriteToDisk.d.ts +2 -2
- package/{dist-types → dist}/server/browserLogs.d.ts +1 -1
- package/{dist-types → dist}/server/buildManager.d.ts +3 -3
- package/{dist-types → dist}/server/cliShortcuts.d.ts +2 -2
- package/{dist-types → dist}/server/devMiddlewares.d.ts +4 -4
- package/{dist-types → dist}/server/devServer.d.ts +4 -4
- package/{dist-types → dist}/server/environment.d.ts +1 -1
- package/{dist-types → dist}/server/gzipMiddleware.d.ts +1 -1
- package/{dist-types → dist}/server/helper.d.ts +4 -4
- package/{dist-types → dist}/server/historyApiFallback.d.ts +2 -2
- package/{dist-types → dist}/server/httpServer.d.ts +1 -1
- package/{dist-types → dist}/server/middlewares.d.ts +2 -2
- package/{dist-types → dist}/server/open.d.ts +2 -2
- package/{dist-types → dist}/server/previewServer.d.ts +2 -2
- package/{dist-types → dist}/server/proxy.d.ts +3 -3
- package/{dist-types → dist}/server/runner/basic.d.ts +1 -1
- package/{dist-types → dist}/server/runner/cjs.d.ts +2 -2
- package/{dist-types → dist}/server/runner/esm.d.ts +2 -2
- package/{dist-types → dist}/server/runner/index.d.ts +1 -1
- package/{dist-types → dist}/server/serverSetup.d.ts +1 -1
- package/{dist-types → dist}/server/socketServer.d.ts +1 -1
- package/{dist-types → dist}/server/watchFiles.d.ts +4 -3
- package/dist/sirv.js +1 -1
- package/dist/tinyglobby.js +1 -1670
- package/{dist-types → dist}/types/config.d.ts +24 -15
- package/{dist-types → dist}/types/context.d.ts +9 -9
- package/{dist-types → dist}/types/hooks.d.ts +31 -15
- package/dist/types/index.d.ts +8 -0
- package/{dist-types → dist}/types/plugin.d.ts +7 -7
- package/{dist-types → dist}/types/rsbuild.d.ts +15 -14
- package/{dist-types → dist}/types/rspack.d.ts +2 -2
- package/{dist-types → dist}/types/thirdParty.d.ts +5 -5
- package/dist/ws.js +2 -1524
- package/package.json +9 -10
- package/dist-types/build.d.ts +0 -4
- package/dist-types/package.json +0 -1
- package/dist-types/plugins/cache.d.ts +0 -2
- package/dist-types/plugins/entry.d.ts +0 -2
- package/dist-types/plugins/nonce.d.ts +0 -2
- package/dist-types/plugins/sri.d.ts +0 -2
- package/dist-types/plugins/wasm.d.ts +0 -2
- package/dist-types/restart.d.ts +0 -14
- package/dist-types/types/index.d.ts +0 -8
- /package/dist/{711.js.LICENSE.txt → 626.js.LICENSE.txt} +0 -0
- /package/{dist-types → dist}/cli/index.d.ts +0 -0
- /package/dist/client/{307.js → 307~0.js} +0 -0
- /package/{dist-types → dist}/constants.d.ts +0 -0
- /package/{dist-types → dist}/helpers/exitHook.d.ts +0 -0
- /package/{dist-types → dist}/helpers/packageJson.d.ts +0 -0
- /package/{dist-types → dist}/helpers/version.d.ts +0 -0
- /package/{dist-types → dist}/loadEnv.d.ts +0 -0
- /package/{dist-types → dist}/loader/workerLoader.d.ts +0 -0
- /package/dist/{1~rslib-runtime.js → rslib-runtime.js} +0 -0
- /package/{dist-types → dist}/rspack-plugins/resource-hints/getResourceType.d.ts +0 -0
- /package/{dist-types → dist}/server/ansiHTML.d.ts +0 -0
- /package/{dist-types → dist}/server/assets-middleware/parseTokenList.d.ts +0 -0
- /package/{dist-types → dist}/server/compileState.d.ts +0 -0
- /package/{dist-types → dist}/server/gracefulShutdown.d.ts +0 -0
- /package/{dist-types → dist}/server/hmrFallback.d.ts +0 -0
- /package/{dist-types → dist}/server/overlay.d.ts +0 -0
- /package/{dist-types → dist}/server/publicPathnames.d.ts +0 -0
- /package/{dist-types → dist}/server/runner/asModule.d.ts +0 -0
- /package/{dist-types → dist}/server/runner/type.d.ts +0 -0
- /package/{dist-types → dist}/types/utils.d.ts +0 -0
|
@@ -3,20 +3,20 @@ import type { SecureServerSessionOptions } from 'node:http2';
|
|
|
3
3
|
import type { ServerOptions as HttpsServerOptions } from 'node:https';
|
|
4
4
|
import type { URL } from 'node:url';
|
|
5
5
|
import type { CopyRspackPluginOptions, DefinePluginOptions, Externals, LightningCssMinimizerRspackPluginOptions, ModuleFederationPluginOptions, RuleSetCondition, SwcJsMinimizerRspackPluginOptions, SwcLoaderOptions } from '@rspack/core';
|
|
6
|
-
import type { ChokidarOptions } from '../../compiled/chokidar';
|
|
7
|
-
import type Cors from '../../compiled/cors';
|
|
8
|
-
import type { Options as HttpProxyOptions, Filter as ProxyFilter } from '../../compiled/http-proxy-middleware';
|
|
9
|
-
import type { RspackChain } from '../../compiled/rspack-chain/types';
|
|
10
|
-
import type { FileDescriptor } from '../../compiled/rspack-manifest-plugin';
|
|
11
|
-
import type { HotSend, RsbuildDevServer } from '../server/devServer';
|
|
12
|
-
import type { RsbuildPreviewServer } from '../server/previewServer';
|
|
13
|
-
import type { Logger } from '../logger';
|
|
14
|
-
import type { EnvironmentContext, ModifyBundlerChainUtils, ModifyChainUtils, Routes } from './hooks';
|
|
15
|
-
import type { RsbuildPlugins } from './plugin';
|
|
16
|
-
import type { RsbuildEntry, RsbuildMode, RsbuildTarget } from './rsbuild';
|
|
17
|
-
import type { Rspack, RspackRule } from './rspack';
|
|
18
|
-
import type { Connect, CSSExtractOptions, CSSLoaderModulesOptions, CSSLoaderOptions, HtmlRspackPlugin, LoosePostCSSPlugin, PostCSSLoaderOptions, StyleLoaderOptions } from './thirdParty';
|
|
19
|
-
import type { ConfigChain, ConfigChainAsyncWithContext, ConfigChainWithContext, LiteralUnion, MaybePromise, OneOrMany, Optional, TwoLevelReadonly } from './utils';
|
|
6
|
+
import type { ChokidarOptions } from '../../compiled/chokidar/index.js';
|
|
7
|
+
import type Cors from '../../compiled/cors/index.js';
|
|
8
|
+
import type { Options as HttpProxyOptions, Filter as ProxyFilter } from '../../compiled/http-proxy-middleware/index.js';
|
|
9
|
+
import type { RspackChain } from '../../compiled/rspack-chain/types/index.js';
|
|
10
|
+
import type { FileDescriptor } from '../../compiled/rspack-manifest-plugin/index.js';
|
|
11
|
+
import type { HotSend, RsbuildDevServer } from '../server/devServer.js';
|
|
12
|
+
import type { RsbuildPreviewServer } from '../server/previewServer.js';
|
|
13
|
+
import type { Logger } from '../logger.js';
|
|
14
|
+
import type { EnvironmentContext, ModifyBundlerChainUtils, ModifyChainUtils, Routes, WatchFileEvent } from './hooks.js';
|
|
15
|
+
import type { RsbuildPlugins } from './plugin.js';
|
|
16
|
+
import type { RsbuildEntry, RsbuildMode, RsbuildTarget } from './rsbuild.js';
|
|
17
|
+
import type { Rspack, RspackRule } from './rspack.js';
|
|
18
|
+
import type { Connect, CSSExtractOptions, CSSLoaderModulesOptions, CSSLoaderOptions, HtmlRspackPlugin, LoosePostCSSPlugin, PostCSSLoaderOptions, StyleLoaderOptions } from './thirdParty.js';
|
|
19
|
+
import type { ConfigChain, ConfigChainAsyncWithContext, ConfigChainWithContext, LiteralUnion, MaybePromise, OneOrMany, Optional, TwoLevelReadonly } from './utils.js';
|
|
20
20
|
export type ToolsSwcConfig = ConfigChain<SwcLoaderOptions>;
|
|
21
21
|
export type ToolsBundlerChainConfig = OneOrMany<(chain: RspackChain, utils: ModifyBundlerChainUtils) => MaybePromise<void>>;
|
|
22
22
|
export type ToolsPostCSSContext = {
|
|
@@ -883,8 +883,10 @@ export type Minify = boolean | {
|
|
|
883
883
|
*/ css?: boolean | 'always';
|
|
884
884
|
/**
|
|
885
885
|
* Minimizer options of CSS, which will be passed to LightningCSS.
|
|
886
|
+
* When using an array, each item registers a separate minimizer and the first matching item
|
|
887
|
+
* applies to each CSS asset.
|
|
886
888
|
* @default inherit from `tools.lightningcssLoader` config
|
|
887
|
-
*/ cssOptions?: LightningCssMinimizerRspackPluginOptions
|
|
889
|
+
*/ cssOptions?: OneOrMany<LightningCssMinimizerRspackPluginOptions>;
|
|
888
890
|
};
|
|
889
891
|
export type InlineChunkTestFunction = (params: {
|
|
890
892
|
size: number;
|
|
@@ -1499,6 +1501,13 @@ export type WatchFiles = {
|
|
|
1499
1501
|
* Paths of the files or directories to watch, supports glob syntax.
|
|
1500
1502
|
*/ paths: string | string[];
|
|
1501
1503
|
/**
|
|
1504
|
+
* File events that trigger the configured action.
|
|
1505
|
+
* - `add`: A file is created.
|
|
1506
|
+
* - `change`: A file is modified.
|
|
1507
|
+
* - `unlink`: A file is deleted.
|
|
1508
|
+
* @default ['add', 'change', 'unlink']
|
|
1509
|
+
*/ events?: WatchFileEvent[];
|
|
1510
|
+
/**
|
|
1502
1511
|
* Watch options passed to [chokidar](https://github.com/paulmillr/chokidar).
|
|
1503
1512
|
*/ options?: ChokidarOptions;
|
|
1504
1513
|
/**
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type { Hooks } from '../hooks';
|
|
2
|
-
import type { RestartManager } from '../helpers/restartManager';
|
|
3
|
-
import type { Logger } from '../logger';
|
|
4
|
-
import type { SocketServer } from '../server/socketServer';
|
|
5
|
-
import type { NormalizedConfig, RsbuildConfig } from './config';
|
|
6
|
-
import type { EnvironmentContext } from './hooks';
|
|
7
|
-
import type { RsbuildPluginAPI } from './plugin';
|
|
8
|
-
import type { RsbuildStats } from './rsbuild';
|
|
1
|
+
import type { Hooks } from '../hooks.js';
|
|
2
|
+
import type { RestartManager } from '../helpers/restartManager.js';
|
|
3
|
+
import type { Logger } from '../logger.js';
|
|
4
|
+
import type { SocketServer } from '../server/socketServer.js';
|
|
5
|
+
import type { NormalizedConfig, RsbuildConfig } from './config.js';
|
|
6
|
+
import type { EnvironmentContext } from './hooks.js';
|
|
7
|
+
import type { RsbuildPluginAPI } from './plugin.js';
|
|
8
|
+
import type { RsbuildStats } from './rsbuild.js';
|
|
9
9
|
export type BundlerType = 'rspack';
|
|
10
10
|
export type ActionType = 'dev' | 'build' | 'preview';
|
|
11
11
|
/** The public context */ export type RsbuildContext = {
|
|
@@ -24,7 +24,7 @@ export type ActionType = 'dev' | 'build' | 'preview';
|
|
|
24
24
|
* import { createRsbuild } from '@rsbuild/core';
|
|
25
25
|
*
|
|
26
26
|
* async function main() {
|
|
27
|
-
* const rsbuild = createRsbuild({
|
|
27
|
+
* const rsbuild = await createRsbuild({
|
|
28
28
|
* // ...
|
|
29
29
|
* });
|
|
30
30
|
* await rsbuild.startDevServer();
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type { rspack } from '@rspack/core';
|
|
2
|
-
import type { ChainIdentifier, ManifestData } from '
|
|
3
|
-
import type { RsbuildDevServer } from '../server/devServer';
|
|
4
|
-
import type { RsbuildPreviewServer } from '../server/previewServer';
|
|
5
|
-
import type { RspackChain } from '../types';
|
|
6
|
-
import type { EnvironmentConfig, HtmlBasicTag, MergedEnvironmentConfig, NormalizedEnvironmentConfig, RsbuildConfig } from './config';
|
|
7
|
-
import type { RsbuildEntry, RsbuildTarget } from './rsbuild';
|
|
8
|
-
import type { Rspack } from './rspack';
|
|
9
|
-
import type { HtmlRspackPlugin } from './thirdParty';
|
|
10
|
-
import type { MaybePromise } from './utils';
|
|
2
|
+
import type { ChainIdentifier, ManifestData } from '../index.js';
|
|
3
|
+
import type { RsbuildDevServer } from '../server/devServer.js';
|
|
4
|
+
import type { RsbuildPreviewServer } from '../server/previewServer.js';
|
|
5
|
+
import type { RspackChain } from '../types/index.js';
|
|
6
|
+
import type { EnvironmentConfig, HtmlBasicTag, MergedEnvironmentConfig, NormalizedEnvironmentConfig, RsbuildConfig } from './config.js';
|
|
7
|
+
import type { BuildOptions, RsbuildEntry, RsbuildTarget, StartDevServerOptions } from './rsbuild.js';
|
|
8
|
+
import type { Rspack } from './rspack.js';
|
|
9
|
+
import type { HtmlRspackPlugin } from './thirdParty.js';
|
|
10
|
+
import type { MaybePromise } from './utils.js';
|
|
11
11
|
type CompileCommonParams = {
|
|
12
12
|
isFirstCompile: boolean;
|
|
13
13
|
isWatch: boolean;
|
|
@@ -102,15 +102,31 @@ export type OnAfterCreateCompilerFn<Compiler = Rspack.Compiler | Rspack.MultiCom
|
|
|
102
102
|
export type OnExitFn = (context: {
|
|
103
103
|
exitCode: number;
|
|
104
104
|
}) => void;
|
|
105
|
+
export type WatchFileEvent = 'add' | 'change' | 'unlink';
|
|
105
106
|
export type RestartContext = {
|
|
106
107
|
/**
|
|
107
|
-
* The current Rsbuild action being restarted.
|
|
108
|
-
*/ action: 'dev' | 'build';
|
|
109
|
-
/**
|
|
110
108
|
* The absolute path of the file that triggered the restart.
|
|
111
109
|
* It is undefined when the restart is manually triggered.
|
|
112
110
|
*/ filePath?: string;
|
|
113
|
-
|
|
111
|
+
/**
|
|
112
|
+
* The file event that triggered the restart.
|
|
113
|
+
* It is undefined when the restart is manually triggered.
|
|
114
|
+
*/ event?: WatchFileEvent;
|
|
115
|
+
} & ({
|
|
116
|
+
/**
|
|
117
|
+
* The current Rsbuild action being restarted.
|
|
118
|
+
*/ action: 'build';
|
|
119
|
+
/**
|
|
120
|
+
* The options passed to `rsbuild.build()`.
|
|
121
|
+
*/ options: BuildOptions;
|
|
122
|
+
} | {
|
|
123
|
+
/**
|
|
124
|
+
* The current Rsbuild action being restarted.
|
|
125
|
+
*/ action: 'dev';
|
|
126
|
+
/**
|
|
127
|
+
* The options passed to `rsbuild.startDevServer()`.
|
|
128
|
+
*/ options: StartDevServerOptions;
|
|
129
|
+
});
|
|
114
130
|
/** Restart the current Rsbuild task and return whether the restart succeeded. */ export type RestartFn = (context: RestartContext) => MaybePromise<boolean>;
|
|
115
131
|
export type OnRestartFn = (context: RestartContext) => MaybePromise<void>;
|
|
116
132
|
export type ModifyHTMLContext = {
|
|
@@ -188,8 +204,8 @@ export type EnvironmentContext = {
|
|
|
188
204
|
*/ manifest?: Record<string, unknown> | ManifestData;
|
|
189
205
|
/**
|
|
190
206
|
* WebSocket authentication token, used to authenticate WebSocket connections and
|
|
191
|
-
* prevent unauthorized access.
|
|
192
|
-
* an empty string
|
|
207
|
+
* prevent unauthorized access. It contains a token when running the `dev` action
|
|
208
|
+
* and is an empty string for other actions.
|
|
193
209
|
*/ webSocketToken: string;
|
|
194
210
|
};
|
|
195
211
|
export type ModifyChainUtils = {
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type * from './config.js';
|
|
2
|
+
export type * from './context.js';
|
|
3
|
+
export type * from './hooks.js';
|
|
4
|
+
export type * from './plugin.js';
|
|
5
|
+
export type * from './rsbuild.js';
|
|
6
|
+
export type * from './rspack.js';
|
|
7
|
+
export type * from './thirdParty.js';
|
|
8
|
+
export type * from './utils.js';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type { Logger } from '../logger';
|
|
2
|
-
import type { ModifyRspackConfigUtils, NarrowedRspackConfig, NormalizedConfig, NormalizedEnvironmentConfig, RsbuildConfig } from './config';
|
|
3
|
-
import type { RsbuildContext } from './context';
|
|
4
|
-
import type { EnvironmentContext, ModifyBundlerChainFn, ModifyEnvironmentConfigFn, ModifyHTMLFn, ModifyHTMLTagsFn, ModifyRsbuildConfigFn, OnAfterBuildFn, OnAfterCreateCompilerFn, OnAfterDevCompileFn, OnAfterEnvironmentCompileFn, OnAfterStartDevServerFn, OnAfterStartPreviewServerFn, OnBeforeBuildFn, OnBeforeCreateCompilerFn, OnBeforeDevCompileFn, OnBeforeEnvironmentCompileFn, OnBeforeStartDevServerFn, OnBeforeStartPreviewServerFn, OnCloseBuildFn, OnCloseDevServerFn, OnExitFn, OnRestartFn } from './hooks';
|
|
5
|
-
import type { AddPluginsOptions, RsbuildInstance, RsbuildTarget } from './rsbuild';
|
|
6
|
-
import type { Rspack } from './rspack';
|
|
7
|
-
import type { Falsy, MaybePromise } from './utils';
|
|
1
|
+
import type { Logger } from '../logger.js';
|
|
2
|
+
import type { ModifyRspackConfigUtils, NarrowedRspackConfig, NormalizedConfig, NormalizedEnvironmentConfig, RsbuildConfig } from './config.js';
|
|
3
|
+
import type { RsbuildContext } from './context.js';
|
|
4
|
+
import type { EnvironmentContext, ModifyBundlerChainFn, ModifyEnvironmentConfigFn, ModifyHTMLFn, ModifyHTMLTagsFn, ModifyRsbuildConfigFn, OnAfterBuildFn, OnAfterCreateCompilerFn, OnAfterDevCompileFn, OnAfterEnvironmentCompileFn, OnAfterStartDevServerFn, OnAfterStartPreviewServerFn, OnBeforeBuildFn, OnBeforeCreateCompilerFn, OnBeforeDevCompileFn, OnBeforeEnvironmentCompileFn, OnBeforeStartDevServerFn, OnBeforeStartPreviewServerFn, OnCloseBuildFn, OnCloseDevServerFn, OnExitFn, OnRestartFn } from './hooks.js';
|
|
5
|
+
import type { AddPluginsOptions, RsbuildInstance, RsbuildTarget } from './rsbuild.js';
|
|
6
|
+
import type { Rspack } from './rspack.js';
|
|
7
|
+
import type { Falsy, MaybePromise } from './utils.js';
|
|
8
8
|
type HookOrder = 'pre' | 'post' | 'default';
|
|
9
9
|
export type HookDescriptor<T extends (...args: any[]) => any> = {
|
|
10
10
|
handler: T;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import type { Compiler, MultiCompiler } from '@rspack/core';
|
|
2
|
-
import type { LoadConfigResult } from '../loadConfig';
|
|
3
|
-
import type { LoadEnvOptions } from '../loadEnv';
|
|
4
|
-
import type { Logger } from '../logger';
|
|
5
|
-
import type { RsbuildDevServer } from '../server/devServer';
|
|
6
|
-
import type { StartDevServerResult, StartPreviewServerResult } from '../server/helper';
|
|
7
|
-
import type { NormalizedConfig, NormalizedEnvironmentConfig, RsbuildConfig } from './config';
|
|
8
|
-
import type { RsbuildContext } from './context';
|
|
9
|
-
import type { RestartFn } from './hooks';
|
|
10
|
-
import type { RsbuildPlugin, RsbuildPluginAPI } from './plugin';
|
|
11
|
-
import type { Rspack } from './rspack';
|
|
12
|
-
import type { Falsy } from './utils';
|
|
2
|
+
import type { LoadConfigResult } from '../loadConfig.js';
|
|
3
|
+
import type { LoadEnvOptions } from '../loadEnv.js';
|
|
4
|
+
import type { Logger } from '../logger.js';
|
|
5
|
+
import type { RsbuildDevServer } from '../server/devServer.js';
|
|
6
|
+
import type { StartDevServerResult, StartPreviewServerResult } from '../server/helper.js';
|
|
7
|
+
import type { NormalizedConfig, NormalizedEnvironmentConfig, RsbuildConfig } from './config.js';
|
|
8
|
+
import type { RsbuildContext } from './context.js';
|
|
9
|
+
import type { RestartFn } from './hooks.js';
|
|
10
|
+
import type { RsbuildPlugin, RsbuildPluginAPI } from './plugin.js';
|
|
11
|
+
import type { Rspack } from './rspack.js';
|
|
12
|
+
import type { Falsy } from './utils.js';
|
|
13
13
|
export type StartDevServerOptions = {
|
|
14
14
|
/**
|
|
15
15
|
* Whether to get port silently and not print any logs.
|
|
@@ -52,8 +52,9 @@ export type InitConfigsOptions = Pick<RsbuildContext, 'action'>;
|
|
|
52
52
|
export type InspectConfigOptions = {
|
|
53
53
|
/**
|
|
54
54
|
* Inspect the config in the specified mode.
|
|
55
|
-
* Available options: 'development' or '
|
|
56
|
-
* @default 'development'
|
|
55
|
+
* Available options: 'development', 'production', or 'none'.
|
|
56
|
+
* @default Inferred from `process.env.NODE_ENV`: 'development' when unset,
|
|
57
|
+
* 'development' or 'production' when matching, otherwise 'none'.
|
|
57
58
|
*/ mode?: RsbuildMode;
|
|
58
59
|
/**
|
|
59
60
|
* Enables verbose mode to display the complete function
|
|
@@ -62,7 +63,7 @@ export type InspectConfigOptions = {
|
|
|
62
63
|
*/ verbose?: boolean;
|
|
63
64
|
/**
|
|
64
65
|
* Specify the output path for inspection results.
|
|
65
|
-
* @default '
|
|
66
|
+
* @default '<context.distPath>/.rsbuild'
|
|
66
67
|
*/ outputPath?: string;
|
|
67
68
|
/**
|
|
68
69
|
* Whether to write the inspection results to disk.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type * as Rspack from '@rspack/core';
|
|
2
|
-
import type { RspackChain } from '../../compiled/rspack-chain/types';
|
|
3
|
-
import type { TransformHandler } from './plugin';
|
|
2
|
+
import type { RspackChain } from '../../compiled/rspack-chain/types/index.js';
|
|
3
|
+
import type { TransformHandler } from './plugin.js';
|
|
4
4
|
export type { Rspack, RspackChain };
|
|
5
5
|
declare module '@rspack/core' {
|
|
6
6
|
interface Compiler {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { CssExtractRspackLoaderOptions, CssExtractRspackPluginOptions } from '@rspack/core';
|
|
2
|
-
import type * as Connect from '../../compiled/connect-next';
|
|
3
|
-
import type HtmlRspackPlugin from '../../compiled/html-rspack-plugin';
|
|
4
|
-
import type { AcceptedPlugin, ProcessOptions } from '../../compiled/postcss';
|
|
5
|
-
import type { Rspack } from './rspack';
|
|
6
|
-
import type { LiteralUnion } from './utils';
|
|
2
|
+
import type * as Connect from '../../compiled/connect-next/index.js';
|
|
3
|
+
import type HtmlRspackPlugin from '../../compiled/html-rspack-plugin/index.js';
|
|
4
|
+
import type { AcceptedPlugin, ProcessOptions } from '../../compiled/postcss/lib/postcss.js';
|
|
5
|
+
import type { Rspack } from './rspack.js';
|
|
6
|
+
import type { LiteralUnion } from './utils.js';
|
|
7
7
|
export type { Connect };
|
|
8
8
|
export type { HtmlRspackPlugin };
|
|
9
9
|
export interface CSSExtractOptions {
|