@rsbuild/core 1.1.1 → 1.1.2
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/chokidar/index.d.ts +318 -189
- package/compiled/chokidar/index.js +1069 -4439
- package/compiled/chokidar/license +1 -1
- package/compiled/chokidar/package.json +1 -1
- package/compiled/tinyglobby/index.d.ts +25 -0
- package/compiled/tinyglobby/index.js +2749 -0
- package/compiled/tinyglobby/index1.js +17 -0
- package/compiled/tinyglobby/license +21 -0
- package/compiled/tinyglobby/package.json +1 -0
- package/dist/ignoreCssLoader.cjs +22 -44
- package/dist/index.cjs +3964 -8135
- package/dist/index.cjs.LICENSE.txt +13 -0
- package/dist/index.js +3957 -8098
- package/dist/index.js.LICENSE.txt +13 -0
- package/dist/transformLoader.cjs +26 -44
- package/dist/transformRawLoader.cjs +26 -53
- package/dist-types/cli/init.d.ts +2 -1
- package/dist-types/config.d.ts +2 -2
- package/dist-types/index.d.ts +1 -1
- package/dist-types/internal.d.ts +1 -13
- package/dist-types/plugins/css.d.ts +1 -2
- package/dist-types/provider/helpers.d.ts +12 -0
- package/dist-types/server/restart.d.ts +4 -0
- package/dist-types/server/watchFiles.d.ts +4 -1
- package/dist-types/types/config.d.ts +14 -6
- package/dist-types/types/rsbuild.d.ts +3 -1
- package/package.json +5 -5
|
@@ -0,0 +1,13 @@
|
|
|
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
|
+
*/
|
package/dist/transformLoader.cjs
CHANGED
|
@@ -1,49 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
// The require scope
|
|
3
2
|
var __webpack_require__ = {};
|
|
4
|
-
|
|
5
|
-
(()
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
(
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
// webpack/runtime/make_namespace_object
|
|
20
|
-
(()=>{
|
|
21
|
-
// define __esModule on exports
|
|
22
|
-
__webpack_require__.r = function(exports1) {
|
|
23
|
-
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
24
|
-
value: 'Module'
|
|
25
|
-
});
|
|
26
|
-
Object.defineProperty(exports1, '__esModule', {
|
|
27
|
-
value: true
|
|
28
|
-
});
|
|
29
|
-
};
|
|
30
|
-
})();
|
|
31
|
-
/************************************************************************/ var __webpack_exports__ = {};
|
|
32
|
-
__webpack_require__.r(__webpack_exports__);
|
|
33
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
34
|
-
default: function() {
|
|
35
|
-
return transform;
|
|
36
|
-
}
|
|
37
|
-
});
|
|
3
|
+
__webpack_require__.d = function(exports1, definition) {
|
|
4
|
+
for(var key in definition)__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key) && Object.defineProperty(exports1, key, {
|
|
5
|
+
enumerable: !0,
|
|
6
|
+
get: definition[key]
|
|
7
|
+
});
|
|
8
|
+
}, __webpack_require__.o = function(obj, prop) {
|
|
9
|
+
return Object.prototype.hasOwnProperty.call(obj, prop);
|
|
10
|
+
}, __webpack_require__.r = function(exports1) {
|
|
11
|
+
'undefined' != typeof Symbol && Symbol.toStringTag && Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
12
|
+
value: 'Module'
|
|
13
|
+
}), Object.defineProperty(exports1, '__esModule', {
|
|
14
|
+
value: !0
|
|
15
|
+
});
|
|
16
|
+
};
|
|
17
|
+
var __webpack_exports__ = {};
|
|
38
18
|
async function transform(source, map) {
|
|
39
19
|
var _this__compiler___rsbuildTransformer, _this__compiler;
|
|
40
|
-
|
|
41
|
-
const bypass = ()=>callback(null, source, map);
|
|
42
|
-
const { id: transformId, getEnvironment } = this.getOptions();
|
|
20
|
+
let callback = this.async(), bypass = ()=>callback(null, source, map), { id: transformId, getEnvironment } = this.getOptions();
|
|
43
21
|
if (!transformId) return bypass();
|
|
44
|
-
|
|
22
|
+
let transform = null === (_this__compiler = this._compiler) || void 0 === _this__compiler ? void 0 : null === (_this__compiler___rsbuildTransformer = _this__compiler.__rsbuildTransformer) || void 0 === _this__compiler___rsbuildTransformer ? void 0 : _this__compiler___rsbuildTransformer[transformId];
|
|
45
23
|
if (!transform) return bypass();
|
|
46
|
-
|
|
24
|
+
let result = await transform({
|
|
47
25
|
code: source,
|
|
48
26
|
resource: this.resource,
|
|
49
27
|
resourcePath: this.resourcePath,
|
|
@@ -54,14 +32,18 @@ async function transform(source, map) {
|
|
|
54
32
|
});
|
|
55
33
|
if (null == result) return bypass();
|
|
56
34
|
if ('string' == typeof result) return callback(null, result, map);
|
|
57
|
-
|
|
58
|
-
const finalMap = result.map ?? map;
|
|
35
|
+
let useMap = null != map, finalMap = result.map ?? map;
|
|
59
36
|
callback(null, result.code, useMap ? finalMap : void 0);
|
|
60
37
|
}
|
|
38
|
+
__webpack_require__.r(__webpack_exports__), __webpack_require__.d(__webpack_exports__, {
|
|
39
|
+
default: function() {
|
|
40
|
+
return transform;
|
|
41
|
+
}
|
|
42
|
+
});
|
|
61
43
|
var __webpack_export_target__ = exports;
|
|
62
44
|
for(var i in __webpack_exports__)__webpack_export_target__[i] = __webpack_exports__[i];
|
|
63
|
-
|
|
64
|
-
value:
|
|
45
|
+
__webpack_exports__.__esModule && Object.defineProperty(__webpack_export_target__, '__esModule', {
|
|
46
|
+
value: !0
|
|
65
47
|
});
|
|
66
48
|
|
|
67
49
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -8,13 +8,11 @@ var __webpack_modules__ = {
|
|
|
8
8
|
});
|
|
9
9
|
async function transform(source, map) {
|
|
10
10
|
var _this__compiler___rsbuildTransformer, _this__compiler;
|
|
11
|
-
|
|
12
|
-
const bypass = ()=>callback(null, source, map);
|
|
13
|
-
const { id: transformId, getEnvironment } = this.getOptions();
|
|
11
|
+
let callback = this.async(), bypass = ()=>callback(null, source, map), { id: transformId, getEnvironment } = this.getOptions();
|
|
14
12
|
if (!transformId) return bypass();
|
|
15
|
-
|
|
13
|
+
let transform = null === (_this__compiler = this._compiler) || void 0 === _this__compiler ? void 0 : null === (_this__compiler___rsbuildTransformer = _this__compiler.__rsbuildTransformer) || void 0 === _this__compiler___rsbuildTransformer ? void 0 : _this__compiler___rsbuildTransformer[transformId];
|
|
16
14
|
if (!transform) return bypass();
|
|
17
|
-
|
|
15
|
+
let result = await transform({
|
|
18
16
|
code: source,
|
|
19
17
|
resource: this.resource,
|
|
20
18
|
resourcePath: this.resourcePath,
|
|
@@ -25,58 +23,35 @@ var __webpack_modules__ = {
|
|
|
25
23
|
});
|
|
26
24
|
if (null == result) return bypass();
|
|
27
25
|
if ('string' == typeof result) return callback(null, result, map);
|
|
28
|
-
|
|
29
|
-
const finalMap = result.map ?? map;
|
|
26
|
+
let useMap = null != map, finalMap = result.map ?? map;
|
|
30
27
|
callback(null, result.code, useMap ? finalMap : void 0);
|
|
31
28
|
}
|
|
32
29
|
}
|
|
33
|
-
};
|
|
34
|
-
/************************************************************************/ // The module cache
|
|
35
|
-
var __webpack_module_cache__ = {};
|
|
36
|
-
// The require function
|
|
30
|
+
}, __webpack_module_cache__ = {};
|
|
37
31
|
function __webpack_require__(moduleId) {
|
|
38
|
-
// Check if module is in cache
|
|
39
32
|
var cachedModule = __webpack_module_cache__[moduleId];
|
|
40
33
|
if (void 0 !== cachedModule) return cachedModule.exports;
|
|
41
|
-
// Create a new module (and put it into the cache)
|
|
42
34
|
var module = __webpack_module_cache__[moduleId] = {
|
|
43
35
|
exports: {}
|
|
44
36
|
};
|
|
45
|
-
|
|
46
|
-
__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
47
|
-
// Return the exports of the module
|
|
48
|
-
return module.exports;
|
|
37
|
+
return __webpack_modules__[moduleId](module, module.exports, __webpack_require__), module.exports;
|
|
49
38
|
}
|
|
50
|
-
|
|
51
|
-
(()
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
(
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
(()=>{
|
|
67
|
-
// define __esModule on exports
|
|
68
|
-
__webpack_require__.r = function(exports1) {
|
|
69
|
-
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
70
|
-
value: 'Module'
|
|
71
|
-
});
|
|
72
|
-
Object.defineProperty(exports1, '__esModule', {
|
|
73
|
-
value: true
|
|
74
|
-
});
|
|
75
|
-
};
|
|
76
|
-
})();
|
|
77
|
-
/************************************************************************/ var __webpack_exports__ = {};
|
|
78
|
-
__webpack_require__.r(__webpack_exports__);
|
|
79
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
39
|
+
__webpack_require__.d = function(exports1, definition) {
|
|
40
|
+
for(var key in definition)__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key) && Object.defineProperty(exports1, key, {
|
|
41
|
+
enumerable: !0,
|
|
42
|
+
get: definition[key]
|
|
43
|
+
});
|
|
44
|
+
}, __webpack_require__.o = function(obj, prop) {
|
|
45
|
+
return Object.prototype.hasOwnProperty.call(obj, prop);
|
|
46
|
+
}, __webpack_require__.r = function(exports1) {
|
|
47
|
+
'undefined' != typeof Symbol && Symbol.toStringTag && Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
48
|
+
value: 'Module'
|
|
49
|
+
}), Object.defineProperty(exports1, '__esModule', {
|
|
50
|
+
value: !0
|
|
51
|
+
});
|
|
52
|
+
};
|
|
53
|
+
var __webpack_exports__ = {};
|
|
54
|
+
__webpack_require__.r(__webpack_exports__), __webpack_require__.d(__webpack_exports__, {
|
|
80
55
|
default: function() {
|
|
81
56
|
return __WEBPACK_DEFAULT_EXPORT__;
|
|
82
57
|
},
|
|
@@ -84,14 +59,12 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
84
59
|
return raw;
|
|
85
60
|
}
|
|
86
61
|
});
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
// make the loader to receive raw Buffer
|
|
90
|
-
const raw = true;
|
|
62
|
+
var _transformLoader__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./src/loader/transformLoader.ts");
|
|
63
|
+
let __WEBPACK_DEFAULT_EXPORT__ = _transformLoader__WEBPACK_IMPORTED_MODULE_0__.default, raw = !0;
|
|
91
64
|
var __webpack_export_target__ = exports;
|
|
92
65
|
for(var i in __webpack_exports__)__webpack_export_target__[i] = __webpack_exports__[i];
|
|
93
|
-
|
|
94
|
-
value:
|
|
66
|
+
__webpack_exports__.__esModule && Object.defineProperty(__webpack_export_target__, '__esModule', {
|
|
67
|
+
value: !0
|
|
95
68
|
});
|
|
96
69
|
|
|
97
70
|
// Annotate the CommonJS export names for ESM import in node:
|
package/dist-types/cli/init.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { RsbuildInstance } from '../types';
|
|
2
2
|
import type { CommonOptions } from './commands';
|
|
3
|
-
export declare function init({ cliOptions, isRestart, }: {
|
|
3
|
+
export declare function init({ cliOptions, isRestart, isBuildWatch, }: {
|
|
4
4
|
cliOptions?: CommonOptions;
|
|
5
5
|
isRestart?: boolean;
|
|
6
|
+
isBuildWatch?: boolean;
|
|
6
7
|
}): Promise<RsbuildInstance | undefined>;
|
package/dist-types/config.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ChokidarOptions } from '../compiled/chokidar/index.js';
|
|
2
2
|
import type { InspectConfigOptions, InspectConfigResult, NormalizedConfig, PluginManager, PublicDir, PublicDirOptions, RsbuildConfig, RsbuildEntry } from './types';
|
|
3
3
|
export declare function getDefaultEntry(root: string): RsbuildEntry;
|
|
4
4
|
export declare const withDefaultConfig: (rootPath: string, config: RsbuildConfig) => Promise<RsbuildConfig>;
|
|
@@ -24,7 +24,7 @@ export declare function defineConfig(config: RsbuildConfig): RsbuildConfig;
|
|
|
24
24
|
export declare function defineConfig(config: RsbuildConfigSyncFn): RsbuildConfigSyncFn;
|
|
25
25
|
export declare function defineConfig(config: RsbuildConfigAsyncFn): RsbuildConfigAsyncFn;
|
|
26
26
|
export declare function defineConfig(config: RsbuildConfigExport): RsbuildConfigExport;
|
|
27
|
-
export declare function watchFilesForRestart(files: string[], watchOptions?:
|
|
27
|
+
export declare function watchFilesForRestart(files: string[], root: string, isBuildWatch: boolean, watchOptions?: ChokidarOptions): Promise<void>;
|
|
28
28
|
export declare function loadConfig({ cwd, path, envMode, }?: {
|
|
29
29
|
cwd?: string;
|
|
30
30
|
path?: string;
|
package/dist-types/index.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ 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 { AppIcon, AppIconItem, AliasStrategy, Build, BuildOptions, BundlerPluginInstance, CacheGroup, CacheGroups, Charset, ClientConfig, CliShortcut, ConfigChain, ConfigChainWithContext, ConsoleType, CreateCompiler, CreateRsbuildOptions, CrossOrigin, CSSLoaderOptions, CSSModules, CSSModulesLocalsConvention, DataUriLimit, Decorators, DevConfig, DistPathConfig, EnvironmentContext, EnvironmentConfig, FilenameConfig, HistoryApiFallbackContext, HistoryApiFallbackOptions, HtmlConfig, HtmlRspackPlugin, HtmlBasicTag, HtmlFallback, HtmlTagHandler, HtmlTagDescriptor, HtmlTagContext, InspectConfigOptions, InspectConfigResult, InlineChunkConfig, InlineChunkTest, InlineChunkTestFunction, LegalComments, MetaAttrs, MetaOptions, Minify, ModifyBundlerChainFn, ModifyBundlerChainUtils, ModifyChainUtils, ModifyRspackConfigFn, ModifyRspackConfigUtils, ModifyRsbuildConfigFn, ModifyWebpackChainFn, ModifyWebpackChainUtils, ModifyWebpackConfigFn, ModifyWebpackConfigUtils, ModuleFederationConfig, MergedEnvironmentConfig, NormalizedConfig, NormalizedDevConfig, NormalizedEnvironmentConfig, NormalizedHtmlConfig, NormalizedModuleFederationConfig, NormalizedOutputConfig, NormalizedPerformanceConfig, NormalizedSecurityConfig, NormalizedServerConfig, NormalizedSourceConfig, NormalizedToolsConfig, OnAfterBuildFn, OnAfterCreateCompilerFn, OnAfterStartDevServerFn, OnAfterStartProdServerFn, OnBeforeBuildFn, OnBeforeCreateCompilerFn, OnBeforeStartDevServerFn, OnBeforeStartProdServerFn, OnCloseDevServerFn, OnDevCompileDoneFn, OnExitFn, OutputConfig, OutputStructure, PerformanceConfig, PluginManager, Polyfill, PostCSSLoaderOptions, PostCSSPlugin, PreviewOptions, PreconnectOption, ProxyConfig, ProxyOptions, PrintUrls, PublicDir, PublicDirOptions, ProgressBarConfig, RequestHandler, ResolvedCreateRsbuildOptions, RsbuildConfig, RsbuildContext, RsbuildEntry, RsbuildEntryDescription, RsbuildInstance, RsbuildMode, RsbuildPlugin, RsbuildPluginAPI, RsbuildPlugins, RsbuildProvider, RsbuildTarget, RspackChain, RspackRule, SriOptions, SriAlgorithm, ScriptInject, ScriptLoading, SecurityConfig, SourceMap, SetupMiddlewaresFn, SetupMiddlewaresServer, ServerConfig, SourceConfig, SplitChunks, StyleLoaderOptions, ToolsConfig, TransformFn, TransformHandler, TransformImport, WatchFiles, } from './types';
|
|
18
|
+
export type { AppIcon, AppIconItem, AliasStrategy, Build, BuildOptions, BundlerPluginInstance, CacheGroup, CacheGroups, Charset, ClientConfig, CliShortcut, ConfigChain, ConfigChainWithContext, ConsoleType, CreateCompiler, CreateRsbuildOptions, CrossOrigin, CSSLoaderOptions, CSSModules, CSSModulesLocalsConvention, DataUriLimit, Decorators, DevConfig, DistPathConfig, EnvironmentContext, EnvironmentConfig, FilenameConfig, HistoryApiFallbackContext, HistoryApiFallbackOptions, HtmlConfig, HtmlRspackPlugin, HtmlBasicTag, HtmlFallback, HtmlTagHandler, HtmlTagDescriptor, HtmlTagContext, InspectConfigOptions, InspectConfigResult, InlineChunkConfig, InlineChunkTest, InlineChunkTestFunction, InternalContext, LegalComments, MetaAttrs, MetaOptions, Minify, ModifyBundlerChainFn, ModifyBundlerChainUtils, ModifyChainUtils, ModifyRspackConfigFn, ModifyRspackConfigUtils, ModifyRsbuildConfigFn, ModifyWebpackChainFn, ModifyWebpackChainUtils, ModifyWebpackConfigFn, ModifyWebpackConfigUtils, ModuleFederationConfig, MergedEnvironmentConfig, NormalizedConfig, NormalizedDevConfig, NormalizedEnvironmentConfig, NormalizedHtmlConfig, NormalizedModuleFederationConfig, NormalizedOutputConfig, NormalizedPerformanceConfig, NormalizedSecurityConfig, NormalizedServerConfig, NormalizedSourceConfig, NormalizedToolsConfig, OnAfterBuildFn, OnAfterCreateCompilerFn, OnAfterStartDevServerFn, OnAfterStartProdServerFn, OnBeforeBuildFn, OnBeforeCreateCompilerFn, OnBeforeStartDevServerFn, OnBeforeStartProdServerFn, OnCloseDevServerFn, OnDevCompileDoneFn, OnExitFn, OutputConfig, OutputStructure, PerformanceConfig, PluginManager, Polyfill, PostCSSLoaderOptions, PostCSSPlugin, PreviewOptions, PreconnectOption, ProxyConfig, ProxyOptions, PrintUrls, PublicDir, PublicDirOptions, ProgressBarConfig, RequestHandler, ResolvedCreateRsbuildOptions, RsbuildConfig, RsbuildContext, RsbuildEntry, RsbuildEntryDescription, RsbuildInstance, RsbuildMode, RsbuildPlugin, RsbuildPluginAPI, RsbuildPlugins, RsbuildProvider, RsbuildProviderHelpers, RsbuildTarget, RspackChain, RspackRule, SriOptions, SriAlgorithm, ScriptInject, ScriptLoading, SecurityConfig, SourceMap, SetupMiddlewaresFn, SetupMiddlewaresServer, ServerConfig, SourceConfig, SplitChunks, StyleLoaderOptions, ToolsConfig, TransformFn, TransformHandler, TransformImport, WatchFiles, } from './types';
|
|
19
19
|
export type { ChainIdentifier } from './configChain';
|
|
20
20
|
export {
|
|
21
21
|
/**
|
package/dist-types/internal.d.ts
CHANGED
|
@@ -5,16 +5,4 @@
|
|
|
5
5
|
*/
|
|
6
6
|
export { runCli } from './cli/commands';
|
|
7
7
|
export { prepareCli } from './cli/prepare';
|
|
8
|
-
export {
|
|
9
|
-
export { initHooks, type Hooks } from './hooks';
|
|
10
|
-
export { initRsbuildConfig } from './provider/initConfigs';
|
|
11
|
-
export { stringifyConfig, getRsbuildInspectConfig, outputInspectConfigFiles, } from './config';
|
|
12
|
-
export type { InternalContext } from './types';
|
|
13
|
-
export { setHTMLPlugin, getHTMLPlugin } from './pluginHelper';
|
|
14
|
-
export { formatStats, getStatsOptions, prettyTime, isPlainObject, } from './helpers';
|
|
15
|
-
export { registerBuildHook, registerDevHook, onCompileDone } from './hooks';
|
|
16
|
-
export { getChainUtils, getConfigUtils } from './provider/rspackConfig';
|
|
17
|
-
export { chainToConfig, modifyBundlerChain } from './configChain';
|
|
18
|
-
export { applySwcDecoratorConfig } from './plugins/swc';
|
|
19
|
-
export { getSwcMinimizerOptions } from './plugins/minimize';
|
|
20
|
-
export { createDevServer } from './server/devServer';
|
|
8
|
+
export { setHTMLPlugin } from './pluginHelper';
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { CSSLoaderOptions,
|
|
2
|
-
export declare const isUseCssExtract: (config: NormalizedEnvironmentConfig, target: RsbuildTarget) => boolean;
|
|
1
|
+
import type { CSSLoaderOptions, RsbuildPlugin } from '../types';
|
|
3
2
|
export declare const normalizeCssLoaderOptions: (options: CSSLoaderOptions, exportOnlyLocals: boolean) => CSSLoaderOptions;
|
|
4
3
|
export declare const pluginCss: () => RsbuildPlugin;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Helpers for `@rsbuild/webpack`.
|
|
3
|
+
*/
|
|
4
|
+
export { setCssExtractPlugin } from '../pluginHelper';
|
|
5
|
+
export { initRsbuildConfig } from './initConfigs';
|
|
6
|
+
export { stringifyConfig, getRsbuildInspectConfig, outputInspectConfigFiles, } from '../config';
|
|
7
|
+
export { getHTMLPlugin } from '../pluginHelper';
|
|
8
|
+
export { formatStats, getStatsOptions, prettyTime } from '../helpers';
|
|
9
|
+
export { registerBuildHook, registerDevHook } from '../hooks';
|
|
10
|
+
export { getChainUtils, getConfigUtils } from './rspackConfig';
|
|
11
|
+
export { chainToConfig, modifyBundlerChain } from '../configChain';
|
|
12
|
+
export { createDevServer } from '../server/devServer';
|
|
@@ -7,4 +7,8 @@ export declare const restartDevServer: ({ filePath, clear, }?: {
|
|
|
7
7
|
filePath?: string;
|
|
8
8
|
clear?: boolean;
|
|
9
9
|
}) => Promise<void>;
|
|
10
|
+
export declare const restartBuild: ({ filePath, clear, }?: {
|
|
11
|
+
filePath?: string;
|
|
12
|
+
clear?: boolean;
|
|
13
|
+
}) => Promise<void>;
|
|
10
14
|
export {};
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { FSWatcher } from '../../compiled/chokidar/index.js';
|
|
2
|
+
import type { ChokidarOptions, DevConfig, ServerConfig } from '../types';
|
|
2
3
|
import type { CompileMiddlewareAPI } from './getDevMiddlewares';
|
|
3
4
|
type WatchFilesOptions = {
|
|
4
5
|
dev: DevConfig;
|
|
5
6
|
server: ServerConfig;
|
|
6
7
|
compileMiddlewareAPI?: CompileMiddlewareAPI;
|
|
8
|
+
root: string;
|
|
7
9
|
};
|
|
8
10
|
export declare function setupWatchFiles(options: WatchFilesOptions): Promise<{
|
|
9
11
|
close(): Promise<void>;
|
|
10
12
|
} | undefined>;
|
|
13
|
+
export declare function createChokidar(pathOrGlobs: string[], root: string, options: ChokidarOptions): Promise<FSWatcher>;
|
|
11
14
|
export {};
|
|
@@ -2,7 +2,7 @@ import type { IncomingMessage, ServerResponse } from 'node:http';
|
|
|
2
2
|
import type { SecureServerSessionOptions } from 'node:http2';
|
|
3
3
|
import type { ServerOptions as HttpsServerOptions } from 'node:https';
|
|
4
4
|
import type { Configuration, CopyRspackPluginOptions, Externals, LightningCssMinimizerRspackPluginOptions, ModuleFederationPluginOptions, RuleSetCondition, SwcJsMinimizerRspackPluginOptions, SwcLoaderOptions, rspack } from '@rspack/core';
|
|
5
|
-
import type {
|
|
5
|
+
import type { ChokidarOptions } from '../../compiled/chokidar/index.js';
|
|
6
6
|
import type { Options as HttpProxyOptions, Filter as ProxyFilter } from '../../compiled/http-proxy-middleware/index.js';
|
|
7
7
|
import type RspackChain from '../../compiled/rspack-chain/index.js';
|
|
8
8
|
import type { BundleAnalyzerPlugin } from '../../compiled/webpack-bundle-analyzer/index.js';
|
|
@@ -377,7 +377,8 @@ export interface PerformanceConfig {
|
|
|
377
377
|
/**
|
|
378
378
|
* Used to control resource `Prefetch`.
|
|
379
379
|
*
|
|
380
|
-
* Specifies that the user agent should preemptively fetch and cache the target resource as it
|
|
380
|
+
* Specifies that the user agent should preemptively fetch and cache the target resource as it
|
|
381
|
+
* is likely to be required for a followup navigation.
|
|
381
382
|
*/
|
|
382
383
|
prefetch?: true | PreloadOrPreFetchOption;
|
|
383
384
|
/**
|
|
@@ -643,7 +644,8 @@ export interface OutputConfig {
|
|
|
643
644
|
*/
|
|
644
645
|
target?: RsbuildTarget;
|
|
645
646
|
/**
|
|
646
|
-
* At build time, prevent some `import` dependencies from being packed into bundles in your code,
|
|
647
|
+
* At build time, prevent some `import` dependencies from being packed into bundles in your code,
|
|
648
|
+
* and instead fetch them externally at runtime.
|
|
647
649
|
* For more information, please see: [Rspack Externals](https://rspack.dev/config/externals)
|
|
648
650
|
* @default undefined
|
|
649
651
|
*/
|
|
@@ -759,6 +761,13 @@ export interface OutputConfig {
|
|
|
759
761
|
* @default true
|
|
760
762
|
*/
|
|
761
763
|
emitAssets?: boolean;
|
|
764
|
+
/**
|
|
765
|
+
* Whether to emit CSS to the output bundles.
|
|
766
|
+
* If `false`, the CSS will not be extracted to separate files or injected into the JavaScript
|
|
767
|
+
* bundles via `output.injectStyles`.
|
|
768
|
+
* @default `true` when `output.target` is `web`, otherwise `false`
|
|
769
|
+
*/
|
|
770
|
+
emitCss?: boolean;
|
|
762
771
|
}
|
|
763
772
|
export interface NormalizedOutputConfig extends OutputConfig {
|
|
764
773
|
target: RsbuildTarget;
|
|
@@ -1015,10 +1024,10 @@ export type ClientConfig = {
|
|
|
1015
1024
|
overlay?: boolean;
|
|
1016
1025
|
};
|
|
1017
1026
|
export type NormalizedClientConfig = Pick<ClientConfig, 'protocol'> & Omit<Required<ClientConfig>, 'protocol'>;
|
|
1018
|
-
export type
|
|
1027
|
+
export type { ChokidarOptions };
|
|
1019
1028
|
export type WatchFiles = {
|
|
1020
1029
|
paths: string | string[];
|
|
1021
|
-
options?:
|
|
1030
|
+
options?: ChokidarOptions;
|
|
1022
1031
|
type?: 'reload-page' | 'reload-server';
|
|
1023
1032
|
};
|
|
1024
1033
|
export type CliShortcut = {
|
|
@@ -1215,4 +1224,3 @@ export type NormalizedConfig = NormalizedEnvironmentConfig & {
|
|
|
1215
1224
|
[name: string]: NormalizedEnvironmentConfig;
|
|
1216
1225
|
};
|
|
1217
1226
|
};
|
|
1218
|
-
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Compiler, MultiCompiler } from '@rspack/core';
|
|
2
|
+
import type * as providerHelpers from '../provider/helpers';
|
|
2
3
|
import type { RsbuildDevServer } from '../server/devServer';
|
|
3
4
|
import type { StartServerResult } from '../server/helper';
|
|
4
5
|
import type { RsbuildConfig } from './config';
|
|
@@ -100,11 +101,12 @@ export type ProviderInstance<B extends 'rspack' | 'webpack' = 'rspack'> = {
|
|
|
100
101
|
initConfigs: () => Promise<B extends 'rspack' ? Rspack.Configuration[] : WebpackConfig[]>;
|
|
101
102
|
inspectConfig: (options?: InspectConfigOptions) => Promise<InspectConfigResult<B>>;
|
|
102
103
|
};
|
|
104
|
+
export type RsbuildProviderHelpers = typeof providerHelpers;
|
|
103
105
|
export type RsbuildProvider<B extends 'rspack' | 'webpack' = 'rspack'> = (options: {
|
|
104
106
|
context: InternalContext;
|
|
105
107
|
pluginManager: PluginManager;
|
|
106
108
|
rsbuildOptions: ResolvedCreateRsbuildOptions;
|
|
107
|
-
|
|
109
|
+
helpers: RsbuildProviderHelpers;
|
|
108
110
|
}) => Promise<ProviderInstance<B>>;
|
|
109
111
|
export type RsbuildInstance = {
|
|
110
112
|
context: RsbuildContext;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsbuild/core",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"description": "The Rspack-based build tool.",
|
|
5
5
|
"homepage": "https://rsbuild.dev",
|
|
6
6
|
"bugs": {
|
|
@@ -55,12 +55,13 @@
|
|
|
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",
|
|
58
59
|
"@types/node": "^22.9.0",
|
|
59
60
|
"@types/on-finished": "2.3.4",
|
|
60
61
|
"@types/webpack-bundle-analyzer": "4.7.0",
|
|
61
62
|
"@types/ws": "^8.5.13",
|
|
62
63
|
"browserslist-load-config": "1.0.0",
|
|
63
|
-
"chokidar": "
|
|
64
|
+
"chokidar": "^4.0.1",
|
|
64
65
|
"commander": "^12.1.0",
|
|
65
66
|
"connect": "3.7.0",
|
|
66
67
|
"connect-history-api-fallback": "^2.0.0",
|
|
@@ -71,6 +72,7 @@
|
|
|
71
72
|
"fs-extra": "^11.2.0",
|
|
72
73
|
"html-rspack-plugin": "6.0.2",
|
|
73
74
|
"http-proxy-middleware": "^2.0.6",
|
|
75
|
+
"is-glob": "^4.0.3",
|
|
74
76
|
"jiti": "^1.21.6",
|
|
75
77
|
"launch-editor-middleware": "^2.9.1",
|
|
76
78
|
"mrmime": "^2.0.0",
|
|
@@ -89,15 +91,13 @@
|
|
|
89
91
|
"rspack-manifest-plugin": "5.0.2",
|
|
90
92
|
"sirv": "^3.0.0",
|
|
91
93
|
"style-loader": "3.3.4",
|
|
94
|
+
"tinyglobby": "^0.2.10",
|
|
92
95
|
"typescript": "^5.6.3",
|
|
93
96
|
"webpack": "^5.96.1",
|
|
94
97
|
"webpack-bundle-analyzer": "^4.10.2",
|
|
95
98
|
"webpack-merge": "6.0.1",
|
|
96
99
|
"ws": "^8.18.0"
|
|
97
100
|
},
|
|
98
|
-
"optionalDependencies": {
|
|
99
|
-
"fsevents": "~2.3.3"
|
|
100
|
-
},
|
|
101
101
|
"engines": {
|
|
102
102
|
"node": ">=16.7.0"
|
|
103
103
|
},
|