@rsbuild/core 1.1.2 → 1.1.4

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.
@@ -20,4 +20,4 @@ export type InspectOptions = CommonOptions & {
20
20
  };
21
21
  export type DevOptions = CommonOptions;
22
22
  export type PreviewOptions = CommonOptions;
23
- export declare function runCli(): void;
23
+ export declare function setupCommands(): void;
@@ -0,0 +1 @@
1
+ export declare function runCLI(): Promise<void>;
@@ -12,6 +12,7 @@ export type ConfigParams = {
12
12
  env: string;
13
13
  command: string;
14
14
  envMode?: string;
15
+ meta?: Record<string, unknown>;
15
16
  };
16
17
  export type RsbuildConfigAsyncFn = (env: ConfigParams) => Promise<RsbuildConfig>;
17
18
  export type RsbuildConfigSyncFn = (env: ConfigParams) => RsbuildConfig;
@@ -25,14 +26,39 @@ export declare function defineConfig(config: RsbuildConfigSyncFn): RsbuildConfig
25
26
  export declare function defineConfig(config: RsbuildConfigAsyncFn): RsbuildConfigAsyncFn;
26
27
  export declare function defineConfig(config: RsbuildConfigExport): RsbuildConfigExport;
27
28
  export declare function watchFilesForRestart(files: string[], root: string, isBuildWatch: boolean, watchOptions?: ChokidarOptions): Promise<void>;
