@rsbuild/core 0.7.10 → 1.0.0-alpha.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.
- package/compiled/css-loader/index.js +46 -46
- package/compiled/launch-editor-middleware/index.js +58 -22
- package/compiled/launch-editor-middleware/package.json +1 -1
- package/compiled/postcss-load-config/index.js +10 -10
- package/compiled/postcss-loader/index.js +43 -43
- package/compiled/rspack-manifest-plugin/index.js +4 -4
- package/compiled/style-loader/index.js +10 -10
- package/compiled/webpack-dev-middleware/index.js +31 -31
- package/dist/client/hmr.js +1 -3
- package/dist/index.cjs +4208 -1299
- package/dist/index.js +4125 -1239
- package/dist-types/cli/init.d.ts +2 -1
- package/dist-types/client/hmr.d.ts +0 -4
- package/dist-types/config.d.ts +25 -6
- package/dist-types/configChain.d.ts +1 -1
- package/dist-types/constants.d.ts +6 -4
- package/dist-types/createContext.d.ts +6 -3
- package/dist-types/createRsbuild.d.ts +1 -5
- package/dist-types/helpers/path.d.ts +10 -0
- package/dist-types/helpers.d.ts +21 -19
- package/dist-types/index.d.ts +3 -3
- package/dist-types/initHooks.d.ts +2 -1
- package/dist-types/initPlugins.d.ts +3 -3
- package/dist-types/internal.d.ts +2 -3
- package/dist-types/mergeConfig.d.ts +1 -1
- package/dist-types/plugins/css.d.ts +3 -4
- package/dist-types/plugins/entry.d.ts +1 -3
- package/dist-types/plugins/html.d.ts +2 -11
- package/dist-types/plugins/minimize.d.ts +4 -4
- package/dist-types/plugins/rspackProfile.d.ts +0 -3
- package/dist-types/plugins/swc.d.ts +2 -2
- package/dist-types/provider/inspectConfig.d.ts +1 -1
- package/dist-types/provider/rspackConfig.d.ts +4 -3
- package/dist-types/rspack/HtmlBasicPlugin.d.ts +3 -6
- package/dist-types/rspack/InlineChunkHtmlPlugin.d.ts +7 -24
- package/dist-types/rspack/preload/HtmlPreloadOrPrefetchPlugin.d.ts +1 -1
- package/dist-types/rspack/preload/helpers/extractChunks.d.ts +4 -1
- package/dist-types/server/compilerDevMiddleware.d.ts +0 -2
- package/dist-types/server/devMiddleware.d.ts +5 -11
- package/dist-types/server/devServer.d.ts +3 -1
- package/dist-types/server/environment.d.ts +7 -0
- package/dist-types/server/getDevMiddlewares.d.ts +2 -1
- package/dist-types/server/helper.d.ts +4 -13
- package/dist-types/server/httpServer.d.ts +3 -4
- package/dist-types/server/prodServer.d.ts +2 -4
- package/dist-types/server/proxy.d.ts +1 -2
- package/dist-types/server/restart.d.ts +1 -1
- package/dist-types/server/runner/asModule.d.ts +2 -0
- package/dist-types/server/runner/basic.d.ts +25 -0
- package/dist-types/server/runner/cjs.d.ts +10 -0
- package/dist-types/server/runner/esm.d.ts +6 -0
- package/dist-types/server/runner/index.d.ts +8 -0
- package/dist-types/server/runner/type.d.ts +36 -0
- package/dist-types/server/socketServer.d.ts +1 -4
- package/dist-types/types.d.ts +4 -3
- package/package.json +12 -10
- package/types.d.ts +0 -4
package/dist-types/cli/init.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import type { RsbuildInstance } from '../types';
|
|
1
2
|
import type { CommonOptions } from './commands';
|
|
2
3
|
export declare function init({ cliOptions, isRestart, }: {
|
|
3
4
|
cliOptions?: CommonOptions;
|
|
4
5
|
isRestart?: boolean;
|
|
5
|
-
}): Promise<
|
|
6
|
+
}): Promise<RsbuildInstance | undefined>;
|
package/dist-types/config.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { InspectConfigOptions, NormalizedConfig, PublicDir, PublicDirOptions, RsbuildConfig } from '@rsbuild/shared';
|
|
1
|
+
import type { InspectConfigOptions, InspectConfigResult, NormalizedConfig, PluginManager, PublicDir, PublicDirOptions, RsbuildConfig, RsbuildEntry } from '@rsbuild/shared';
|
|
2
|
+
export declare function getDefaultEntry(root: string): RsbuildEntry;
|
|
2
3
|
export declare const withDefaultConfig: (rootPath: string, config: RsbuildConfig) => Promise<RsbuildConfig>;
|
|
3
4
|
/** #__PURE__
|
|
4
5
|
* 1. May used by multiple plugins.
|
|
@@ -31,14 +32,32 @@ export declare function loadConfig({ cwd, path, envMode, }?: {
|
|
|
31
32
|
content: RsbuildConfig;
|
|
32
33
|
filePath: string | null;
|
|
33
34
|
}>;
|
|
34
|
-
export declare
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
export declare const getRsbuildInspectConfig: ({ normalizedConfig, inspectOptions, pluginManager, }: {
|
|
36
|
+
normalizedConfig: NormalizedConfig;
|
|
37
|
+
inspectOptions: InspectConfigOptions;
|
|
38
|
+
pluginManager: PluginManager;
|
|
39
|
+
}) => {
|
|
37
40
|
rawRsbuildConfig: string;
|
|
38
|
-
|
|
41
|
+
rsbuildConfig: InspectConfigResult["origin"]["rsbuildConfig"];
|
|
42
|
+
rawEnvironmentConfigs: Array<{
|
|
43
|
+
name: string;
|
|
44
|
+
content: string;
|
|
45
|
+
}>;
|
|
46
|
+
environmentConfigs: InspectConfigResult["origin"]["environmentConfigs"];
|
|
47
|
+
};
|
|
48
|
+
export declare function outputInspectConfigFiles({ rawBundlerConfigs, rawEnvironmentConfigs, inspectOptions, configType, }: {
|
|
49
|
+
configType: string;
|
|
50
|
+
rawEnvironmentConfigs: Array<{
|
|
51
|
+
name: string;
|
|
52
|
+
content: string;
|
|
53
|
+
}>;
|
|
54
|
+
rawBundlerConfigs: Array<{
|
|
55
|
+
name: string;
|
|
56
|
+
content: string;
|
|
57
|
+
}>;
|
|
39
58
|
inspectOptions: InspectConfigOptions & {
|
|
40
59
|
outputPath: string;
|
|
41
60
|
};
|
|
42
61
|
}): Promise<void>;
|
|
43
|
-
export declare function stringifyConfig(config: unknown, verbose?: boolean):
|
|
62
|
+
export declare function stringifyConfig(config: unknown, verbose?: boolean): string;
|
|
44
63
|
export declare const normalizePublicDirs: (publicDir?: PublicDir) => Required<PublicDirOptions>[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type CreateAsyncHook, type ModifyBundlerChainFn, type ModifyBundlerChainUtils, type RsbuildContext, RspackChain, type RspackConfig } from '@rsbuild/shared';
|
|
2
2
|
import type { RsbuildConfig } from './types';
|
|
3
|
-
export declare function getBundlerChain():
|
|
3
|
+
export declare function getBundlerChain(): RspackChain;
|
|
4
4
|
export declare function modifyBundlerChain(context: RsbuildContext & {
|
|
5
5
|
hooks: {
|
|
6
6
|
modifyBundlerChain: CreateAsyncHook<ModifyBundlerChainFn>;
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
import type { RsbuildTarget } from '@rsbuild/shared';
|
|
2
1
|
export declare const ROOT_DIST_DIR = "dist";
|
|
3
2
|
export declare const HTML_DIST_DIR = "/";
|
|
4
|
-
export declare const SERVER_DIST_DIR = "server";
|
|
5
|
-
export declare const SERVICE_WORKER_DIST_DIR = "worker";
|
|
6
3
|
export declare const JS_DIST_DIR = "static/js";
|
|
7
4
|
export declare const CSS_DIST_DIR = "static/css";
|
|
8
5
|
export declare const SVG_DIST_DIR = "static/svg";
|
|
@@ -14,16 +11,21 @@ export declare const LOADER_PATH: string;
|
|
|
14
11
|
export declare const STATIC_PATH: string;
|
|
15
12
|
export declare const COMPILED_PATH: string;
|
|
16
13
|
export declare const TS_CONFIG_FILE = "tsconfig.json";
|
|
14
|
+
export declare const HMR_SOCKET_PATH = "/rsbuild-hmr";
|
|
17
15
|
export declare const DEFAULT_PORT = 3000;
|
|
18
16
|
export declare const DEFAULT_DATA_URL_SIZE = 4096;
|
|
19
17
|
export declare const DEFAULT_MOUNT_ID = "root";
|
|
20
18
|
export declare const DEFAULT_DEV_HOST = "0.0.0.0";
|
|
19
|
+
export declare const DEFAULT_ASSET_PREFIX = "/";
|
|
20
|
+
export declare const DEFAULT_WEB_BROWSERSLIST: string[];
|
|
21
|
+
export declare const DEFAULT_BROWSERSLIST: Record<string, string[]>;
|
|
21
22
|
export declare const HTML_REGEX: RegExp;
|
|
23
|
+
export declare const JS_REGEX: RegExp;
|
|
22
24
|
export declare const CSS_REGEX: RegExp;
|
|
25
|
+
export declare const NODE_MODULES_REGEX: RegExp;
|
|
23
26
|
export declare const PLUGIN_SWC_NAME = "rsbuild:swc";
|
|
24
27
|
export declare const PLUGIN_CSS_NAME = "rsbuild:css";
|
|
25
28
|
export declare const FONT_EXTENSIONS: string[];
|
|
26
29
|
export declare const IMAGE_EXTENSIONS: string[];
|
|
27
30
|
export declare const VIDEO_EXTENSIONS: string[];
|
|
28
31
|
export declare const AUDIO_EXTENSIONS: string[];
|
|
29
|
-
export declare const TARGET_ID_MAP: Record<RsbuildTarget, string>;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import type { BundlerType, RsbuildContext } from '@rsbuild/shared';
|
|
2
|
-
import type { CreateRsbuildOptions, InternalContext,
|
|
3
|
-
export declare function
|
|
1
|
+
import type { BundlerType, NormalizedEnvironmentConfig, RsbuildContext } from '@rsbuild/shared';
|
|
2
|
+
import type { CreateRsbuildOptions, InternalContext, RsbuildConfig } from './types';
|
|
3
|
+
export declare function getBrowserslist(path: string): Promise<string[] | null>;
|
|
4
|
+
export declare function getBrowserslistByEnvironment(path: string, config: NormalizedEnvironmentConfig): Promise<string[]>;
|
|
5
|
+
export declare function updateEnvironmentContext(context: InternalContext, configs: Record<string, NormalizedEnvironmentConfig>): Promise<void>;
|
|
6
|
+
export declare function updateContextByNormalizedConfig(context: InternalContext): void;
|
|
4
7
|
export declare function createPublicContext(context: RsbuildContext): Readonly<RsbuildContext>;
|
|
5
8
|
/**
|
|
6
9
|
* Generate the actual context used in the build,
|
|
@@ -1,6 +1,2 @@
|
|
|
1
|
-
import type { CreateRsbuildOptions,
|
|
2
|
-
/**
|
|
3
|
-
* Omit unused keys from Rsbuild config passed by user
|
|
4
|
-
*/
|
|
5
|
-
export declare const pickRsbuildConfig: (rsbuildConfig: RsbuildConfig) => RsbuildConfig;
|
|
1
|
+
import type { CreateRsbuildOptions, RsbuildInstance } from './types';
|
|
6
2
|
export declare function createRsbuild(options?: CreateRsbuildOptions): Promise<RsbuildInstance>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare function getCommonParentPath(paths: string[]): string;
|
|
2
|
+
export declare const getCompiledPath: (packageName: string) => string;
|
|
3
|
+
/**
|
|
4
|
+
* ensure absolute file path.
|
|
5
|
+
* @param base - Base path to resolve relative from.
|
|
6
|
+
* @param filePath - Absolute or relative file path.
|
|
7
|
+
* @returns Resolved absolute file path.
|
|
8
|
+
*/
|
|
9
|
+
export declare const ensureAbsolutePath: (base: string, filePath: string) => string;
|
|
10
|
+
export declare const pathnameParse: (publicPath: string) => string;
|
package/dist-types/helpers.d.ts
CHANGED
|
@@ -1,31 +1,29 @@
|
|
|
1
|
-
import { type FilenameConfig, type MultiStats, type NormalizedConfig, type RsbuildTarget, type Rspack, type RspackChain, type Stats } from '@rsbuild/shared';
|
|
1
|
+
import { type FilenameConfig, type MultiStats, type NodeEnv, type NormalizedConfig, type NormalizedEnvironmentConfig, type RsbuildTarget, type Rspack, type RspackChain, type Stats } from '@rsbuild/shared';
|
|
2
2
|
import type { StatsCompilation, StatsValue } from '@rspack/core';
|
|
3
3
|
import type { Compiler as WebpackCompiler, MultiCompiler as WebpackMultiCompiler } from 'webpack';
|
|
4
|
-
export declare const rspackMinVersion = "0.
|
|
4
|
+
export declare const rspackMinVersion = "0.7.0";
|
|
5
|
+
export declare const getNodeEnv: () => NodeEnv;
|
|
6
|
+
export declare const setNodeEnv: (env: NodeEnv) => void;
|
|
7
|
+
export declare const isDev: () => boolean;
|
|
8
|
+
export declare const isProd: () => boolean;
|
|
9
|
+
export declare const isNil: (o: unknown) => o is undefined | null;
|
|
10
|
+
export declare const isFunction: (func: unknown) => func is (...args: any[]) => any;
|
|
11
|
+
export declare const isObject: (obj: unknown) => obj is Record<string, any>;
|
|
12
|
+
export declare const isPlainObject: (obj: unknown) => obj is Record<string, any>;
|
|
5
13
|
export declare const isSatisfyRspackVersion: (originalVersion: string) => Promise<boolean>;
|
|
6
|
-
export declare const getCompiledPath: (packageName: string) => string;
|
|
7
14
|
export declare const getAllStatsErrors: (statsData: StatsCompilation) => Rspack.StatsError[] | undefined;
|
|
8
15
|
export declare const getAllStatsWarnings: (statsData: StatsCompilation) => Rspack.StatsError[] | undefined;
|
|
9
16
|
export declare function getStatsOptions(compiler: Parameters<typeof isMultiCompiler>[0]): StatsValue | undefined;
|
|
10
17
|
export declare function formatStats(stats: Stats | MultiStats, options?: StatsValue): {
|
|
11
|
-
message
|
|
12
|
-
level
|
|
13
|
-
} | {
|
|
14
|
-
message?: undefined;
|
|
15
|
-
level?: undefined;
|
|
18
|
+
message?: string;
|
|
19
|
+
level?: string;
|
|
16
20
|
};
|
|
17
21
|
export declare const removeLeadingSlash: (s: string) => string;
|
|
18
22
|
export declare const removeTailingSlash: (s: string) => string;
|
|
19
23
|
export declare const addTrailingSlash: (s: string) => string;
|
|
20
24
|
export declare const formatPublicPath: (publicPath: string, withSlash?: boolean) => string;
|
|
21
25
|
export declare const getPublicPathFromChain: (chain: RspackChain, withSlash?: boolean) => string;
|
|
22
|
-
|
|
23
|
-
* ensure absolute file path.
|
|
24
|
-
* @param base - Base path to resolve relative from.
|
|
25
|
-
* @param filePath - Absolute or relative file path.
|
|
26
|
-
* @returns Resolved absolute file path.
|
|
27
|
-
*/
|
|
28
|
-
export declare const ensureAbsolutePath: (base: string, filePath: string) => string;
|
|
26
|
+
export declare const getPublicPathFromCompiler: (compiler: Rspack.Compiler) => string;
|
|
29
27
|
export declare const isFileSync: (filePath: string) => boolean | undefined;
|
|
30
28
|
export declare function isEmptyDir(path: string): boolean;
|
|
31
29
|
/**
|
|
@@ -34,13 +32,15 @@ export declare function isEmptyDir(path: string): boolean;
|
|
|
34
32
|
* @returns The file path if exists, or false if no file exists.
|
|
35
33
|
*/
|
|
36
34
|
export declare const findExists: (files: string[]) => string | false;
|
|
35
|
+
export declare function pathExists(path: string): Promise<boolean>;
|
|
37
36
|
export declare function isFileExists(file: string): Promise<boolean>;
|
|
37
|
+
export declare function emptyDir(dir: string): Promise<void>;
|
|
38
38
|
export declare const canParse: (url: string) => boolean;
|
|
39
|
-
export declare const ensureAssetPrefix: (url: string, assetPrefix
|
|
40
|
-
export declare function getFilename(config: NormalizedConfig, type: 'js', isProd: boolean): NonNullable<FilenameConfig['js']>;
|
|
41
|
-
export declare function getFilename(config: NormalizedConfig, type: Exclude<keyof FilenameConfig, 'js'>, isProd: boolean): string;
|
|
39
|
+
export declare const ensureAssetPrefix: (url: string, assetPrefix?: string) => string;
|
|
40
|
+
export declare function getFilename(config: NormalizedConfig | NormalizedEnvironmentConfig, type: 'js', isProd: boolean): NonNullable<FilenameConfig['js']>;
|
|
41
|
+
export declare function getFilename(config: NormalizedConfig | NormalizedEnvironmentConfig, type: Exclude<keyof FilenameConfig, 'js'>, isProd: boolean): string;
|
|
42
42
|
export declare function partition<T>(array: T[], predicate: (value: T) => boolean): [T[], T[]];
|
|
43
|
-
export declare const applyToCompiler: (compiler: Rspack.Compiler | Rspack.MultiCompiler, apply: (c: Rspack.Compiler) => void) => void;
|
|
43
|
+
export declare const applyToCompiler: (compiler: Rspack.Compiler | Rspack.MultiCompiler, apply: (c: Rspack.Compiler, index: number) => void) => void;
|
|
44
44
|
export declare const upperFirst: (str: string) => string;
|
|
45
45
|
export declare function debounce<T extends (...args: any[]) => void>(func: T, wait: number): (...args: Parameters<T>) => void;
|
|
46
46
|
export declare const isURL: (str: string) => boolean;
|
|
@@ -50,3 +50,5 @@ export declare function isWebTarget(target: RsbuildTarget | RsbuildTarget[]): bo
|
|
|
50
50
|
export declare const isMultiCompiler: <C extends Rspack.Compiler | WebpackCompiler = Rspack.Compiler, M extends Rspack.MultiCompiler | WebpackMultiCompiler = Rspack.MultiCompiler>(compiler: C | M) => compiler is M;
|
|
51
51
|
export declare const onCompileDone: (compiler: Rspack.Compiler | Rspack.MultiCompiler, onDone: (stats: Stats | MultiStats) => Promise<void>, MultiStatsCtor: new (stats: Stats[]) => MultiStats) => void;
|
|
52
52
|
export declare function pick<T, U extends keyof T>(obj: T, keys: ReadonlyArray<U>): Pick<T, U>;
|
|
53
|
+
export declare const camelCase: (input: string) => string;
|
|
54
|
+
export declare const prettyTime: (seconds: number) => string;
|
package/dist-types/index.d.ts
CHANGED
|
@@ -8,15 +8,15 @@ import * as __internalHelper from './internal';
|
|
|
8
8
|
export { loadEnv } from './loadEnv';
|
|
9
9
|
export { createRsbuild } from './createRsbuild';
|
|
10
10
|
export { loadConfig, defineConfig } from './config';
|
|
11
|
-
export declare const version:
|
|
11
|
+
export declare const version: string;
|
|
12
12
|
export { rspack };
|
|
13
13
|
export type { Rspack };
|
|
14
14
|
export { logger } from './logger';
|
|
15
15
|
export { mergeRsbuildConfig } from './mergeConfig';
|
|
16
16
|
export { ensureAssetPrefix } from './helpers';
|
|
17
17
|
export { PLUGIN_SWC_NAME, PLUGIN_CSS_NAME } from './constants';
|
|
18
|
-
export type { RsbuildConfig, DevConfig, HtmlConfig, ToolsConfig, SourceConfig, ServerConfig, OutputConfig, SecurityConfig, PerformanceConfig, ModuleFederationConfig, NormalizedConfig, NormalizedDevConfig, NormalizedHtmlConfig, NormalizedToolsConfig, NormalizedSourceConfig, NormalizedServerConfig, NormalizedOutputConfig, NormalizedSecurityConfig, NormalizedPerformanceConfig, NormalizedModuleFederationConfig, RsbuildPlugin, RsbuildPlugins, RsbuildPluginAPI, RsbuildInstance, RsbuildProvider, CreateRsbuildOptions, } from './types';
|
|
19
|
-
export type { RsbuildMode, RsbuildEntry, RsbuildTarget, RsbuildContext, InspectConfigResult, InspectConfigOptions, Minify, Polyfill, PrintUrls, PublicDir, Decorators, RspackRule, WatchFiles, CSSModules, CrossOrigin, ConsoleType, SplitChunks, RspackChain, ClientConfig, ScriptInject, ConfigChain, PostCSSPlugin, ScriptLoading, LegalComments, AliasStrategy, FilenameConfig, DistPathConfig, OutputStructure, ChainIdentifier, PublicDirOptions, PreconnectOption, CSSLoaderOptions, ModifyChainUtils, StyleLoaderOptions, PostCSSLoaderOptions, ConfigChainWithContext, ModifyRspackConfigUtils, CSSModulesLocalsConvention, OnExitFn, OnAfterBuildFn, OnAfterCreateCompilerFn, OnAfterStartDevServerFn, OnAfterStartProdServerFn, OnBeforeBuildFn, OnBeforeStartDevServerFn, OnBeforeStartProdServerFn, OnBeforeCreateCompilerFn, OnCloseDevServerFn, OnDevCompileDoneFn, ModifyBundlerChainFn, ModifyRspackConfigFn, ModifyRsbuildConfigFn, TransformFn, TransformHandler, } from '@rsbuild/shared';
|
|
18
|
+
export type { RsbuildConfig, DevConfig, HtmlConfig, ToolsConfig, SourceConfig, ServerConfig, OutputConfig, SecurityConfig, PerformanceConfig, ModuleFederationConfig, NormalizedConfig, NormalizedDevConfig, NormalizedHtmlConfig, NormalizedToolsConfig, NormalizedSourceConfig, NormalizedServerConfig, NormalizedOutputConfig, NormalizedSecurityConfig, NormalizedPerformanceConfig, NormalizedModuleFederationConfig, NormalizedEnvironmentConfig, RsbuildPlugin, RsbuildPlugins, RsbuildPluginAPI, RsbuildInstance, RsbuildProvider, CreateRsbuildOptions, } from './types';
|
|
19
|
+
export type { RsbuildMode, RsbuildEntry, RsbuildTarget, RsbuildContext, EnvironmentContext, InspectConfigResult, InspectConfigOptions, Minify, Polyfill, PrintUrls, PublicDir, Decorators, RspackRule, WatchFiles, CSSModules, CrossOrigin, ConsoleType, SplitChunks, RspackChain, ClientConfig, ScriptInject, ConfigChain, PostCSSPlugin, ScriptLoading, LegalComments, AliasStrategy, FilenameConfig, DistPathConfig, OutputStructure, ChainIdentifier, PublicDirOptions, PreconnectOption, CSSLoaderOptions, ModifyChainUtils, StyleLoaderOptions, PostCSSLoaderOptions, ConfigChainWithContext, ModifyRspackConfigUtils, CSSModulesLocalsConvention, OnExitFn, OnAfterBuildFn, OnAfterCreateCompilerFn, OnAfterStartDevServerFn, OnAfterStartProdServerFn, OnBeforeBuildFn, OnBeforeStartDevServerFn, OnBeforeStartProdServerFn, OnBeforeCreateCompilerFn, OnCloseDevServerFn, OnDevCompileDoneFn, ModifyBundlerChainFn, ModifyRspackConfigFn, ModifyRsbuildConfigFn, TransformFn, TransformHandler, ServerAPIs, RequestHandler, } from '@rsbuild/shared';
|
|
20
20
|
export {
|
|
21
21
|
/**
|
|
22
22
|
* @private
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AsyncHook, ModifyBundlerChainFn, ModifyHTMLTagsFn, ModifyRsbuildConfigFn, ModifyRspackConfigFn, ModifyWebpackChainFn, ModifyWebpackConfigFn, OnAfterBuildFn, OnAfterCreateCompilerFn, OnAfterStartDevServerFn, OnAfterStartProdServerFn, OnBeforeBuildFn, OnBeforeCreateCompilerFn, OnBeforeStartDevServerFn, OnBeforeStartProdServerFn, OnCloseDevServerFn, OnDevCompileDoneFn, OnExitFn } from '@rsbuild/shared';
|
|
1
|
+
import type { AsyncHook, ModifyBundlerChainFn, ModifyEnvironmentConfigFn, ModifyHTMLTagsFn, ModifyRsbuildConfigFn, ModifyRspackConfigFn, ModifyWebpackChainFn, ModifyWebpackConfigFn, OnAfterBuildFn, OnAfterCreateCompilerFn, OnAfterStartDevServerFn, OnAfterStartProdServerFn, OnBeforeBuildFn, OnBeforeCreateCompilerFn, OnBeforeStartDevServerFn, OnBeforeStartProdServerFn, OnCloseDevServerFn, OnDevCompileDoneFn, OnExitFn } from '@rsbuild/shared';
|
|
2
2
|
export declare function createAsyncHook<Callback extends (...args: any[]) => any>(): AsyncHook<Callback>;
|
|
3
3
|
export declare function initHooks(): {
|
|
4
4
|
onExit: AsyncHook<OnExitFn>;
|
|
@@ -18,5 +18,6 @@ export declare function initHooks(): {
|
|
|
18
18
|
modifyWebpackChain: AsyncHook<ModifyWebpackChainFn>;
|
|
19
19
|
modifyWebpackConfig: AsyncHook<ModifyWebpackConfigFn>;
|
|
20
20
|
modifyRsbuildConfig: AsyncHook<ModifyRsbuildConfigFn>;
|
|
21
|
+
modifyEnvironmentConfig: AsyncHook<ModifyEnvironmentConfigFn>;
|
|
21
22
|
};
|
|
22
23
|
export type Hooks = ReturnType<typeof initHooks>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { PluginManager, RsbuildPluginAPI } from '@rsbuild/shared';
|
|
2
|
-
import type { InternalContext
|
|
3
|
-
export declare function getHTMLPathByEntry(entryName: string, config:
|
|
1
|
+
import type { NormalizedEnvironmentConfig, PluginManager, RsbuildPluginAPI } from '@rsbuild/shared';
|
|
2
|
+
import type { InternalContext } from './types';
|
|
3
|
+
export declare function getHTMLPathByEntry(entryName: string, config: NormalizedEnvironmentConfig): string;
|
|
4
4
|
export declare function getPluginAPI({ context, pluginManager, }: {
|
|
5
5
|
context: InternalContext;
|
|
6
6
|
pluginManager: PluginManager;
|
package/dist-types/internal.d.ts
CHANGED
|
@@ -8,14 +8,13 @@ export { prepareCli } from './cli/prepare';
|
|
|
8
8
|
export { initPlugins, createPluginManager } from './pluginManager';
|
|
9
9
|
export { initHooks, type Hooks } from './initHooks';
|
|
10
10
|
export { initRsbuildConfig } from './provider/initConfigs';
|
|
11
|
-
export { stringifyConfig, outputInspectConfigFiles } from './config';
|
|
11
|
+
export { stringifyConfig, getRsbuildInspectConfig, outputInspectConfigFiles, } from './config';
|
|
12
12
|
export type { InternalContext } from './types';
|
|
13
13
|
export { setHTMLPlugin, getHTMLPlugin } from './pluginHelper';
|
|
14
|
-
export { formatStats, getStatsOptions, onCompileDone } from './helpers';
|
|
14
|
+
export { formatStats, getStatsOptions, onCompileDone, prettyTime, } from './helpers';
|
|
15
15
|
export { getChainUtils } from './provider/rspackConfig';
|
|
16
16
|
export { chainToConfig, modifyBundlerChain } from './configChain';
|
|
17
17
|
export { applySwcDecoratorConfig } from './plugins/swc';
|
|
18
18
|
export { getSwcMinimizerOptions } from './plugins/minimize';
|
|
19
19
|
export { getDevMiddleware } from './server/devMiddleware';
|
|
20
20
|
export { createDevServer } from './server/devServer';
|
|
21
|
-
export { TARGET_ID_MAP } from './constants';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { type RsbuildConfig } from '@rsbuild/shared';
|
|
2
|
-
export declare const mergeRsbuildConfig: (...configs:
|
|
2
|
+
export declare const mergeRsbuildConfig: <T = RsbuildConfig>(...configs: T[]) => T;
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { type CSSLoaderOptions, type RsbuildTarget } from '@rsbuild/shared';
|
|
2
2
|
import type { AcceptedPlugin } from 'postcss';
|
|
3
|
-
import type {
|
|
4
|
-
export declare const
|
|
5
|
-
export declare const isUseCssExtract: (config: NormalizedConfig, target: RsbuildTarget) => boolean;
|
|
3
|
+
import type { NormalizedEnvironmentConfig, RsbuildPlugin } from '../types';
|
|
4
|
+
export declare const isUseCssExtract: (config: NormalizedEnvironmentConfig, target: RsbuildTarget) => boolean;
|
|
6
5
|
export declare const normalizeCssLoaderOptions: (options: CSSLoaderOptions, exportOnlyLocals: boolean) => CSSLoaderOptions;
|
|
7
6
|
/**
|
|
8
7
|
* Apply autoprefixer to the postcss plugins
|
|
9
8
|
* Check if autoprefixer is already in the plugins, if not, add it
|
|
10
9
|
*/
|
|
11
|
-
export declare const applyAutoprefixer: (plugins: unknown[], browserslist: string[], config:
|
|
10
|
+
export declare const applyAutoprefixer: (plugins: unknown[], browserslist: string[], config: NormalizedEnvironmentConfig) => Promise<AcceptedPlugin[]>;
|
|
12
11
|
export declare const pluginCss: () => RsbuildPlugin;
|
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type { NormalizedConfig, RsbuildConfig, RsbuildPlugin } from '../types';
|
|
3
|
-
export declare function getEntryObject(config: RsbuildConfig | NormalizedConfig, target: RsbuildTarget): RsbuildEntry;
|
|
1
|
+
import type { RsbuildPlugin } from '../types';
|
|
4
2
|
export declare const pluginEntry: () => RsbuildPlugin;
|
|
@@ -1,16 +1,7 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ModifyHTMLTagsFn, NormalizedEnvironmentConfig } from '@rsbuild/shared';
|
|
2
2
|
import type { RsbuildPlugin } from '../types';
|
|
3
|
-
export declare function
|
|
4
|
-
export declare function getTitle(entryName: string, config: NormalizedConfig): string;
|
|
5
|
-
export declare function getInject(entryName: string, config: NormalizedConfig): import("@rsbuild/shared").ScriptInject;
|
|
6
|
-
export declare function getTemplate(entryName: string, config: NormalizedConfig, rootPath: string): Promise<{
|
|
3
|
+
export declare function getTemplate(entryName: string, config: NormalizedEnvironmentConfig, rootPath: string): Promise<{
|
|
7
4
|
templatePath: string;
|
|
8
5
|
templateContent?: string;
|
|
9
6
|
}>;
|
|
10
|
-
export declare function getFavicon(entryName: string, config: {
|
|
11
|
-
html: HtmlConfig;
|
|
12
|
-
}): string;
|
|
13
|
-
export declare function getMetaTags(entryName: string, config: {
|
|
14
|
-
html: HtmlConfig;
|
|
15
|
-
}, templateContent?: string): import("@rsbuild/shared").MetaOptions;
|
|
16
7
|
export declare const pluginHtml: (modifyTagsFn?: ModifyHTMLTagsFn) => RsbuildPlugin;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { type HTMLPluginOptions, type
|
|
1
|
+
import { type HTMLPluginOptions, type NormalizedEnvironmentConfig } from '@rsbuild/shared';
|
|
2
2
|
import type { SwcJsMinimizerRspackPluginOptions } from '@rspack/core';
|
|
3
3
|
import type { RsbuildPlugin } from '../types';
|
|
4
|
-
export declare const getSwcMinimizerOptions: (config:
|
|
5
|
-
export declare const parseMinifyOptions: (config:
|
|
4
|
+
export declare const getSwcMinimizerOptions: (config: NormalizedEnvironmentConfig) => SwcJsMinimizerRspackPluginOptions;
|
|
5
|
+
export declare const parseMinifyOptions: (config: NormalizedEnvironmentConfig, isProd?: boolean) => {
|
|
6
6
|
minifyJs: boolean;
|
|
7
7
|
minifyCss: boolean;
|
|
8
8
|
minifyHtml: boolean;
|
|
9
9
|
jsOptions?: SwcJsMinimizerRspackPluginOptions;
|
|
10
|
-
htmlOptions?: HTMLPluginOptions[
|
|
10
|
+
htmlOptions?: HTMLPluginOptions["minify"];
|
|
11
11
|
};
|
|
12
12
|
export declare const pluginMinimize: () => RsbuildPlugin;
|
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import inspector from 'node:inspector';
|
|
3
1
|
import type { RsbuildPlugin } from '../types';
|
|
4
|
-
export declare const stopProfiler: (output: string, profileSession?: inspector.Session) => void;
|
|
5
2
|
export declare const pluginRspackProfile: () => RsbuildPlugin;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { SwcLoaderOptions } from '@rspack/core';
|
|
2
|
-
import type {
|
|
2
|
+
import type { NormalizedEnvironmentConfig, RsbuildPlugin } from '../types';
|
|
3
3
|
/**
|
|
4
4
|
* Provide some swc configs of rspack
|
|
5
5
|
*/
|
|
6
6
|
export declare const pluginSwc: () => RsbuildPlugin;
|
|
7
|
-
export declare function applySwcDecoratorConfig(swcConfig: SwcLoaderOptions, config:
|
|
7
|
+
export declare function applySwcDecoratorConfig(swcConfig: SwcLoaderOptions, config: NormalizedEnvironmentConfig): void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { InspectConfigOptions, InspectConfigResult, RspackConfig } from '@rsbuild/shared';
|
|
2
2
|
import { type InitConfigsOptions } from './initConfigs';
|
|
3
3
|
export declare function inspectConfig({ context, pluginManager, rsbuildOptions, bundlerConfigs, inspectOptions, }: InitConfigsOptions & {
|
|
4
4
|
inspectOptions?: InspectConfigOptions;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { type ModifyChainUtils, type RsbuildTarget, type RspackConfig } from '@rsbuild/shared';
|
|
1
|
+
import { type EnvironmentContext, type ModifyChainUtils, type RsbuildTarget, type RspackConfig } from '@rsbuild/shared';
|
|
2
2
|
import type { InternalContext } from '../types';
|
|
3
|
-
export declare function getChainUtils(target: RsbuildTarget): ModifyChainUtils;
|
|
4
|
-
export declare function generateRspackConfig({ target, context, }: {
|
|
3
|
+
export declare function getChainUtils(target: RsbuildTarget, environment: EnvironmentContext): ModifyChainUtils;
|
|
4
|
+
export declare function generateRspackConfig({ target, context, environment, }: {
|
|
5
|
+
environment: string;
|
|
5
6
|
target: RsbuildTarget;
|
|
6
7
|
context: InternalContext;
|
|
7
8
|
}): Promise<RspackConfig>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { EnvironmentContext, HtmlTag, HtmlTagDescriptor, ModifyHTMLTagsFn } from '@rsbuild/shared';
|
|
2
2
|
import type { Compiler } from '@rspack/core';
|
|
3
3
|
import type HtmlWebpackPlugin from 'html-webpack-plugin';
|
|
4
4
|
import type { HtmlTagObject } from 'html-webpack-plugin';
|
|
@@ -8,10 +8,6 @@ export type TagConfig = {
|
|
|
8
8
|
append?: HtmlTag['append'];
|
|
9
9
|
publicPath?: HtmlTag['publicPath'];
|
|
10
10
|
};
|
|
11
|
-
/** @see {@link https://developer.mozilla.org/en-US/docs/Glossary/Void_element} */
|
|
12
|
-
export declare const VOID_TAGS: string[];
|
|
13
|
-
/** @see {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/head#see_also} */
|
|
14
|
-
export declare const HEAD_TAGS: string[];
|
|
15
11
|
export declare const FILE_ATTRS: {
|
|
16
12
|
link: string;
|
|
17
13
|
script: string;
|
|
@@ -32,8 +28,9 @@ export type AlterAssetTagGroupsData = {
|
|
|
32
28
|
export declare const hasTitle: (html?: string) => boolean;
|
|
33
29
|
export declare class HtmlBasicPlugin {
|
|
34
30
|
readonly name: string;
|
|
31
|
+
readonly getEnvironment: () => EnvironmentContext;
|
|
35
32
|
readonly options: HtmlBasicPluginOptions;
|
|
36
33
|
readonly modifyTagsFn?: ModifyHTMLTagsFn;
|
|
37
|
-
constructor(options: HtmlBasicPluginOptions, modifyTagsFn?: ModifyHTMLTagsFn);
|
|
34
|
+
constructor(options: HtmlBasicPluginOptions, environment: EnvironmentContext, modifyTagsFn?: ModifyHTMLTagsFn);
|
|
38
35
|
apply(compiler: Compiler): void;
|
|
39
36
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type {
|
|
3
|
-
import type { HtmlTagObject } from 'html-webpack-plugin';
|
|
1
|
+
import type { InlineChunkTest } from '@rsbuild/shared';
|
|
2
|
+
import type { Compiler } from '@rspack/core';
|
|
4
3
|
export type InlineChunkHtmlPluginOptions = {
|
|
5
4
|
styleTests: InlineChunkTest[];
|
|
6
5
|
scriptTests: InlineChunkTest[];
|
|
@@ -21,26 +20,10 @@ export declare class InlineChunkHtmlPlugin {
|
|
|
21
20
|
* because the relative path of source code has been changed.
|
|
22
21
|
* @param source
|
|
23
22
|
*/
|
|
24
|
-
updateSourceMappingURL
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}): string;
|
|
30
|
-
matchTests(name: string, source: string, tests: InlineChunkTest[]): boolean;
|
|
31
|
-
getInlinedScriptTag(publicPath: string, tag: HtmlTagObject, compilation: Compilation): HtmlTagObject | {
|
|
32
|
-
tagName: string;
|
|
33
|
-
innerHTML: string;
|
|
34
|
-
attributes: {
|
|
35
|
-
[x: string]: string | boolean | null | undefined;
|
|
36
|
-
};
|
|
37
|
-
closeTag: boolean;
|
|
38
|
-
};
|
|
39
|
-
getInlinedCSSTag(publicPath: string, tag: HtmlTagObject, compilation: Compilation): HtmlTagObject | {
|
|
40
|
-
tagName: string;
|
|
41
|
-
innerHTML: string;
|
|
42
|
-
closeTag: boolean;
|
|
43
|
-
};
|
|
44
|
-
getInlinedTag(publicPath: string, tag: HtmlTagObject, compilation: Compilation): HtmlTagObject;
|
|
23
|
+
private updateSourceMappingURL;
|
|
24
|
+
private matchTests;
|
|
25
|
+
private getInlinedScriptTag;
|
|
26
|
+
private getInlinedCSSTag;
|
|
27
|
+
private getInlinedTag;
|
|
45
28
|
apply(compiler: Compiler): void;
|
|
46
29
|
}
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
-
import {
|
|
17
|
+
import type { PreloadOrPreFetchOption } from '@rsbuild/shared';
|
|
18
18
|
import type { Compiler, RspackPluginInstance } from '@rspack/core';
|
|
19
19
|
import type HtmlWebpackPlugin from 'html-webpack-plugin';
|
|
20
20
|
type LinkType = 'preload' | 'prefetch';
|
|
@@ -20,5 +20,8 @@ interface ExtractChunks {
|
|
|
20
20
|
compilation: Compilation;
|
|
21
21
|
includeType?: PreloadIncludeType;
|
|
22
22
|
}
|
|
23
|
-
export declare function extractChunks({ compilation, includeType
|
|
23
|
+
export declare function extractChunks({ compilation, includeType }: ExtractChunks): Chunk[] | Array<{
|
|
24
|
+
files: string[];
|
|
25
|
+
auxiliaryFiles?: string[];
|
|
26
|
+
}>;
|
|
24
27
|
export {};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import type { IncomingMessage, ServerResponse } from 'node:http';
|
|
3
2
|
import type { CompilerTapFn, NextFunction } from '@rsbuild/shared';
|
|
4
3
|
import type { Compiler, MultiCompiler } from '@rspack/core';
|
|
@@ -9,22 +8,17 @@ type ServerCallbacks = {
|
|
|
9
8
|
};
|
|
10
9
|
export declare const isClientCompiler: (compiler: {
|
|
11
10
|
options: {
|
|
12
|
-
target?: Compiler[
|
|
13
|
-
};
|
|
14
|
-
}) => boolean;
|
|
15
|
-
export declare const isNodeCompiler: (compiler: {
|
|
16
|
-
options: {
|
|
17
|
-
target?: Compiler['options']['target'];
|
|
11
|
+
target?: Compiler["options"]["target"];
|
|
18
12
|
};
|
|
19
13
|
}) => boolean;
|
|
20
14
|
export declare const setupServerHooks: (compiler: {
|
|
21
15
|
options: {
|
|
22
|
-
target?: Compiler[
|
|
16
|
+
target?: Compiler["options"]["target"];
|
|
23
17
|
};
|
|
24
18
|
hooks: {
|
|
25
|
-
compile: CompilerTapFn<ServerCallbacks[
|
|
26
|
-
invalid: CompilerTapFn<ServerCallbacks[
|
|
27
|
-
done: CompilerTapFn<ServerCallbacks[
|
|
19
|
+
compile: CompilerTapFn<ServerCallbacks["onInvalid"]>;
|
|
20
|
+
invalid: CompilerTapFn<ServerCallbacks["onInvalid"]>;
|
|
21
|
+
done: CompilerTapFn<ServerCallbacks["onDone"]>;
|
|
28
22
|
};
|
|
29
23
|
}, hookCallbacks: ServerCallbacks) => void;
|
|
30
24
|
export type Middleware = (req: IncomingMessage, res: ServerResponse, next: NextFunction) => Promise<void>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { CreateDevServerOptions, EnvironmentAPI, StartDevServerOptions } from '@rsbuild/shared';
|
|
2
2
|
import type Connect from '../../compiled/connect';
|
|
3
3
|
import type { CreateDevMiddlewareReturns } from '../provider/createCompiler';
|
|
4
4
|
import type { InternalContext, NormalizedConfig } from '../types';
|
|
@@ -15,6 +15,8 @@ export type RsbuildDevServer = {
|
|
|
15
15
|
};
|
|
16
16
|
}>;
|
|
17
17
|
/** The following APIs will be used when you use a custom server */
|
|
18
|
+
/** The Rsbuild server environment API */
|
|
19
|
+
environments: EnvironmentAPI;
|
|
18
20
|
/**
|
|
19
21
|
* The resolved port.
|
|
20
22
|
*
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { EnvironmentContext, Stats } from '@rsbuild/shared';
|
|
2
|
+
export type ServerUtils = {
|
|
3
|
+
readFileSync: (fileName: string) => string;
|
|
4
|
+
environment: EnvironmentContext;
|
|
5
|
+
};
|
|
6
|
+
export declare const loadBundle: <T>(stats: Stats, entryName: string, utils: ServerUtils) => Promise<T>;
|
|
7
|
+
export declare const getTransformedHtml: (entryName: string, utils: ServerUtils) => Promise<string>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { DevConfig, RequestHandler, Rspack, ServerAPIs, ServerConfig } from '@rsbuild/shared';
|
|
1
|
+
import type { DevConfig, EnvironmentAPI, RequestHandler, Rspack, ServerAPIs, ServerConfig } from '@rsbuild/shared';
|
|
2
2
|
import type { UpgradeEvent } from './helper';
|
|
3
3
|
export type CompileMiddlewareAPI = {
|
|
4
4
|
middleware: RequestHandler;
|
|
@@ -10,6 +10,7 @@ export type RsbuildDevMiddlewareOptions = {
|
|
|
10
10
|
pwd: string;
|
|
11
11
|
dev: DevConfig;
|
|
12
12
|
server: ServerConfig;
|
|
13
|
+
environments: EnvironmentAPI;
|
|
13
14
|
compileMiddlewareAPI?: CompileMiddlewareAPI;
|
|
14
15
|
outputFileSystem: Rspack.OutputFileSystem;
|
|
15
16
|
output: {
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
/// <reference types="node" />
|
|
3
1
|
import type { IncomingMessage } from 'node:http';
|
|
4
2
|
import type { Socket } from 'node:net';
|
|
5
|
-
import type {
|
|
3
|
+
import type { NormalizedConfig, OutputStructure, PrintUrls, Routes, RsbuildEntry } from '@rsbuild/shared';
|
|
4
|
+
import type { InternalContext } from '../types';
|
|
6
5
|
/**
|
|
7
6
|
* It used to subscribe http upgrade event
|
|
8
7
|
*/
|
|
@@ -15,6 +14,7 @@ export type StartServerResult = {
|
|
|
15
14
|
};
|
|
16
15
|
};
|
|
17
16
|
export declare const normalizeUrl: (url: string) => string;
|
|
17
|
+
export declare const getRoutes: (context: InternalContext) => Routes;
|
|
18
18
|
export declare const formatRoutes: (entry: RsbuildEntry, prefix: string | undefined, outputStructure: OutputStructure | undefined) => Routes;
|
|
19
19
|
export declare function printServerURLs({ urls: originalUrls, port, routes, protocol, printUrls, }: {
|
|
20
20
|
urls: Array<{
|
|
@@ -25,11 +25,7 @@ export declare function printServerURLs({ urls: originalUrls, port, routes, prot
|
|
|
25
25
|
routes: Routes;
|
|
26
26
|
protocol: string;
|
|
27
27
|
printUrls?: PrintUrls;
|
|
28
|
-
}): string |
|
|
29
|
-
/**
|
|
30
|
-
* hmr socket connect path
|
|
31
|
-
*/
|
|
32
|
-
export declare const HMR_SOCK_PATH = "/rsbuild-hmr";
|
|
28
|
+
}): string | null;
|
|
33
29
|
/**
|
|
34
30
|
* Get available free port.
|
|
35
31
|
* @param port - Current port want to use.
|
|
@@ -52,11 +48,6 @@ export declare const getServerConfig: ({ config, getPortSilently, }: {
|
|
|
52
48
|
host: string;
|
|
53
49
|
https: boolean;
|
|
54
50
|
}>;
|
|
55
|
-
export declare const getDevConfig: ({ config, port, }: {
|
|
56
|
-
config: NormalizedConfig;
|
|
57
|
-
port: number;
|
|
58
|
-
}) => DevConfig;
|
|
59
|
-
export declare const getUrlLabel: (url: string) => "Local: " | "Network: ";
|
|
60
51
|
type AddressUrl = {
|
|
61
52
|
label: string;
|
|
62
53
|
url: string;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
/// <reference types="node" />
|
|
1
|
+
import type { Server } from 'node:http';
|
|
2
|
+
import type { Http2SecureServer } from 'node:http2';
|
|
4
3
|
import type { ServerConfig } from '@rsbuild/shared';
|
|
5
4
|
import type Connect from '../../compiled/connect';
|
|
6
5
|
export declare const createHttpServer: ({ serverConfig, middlewares, }: {
|
|
7
6
|
serverConfig: ServerConfig;
|
|
8
7
|
middlewares: Connect.Server;
|
|
9
|
-
}) => Promise<
|
|
8
|
+
}) => Promise<Http2SecureServer | Server>;
|