@rsbuild/core 2.0.8 → 2.0.10
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/connect-next/package.json +1 -1
- package/compiled/css-loader/index.js +2 -2
- package/compiled/html-rspack-plugin/index.js +14 -14
- package/compiled/html-rspack-plugin/package.json +1 -1
- package/compiled/postcss-loader/index.js +6 -6
- package/compiled/rslog/index.d.ts +3 -3
- package/compiled/rslog/package.json +1 -1
- package/compiled/rspack-chain/package.json +1 -1
- package/dist/1~rslib-runtime.js +8 -5
- package/dist/756.js +25 -21
- package/dist/launch-editor-middleware.js +58 -23
- package/dist/manifest-plugin.js +6 -6
- package/dist/memfs.js +101 -99
- package/dist/tinyglobby.js +11 -9
- package/dist-types/build.d.ts +1 -1
- package/dist-types/cli/init.d.ts +1 -1
- package/dist-types/configChain.d.ts +59 -118
- package/dist-types/constants.d.ts +35 -31
- package/dist-types/createContext.d.ts +1 -2
- package/dist-types/createRsbuild.d.ts +1 -2
- package/dist-types/defaultConfig.d.ts +2 -4
- package/dist-types/helpers/exitHook.d.ts +1 -1
- package/dist-types/helpers/format.d.ts +2 -1
- package/dist-types/helpers/fs.d.ts +2 -4
- package/dist-types/helpers/index.d.ts +1 -2
- package/dist-types/helpers/path.d.ts +4 -8
- package/dist-types/helpers/stats.d.ts +3 -5
- package/dist-types/helpers/url.d.ts +1 -0
- package/dist-types/helpers/vendors.d.ts +2 -3
- package/dist-types/helpers/version.d.ts +2 -3
- package/dist-types/hooks.d.ts +6 -8
- package/dist-types/index.d.ts +10 -5
- package/dist-types/initConfigs.d.ts +2 -3
- package/dist-types/initPlugins.d.ts +1 -1
- package/dist-types/inspectConfig.d.ts +1 -1
- package/dist-types/loadConfig.d.ts +24 -32
- package/dist-types/loadEnv.d.ts +48 -57
- package/dist-types/loader/transformRawLoader.d.ts +1 -0
- package/dist-types/logger.d.ts +1 -2
- package/dist-types/mergeConfig.d.ts +1 -2
- package/dist-types/pluginHelper.d.ts +1 -2
- package/dist-types/pluginManager.d.ts +4 -7
- package/dist-types/plugins/basic.d.ts +1 -2
- package/dist-types/plugins/css.d.ts +4 -0
- package/dist-types/plugins/fileSize.d.ts +6 -5
- package/dist-types/plugins/rspackProfile.d.ts +2 -0
- package/dist-types/plugins/server.d.ts +1 -0
- package/dist-types/plugins/swc.d.ts +1 -2
- package/dist-types/restart.d.ts +4 -5
- package/dist-types/rspack-plugins/RsbuildHtmlPlugin.d.ts +2 -3
- package/dist-types/rspack-plugins/resource-hints/HtmlResourceHintsPlugin.d.ts +2 -3
- package/dist-types/rspack-plugins/resource-hints/doesChunkBelongToHtml.d.ts +3 -4
- package/dist-types/rspack-plugins/resource-hints/extractChunks.d.ts +1 -2
- package/dist-types/rspack-plugins/resource-hints/getResourceType.d.ts +2 -3
- package/dist-types/rspackConfig.d.ts +1 -1
- package/dist-types/server/ansiHTML.d.ts +1 -2
- package/dist-types/server/assets-middleware/getFileFromUrl.d.ts +1 -2
- package/dist-types/server/assets-middleware/index.d.ts +3 -5
- package/dist-types/server/assets-middleware/setupWriteToDisk.d.ts +1 -2
- package/dist-types/server/browserLogs.d.ts +1 -2
- package/dist-types/server/buildManager.d.ts +4 -6
- package/dist-types/server/cliShortcuts.d.ts +3 -1
- package/dist-types/server/devMiddlewares.d.ts +2 -3
- package/dist-types/server/devServer.d.ts +18 -23
- package/dist-types/server/gracefulShutdown.d.ts +2 -4
- package/dist-types/server/gzipMiddleware.d.ts +1 -1
- package/dist-types/server/helper.d.ts +36 -45
- package/dist-types/server/historyApiFallback.d.ts +8 -1
- package/dist-types/server/httpServer.d.ts +1 -1
- package/dist-types/server/middlewares.d.ts +4 -8
- package/dist-types/server/open.d.ts +1 -1
- package/dist-types/server/runner/basic.d.ts +4 -5
- package/dist-types/server/runner/index.d.ts +3 -1
- package/dist-types/server/socketServer.d.ts +24 -18
- package/dist-types/server/watchFiles.d.ts +1 -1
- package/dist-types/types/config.d.ts +1192 -1465
- package/dist-types/types/context.d.ts +63 -92
- package/dist-types/types/hooks.d.ts +106 -150
- package/dist-types/types/plugin.d.ts +359 -444
- package/dist-types/types/rsbuild.d.ts +156 -191
- package/dist-types/types/thirdParty.d.ts +101 -132
- package/dist-types/types/utils.d.ts +2 -5
- package/package.json +13 -13
- package/dist-types/client/hmr.d.ts +0 -3
- package/dist-types/client/log.d.ts +0 -13
- package/dist-types/client/overlay.d.ts +0 -1
package/dist/tinyglobby.js
CHANGED
|
@@ -1457,7 +1457,7 @@ var Builder = class {
|
|
|
1457
1457
|
return isMatch || (isMatch = globFn(patterns, ...options), this.globCache[patterns.join("\0")] = isMatch), this.options.filters.push((path)=>isMatch(path)), this;
|
|
1458
1458
|
}
|
|
1459
1459
|
};
|
|
1460
|
-
let picomatch = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/index.js"), isReadonlyArray = Array.isArray, BACKSLASHES = /\\/g, isWin = "win32" === process.platform, ONLY_PARENT_DIRECTORIES = /^(\/?\.\.)+$/;
|
|
1460
|
+
let picomatch = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/index.js"), isReadonlyArray = Array.isArray, BACKSLASHES = /\\/g, DRIVE_RELATIVE_PATH = /^[A-Za-z]:$/, isWin = "win32" === process.platform, ONLY_PARENT_DIRECTORIES = /^(\/?\.\.)+$/;
|
|
1461
1461
|
function getPartialMatcher(patterns, options = {}) {
|
|
1462
1462
|
let i, j, patternsCount = patterns.length, patternsParts = Array(patternsCount), matchers = Array(patternsCount);
|
|
1463
1463
|
for(i = 0; i < patternsCount; i++){
|
|
@@ -1510,6 +1510,9 @@ function buildRelative(cwd, root) {
|
|
|
1510
1510
|
return "/" === p[p.length - 1] && "" !== result ? `${result}/` : result || ".";
|
|
1511
1511
|
};
|
|
1512
1512
|
}
|
|
1513
|
+
function ensureNonDriveRelativePath(path) {
|
|
1514
|
+
return path.replace(DRIVE_RELATIVE_PATH, (match)=>`${match}/`);
|
|
1515
|
+
}
|
|
1513
1516
|
let splitPatternOptions = {
|
|
1514
1517
|
parts: !0
|
|
1515
1518
|
};
|
|
@@ -1546,7 +1549,7 @@ function normalizePattern(pattern, opts, props, isIgnore) {
|
|
|
1546
1549
|
let n = (parentDir.length + 1) / 3, i = 0, cwdParts = escapedCwd.split("/");
|
|
1547
1550
|
for(; i < n && parts[i + n] === cwdParts[cwdParts.length + i - n];)result = result.slice(0, (n - i - 1) * 3) + result.slice((n - i) * 3 + parts[i + n].length + 1) || ".", i++;
|
|
1548
1551
|
let potentialRoot = posix.join(cwd, parentDir.slice(3 * i));
|
|
1549
|
-
"." !== potentialRoot[0] && props.root.length > potentialRoot.length && (props.root = potentialRoot, props.depthOffset = -n + i);
|
|
1552
|
+
"." !== potentialRoot[0] && props.root.length > potentialRoot.length && (props.root = ensureNonDriveRelativePath(potentialRoot), props.depthOffset = -n + i);
|
|
1550
1553
|
}
|
|
1551
1554
|
if (!isIgnore && props.depthOffset >= 0) {
|
|
1552
1555
|
null != props.commonPath || (props.commonPath = parts);
|
|
@@ -1560,7 +1563,7 @@ function normalizePattern(pattern, opts, props, isIgnore) {
|
|
|
1560
1563
|
if (i === parts.length - 1 || part !== props.commonPath[i] || isDynamicPattern(part)) break;
|
|
1561
1564
|
newCommonPath.push(part);
|
|
1562
1565
|
}
|
|
1563
|
-
props.depthOffset = newCommonPath.length, props.commonPath = newCommonPath, props.root = newCommonPath.length > 0 ? posix.join(cwd, ...newCommonPath) : cwd;
|
|
1566
|
+
props.depthOffset = newCommonPath.length, props.commonPath = newCommonPath, props.root = ensureNonDriveRelativePath(newCommonPath.length > 0 ? posix.join(cwd, ...newCommonPath) : cwd);
|
|
1564
1567
|
}
|
|
1565
1568
|
return result;
|
|
1566
1569
|
}
|
|
@@ -1631,18 +1634,17 @@ function formatPaths(paths, mapper) {
|
|
|
1631
1634
|
}
|
|
1632
1635
|
let defaultOptions = {
|
|
1633
1636
|
caseSensitiveMatch: !0,
|
|
1634
|
-
cwd: process.cwd(),
|
|
1635
1637
|
debug: !!process.env.TINYGLOBBY_DEBUG,
|
|
1636
1638
|
expandDirectories: !0,
|
|
1637
1639
|
followSymbolicLinks: !0,
|
|
1638
1640
|
onlyFiles: !0
|
|
1639
1641
|
};
|
|
1640
1642
|
function getOptions(options) {
|
|
1641
|
-
let opts = {
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
};
|
|
1645
|
-
return opts.cwd = (opts.cwd instanceof URL ? fileURLToPath(opts.cwd) : resolve(opts.cwd)).replace(BACKSLASHES, "/"), opts.ignore = ensureStringArray(opts.ignore), opts.fs && (opts.fs = {
|
|
1643
|
+
let opts = Object.assign({}, options);
|
|
1644
|
+
for(let key in defaultOptions)void 0 === opts[key] && Object.assign(opts, {
|
|
1645
|
+
[key]: defaultOptions[key]
|
|
1646
|
+
});
|
|
1647
|
+
return opts.cwd = (opts.cwd instanceof URL ? fileURLToPath(opts.cwd) : resolve(opts.cwd || process.cwd())).replace(BACKSLASHES, "/"), opts.ignore = ensureStringArray(opts.ignore), opts.fs && (opts.fs = {
|
|
1646
1648
|
readdir: opts.fs.readdir || readdir,
|
|
1647
1649
|
readdirSync: opts.fs.readdirSync || readdirSync,
|
|
1648
1650
|
realpath: opts.fs.realpath || realpath,
|
package/dist-types/build.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { InitConfigsOptions } from './initConfigs';
|
|
2
2
|
import type { Build, BuildOptions } from './types';
|
|
3
|
-
export declare const RSPACK_BUILD_ERROR =
|
|
3
|
+
export declare const RSPACK_BUILD_ERROR = 'Rspack build failed.';
|
|
4
4
|
export declare const build: (initOptions: InitConfigsOptions, { watch }?: BuildOptions) => Promise<ReturnType<Build>>;
|
package/dist-types/cli/init.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { RsbuildInstance } from '../types';
|
|
2
2
|
import type { CommonOptions } from './commands';
|
|
3
|
-
export declare function init({ cliOptions, isRestart, isBuildWatch
|
|
3
|
+
export declare function init({ cliOptions, isRestart, isBuildWatch }: {
|
|
4
4
|
cliOptions?: CommonOptions;
|
|
5
5
|
isRestart?: boolean;
|
|
6
6
|
isBuildWatch?: boolean;
|
|
@@ -2,138 +2,79 @@ import { RspackChain } from './helpers';
|
|
|
2
2
|
import type { InternalContext, ModifyBundlerChainUtils } from './types';
|
|
3
3
|
export declare function modifyBundlerChain(context: InternalContext, utils: ModifyBundlerChainUtils): Promise<RspackChain>;
|
|
4
4
|
export declare const CHAIN_ID: {
|
|
5
|
-
/** Predefined rules */
|
|
6
|
-
|
|
7
|
-
/** Rule for
|
|
8
|
-
readonly
|
|
9
|
-
/** Rule for
|
|
10
|
-
readonly
|
|
11
|
-
/** Rule for
|
|
12
|
-
readonly
|
|
13
|
-
/** Rule for
|
|
14
|
-
readonly
|
|
15
|
-
/** Rule for
|
|
16
|
-
readonly
|
|
17
|
-
/** Rule for
|
|
18
|
-
readonly
|
|
19
|
-
/** Rule for
|
|
20
|
-
readonly
|
|
21
|
-
/** Rule for
|
|
22
|
-
readonly JS_DATA_URI: 'js-data-uri';
|
|
23
|
-
/** Rule for CSS */
|
|
24
|
-
readonly CSS: 'css';
|
|
25
|
-
/** Rule for Less */
|
|
26
|
-
readonly LESS: 'less';
|
|
27
|
-
/** Rule for Sass */
|
|
28
|
-
readonly SASS: 'sass';
|
|
29
|
-
/** Rule for stylus */
|
|
30
|
-
readonly STYLUS: 'stylus';
|
|
31
|
-
/** Rule for svg */
|
|
32
|
-
readonly SVG: 'svg';
|
|
33
|
-
/** Rule for Vue */
|
|
34
|
-
readonly VUE: 'vue';
|
|
35
|
-
/** Rule for wasm */
|
|
36
|
-
readonly WASM: 'wasm';
|
|
37
|
-
/** Rule for svelte */
|
|
38
|
-
readonly SVELTE: 'svelte';
|
|
5
|
+
/** Predefined rules */ readonly RULE: {
|
|
6
|
+
/** Rule for .mjs */ readonly MJS: 'mjs';
|
|
7
|
+
/** Rule for fonts */ readonly FONT: 'font';
|
|
8
|
+
/** Rule for JSON */ readonly JSON: 'json';
|
|
9
|
+
/** Rule for images */ readonly IMAGE: 'image';
|
|
10
|
+
/** Rule for media */ readonly MEDIA: 'media';
|
|
11
|
+
/** Rule for additional assets */ readonly ADDITIONAL_ASSETS: 'additional-assets';
|
|
12
|
+
/** Rule for JS */ readonly JS: 'js';
|
|
13
|
+
/** Rule for data uri encoded javascript */ readonly JS_DATA_URI: 'js-data-uri';
|
|
14
|
+
/** Rule for CSS */ readonly CSS: 'css';
|
|
15
|
+
/** Rule for Less */ readonly LESS: 'less';
|
|
16
|
+
/** Rule for Sass */ readonly SASS: 'sass';
|
|
17
|
+
/** Rule for stylus */ readonly STYLUS: 'stylus';
|
|
18
|
+
/** Rule for svg */ readonly SVG: 'svg';
|
|
19
|
+
/** Rule for Vue */ readonly VUE: 'vue';
|
|
20
|
+
/** Rule for wasm */ readonly WASM: 'wasm';
|
|
21
|
+
/** Rule for svelte */ readonly SVELTE: 'svelte';
|
|
39
22
|
};
|
|
40
|
-
/** Predefined rule groups */
|
|
41
|
-
|
|
42
|
-
/** JS oneOf rules */
|
|
43
|
-
readonly JS_MAIN: 'js';
|
|
23
|
+
/** Predefined rule groups */ readonly ONE_OF: {
|
|
24
|
+
/** JS oneOf rules */ readonly JS_MAIN: 'js';
|
|
44
25
|
readonly JS_WORKER: 'js-worker';
|
|
45
26
|
readonly JS_RAW: 'js-raw';
|
|
46
|
-
/** CSS oneOf rules */
|
|
47
|
-
readonly CSS_MAIN: 'css';
|
|
27
|
+
/** CSS oneOf rules */ readonly CSS_MAIN: 'css';
|
|
48
28
|
readonly CSS_RAW: 'css-raw';
|
|
49
29
|
readonly CSS_URL: 'css-url';
|
|
50
30
|
readonly CSS_INLINE: 'css-inline';
|
|
51
|
-
/** SVG oneOf rules */
|
|
52
|
-
readonly SVG: 'svg';
|
|
31
|
+
/** SVG oneOf rules */ readonly SVG: 'svg';
|
|
53
32
|
readonly SVG_RAW: 'svg-asset-raw';
|
|
54
33
|
readonly SVG_URL: 'svg-asset-url';
|
|
55
34
|
readonly SVG_ASSET: 'svg-asset';
|
|
56
35
|
readonly SVG_REACT: 'svg-react';
|
|
57
36
|
readonly SVG_INLINE: 'svg-asset-inline';
|
|
58
37
|
};
|
|
59
|
-
/** Predefined loaders */
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
readonly
|
|
63
|
-
/**
|
|
64
|
-
readonly
|
|
65
|
-
/**
|
|
66
|
-
readonly
|
|
67
|
-
/**
|
|
68
|
-
readonly
|
|
69
|
-
/**
|
|
70
|
-
readonly
|
|
71
|
-
/**
|
|
72
|
-
readonly
|
|
73
|
-
/**
|
|
74
|
-
readonly
|
|
75
|
-
/**
|
|
76
|
-
readonly
|
|
77
|
-
/**
|
|
78
|
-
readonly
|
|
79
|
-
/** worker query loader */
|
|
80
|
-
readonly WORKER_QUERY: 'worker-query';
|
|
81
|
-
/** svgr */
|
|
82
|
-
readonly SVGR: 'svgr';
|
|
83
|
-
/** babel-loader */
|
|
84
|
-
readonly BABEL: 'babel';
|
|
85
|
-
/** style-loader */
|
|
86
|
-
readonly STYLE: 'style-loader';
|
|
87
|
-
/** svelte-loader */
|
|
88
|
-
readonly SVELTE: 'svelte';
|
|
89
|
-
/** postcss-loader */
|
|
90
|
-
readonly POSTCSS: 'postcss';
|
|
91
|
-
/** lightningcss-loader */
|
|
92
|
-
readonly LIGHTNINGCSS: 'lightningcss';
|
|
93
|
-
/** ignore-css-loader */
|
|
94
|
-
readonly IGNORE_CSS: 'ignore-css';
|
|
95
|
-
/** CssExtractRspackPlugin.loader */
|
|
96
|
-
readonly MINI_CSS_EXTRACT: 'mini-css-extract';
|
|
97
|
-
/** resolve-url-loader */
|
|
98
|
-
readonly RESOLVE_URL: 'resolve-url-loader';
|
|
38
|
+
/** Predefined loaders */ readonly USE: {
|
|
39
|
+
/** ts-loader */ readonly TS: 'ts';
|
|
40
|
+
/** css-loader */ readonly CSS: 'css';
|
|
41
|
+
/** CSS URL loader */ readonly CSS_URL: 'css-url';
|
|
42
|
+
/** sass-loader */ readonly SASS: 'sass';
|
|
43
|
+
/** less-loader */ readonly LESS: 'less';
|
|
44
|
+
/** stylus-loader */ readonly STYLUS: 'stylus';
|
|
45
|
+
/** url-loader */ readonly URL: 'url';
|
|
46
|
+
/** vue-loader */ readonly VUE: 'vue';
|
|
47
|
+
/** swc-loader */ readonly SWC: 'swc';
|
|
48
|
+
/** worker query loader */ readonly WORKER_QUERY: 'worker-query';
|
|
49
|
+
/** svgr */ readonly SVGR: 'svgr';
|
|
50
|
+
/** babel-loader */ readonly BABEL: 'babel';
|
|
51
|
+
/** style-loader */ readonly STYLE: 'style-loader';
|
|
52
|
+
/** svelte-loader */ readonly SVELTE: 'svelte';
|
|
53
|
+
/** postcss-loader */ readonly POSTCSS: 'postcss';
|
|
54
|
+
/** lightningcss-loader */ readonly LIGHTNINGCSS: 'lightningcss';
|
|
55
|
+
/** ignore-css-loader */ readonly IGNORE_CSS: 'ignore-css';
|
|
56
|
+
/** CssExtractRspackPlugin.loader */ readonly MINI_CSS_EXTRACT: 'mini-css-extract';
|
|
57
|
+
/** resolve-url-loader */ readonly RESOLVE_URL: 'resolve-url-loader';
|
|
99
58
|
};
|
|
100
|
-
/** Predefined plugins */
|
|
101
|
-
|
|
102
|
-
/**
|
|
103
|
-
readonly
|
|
104
|
-
/**
|
|
105
|
-
readonly
|
|
106
|
-
/**
|
|
107
|
-
readonly
|
|
108
|
-
/**
|
|
109
|
-
readonly
|
|
110
|
-
/**
|
|
111
|
-
readonly
|
|
112
|
-
/**
|
|
113
|
-
readonly
|
|
114
|
-
/**
|
|
115
|
-
readonly TS_CHECKER: 'ts-checker';
|
|
116
|
-
/** ModuleFederationPlugin */
|
|
117
|
-
readonly MODULE_FEDERATION: 'module-federation';
|
|
118
|
-
/** HtmlResourceHintsPlugin (prefetch) */
|
|
119
|
-
readonly HTML_PREFETCH: 'html-prefetch-plugin';
|
|
120
|
-
/** HtmlResourceHintsPlugin (preload) */
|
|
121
|
-
readonly HTML_PRELOAD: 'html-preload-plugin';
|
|
122
|
-
/** CssExtractRspackPlugin */
|
|
123
|
-
readonly MINI_CSS_EXTRACT: 'mini-css-extract';
|
|
124
|
-
/** VueLoaderPlugin */
|
|
125
|
-
readonly VUE_LOADER_PLUGIN: 'vue-loader-plugin';
|
|
126
|
-
/** ReactFastRefreshPlugin */
|
|
127
|
-
readonly REACT_FAST_REFRESH: 'react-fast-refresh';
|
|
128
|
-
/** SubresourceIntegrityPlugin */
|
|
129
|
-
readonly SUBRESOURCE_INTEGRITY: 'subresource-integrity';
|
|
59
|
+
/** Predefined plugins */ readonly PLUGIN: {
|
|
60
|
+
/** HotModuleReplacementPlugin */ readonly HMR: 'hmr';
|
|
61
|
+
/** CopyRspackPlugin */ readonly COPY: 'copy';
|
|
62
|
+
/** HtmlRspackPlugin */ readonly HTML: 'html';
|
|
63
|
+
/** DefinePlugin */ readonly DEFINE: 'define';
|
|
64
|
+
/** ProgressPlugin */ readonly PROGRESS: 'progress';
|
|
65
|
+
/** RspackManifestPlugin */ readonly MANIFEST: 'rspack-manifest';
|
|
66
|
+
/** ForkTsCheckerWebpackPlugin */ readonly TS_CHECKER: 'ts-checker';
|
|
67
|
+
/** ModuleFederationPlugin */ readonly MODULE_FEDERATION: 'module-federation';
|
|
68
|
+
/** HtmlResourceHintsPlugin (prefetch) */ readonly HTML_PREFETCH: 'html-prefetch-plugin';
|
|
69
|
+
/** HtmlResourceHintsPlugin (preload) */ readonly HTML_PRELOAD: 'html-preload-plugin';
|
|
70
|
+
/** CssExtractRspackPlugin */ readonly MINI_CSS_EXTRACT: 'mini-css-extract';
|
|
71
|
+
/** VueLoaderPlugin */ readonly VUE_LOADER_PLUGIN: 'vue-loader-plugin';
|
|
72
|
+
/** ReactFastRefreshPlugin */ readonly REACT_FAST_REFRESH: 'react-fast-refresh';
|
|
73
|
+
/** SubresourceIntegrityPlugin */ readonly SUBRESOURCE_INTEGRITY: 'subresource-integrity';
|
|
130
74
|
};
|
|
131
|
-
/** Predefined minimizers */
|
|
132
|
-
|
|
133
|
-
/**
|
|
134
|
-
readonly JS: 'js';
|
|
135
|
-
/** LightningCssMinimizerRspackPlugin */
|
|
136
|
-
readonly CSS: 'css';
|
|
75
|
+
/** Predefined minimizers */ readonly MINIMIZER: {
|
|
76
|
+
/** SwcJsMinimizerRspackPlugin */ readonly JS: 'js';
|
|
77
|
+
/** LightningCssMinimizerRspackPlugin */ readonly CSS: 'css';
|
|
137
78
|
};
|
|
138
79
|
};
|
|
139
80
|
export type ChainIdentifier = typeof CHAIN_ID;
|
|
@@ -1,61 +1,65 @@
|
|
|
1
1
|
export declare const isDeno: boolean;
|
|
2
2
|
export declare const isWindows: boolean;
|
|
3
|
-
|
|
4
|
-
export declare const
|
|
5
|
-
export declare const
|
|
6
|
-
export declare const
|
|
7
|
-
export declare const
|
|
8
|
-
export declare const
|
|
9
|
-
export declare const
|
|
10
|
-
export declare const
|
|
11
|
-
export declare const
|
|
12
|
-
export declare const
|
|
13
|
-
export declare const
|
|
3
|
+
// Paths
|
|
4
|
+
export declare const ROOT_DIST_DIR = 'dist';
|
|
5
|
+
export declare const HTML_DIST_DIR = './';
|
|
6
|
+
export declare const FAVICON_DIST_DIR = './';
|
|
7
|
+
export declare const JS_DIST_DIR = 'static/js';
|
|
8
|
+
export declare const CSS_DIST_DIR = 'static/css';
|
|
9
|
+
export declare const SVG_DIST_DIR = 'static/svg';
|
|
10
|
+
export declare const FONT_DIST_DIR = 'static/font';
|
|
11
|
+
export declare const WASM_DIST_DIR = 'static/wasm';
|
|
12
|
+
export declare const IMAGE_DIST_DIR = 'static/image';
|
|
13
|
+
export declare const MEDIA_DIST_DIR = 'static/media';
|
|
14
|
+
export declare const ASSETS_DIST_DIR = 'static/assets';
|
|
15
|
+
// loaders will be emitted to the same folder of the main bundle
|
|
14
16
|
export declare const LOADER_PATH: string;
|
|
15
17
|
export declare const STATIC_PATH: string;
|
|
16
18
|
export declare const CLIENT_PATH: string;
|
|
17
19
|
export declare const COMPILED_PATH: string;
|
|
18
|
-
export declare const TS_CONFIG_FILE =
|
|
19
|
-
export declare const HMR_SOCKET_PATH =
|
|
20
|
-
export declare const RSBUILD_OUTPUTS_PATH =
|
|
21
|
-
export declare const LOCALHOST =
|
|
22
|
-
export declare const ALL_INTERFACES_IPV4 =
|
|
20
|
+
export declare const TS_CONFIG_FILE = 'tsconfig.json';
|
|
21
|
+
export declare const HMR_SOCKET_PATH = '/rsbuild-hmr';
|
|
22
|
+
export declare const RSBUILD_OUTPUTS_PATH = '.rsbuild';
|
|
23
|
+
export declare const LOCALHOST = 'localhost';
|
|
24
|
+
export declare const ALL_INTERFACES_IPV4 = '0.0.0.0';
|
|
25
|
+
// Defaults
|
|
23
26
|
export declare const DEFAULT_PORT = 3000;
|
|
24
27
|
export declare const DEFAULT_DATA_URL_SIZE = 4096;
|
|
25
|
-
export declare const DEFAULT_MOUNT_ID =
|
|
26
|
-
export declare const DEFAULT_ASSET_PREFIX =
|
|
27
|
-
export declare const DEFAULT_STACK_TRACE =
|
|
28
|
+
export declare const DEFAULT_MOUNT_ID = 'root';
|
|
29
|
+
export declare const DEFAULT_ASSET_PREFIX = '/';
|
|
30
|
+
export declare const DEFAULT_STACK_TRACE = 'summary';
|
|
31
|
+
// Defaults to "baseline widely available on 2025-05-01"
|
|
32
|
+
// https://browsersl.ist/#q=baseline+widely+available+on+2025-05-01
|
|
28
33
|
export declare const DEFAULT_WEB_BROWSERSLIST: string[];
|
|
29
34
|
export declare const DEFAULT_BROWSERSLIST: Record<string, string[]>;
|
|
35
|
+
// RegExp
|
|
30
36
|
export declare const JS_REGEX: RegExp;
|
|
31
37
|
export declare const SCRIPT_REGEX: RegExp;
|
|
32
38
|
export declare const CSS_REGEX: RegExp;
|
|
33
39
|
/**
|
|
34
40
|
* Regular expression to match the 'raw' query parameter.
|
|
35
41
|
* Matches patterns like: `?raw`, `?raw&other=value`, `?other=value&raw`, `?raw=value`
|
|
36
|
-
*/
|
|
37
|
-
export declare const RAW_QUERY_REGEX: RegExp;
|
|
42
|
+
*/ export declare const RAW_QUERY_REGEX: RegExp;
|
|
38
43
|
/**
|
|
39
44
|
* Regular expression to match the 'inline' query parameter.
|
|
40
45
|
* Matches patterns like: `?inline`, `?inline&other=value`, `?other=value&inline`, `?inline=value`
|
|
41
|
-
*/
|
|
42
|
-
export declare const INLINE_QUERY_REGEX: RegExp;
|
|
46
|
+
*/ export declare const INLINE_QUERY_REGEX: RegExp;
|
|
43
47
|
/**
|
|
44
48
|
* Regular expression to match the 'url' query parameter.
|
|
45
49
|
* Matches patterns like: `?url`, `?url&other=value`, `?other=value&url`, `?url=value`
|
|
46
|
-
*/
|
|
47
|
-
export declare const URL_QUERY_REGEX: RegExp;
|
|
50
|
+
*/ export declare const URL_QUERY_REGEX: RegExp;
|
|
48
51
|
/**
|
|
49
52
|
* Regular expression to match the 'worker' query parameter.
|
|
50
53
|
* Matches patterns like: `?worker`, `?worker&inline`, `?inline&worker`, `?worker=value`
|
|
51
|
-
*/
|
|
52
|
-
export declare const WORKER_QUERY_REGEX: RegExp;
|
|
54
|
+
*/ export declare const WORKER_QUERY_REGEX: RegExp;
|
|
53
55
|
export declare const NODE_MODULES_REGEX: RegExp;
|
|
54
|
-
|
|
55
|
-
export declare const
|
|
56
|
+
// Plugins
|
|
57
|
+
export declare const PLUGIN_SWC_NAME = 'rsbuild:swc';
|
|
58
|
+
export declare const PLUGIN_CSS_NAME = 'rsbuild:css';
|
|
59
|
+
// Extensions
|
|
56
60
|
export declare const FONT_EXTENSIONS: string[];
|
|
57
61
|
export declare const IMAGE_EXTENSIONS: string[];
|
|
58
62
|
export declare const VIDEO_EXTENSIONS: string[];
|
|
59
63
|
export declare const AUDIO_EXTENSIONS: string[];
|
|
60
|
-
export declare const LAZY_COMPILATION_IDENTIFIER =
|
|
61
|
-
export declare const BROWSER_LOG_PREFIX =
|
|
64
|
+
export declare const LAZY_COMPILATION_IDENTIFIER = 'lazy-compilation-proxy';
|
|
65
|
+
export declare const BROWSER_LOG_PREFIX = '[browser]';
|
|
@@ -8,5 +8,4 @@ export declare function createPublicContext(context: InternalContext): Readonly<
|
|
|
8
8
|
/**
|
|
9
9
|
* Generate the actual context used in the build,
|
|
10
10
|
* which can have a lot of overhead and take some side effects.
|
|
11
|
-
*/
|
|
12
|
-
export declare function createContext(options: ResolvedCreateRsbuildOptions, userConfig: RsbuildConfig, logger: Logger): Promise<InternalContext>;
|
|
11
|
+
*/ export declare function createContext(options: ResolvedCreateRsbuildOptions, userConfig: RsbuildConfig, logger: Logger): Promise<InternalContext>;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { CreateRsbuildOptions, RsbuildInstance } from './types';
|
|
2
2
|
/**
|
|
3
3
|
* Create an Rsbuild instance.
|
|
4
|
-
*/
|
|
5
|
-
export declare function createRsbuild(options?: CreateRsbuildOptions): Promise<RsbuildInstance>;
|
|
4
|
+
*/ export declare function createRsbuild(options?: CreateRsbuildOptions): Promise<RsbuildInstance>;
|
|
@@ -14,12 +14,10 @@ import type { NormalizedConfig, RsbuildConfig, RsbuildEntry } from './types';
|
|
|
14
14
|
* },
|
|
15
15
|
* }
|
|
16
16
|
* ```
|
|
17
|
-
*/
|
|
18
|
-
export declare const defaultAllowedOrigins: RegExp;
|
|
17
|
+
*/ export declare const defaultAllowedOrigins: RegExp;
|
|
19
18
|
export declare function getDefaultEntry(root: string): RsbuildEntry;
|
|
20
19
|
export declare const withDefaultConfig: (rootPath: string, userConfig: RsbuildConfig) => Promise<RsbuildConfig>;
|
|
21
20
|
/**
|
|
22
21
|
* Normalizes the user configuration by merging it with defaults and ensuring
|
|
23
22
|
* consistent structure.
|
|
24
|
-
*/
|
|
25
|
-
export declare const normalizeConfig: (config: RsbuildConfig, rootPath: string) => NormalizedConfig;
|
|
23
|
+
*/ export declare const normalizeConfig: (config: RsbuildConfig, rootPath: string) => NormalizedConfig;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import type { StatsError } from '@rspack/core';
|
|
2
2
|
import { type Logger } from '../logger';
|
|
3
|
-
|
|
3
|
+
// Formats Rspack stats error to readable message
|
|
4
|
+
export declare function formatStatsError(stats: StatsError, root: string, level: 'error' | 'warning' | undefined, logger: Logger): string;
|
|
@@ -6,13 +6,11 @@ export declare function isEmptyDir(path: string): boolean;
|
|
|
6
6
|
* Find first already exists file.
|
|
7
7
|
* @param files - Absolute file paths with extension.
|
|
8
8
|
* @returns The file path if exists, or false if no file exists.
|
|
9
|
-
*/
|
|
10
|
-
export declare const findExists: (files: string[]) => string | false;
|
|
9
|
+
*/ export declare const findExists: (files: string[]) => string | false;
|
|
11
10
|
export declare function pathExists(path: string): Promise<boolean>;
|
|
12
11
|
export declare function isFileExists(file: string): Promise<boolean>;
|
|
13
12
|
export declare function fileExistsByCompilation({ inputFileSystem }: Rspack.Compilation, filePath: string): Promise<boolean>;
|
|
14
13
|
/**
|
|
15
14
|
* Read file asynchronously using Rspack compiler's filesystem.
|
|
16
|
-
*/
|
|
17
|
-
export declare function readFileAsync(fs: NonNullable<Rspack.Compilation['inputFileSystem'] | Rspack.OutputFileSystem>, filename: string): Promise<Buffer | string>;
|
|
15
|
+
*/ export declare function readFileAsync(fs: NonNullable<Rspack.Compilation['inputFileSystem'] | Rspack.OutputFileSystem>, filename: string): Promise<Buffer | string>;
|
|
18
16
|
export declare function emptyDir(dir: string, logger: Logger, keep?: RegExp[], checkExists?: boolean): Promise<void>;
|
|
@@ -24,7 +24,6 @@ export declare const camelCase: (input: string) => string;
|
|
|
24
24
|
export declare const prettyTime: (seconds: number) => string;
|
|
25
25
|
/**
|
|
26
26
|
* Check if running in a TTY context
|
|
27
|
-
*/
|
|
28
|
-
export declare const isTTY: (type?: 'stdin' | 'stdout') => boolean;
|
|
27
|
+
*/ export declare const isTTY: (type?: 'stdin' | 'stdout') => boolean;
|
|
29
28
|
export declare function hash(data: string): Promise<string>;
|
|
30
29
|
export declare const isRspackRuntimeModule: (identifier: string) => boolean;
|
|
@@ -7,20 +7,16 @@ export declare const getCompiledPath: (packageName: string) => string;
|
|
|
7
7
|
* @param base - Base path to resolve relative from.
|
|
8
8
|
* @param filePath - Absolute or relative file path.
|
|
9
9
|
* @returns Resolved absolute file path.
|
|
10
|
-
*/
|
|
11
|
-
export declare const ensureAbsolutePath: (base: string, filePath: string) => string;
|
|
10
|
+
*/ export declare const ensureAbsolutePath: (base: string, filePath: string) => string;
|
|
12
11
|
export declare const getPathnameFromUrl: (url: string) => string;
|
|
13
|
-
/** dedupe and remove nested paths */
|
|
14
|
-
export declare const dedupeNestedPaths: (paths: string[]) => string[];
|
|
12
|
+
/** dedupe and remove nested paths */ export declare const dedupeNestedPaths: (paths: string[]) => string[];
|
|
15
13
|
/**
|
|
16
14
|
* Convert Windows backslash paths to posix forward slashes
|
|
17
15
|
* @example
|
|
18
16
|
* toPosixPath('foo\\bar') // returns 'foo/bar'
|
|
19
|
-
*/
|
|
20
|
-
export declare const toPosixPath: (filepath: string) => string;
|
|
17
|
+
*/ export declare const toPosixPath: (filepath: string) => string;
|
|
21
18
|
/**
|
|
22
19
|
* Normalize filepaths for `source.include` and `source.exclude` configuration.
|
|
23
20
|
* On Windows, `require.resolve` returns paths with posix forward slashes,
|
|
24
21
|
* This function normalizes the path to use backslashes.
|
|
25
|
-
*/
|
|
26
|
-
export declare const normalizeRuleConditionPath: (filepath: Rspack.RuleSetCondition) => Rspack.RuleSetCondition;
|
|
22
|
+
*/ export declare const normalizeRuleConditionPath: (filepath: Rspack.RuleSetCondition) => Rspack.RuleSetCondition;
|
|
@@ -4,9 +4,8 @@ import type { ActionType, RsbuildStats, Rspack } from '../types';
|
|
|
4
4
|
* If stats has errors, return stats errors directly
|
|
5
5
|
* If stats has no errors, return child errors, as some errors exist in both
|
|
6
6
|
* stats and childCompiler
|
|
7
|
-
*/
|
|
8
|
-
export declare const
|
|
9
|
-
export declare const getStatsWarnings: ({ warnings, children, }: RsbuildStats) => Rspack.StatsError[];
|
|
7
|
+
*/ export declare const getStatsErrors: ({ errors, children }: RsbuildStats) => Rspack.StatsError[];
|
|
8
|
+
export declare const getStatsWarnings: ({ warnings, children }: RsbuildStats) => Rspack.StatsError[];
|
|
10
9
|
export declare function getRsbuildStats(statsInstance: Rspack.Stats | Rspack.MultiStats, compiler: Rspack.Compiler | Rspack.MultiCompiler, logger: Logger, action?: ActionType): RsbuildStats;
|
|
11
10
|
export declare function formatStats(stats: RsbuildStats, hasErrors: boolean, root: string, logger: Logger): {
|
|
12
11
|
message?: string;
|
|
@@ -15,5 +14,4 @@ export declare function formatStats(stats: RsbuildStats, hasErrors: boolean, roo
|
|
|
15
14
|
/**
|
|
16
15
|
* Remove the loader chain delimiter from the module identifier.
|
|
17
16
|
* @example ./src/index.js!=!/node_modules/my-loader/index.js -> ./src/index.js
|
|
18
|
-
*/
|
|
19
|
-
export declare const removeLoaderChainDelimiter: (moduleId: string, logger: Logger) => string;
|
|
17
|
+
*/ export declare const removeLoaderChainDelimiter: (moduleId: string, logger: Logger) => string;
|
|
@@ -3,6 +3,7 @@ import type { Rspack } from '../types';
|
|
|
3
3
|
export declare const removeLeadingSlash: (s: string) => string;
|
|
4
4
|
export declare const removeTailingSlash: (s: string) => string;
|
|
5
5
|
export declare const addTrailingSlash: (s: string) => string;
|
|
6
|
+
// Determine if the string is a URL
|
|
6
7
|
export declare const isURL: (str: string) => boolean;
|
|
7
8
|
export declare const urlJoin: (base: string, path: string) => string;
|
|
8
9
|
export declare const ensureAssetPrefix: (url: string, assetPrefix?: Rspack.PublicPath) => string;
|
|
@@ -8,6 +8,5 @@ export declare const require: NodeJS.Require;
|
|
|
8
8
|
* https://github.com/nodejs/node/issues/59913
|
|
9
9
|
* @param name
|
|
10
10
|
* @returns
|
|
11
|
-
*/
|
|
12
|
-
export
|
|
13
|
-
export {};
|
|
11
|
+
*/ export declare const requireCompiledPackage: <T extends keyof CompiledPackages>(name: T) => CompiledPackages[T];
|
|
12
|
+
export { };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
export declare const rspackMinVersion =
|
|
1
|
+
export declare const rspackMinVersion = '2.0.0';
|
|
2
2
|
/**
|
|
3
3
|
* If the application overrides the Rspack version to a lower one,
|
|
4
4
|
* we should check that the Rspack version is greater than the minimum
|
|
5
5
|
* supported version.
|
|
6
|
-
*/
|
|
7
|
-
export declare const isSatisfyRspackVersion: (originalVersion: string) => boolean;
|
|
6
|
+
*/ export declare const isSatisfyRspackVersion: (originalVersion: string) => boolean;
|
package/dist-types/hooks.d.ts
CHANGED
|
@@ -2,8 +2,7 @@ import type { AsyncHook, EnvironmentAsyncHook, InternalContext, ModifyBundlerCha
|
|
|
2
2
|
export declare function createEnvironmentAsyncHook<Callback extends (...args: any[]) => any>(): EnvironmentAsyncHook<Callback>;
|
|
3
3
|
export declare function createAsyncHook<Callback extends (...args: any[]) => any>(): AsyncHook<Callback>;
|
|
4
4
|
export declare function initHooks(): {
|
|
5
|
-
/** The following hooks are global hooks */
|
|
6
|
-
onExit: AsyncHook<OnExitFn>;
|
|
5
|
+
/** The following hooks are global hooks */ onExit: AsyncHook<OnExitFn>;
|
|
7
6
|
onAfterBuild: AsyncHook<OnAfterBuildFn>;
|
|
8
7
|
onCloseBuild: AsyncHook<OnCloseBuildFn>;
|
|
9
8
|
onBeforeBuild: AsyncHook<OnBeforeBuildFn>;
|
|
@@ -16,8 +15,7 @@ export declare function initHooks(): {
|
|
|
16
15
|
onBeforeStartPreviewServer: AsyncHook<OnBeforeStartPreviewServerFn>;
|
|
17
16
|
onAfterCreateCompiler: AsyncHook<OnAfterCreateCompilerFn>;
|
|
18
17
|
onBeforeCreateCompiler: AsyncHook<OnBeforeCreateCompilerFn>;
|
|
19
|
-
/** The following hooks are related to the environment */
|
|
20
|
-
modifyHTML: EnvironmentAsyncHook<ModifyHTMLFn>;
|
|
18
|
+
/** The following hooks are related to the environment */ modifyHTML: EnvironmentAsyncHook<ModifyHTMLFn>;
|
|
21
19
|
modifyHTMLTags: EnvironmentAsyncHook<ModifyHTMLTagsFn>;
|
|
22
20
|
modifyRspackConfig: EnvironmentAsyncHook<ModifyRspackConfigFn>;
|
|
23
21
|
modifyBundlerChain: EnvironmentAsyncHook<ModifyBundlerChainFn>;
|
|
@@ -27,16 +25,16 @@ export declare function initHooks(): {
|
|
|
27
25
|
onAfterEnvironmentCompile: EnvironmentAsyncHook<OnAfterEnvironmentCompileFn>;
|
|
28
26
|
};
|
|
29
27
|
export type Hooks = ReturnType<typeof initHooks>;
|
|
30
|
-
export declare const registerBuildHook: ({ context, isWatch, compiler, rspackConfigs, MultiStatsCtor
|
|
28
|
+
export declare const registerBuildHook: ({ context, isWatch, compiler, rspackConfigs, MultiStatsCtor }: {
|
|
31
29
|
rspackConfigs: Rspack.Configuration[];
|
|
32
30
|
context: InternalContext;
|
|
33
31
|
compiler: Rspack.Compiler | Rspack.MultiCompiler;
|
|
34
32
|
isWatch: boolean;
|
|
35
|
-
MultiStatsCtor: new
|
|
33
|
+
MultiStatsCtor: new(stats: Rspack.Stats[]) => Rspack.MultiStats;
|
|
36
34
|
}) => void;
|
|
37
|
-
export declare const registerDevHook: ({ context, compiler, bundlerConfigs, MultiStatsCtor
|
|
35
|
+
export declare const registerDevHook: ({ context, compiler, bundlerConfigs, MultiStatsCtor }: {
|
|
38
36
|
bundlerConfigs: Rspack.Configuration[];
|
|
39
37
|
context: InternalContext;
|
|
40
38
|
compiler: Rspack.Compiler | Rspack.MultiCompiler;
|
|
41
|
-
MultiStatsCtor: new
|
|
39
|
+
MultiStatsCtor: new(stats: Rspack.Stats[]) => Rspack.MultiStats;
|
|
42
40
|
}) => void;
|
package/dist-types/index.d.ts
CHANGED
|
@@ -1,23 +1,28 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The methods and types exported from this file are considered as
|
|
3
3
|
* the public API of @rsbuild/core.
|
|
4
|
-
*/
|
|
5
|
-
import type * as Rspack from '@rspack/core';
|
|
4
|
+
*/ import type * as Rspack from '@rspack/core';
|
|
6
5
|
import { rspack } from '@rspack/core';
|
|
7
6
|
export { runCLI } from './cli';
|
|
8
7
|
export { createRsbuild } from './createRsbuild';
|
|
9
|
-
export { type ConfigParams, defineConfig, type LoadConfigOptions, type LoadConfigResult, loadConfig
|
|
8
|
+
export { type ConfigParams, defineConfig, type LoadConfigOptions, type LoadConfigResult, loadConfig } from './loadConfig';
|
|
9
|
+
// Core methods
|
|
10
10
|
export { type LoadEnvOptions, type LoadEnvResult, loadEnv } from './loadEnv';
|
|
11
|
+
// Rsbuild version
|
|
11
12
|
export declare const version: string;
|
|
13
|
+
// Rspack instance
|
|
12
14
|
export { rspack };
|
|
13
15
|
export type { Rspack };
|
|
14
16
|
export type { ChainIdentifier } from './configChain';
|
|
17
|
+
// Constants
|
|
15
18
|
export { PLUGIN_CSS_NAME, PLUGIN_SWC_NAME } from './constants';
|
|
16
19
|
export { defaultAllowedOrigins } from './defaultConfig';
|
|
17
20
|
export { ensureAssetPrefix } from './helpers/url';
|
|
21
|
+
// Helpers
|
|
18
22
|
export { createLogger, type Logger, defaultLogger as logger } from './logger';
|
|
19
23
|
export { mergeRsbuildConfig } from './mergeConfig';
|
|
20
24
|
export type { RsbuildDevServer } from './server/devServer';
|
|
21
|
-
export type { RsbuildServerBase, ServerStartResult, StartDevServerResult, StartPreviewServerResult
|
|
25
|
+
export type { RsbuildServerBase, ServerStartResult, StartDevServerResult, StartPreviewServerResult } from './server/helper';
|
|
22
26
|
export type { RsbuildPreviewServer } from './server/previewServer';
|
|
23
|
-
|
|
27
|
+
// Types
|
|
28
|
+
export type { AliasStrategy, AppIcon, AppIconItem, AutoExternal, AutoExternalExclude, Build, BuildOptions, BuildResult, Charset, CleanDistPath, CleanDistPathObject, ClientConfig, CliShortcut, CompressOptions, ConfigChain, ConfigChainWithContext, Connect, ConsoleType, CreateCompiler, CreateRsbuildOptions, CrossOrigin, CSSLoaderOptions, CSSModules, CSSModulesLocalsConvention, DataUriLimit, Decorators, DevConfig, DistPathConfig, EnvironmentConfig, EnvironmentContext, FilenameConfig, FilenameHash, HistoryApiFallbackContext, HistoryApiFallbackOptions, HtmlBasicTag, HtmlConfig, HtmlFallback, HtmlRspackPlugin, HtmlTag, HtmlTagContext, HtmlTagDescriptor, HtmlTagHandler, InitConfigsOptions, InlineChunkConfig, InlineChunkTest, InlineChunkTestFunction, InspectConfigOptions, InspectConfigResult, InternalContext, LegalComments, LogLevel, ManifestConfig, ManifestData, ManifestObjectConfig, MergedEnvironmentConfig, MetaAttrs, MetaOptions, Minify, ModifyBundlerChainFn, ModifyBundlerChainUtils, ModifyChainUtils, ModifyEnvironmentConfigFn, ModifyEnvironmentConfigUtils, ModifyHTMLContext, ModifyHTMLFn, ModifyHTMLTagsContext, ModifyHTMLTagsFn, ModifyRsbuildConfigFn, ModifyRsbuildConfigUtils, ModifyRspackConfigFn, ModifyRspackConfigUtils, ModuleFederationConfig, NormalizedConfig, NormalizedDevConfig, NormalizedEnvironmentConfig, NormalizedHtmlConfig, NormalizedModuleFederationConfig, NormalizedOutputConfig, NormalizedPerformanceConfig, NormalizedResolveConfig, NormalizedSecurityConfig, NormalizedServerConfig, NormalizedSourceConfig, NormalizedSplitChunksConfig, NormalizedToolsConfig, OnAfterBuildFn, OnAfterCreateCompilerFn, OnAfterDevCompileFn, OnAfterEnvironmentCompileFn, OnAfterStartDevServerFn, OnAfterStartPreviewServerFn, OnBeforeBuildFn, OnBeforeCreateCompilerFn, OnBeforeDevCompileFn, OnBeforeEnvironmentCompileFn, OnBeforeStartDevServerFn, OnBeforeStartPreviewServerFn, OnCloseBuildFn, OnCloseDevServerFn, OnDevCompileDoneFn, OnExitFn, OutputConfig, OverlayOptions, OutputStructure, PerformanceConfig, PluginManager, Polyfill, PostCSSLoaderOptions, PostCSSOptions, PostCSSPlugin, PreconnectOption, PreviewOptions, PrintUrls, ProcessAssetsDescriptor, ProcessAssetsHandler, ProcessAssetsHook, ProgressBarConfig, ProxyBypass, ProxyConfig, ProxyFilter, ProxyOptions, PublicDir, PublicDirOptions, RequestHandler, ResolveConfig, ResolvedCreateRsbuildOptions, ResolveHandler, ResolveHook, ResourceHintsIncludeType, RsbuildConfig, RsbuildContext, RsbuildEntry, RsbuildEntryDescription, RsbuildInstance, RsbuildMode, RsbuildPlugin, RsbuildPluginAPI, RsbuildPlugins, RsbuildTarget, RspackChain, RspackRule, ScriptInject, ScriptLoading, SecurityConfig, ServerConfig, SetupMiddlewaresContext, SetupMiddlewaresFn, SourceConfig, SourceMap, SourceMapExtract, SourceMapExtractOptions, SourceMapExtractTarget, SplitChunks, SplitChunksConfig, SplitChunksPreset, SriAlgorithm, SriOptions, StartDevServerOptions, StyleLoaderOptions, ToolsConfig, TransformContext, TransformDescriptor, TransformHandler, TransformHook, TransformImport, WatchFiles } from './types';
|
|
@@ -12,8 +12,7 @@ export type InitConfigsOptions = {
|
|
|
12
12
|
* 4. Initialize the configs for each environment
|
|
13
13
|
* 5. Run all the `modifyEnvironmentConfig` hooks
|
|
14
14
|
* 6. Validate the final Rsbuild config
|
|
15
|
-
*/
|
|
16
|
-
export declare function
|
|
17
|
-
export declare function initConfigs({ context, pluginManager, rsbuildOptions, }: InitConfigsOptions): Promise<{
|
|
15
|
+
*/ export declare function initRsbuildConfig({ context, pluginManager }: Pick<InitConfigsOptions, 'context' | 'pluginManager'>): Promise<NormalizedConfig>;
|
|
16
|
+
export declare function initConfigs({ context, pluginManager, rsbuildOptions }: InitConfigsOptions): Promise<{
|
|
18
17
|
rspackConfigs: Rspack.Configuration[];
|
|
19
18
|
}>;
|