@rsbuild/core 2.1.7 → 2.1.8
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/cors/index.d.ts +1 -1
- package/compiled/html-rspack-plugin/index.d.ts +1 -1
- package/dist/{711.js → 626.js} +92 -69
- package/dist/build.d.ts +4 -0
- package/dist/chokidar.js +1 -1046
- package/{dist-types → dist}/cli/commands.d.ts +2 -2
- package/{dist-types → dist}/cli/init.d.ts +2 -2
- package/dist/client/hmr.js +1 -1
- package/dist/client/overlay.js +1 -1
- package/{dist-types → dist}/configChain.d.ts +2 -2
- package/dist/connect-next.js +1 -876
- package/dist/cors.js +1 -1
- package/{dist-types → dist}/createCompiler.d.ts +2 -2
- package/{dist-types → dist}/createContext.d.ts +3 -3
- package/{dist-types → dist}/createRsbuild.d.ts +1 -1
- package/{dist-types → dist}/defaultConfig.d.ts +1 -1
- package/{dist-types → dist}/helpers/compiler.d.ts +1 -1
- package/{dist-types → dist}/helpers/css.d.ts +1 -1
- package/{dist-types → dist}/helpers/format.d.ts +1 -1
- package/{dist-types → dist}/helpers/fs.d.ts +2 -2
- package/{dist-types → dist}/helpers/index.d.ts +4 -4
- package/{dist-types → dist}/helpers/overlayConfig.d.ts +1 -1
- package/{dist-types → dist}/helpers/path.d.ts +1 -1
- package/{dist-types → dist}/helpers/restartManager.d.ts +2 -2
- package/{dist-types → dist}/helpers/stats.d.ts +2 -2
- package/{dist-types → dist}/helpers/url.d.ts +2 -2
- package/{dist-types → dist}/helpers/vendors.d.ts +1 -1
- package/{dist-types → dist}/hooks.d.ts +1 -1
- package/dist/http-proxy-middleware.js +5 -3010
- package/{dist-types → dist}/index.d.ts +14 -14
- package/dist/index.js +1 -1
- package/{dist-types → dist}/initConfigs.d.ts +1 -1
- package/{dist-types → dist}/initPlugins.d.ts +2 -2
- package/{dist-types → dist}/inspectConfig.d.ts +2 -2
- package/dist/launch-editor-middleware.js +1 -544
- package/{dist-types → dist}/loadConfig.d.ts +6 -6
- package/{dist-types → dist}/loader/cssUrlLoader.d.ts +1 -1
- package/{dist-types → dist}/loader/ignoreCssLoader.d.ts +1 -1
- package/{dist-types → dist}/loader/transformLoader.d.ts +1 -1
- package/{dist-types → dist}/loader/transformRawLoader.d.ts +1 -1
- package/{dist-types → dist}/logger.d.ts +1 -1
- package/dist/manifest-plugin.js +1 -692
- package/dist/memfs.js +1 -5695
- package/{dist-types → dist}/mergeConfig.d.ts +1 -1
- package/dist/open.js +2 -439
- package/{dist-types → dist}/pluginHelper.d.ts +1 -1
- package/{dist-types → dist}/pluginManager.d.ts +2 -2
- package/{dist-types → dist}/plugins/appIcon.d.ts +1 -1
- package/{dist-types → dist}/plugins/asset.d.ts +1 -1
- package/{dist-types → dist}/plugins/basic.d.ts +1 -1
- package/dist/plugins/cache.d.ts +2 -0
- package/{dist-types → dist}/plugins/cleanOutput.d.ts +1 -1
- package/{dist-types → dist}/plugins/css.d.ts +1 -1
- package/{dist-types → dist}/plugins/define.d.ts +1 -1
- package/dist/plugins/entry.d.ts +2 -0
- package/{dist-types → dist}/plugins/externals.d.ts +2 -2
- package/{dist-types → dist}/plugins/fileSize.d.ts +1 -1
- package/{dist-types → dist}/plugins/html.d.ts +1 -1
- package/{dist-types → dist}/plugins/inlineChunk.d.ts +1 -1
- package/{dist-types → dist}/plugins/lazyCompilation.d.ts +1 -1
- package/{dist-types → dist}/plugins/manifest.d.ts +1 -1
- package/{dist-types → dist}/plugins/minimize.d.ts +2 -2
- package/{dist-types → dist}/plugins/moduleFederation.d.ts +1 -1
- package/{dist-types → dist}/plugins/nodeAddons.d.ts +1 -1
- package/dist/plugins/nonce.d.ts +2 -0
- package/{dist-types → dist}/plugins/output.d.ts +1 -1
- package/{dist-types → dist}/plugins/progress.d.ts +1 -1
- package/{dist-types → dist}/plugins/resolve.d.ts +1 -1
- package/{dist-types → dist}/plugins/resourceHints.d.ts +1 -1
- package/{dist-types → dist}/plugins/rsdoctor.d.ts +1 -1
- package/{dist-types → dist}/plugins/rspackProfile.d.ts +1 -1
- package/{dist-types → dist}/plugins/server.d.ts +1 -1
- package/{dist-types → dist}/plugins/sourceMap.d.ts +1 -1
- package/{dist-types → dist}/plugins/splitChunks.d.ts +1 -1
- package/dist/plugins/sri.d.ts +2 -0
- package/{dist-types → dist}/plugins/swc.d.ts +1 -1
- package/{dist-types → dist}/plugins/target.d.ts +1 -1
- package/dist/plugins/wasm.d.ts +2 -0
- package/{dist-types → dist}/plugins/worker.d.ts +1 -1
- package/dist/range-parser.js +1 -1
- package/dist/restart.d.ts +15 -0
- package/{dist-types → dist}/rspack-plugins/RsbuildHtmlPlugin.d.ts +1 -1
- package/{dist-types → dist}/rspack-plugins/resource-hints/HtmlResourceHintsPlugin.d.ts +1 -1
- package/{dist-types → dist}/rspack-plugins/resource-hints/doesChunkBelongToHtml.d.ts +1 -1
- package/{dist-types → dist}/rspack-plugins/resource-hints/extractChunks.d.ts +1 -1
- package/{dist-types → dist}/rspackConfig.d.ts +1 -1
- package/{dist-types → dist}/server/assets-middleware/getFileFromUrl.d.ts +1 -1
- package/{dist-types → dist}/server/assets-middleware/index.d.ts +2 -2
- package/{dist-types → dist}/server/assets-middleware/middleware.d.ts +1 -1
- package/{dist-types → dist}/server/assets-middleware/setupOutputFileSystem.d.ts +1 -1
- package/{dist-types → dist}/server/assets-middleware/setupWriteToDisk.d.ts +2 -2
- package/{dist-types → dist}/server/browserLogs.d.ts +1 -1
- package/{dist-types → dist}/server/buildManager.d.ts +3 -3
- package/{dist-types → dist}/server/cliShortcuts.d.ts +2 -2
- package/{dist-types → dist}/server/devMiddlewares.d.ts +4 -4
- package/{dist-types → dist}/server/devServer.d.ts +4 -4
- package/{dist-types → dist}/server/environment.d.ts +1 -1
- package/{dist-types → dist}/server/gzipMiddleware.d.ts +1 -1
- package/{dist-types → dist}/server/helper.d.ts +4 -4
- package/{dist-types → dist}/server/historyApiFallback.d.ts +2 -2
- package/{dist-types → dist}/server/httpServer.d.ts +1 -1
- package/{dist-types → dist}/server/middlewares.d.ts +2 -2
- package/{dist-types → dist}/server/open.d.ts +2 -2
- package/{dist-types → dist}/server/previewServer.d.ts +2 -2
- package/{dist-types → dist}/server/proxy.d.ts +3 -3
- package/{dist-types → dist}/server/runner/basic.d.ts +1 -1
- package/{dist-types → dist}/server/runner/cjs.d.ts +2 -2
- package/{dist-types → dist}/server/runner/esm.d.ts +2 -2
- package/{dist-types → dist}/server/runner/index.d.ts +1 -1
- package/{dist-types → dist}/server/serverSetup.d.ts +1 -1
- package/{dist-types → dist}/server/socketServer.d.ts +1 -1
- package/{dist-types → dist}/server/watchFiles.d.ts +4 -3
- package/dist/sirv.js +1 -1
- package/dist/tinyglobby.js +1 -1670
- package/{dist-types → dist}/types/config.d.ts +24 -15
- package/{dist-types → dist}/types/context.d.ts +8 -8
- package/{dist-types → dist}/types/hooks.d.ts +29 -13
- package/dist/types/index.d.ts +8 -0
- package/{dist-types → dist}/types/plugin.d.ts +7 -7
- package/{dist-types → dist}/types/rsbuild.d.ts +11 -11
- package/{dist-types → dist}/types/rspack.d.ts +2 -2
- package/{dist-types → dist}/types/thirdParty.d.ts +5 -5
- package/dist/ws.js +2 -1524
- package/package.json +7 -8
- package/dist-types/build.d.ts +0 -4
- package/dist-types/package.json +0 -1
- package/dist-types/plugins/cache.d.ts +0 -2
- package/dist-types/plugins/entry.d.ts +0 -2
- package/dist-types/plugins/nonce.d.ts +0 -2
- package/dist-types/plugins/sri.d.ts +0 -2
- package/dist-types/plugins/wasm.d.ts +0 -2
- package/dist-types/restart.d.ts +0 -14
- package/dist-types/types/index.d.ts +0 -8
- /package/dist/{711.js.LICENSE.txt → 626.js.LICENSE.txt} +0 -0
- /package/{dist-types → dist}/cli/index.d.ts +0 -0
- /package/dist/client/{307.js → 307~0.js} +0 -0
- /package/{dist-types → dist}/constants.d.ts +0 -0
- /package/{dist-types → dist}/helpers/exitHook.d.ts +0 -0
- /package/{dist-types → dist}/helpers/packageJson.d.ts +0 -0
- /package/{dist-types → dist}/helpers/version.d.ts +0 -0
- /package/{dist-types → dist}/loadEnv.d.ts +0 -0
- /package/{dist-types → dist}/loader/workerLoader.d.ts +0 -0
- /package/dist/{1~rslib-runtime.js → rslib-runtime.js} +0 -0
- /package/{dist-types → dist}/rspack-plugins/resource-hints/getResourceType.d.ts +0 -0
- /package/{dist-types → dist}/server/ansiHTML.d.ts +0 -0
- /package/{dist-types → dist}/server/assets-middleware/parseTokenList.d.ts +0 -0
- /package/{dist-types → dist}/server/compileState.d.ts +0 -0
- /package/{dist-types → dist}/server/gracefulShutdown.d.ts +0 -0
- /package/{dist-types → dist}/server/hmrFallback.d.ts +0 -0
- /package/{dist-types → dist}/server/overlay.d.ts +0 -0
- /package/{dist-types → dist}/server/publicPathnames.d.ts +0 -0
- /package/{dist-types → dist}/server/runner/asModule.d.ts +0 -0
- /package/{dist-types → dist}/server/runner/type.d.ts +0 -0
- /package/{dist-types → dist}/types/utils.d.ts +0 -0
package/dist/cors.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*! LICENSE: cors.js.LICENSE.txt */
|
|
2
|
-
import { __webpack_require__ } from "./
|
|
2
|
+
import { __webpack_require__ } from "./rslib-runtime.js";
|
|
3
3
|
__webpack_require__.add({
|
|
4
4
|
"../../node_modules/.pnpm/cors@2.8.6/node_modules/cors/lib/index.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
5
5
|
!function() {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type InitConfigsOptions } from './initConfigs';
|
|
2
|
-
import type { Rspack } from './types';
|
|
1
|
+
import { type InitConfigsOptions } from './initConfigs.js';
|
|
2
|
+
import type { Rspack } from './types/index.js';
|
|
3
3
|
export declare function createCompiler(options: InitConfigsOptions): Promise<{
|
|
4
4
|
compiler: Rspack.Compiler | Rspack.MultiCompiler;
|
|
5
5
|
rspackConfigs: Rspack.Configuration[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { LoadConfigResult } from './loadConfig';
|
|
2
|
-
import type { Logger } from './logger';
|
|
3
|
-
import type { InternalContext, NormalizedEnvironmentConfig, ResolvedCreateRsbuildOptions, RsbuildConfig, RsbuildContext } from './types';
|
|
1
|
+
import type { LoadConfigResult } from './loadConfig.js';
|
|
2
|
+
import type { Logger } from './logger.js';
|
|
3
|
+
import type { InternalContext, NormalizedEnvironmentConfig, ResolvedCreateRsbuildOptions, RsbuildConfig, RsbuildContext } from './types/index.js';
|
|
4
4
|
export declare function getBrowserslist(path: string): string[] | null;
|
|
5
5
|
export declare function getBrowserslistByEnvironment(path: string, config: NormalizedEnvironmentConfig): string[];
|
|
6
6
|
export declare function updateEnvironmentContext(context: InternalContext, configs: Record<string, NormalizedEnvironmentConfig>): Promise<void>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CreateRsbuildOptions, RsbuildInstance } from './types';
|
|
1
|
+
import type { CreateRsbuildOptions, RsbuildInstance } from './types/index.js';
|
|
2
2
|
/**
|
|
3
3
|
* Create an Rsbuild instance.
|
|
4
4
|
*/ export declare function createRsbuild(options?: CreateRsbuildOptions): Promise<RsbuildInstance>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Rspack } from '../types';
|
|
1
|
+
import type { Rspack } from '../types/index.js';
|
|
2
2
|
export declare const isMultiCompiler: (compiler: Rspack.Compiler | Rspack.MultiCompiler) => compiler is Rspack.MultiCompiler;
|
|
3
3
|
export declare const getPublicPathFromCompiler: (compiler: Rspack.Compiler | Rspack.Compilation) => string;
|
|
4
4
|
export declare const applyToCompiler: (compiler: Rspack.Compiler | Rspack.MultiCompiler, apply: (c: Rspack.Compiler, index: number) => void) => void;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { LoaderContext } from '@rspack/core';
|
|
2
|
-
import type { CSSLoaderOptions } from '../types';
|
|
2
|
+
import type { CSSLoaderOptions } from '../types/index.js';
|
|
3
3
|
export declare const isCSSModules: (modules: CSSLoaderOptions['modules'], loaderContext: LoaderContext) => boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { StatsError } from '@rspack/core';
|
|
2
|
-
import { type Logger } from '../logger';
|
|
2
|
+
import { type Logger } from '../logger.js';
|
|
3
3
|
// Formats Rspack stats error to readable message
|
|
4
4
|
export declare function formatStatsError(stats: StatsError, root: string, level: 'error' | 'warning' | undefined, logger: Logger): string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Logger } from '../logger';
|
|
2
|
-
import type { Rspack } from '../types';
|
|
1
|
+
import type { Logger } from '../logger.js';
|
|
2
|
+
import type { Rspack } from '../types/index.js';
|
|
3
3
|
export declare const isFileSync: (filePath: string) => boolean | undefined;
|
|
4
4
|
export declare function isEmptyDir(path: string): boolean;
|
|
5
5
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { color } from '../../compiled/rslog';
|
|
2
|
-
import { RspackChain } from '../../compiled/rspack-chain/types';
|
|
3
|
-
import type { FilenameConfig, NormalizedConfig, NormalizedEnvironmentConfig, RsbuildTarget, Rspack } from '../types';
|
|
4
|
-
export { require } from './vendors';
|
|
1
|
+
import { color } from '../../compiled/rslog/index.js';
|
|
2
|
+
import { RspackChain } from '../../compiled/rspack-chain/types/index.js';
|
|
3
|
+
import type { FilenameConfig, NormalizedConfig, NormalizedEnvironmentConfig, RsbuildTarget, Rspack } from '../types/index.js';
|
|
4
|
+
export { require } from './vendors.js';
|
|
5
5
|
export { color, RspackChain };
|
|
6
6
|
export declare const getNodeEnv: () => string;
|
|
7
7
|
export declare const setNodeEnv: (env: string) => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ClientConfig } from '../types';
|
|
1
|
+
import type { ClientConfig } from '../types/index.js';
|
|
2
2
|
export declare const isBuildOverlayEnabled: (overlay: ClientConfig['overlay']) => boolean;
|
|
3
3
|
export declare const isRuntimeOverlayEnabled: (overlay: ClientConfig['overlay']) => boolean;
|
|
4
4
|
export declare const isOverlayEnabled: (overlay: ClientConfig['overlay']) => boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Rspack } from '../types';
|
|
1
|
+
import type { Rspack } from '../types/index.js';
|
|
2
2
|
export declare function toRelativePath(base: string, filepath: string): string;
|
|
3
3
|
export declare function getCommonParentPath(paths: string[]): string;
|
|
4
4
|
export declare const getCompiledPath: (packageName: string) => string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { RestartContext, RestartFn } from '../types/hooks';
|
|
2
|
-
import type { MaybePromise } from '../types/utils';
|
|
1
|
+
import type { RestartContext, RestartFn } from '../types/hooks.js';
|
|
2
|
+
import type { MaybePromise } from '../types/utils.js';
|
|
3
3
|
type Cleanup = () => MaybePromise<void>;
|
|
4
4
|
export type RestartManager = {
|
|
5
5
|
/** Whether a restart executor is available. */ readonly canRestart: boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type Logger } from '../logger';
|
|
2
|
-
import type { ActionType, RsbuildStats, Rspack } from '../types';
|
|
1
|
+
import { type Logger } from '../logger.js';
|
|
2
|
+
import type { ActionType, RsbuildStats, Rspack } from '../types/index.js';
|
|
3
3
|
/**
|
|
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
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { RspackChain } from '../../compiled/rspack-chain/types';
|
|
2
|
-
import type { Rspack } from '../types';
|
|
1
|
+
import type { RspackChain } from '../../compiled/rspack-chain/types/index.js';
|
|
2
|
+
import type { Rspack } from '../types/index.js';
|
|
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;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AsyncHook, EnvironmentAsyncHook, InternalContext, ModifyBundlerChainFn, ModifyEnvironmentConfigFn, ModifyHTMLFn, ModifyHTMLTagsFn, ModifyRsbuildConfigFn, ModifyRspackConfigFn, OnAfterBuildFn, OnAfterCreateCompilerFn, OnAfterDevCompileFn, OnAfterEnvironmentCompileFn, OnAfterStartDevServerFn, OnAfterStartPreviewServerFn, OnBeforeBuildFn, OnBeforeCreateCompilerFn, OnBeforeDevCompileFn, OnBeforeEnvironmentCompileFn, OnBeforeStartDevServerFn, OnBeforeStartPreviewServerFn, OnCloseBuildFn, OnCloseDevServerFn, OnExitFn, OnRestartFn, Rspack } from './types';
|
|
1
|
+
import type { AsyncHook, EnvironmentAsyncHook, InternalContext, ModifyBundlerChainFn, ModifyEnvironmentConfigFn, ModifyHTMLFn, ModifyHTMLTagsFn, ModifyRsbuildConfigFn, ModifyRspackConfigFn, OnAfterBuildFn, OnAfterCreateCompilerFn, OnAfterDevCompileFn, OnAfterEnvironmentCompileFn, OnAfterStartDevServerFn, OnAfterStartPreviewServerFn, OnBeforeBuildFn, OnBeforeCreateCompilerFn, OnBeforeDevCompileFn, OnBeforeEnvironmentCompileFn, OnBeforeStartDevServerFn, OnBeforeStartPreviewServerFn, OnCloseBuildFn, OnCloseDevServerFn, OnExitFn, OnRestartFn, Rspack } from './types/index.js';
|
|
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(): {
|