@rsbuild/core 0.7.8 → 0.7.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/bin/rsbuild.js +1 -2
- package/compiled/css-loader/index.js +20 -20
- package/compiled/launch-editor-middleware/index.js +21 -15
- package/compiled/launch-editor-middleware/package.json +1 -1
- package/compiled/postcss-loader/index.js +8 -8
- package/compiled/rslog/index.d.ts +66 -0
- package/compiled/rslog/index.js +334 -0
- package/compiled/rslog/license +21 -0
- package/compiled/rslog/package.json +1 -0
- package/compiled/rspack-manifest-plugin/index.js +4 -4
- package/dist/index.cjs +687 -416
- package/dist/index.js +519 -290
- package/dist-types/configChain.d.ts +10 -0
- package/dist-types/constants.d.ts +2 -0
- package/dist-types/createContext.d.ts +1 -1
- package/dist-types/helpers.d.ts +20 -3
- package/dist-types/index.d.ts +1 -1
- package/dist-types/initPlugins.d.ts +1 -1
- package/dist-types/internal.d.ts +3 -1
- package/dist-types/logger.d.ts +4 -0
- package/dist-types/provider/initConfigs.d.ts +1 -1
- package/dist-types/server/devMiddleware.d.ts +11 -1
- package/dist-types/server/proxy.d.ts +1 -1
- package/dist-types/server/socketServer.d.ts +1 -1
- package/package.json +7 -6
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type CreateAsyncHook, type ModifyBundlerChainFn, type ModifyBundlerChainUtils, type RsbuildContext, RspackChain, type RspackConfig } from '@rsbuild/shared';
|
|
2
|
+
import type { RsbuildConfig } from './types';
|
|
3
|
+
export declare function getBundlerChain(): Promise<RspackChain>;
|
|
4
|
+
export declare function modifyBundlerChain(context: RsbuildContext & {
|
|
5
|
+
hooks: {
|
|
6
|
+
modifyBundlerChain: CreateAsyncHook<ModifyBundlerChainFn>;
|
|
7
|
+
};
|
|
8
|
+
config: Readonly<RsbuildConfig>;
|
|
9
|
+
}, utils: ModifyBundlerChainUtils): Promise<RspackChain>;
|
|
10
|
+
export declare function chainToConfig(chain: RspackChain): RspackConfig;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { RsbuildTarget } from '@rsbuild/shared';
|
|
1
2
|
export declare const ROOT_DIST_DIR = "dist";
|
|
2
3
|
export declare const HTML_DIST_DIR = "/";
|
|
3
4
|
export declare const SERVER_DIST_DIR = "server";
|
|
@@ -25,3 +26,4 @@ export declare const FONT_EXTENSIONS: string[];
|
|
|
25
26
|
export declare const IMAGE_EXTENSIONS: string[];
|
|
26
27
|
export declare const VIDEO_EXTENSIONS: string[];
|
|
27
28
|
export declare const AUDIO_EXTENSIONS: string[];
|
|
29
|
+
export declare const TARGET_ID_MAP: Record<RsbuildTarget, string>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { BundlerType, RsbuildContext } from '@rsbuild/shared';
|
|
2
2
|
import type { CreateRsbuildOptions, InternalContext, NormalizedConfig, RsbuildConfig } from './types';
|
|
3
3
|
export declare function updateContextByNormalizedConfig(context: RsbuildContext, config: NormalizedConfig): void;
|
|
4
4
|
export declare function createPublicContext(context: RsbuildContext): Readonly<RsbuildContext>;
|
package/dist-types/helpers.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { type MultiStats, type
|
|
1
|
+
import { type FilenameConfig, type MultiStats, type NormalizedConfig, type RsbuildTarget, type Rspack, type RspackChain, type Stats } from '@rsbuild/shared';
|
|
2
2
|
import type { StatsCompilation, StatsValue } from '@rspack/core';
|
|
3
|
+
import type { Compiler as WebpackCompiler, MultiCompiler as WebpackMultiCompiler } from 'webpack';
|
|
3
4
|
export declare const rspackMinVersion = "0.6.2";
|
|
4
5
|
export declare const isSatisfyRspackVersion: (originalVersion: string) => Promise<boolean>;
|
|
5
6
|
export declare const getCompiledPath: (packageName: string) => string;
|
|
6
|
-
export declare const getAllStatsErrors: (statsData: StatsCompilation) => StatsError[] | undefined;
|
|
7
|
-
export declare const getAllStatsWarnings: (statsData: StatsCompilation) => StatsError[] | undefined;
|
|
7
|
+
export declare const getAllStatsErrors: (statsData: StatsCompilation) => Rspack.StatsError[] | undefined;
|
|
8
|
+
export declare const getAllStatsWarnings: (statsData: StatsCompilation) => Rspack.StatsError[] | undefined;
|
|
8
9
|
export declare function getStatsOptions(compiler: Parameters<typeof isMultiCompiler>[0]): StatsValue | undefined;
|
|
9
10
|
export declare function formatStats(stats: Stats | MultiStats, options?: StatsValue): {
|
|
10
11
|
message: string;
|
|
@@ -13,6 +14,9 @@ export declare function formatStats(stats: Stats | MultiStats, options?: StatsVa
|
|
|
13
14
|
message?: undefined;
|
|
14
15
|
level?: undefined;
|
|
15
16
|
};
|
|
17
|
+
export declare const removeLeadingSlash: (s: string) => string;
|
|
18
|
+
export declare const removeTailingSlash: (s: string) => string;
|
|
19
|
+
export declare const addTrailingSlash: (s: string) => string;
|
|
16
20
|
export declare const formatPublicPath: (publicPath: string, withSlash?: boolean) => string;
|
|
17
21
|
export declare const getPublicPathFromChain: (chain: RspackChain, withSlash?: boolean) => string;
|
|
18
22
|
/**
|
|
@@ -33,3 +37,16 @@ export declare const findExists: (files: string[]) => string | false;
|
|
|
33
37
|
export declare function isFileExists(file: string): Promise<boolean>;
|
|
34
38
|
export declare const canParse: (url: string) => boolean;
|
|
35
39
|
export declare const ensureAssetPrefix: (url: string, assetPrefix: string) => string;
|
|
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;
|
|
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;
|
|
44
|
+
export declare const upperFirst: (str: string) => string;
|
|
45
|
+
export declare function debounce<T extends (...args: any[]) => void>(func: T, wait: number): (...args: Parameters<T>) => void;
|
|
46
|
+
export declare const isURL: (str: string) => boolean;
|
|
47
|
+
export declare const createVirtualModule: (content: string) => string;
|
|
48
|
+
export declare const isRegExp: (obj: any) => obj is RegExp;
|
|
49
|
+
export declare function isWebTarget(target: RsbuildTarget | RsbuildTarget[]): boolean;
|
|
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
|
+
export declare const onCompileDone: (compiler: Rspack.Compiler | Rspack.MultiCompiler, onDone: (stats: Stats | MultiStats) => Promise<void>, MultiStatsCtor: new (stats: Stats[]) => MultiStats) => void;
|
|
52
|
+
export declare function pick<T, U extends keyof T>(obj: T, keys: ReadonlyArray<U>): Pick<T, U>;
|
package/dist-types/index.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export { loadConfig, defineConfig } from './config';
|
|
|
11
11
|
export declare const version: any;
|
|
12
12
|
export { rspack };
|
|
13
13
|
export type { Rspack };
|
|
14
|
-
export { logger } from '
|
|
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';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { PluginManager, RsbuildPluginAPI } from '@rsbuild/shared';
|
|
2
2
|
import type { InternalContext, NormalizedConfig } from './types';
|
|
3
3
|
export declare function getHTMLPathByEntry(entryName: string, config: NormalizedConfig): string;
|
|
4
4
|
export declare function getPluginAPI({ context, pluginManager, }: {
|
package/dist-types/internal.d.ts
CHANGED
|
@@ -11,9 +11,11 @@ export { initRsbuildConfig } from './provider/initConfigs';
|
|
|
11
11
|
export { stringifyConfig, outputInspectConfigFiles } from './config';
|
|
12
12
|
export type { InternalContext } from './types';
|
|
13
13
|
export { setHTMLPlugin, getHTMLPlugin } from './pluginHelper';
|
|
14
|
-
export { formatStats, getStatsOptions } from './helpers';
|
|
14
|
+
export { formatStats, getStatsOptions, onCompileDone } from './helpers';
|
|
15
15
|
export { getChainUtils } from './provider/rspackConfig';
|
|
16
|
+
export { chainToConfig, modifyBundlerChain } from './configChain';
|
|
16
17
|
export { applySwcDecoratorConfig } from './plugins/swc';
|
|
17
18
|
export { getSwcMinimizerOptions } from './plugins/minimize';
|
|
18
19
|
export { getDevMiddleware } from './server/devMiddleware';
|
|
19
20
|
export { createDevServer } from './server/devServer';
|
|
21
|
+
export { TARGET_ID_MAP } from './constants';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { PluginManager, RspackConfig } from '@rsbuild/shared';
|
|
2
2
|
import type { CreateRsbuildOptions, InternalContext, NormalizedConfig } from '../types';
|
|
3
3
|
export type InitConfigsOptions = {
|
|
4
4
|
context: InternalContext;
|
|
@@ -1,12 +1,22 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import type { IncomingMessage, ServerResponse } from 'node:http';
|
|
3
|
-
import {
|
|
3
|
+
import type { CompilerTapFn, NextFunction } from '@rsbuild/shared';
|
|
4
4
|
import type { Compiler, MultiCompiler } from '@rspack/core';
|
|
5
5
|
import type { DevMiddlewareOptions } from '../provider/createCompiler';
|
|
6
6
|
type ServerCallbacks = {
|
|
7
7
|
onInvalid: () => void;
|
|
8
8
|
onDone: (stats: any) => void;
|
|
9
9
|
};
|
|
10
|
+
export declare const isClientCompiler: (compiler: {
|
|
11
|
+
options: {
|
|
12
|
+
target?: Compiler['options']['target'];
|
|
13
|
+
};
|
|
14
|
+
}) => boolean;
|
|
15
|
+
export declare const isNodeCompiler: (compiler: {
|
|
16
|
+
options: {
|
|
17
|
+
target?: Compiler['options']['target'];
|
|
18
|
+
};
|
|
19
|
+
}) => boolean;
|
|
10
20
|
export declare const setupServerHooks: (compiler: {
|
|
11
21
|
options: {
|
|
12
22
|
target?: Compiler['options']['target'];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { RequestHandler as Middleware, ProxyDetail, ProxyOptions } from '@rsbuild/shared';
|
|
2
2
|
import type { UpgradeEvent } from './helper';
|
|
3
3
|
export declare function formatProxyOptions(proxyOptions: ProxyOptions): ProxyDetail[];
|
|
4
4
|
export declare const createProxyMiddleware: (proxyOptions: ProxyOptions) => {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// <reference types="node" />
|
|
3
3
|
import type { IncomingMessage } from 'node:http';
|
|
4
4
|
import type { Socket } from 'node:net';
|
|
5
|
-
import {
|
|
5
|
+
import type { DevConfig, Stats } from '@rsbuild/shared';
|
|
6
6
|
import type Ws from '../../compiled/ws';
|
|
7
7
|
export declare class SocketServer {
|
|
8
8
|
private wsServer;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsbuild/core",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.9",
|
|
4
4
|
"description": "The Rspack-based build tool.",
|
|
5
5
|
"homepage": "https://rsbuild.dev",
|
|
6
6
|
"bugs": {
|
|
@@ -46,12 +46,12 @@
|
|
|
46
46
|
"types.d.ts"
|
|
47
47
|
],
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@rspack/core": "0.7.
|
|
49
|
+
"@rspack/core": "0.7.4",
|
|
50
50
|
"@swc/helpers": "0.5.3",
|
|
51
51
|
"core-js": "~3.36.0",
|
|
52
52
|
"html-webpack-plugin": "npm:html-rspack-plugin@5.7.2",
|
|
53
53
|
"postcss": "^8.4.38",
|
|
54
|
-
"@rsbuild/shared": "0.7.
|
|
54
|
+
"@rsbuild/shared": "0.7.9"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
57
|
"@types/connect": "3.4.38",
|
|
@@ -67,17 +67,18 @@
|
|
|
67
67
|
"dotenv-expand": "11.0.6",
|
|
68
68
|
"fs-extra": "^11.2.0",
|
|
69
69
|
"http-compression": "1.0.20",
|
|
70
|
-
"
|
|
70
|
+
"jiti": "^1.21.6",
|
|
71
|
+
"launch-editor-middleware": "^2.7.0",
|
|
71
72
|
"on-finished": "2.4.1",
|
|
72
73
|
"open": "^8.4.0",
|
|
73
74
|
"postcss-load-config": "6.0.1",
|
|
74
75
|
"postcss-loader": "8.1.1",
|
|
75
76
|
"postcss-value-parser": "4.2.0",
|
|
76
77
|
"prebundle": "1.1.0",
|
|
78
|
+
"rslog": "^1.2.2",
|
|
77
79
|
"rspack-manifest-plugin": "5.0.0",
|
|
78
|
-
"sirv": "^2.0.4",
|
|
79
|
-
"jiti": "^1.21.6",
|
|
80
80
|
"semver": "^7.6.2",
|
|
81
|
+
"sirv": "^2.0.4",
|
|
81
82
|
"style-loader": "3.3.4",
|
|
82
83
|
"tsc-alias": "^1.8.10",
|
|
83
84
|
"typescript": "^5.4.2",
|