28
- export declare function loadConfig({ cwd, path, envMode, }?: {
29
+ export type LoadConfigOptions = {
30
+ /**
31
+ * The root path to resolve the config file.
32
+ * @default process.cwd()
33
+ */
29
34
  cwd?: string;
35
+ /**
36
+ * The path to the config file, can be a relative or absolute path.
37
+ * If `path` is not provided, the function will search for the config file in the `cwd`.
38
+ */
30
39
  path?: string;
40
+ /**
41
+ * A custom meta object to be passed into the config function of `defineConfig`.
42
+ */
43
+ meta?: Record<string, unknown>;
44
+ /**
45
+ * The `envMode` passed into the config function of `defineConfig`.
46
+ * @default process.env.NODE_ENV
47
+ */
31
48
  envMode?: string;
32
- }): Promise<{
49
+ };
50
+ export type LoadConfigResult = {
51
+ /**
52
+ * The loaded configuration object.
53
+ */
33
54
  content: RsbuildConfig;
55
+ /**
56
+ * The path to the loaded configuration file.
57
+ * Return `null` if the configuration file is not found.
58
+ */
34
59
  filePath: string | null;
35
- }>;
60
+ };
61
+ export declare function loadConfig({ cwd, path, envMode, meta, }?: LoadConfigOptions): Promise<LoadConfigResult>;
36
62
  export declare const getRsbuildInspectConfig: ({ normalizedConfig, inspectOptions, pluginManager, }: {
37
63
  normalizedConfig: NormalizedConfig;
38
64
  inspectOptions: InspectConfigOptions;
@@ -1,9 +1,8 @@
1
- import type { StatsCompilation, StatsValue } from '@rspack/core';
1
+ import type { StatsCompilation } from '@rspack/core';
2
2
  import type { Rspack } from '../types';
3
- import { isMultiCompiler } from './';
4
3
  export declare const getAllStatsErrors: (statsData: StatsCompilation) => Rspack.StatsError[] | undefined;
5
4
  export declare const getAllStatsWarnings: (statsData: StatsCompilation) => Rspack.StatsError[] | undefined;
6
- export declare function getStatsOptions(compiler: Parameters<typeof isMultiCompiler>[0]): StatsValue | undefined;
5
+ export declare function getStatsOptions(compiler: Rspack.Compiler | Rspack.MultiCompiler): Rspack.StatsOptions;
7
6
  export declare function formatStats(statsData: Rspack.StatsCompilation, hasErrors: boolean): {
8
7
  message?: string;
9
8
  level?: string;
@@ -7,7 +7,8 @@ import type * as Rspack from '@rspack/core';
7
7
  import * as __internalHelper from './internal';
8
8
  export { loadEnv } from './loadEnv';
9
9
  export { createRsbuild } from './createRsbuild';
10
- export { loadConfig, defineConfig } from './config';
10
+ export { loadConfig, defineConfig, type LoadConfigOptions, type LoadConfigResult, } from './config';
11
+ export { runCLI } from './cli';
11
12
  export declare const version: string;
12
13
  export { rspack };
13
14
  export type { Rspack };
@@ -3,6 +3,4 @@
3
3
  * Some internal methods of Rsbuild.
4
4
  * Please do not use them in your Rsbuild project or plugins.
5
5
  */
6
- export { runCli } from './cli/commands';
7
- export { prepareCli } from './cli/prepare';
8
6
  export { setHTMLPlugin } from './pluginHelper';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rsbuild/core",
3
- "version": "1.1.2",
3
+ "version": "1.1.4",
4
4
  "description": "The Rspack-based build tool.",
5
5
  "homepage": "https://rsbuild.dev",
6
6
  "bugs": {
@@ -46,7 +46,7 @@
46
46
  "types.d.ts"
47
47
  ],
48
48
  "dependencies": {
49
- "@rspack/core": "~1.1.1",
49
+ "@rspack/core": "~1.1.2",
50
50
  "@rspack/lite-tapable": "~1.0.1",
51
51
  "@swc/helpers": "^0.5.15",
52
52
  "core-js": "~3.39.0"
@@ -55,8 +55,7 @@
55
55
  "@rslib/core": "0.0.18",
56
56
  "@types/connect": "3.4.38",
57
57
  "@types/fs-extra": "^11.0.4",
58
- "@types/is-glob": "^4.0.4",
59
- "@types/node": "^22.9.0",
58
+ "@types/node": "^22.9.1",
60
59
  "@types/on-finished": "2.3.4",
61
60
  "@types/webpack-bundle-analyzer": "4.7.0",
62
61
  "@types/ws": "^8.5.13",
@@ -68,18 +67,17 @@
68
67
  "css-loader": "7.1.2",
69
68
  "deepmerge": "^4.3.1",
70
69
  "dotenv": "16.4.5",
71
- "dotenv-expand": "11.0.6",
70
+ "dotenv-expand": "11.0.7",
72
71
  "fs-extra": "^11.2.0",
73
72
  "html-rspack-plugin": "6.0.2",
74
73
  "http-proxy-middleware": "^2.0.6",
75
- "is-glob": "^4.0.3",
76
74
  "jiti": "^1.21.6",
77
75
  "launch-editor-middleware": "^2.9.1",
78
76
  "mrmime": "^2.0.0",
79
77
  "on-finished": "2.4.1",
80
78
  "open": "^8.4.0",
81
79
  "picocolors": "^1.1.1",
82
- "postcss": "^8.4.48",
80
+ "postcss": "^8.4.49",
83
81
  "postcss-load-config": "6.0.1",
84
82
  "postcss-loader": "8.1.1",
85
83
  "prebundle": "1.2.5",
@@ -87,7 +85,7 @@
87
85
  "rimraf": "^6.0.1",
88
86
  "rsbuild-dev-middleware": "0.1.2",
89
87
  "rslog": "^1.2.3",
90
- "rspack-chain": "^1.0.3",
88
+ "rspack-chain": "^1.1.0",
91
89
  "rspack-manifest-plugin": "5.0.2",
92
90
  "sirv": "^3.0.0",
93
91
  "style-loader": "3.3.4",
@@ -1,13 +0,0 @@
1
- /*!
2
- * is-extglob <https://github.com/jonschlinkert/is-extglob>
3
- *
4
- * Copyright (c) 2014-2016, Jon Schlinkert.
5
- * Licensed under the MIT License.
6
- */
7
-
8
- /*!
9
- * is-glob <https://github.com/jonschlinkert/is-glob>
10
- *
11
- * Copyright (c) 2014-2017, Jon Schlinkert.
12
- * Released under the MIT License.
13
- */
@@ -1,13 +0,0 @@
1
- /*!
2
- * is-extglob <https://github.com/jonschlinkert/is-extglob>
3
- *
4
- * Copyright (c) 2014-2016, Jon Schlinkert.
5
- * Licensed under the MIT License.
6
- */
7
-
8
- /*!
9
- * is-glob <https://github.com/jonschlinkert/is-glob>
10
- *
11
- * Copyright (c) 2014-2017, Jon Schlinkert.
12
- * Released under the MIT License.
13
- */