@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
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { RsbuildPlugin } from '../types';
|
|
1
|
+
import type { RsbuildPlugin } from '../types/index.js';
|
|
2
2
|
export declare const pluginSourceMap: () => RsbuildPlugin;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { RsbuildPlugin } from '../types';
|
|
1
|
+
import type { RsbuildPlugin } from '../types/index.js';
|
|
2
2
|
export declare const MODULE_PATH_REGEX: RegExp;
|
|
3
3
|
export declare function getPackageNameFromModulePath(modulePath: string): string | undefined;
|
|
4
4
|
export declare const pluginSplitChunks: () => RsbuildPlugin;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { RsbuildPlugin } from '../types';
|
|
1
|
+
import type { RsbuildPlugin } from '../types/index.js';
|
|
2
2
|
export declare const pluginTarget: () => RsbuildPlugin;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { RsbuildPlugin } from '../types';
|
|
1
|
+
import type { RsbuildPlugin } from '../types/index.js';
|
|
2
2
|
export declare const pluginWorker: () => RsbuildPlugin;
|
package/dist/range-parser.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*! LICENSE: range-parser.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/range-parser@1.3.0/node_modules/range-parser/index.js" (module) {
|
|
5
5
|
function parsePos(str) {
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { RestartManager } from './helpers/restartManager.js';
|
|
2
|
+
import type { Logger } from './logger.js';
|
|
3
|
+
import { type WatchFilesResult } from './server/watchFiles.js';
|
|
4
|
+
import type { InternalContext, RestartContext, WatchFiles } from './types/index.js';
|
|
5
|
+
export declare const requestRestart: ({ clear, logger, restartContext, restartManager }: {
|
|
6
|
+
clear?: boolean;
|
|
7
|
+
logger: Logger;
|
|
8
|
+
restartContext: RestartContext;
|
|
9
|
+
restartManager: RestartManager;
|
|
10
|
+
}) => Promise<boolean>;
|
|
11
|
+
export declare function watchFilesForRestart({ watchFiles, context, restartContext }: {
|
|
12
|
+
watchFiles: WatchFiles[];
|
|
13
|
+
context: InternalContext;
|
|
14
|
+
restartContext: RestartContext;
|
|
15
|
+
}): WatchFilesResult | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Compiler } from '@rspack/core';
|
|
2
|
-
import type { EnvironmentContext, HtmlRspackPlugin, HtmlTag, HtmlTagDescriptor, InternalContext } from '../types';
|
|
2
|
+
import type { EnvironmentContext, HtmlRspackPlugin, HtmlTag, HtmlTagDescriptor, InternalContext } from '../types/index.js';
|
|
3
3
|
type HtmlTagObject = HtmlRspackPlugin.HtmlTagObject;
|
|
4
4
|
export type TagConfig = {
|
|
5
5
|
tags?: HtmlTagDescriptor[];
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* See the License for the specific language governing permissions and
|
|
16
16
|
* limitations under the License.
|
|
17
17
|
*/ import type { Compiler, RspackPluginInstance } from '@rspack/core';
|
|
18
|
-
import type { HtmlRspackPlugin, ResourceHintsOptions } from '../../types';
|
|
18
|
+
import type { HtmlRspackPlugin, ResourceHintsOptions } from '../../types/index.js';
|
|
19
19
|
type LinkType = 'preload' | 'prefetch';
|
|
20
20
|
type ResourceHintsInputOptions = ResourceHintsOptions | ResourceHintsOptions[];
|
|
21
21
|
interface ResourceHintGroup {
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* See the License for the specific language governing permissions and
|
|
16
16
|
* limitations under the License.
|
|
17
17
|
*/ import type { Chunk, Compilation } from '@rspack/core';
|
|
18
|
-
import type { HtmlRspackPlugin, ResourceHintsOptions } from '../../types';
|
|
18
|
+
import type { HtmlRspackPlugin, ResourceHintsOptions } from '../../types/index.js';
|
|
19
19
|
interface DoesChunkBelongToHtmlOptions {
|
|
20
20
|
chunk: Chunk;
|
|
21
21
|
compilation?: Compilation;
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* See the License for the specific language governing permissions and
|
|
16
16
|
* limitations under the License.
|
|
17
17
|
*/ import type { Chunk, Compilation } from '@rspack/core';
|
|
18
|
-
import type { ResourceHintsIncludeType } from '../../types';
|
|
18
|
+
import type { ResourceHintsIncludeType } from '../../types/index.js';
|
|
19
19
|
export declare function extractChunks(compilation: Compilation, includeType?: ResourceHintsIncludeType): Chunk[] | {
|
|
20
20
|
files: string[];
|
|
21
21
|
auxiliaryFiles?: string[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { EnvironmentContext, InternalContext, ModifyChainUtils, ModifyRspackConfigUtils, RsbuildTarget, Rspack } from './types';
|
|
1
|
+
import type { EnvironmentContext, InternalContext, ModifyChainUtils, ModifyRspackConfigUtils, RsbuildTarget, Rspack } from './types/index.js';
|
|
2
2
|
export declare function getConfigUtils(getCurrentConfig: () => Rspack.Configuration, chainUtils: ModifyChainUtils): ModifyRspackConfigUtils;
|
|
3
3
|
export declare function getChainUtils(target: RsbuildTarget, environment: EnvironmentContext, environments: Record<string, EnvironmentContext>): ModifyChainUtils;
|
|
4
4
|
export declare function generateRspackConfig({ target, context, environmentName }: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Stats as FSStats } from 'node:fs';
|
|
2
|
-
import type { InternalContext, Rspack } from '../../types';
|
|
2
|
+
import type { InternalContext, Rspack } from '../../types/index.js';
|
|
3
3
|
/**
|
|
4
4
|
* Resolves URL to file path with security checks and retrieves file from
|
|
5
5
|
* the build output directories.
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
* Copyright JS Foundation and other contributors
|
|
7
7
|
* https://github.com/webpack/webpack-dev-middleware/blob/master/LICENSE
|
|
8
8
|
*/ import { type Compiler, type MultiCompiler } from '@rspack/core';
|
|
9
|
-
import type { InternalContext, LiveReload, NormalizedConfig, RequestHandler } from '../../types';
|
|
10
|
-
import type { SocketServer } from '../socketServer';
|
|
9
|
+
import type { InternalContext, LiveReload, NormalizedConfig, RequestHandler } from '../../types/index.js';
|
|
10
|
+
import type { SocketServer } from '../socketServer.js';
|
|
11
11
|
export type MultiWatching = ReturnType<MultiCompiler['watch']>;
|
|
12
12
|
export type AssetsMiddlewareClose = (callback: (err?: Error | null) => void) => void;
|
|
13
13
|
export type AssetsMiddleware = RequestHandler & {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { InternalContext, RequestHandler, Rspack } from '../../types';
|
|
1
|
+
import type { InternalContext, RequestHandler, Rspack } from '../../types/index.js';
|
|
2
2
|
export declare function createAssetsMiddleware(context: InternalContext, ready: (callback: () => void) => void, outputFileSystem: Rspack.OutputFileSystem): RequestHandler;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { Compiler, OutputFileSystem } from '@rspack/core';
|
|
2
|
-
import type { ResolvedWriteToDisk } from './setupWriteToDisk';
|
|
2
|
+
import type { ResolvedWriteToDisk } from './setupWriteToDisk.js';
|
|
3
3
|
export declare function setupOutputFileSystem(writeToDisk: ResolvedWriteToDisk, compilers: Compiler[]): Promise<OutputFileSystem>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Compiler } from '@rspack/core';
|
|
2
|
-
import type { Logger } from '../../logger';
|
|
3
|
-
import type { EnvironmentContext, NormalizedDevConfig } from '../../types';
|
|
2
|
+
import type { Logger } from '../../logger.js';
|
|
3
|
+
import type { EnvironmentContext, NormalizedDevConfig } from '../../types/index.js';
|
|
4
4
|
declare module '@rspack/core' {
|
|
5
5
|
interface Compiler {
|
|
6
6
|
__hasRsbuildAssetEmittedCallback?: boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { TraceMap } from '@jridgewell/trace-mapping';
|
|
2
2
|
import type { StackFrame } from 'stacktrace-parser';
|
|
3
|
-
import type { BrowserLogsStackTrace, InternalContext, Rspack } from '../types';
|
|
3
|
+
import type { BrowserLogsStackTrace, InternalContext, Rspack } from '../types/index.js';
|
|
4
4
|
export type CachedTraceMap = Map<string, TraceMap>;
|
|
5
5
|
/**
|
|
6
6
|
* Formats error messages received from the browser into a log string with
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { InternalContext, NormalizedConfig, Rspack } from '../types';
|
|
2
|
-
import { type AssetsMiddleware } from './assets-middleware';
|
|
3
|
-
import { SocketServer } from './socketServer';
|
|
1
|
+
import type { InternalContext, NormalizedConfig, Rspack } from '../types/index.js';
|
|
2
|
+
import { type AssetsMiddleware } from './assets-middleware/index.js';
|
|
3
|
+
import { SocketServer } from './socketServer.js';
|
|
4
4
|
type Options = {
|
|
5
5
|
context: InternalContext;
|
|
6
6
|
config: NormalizedConfig;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Logger } from '../logger';
|
|
2
|
-
import type { CliShortcut, NormalizedConfig } from '../types/config';
|
|
1
|
+
import type { Logger } from '../logger.js';
|
|
2
|
+
import type { CliShortcut, NormalizedConfig } from '../types/config.js';
|
|
3
3
|
type PrintUrlsHandler = (options?: {
|
|
4
4
|
showAllRoutes?: boolean;
|
|
5
5
|
}) => void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { InternalContext, NormalizedConfig } from '../types';
|
|
2
|
-
import type { BuildManager } from './buildManager';
|
|
3
|
-
import type { RsbuildDevServer } from './devServer';
|
|
4
|
-
import type { UpgradeEvent } from './helper';
|
|
1
|
+
import type { InternalContext, NormalizedConfig } from '../types/index.js';
|
|
2
|
+
import type { BuildManager } from './buildManager.js';
|
|
3
|
+
import type { RsbuildDevServer } from './devServer.js';
|
|
4
|
+
import type { UpgradeEvent } from './helper.js';
|
|
5
5
|
export type RsbuildDevMiddlewareOptions = {
|
|
6
6
|
config: NormalizedConfig;
|
|
7
7
|
context: InternalContext;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { Server } from 'node:http';
|
|
2
2
|
import type { Http2SecureServer } from 'node:http2';
|
|
3
|
-
import type { CreateCompiler, CreateDevServerOptions, EnvironmentAPI, InternalContext, NormalizedConfig } from '../types';
|
|
4
|
-
import { type RsbuildServerBase, type StartDevServerResult } from './helper';
|
|
5
|
-
import type { ServerMessage } from './socketServer';
|
|
3
|
+
import type { CreateCompiler, CreateDevServerOptions, EnvironmentAPI, InternalContext, NormalizedConfig } from '../types/index.js';
|
|
4
|
+
import { type RsbuildServerBase, type StartDevServerResult } from './helper.js';
|
|
5
|
+
import type { ServerMessage } from './socketServer.js';
|
|
6
6
|
type HTTPServer = Server | Http2SecureServer;
|
|
7
7
|
type ExtractSocketMessageData<T extends ServerMessage['type']> = 'data' extends keyof Extract<ServerMessage, {
|
|
8
8
|
type: T;
|
|
@@ -38,5 +38,5 @@ export type RsbuildDevServer = RsbuildServerBase & {
|
|
|
38
38
|
};
|
|
39
39
|
export declare function createDevServer<Options extends {
|
|
40
40
|
context: InternalContext;
|
|
41
|
-
}>(options: Options, createCompiler: CreateCompiler, config: NormalizedConfig,
|
|
41
|
+
}>(options: Options, createCompiler: CreateCompiler, config: NormalizedConfig, devServerOptions?: CreateDevServerOptions): Promise<RsbuildDevServer>;
|
|
42
42
|
export { };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { CompressOptions, RequestHandler } from '../types';
|
|
1
|
+
import type { CompressOptions, RequestHandler } from '../types/index.js';
|
|
2
2
|
export declare function gzipMiddleware({ filter, level }?: CompressOptions): RequestHandler;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { IncomingMessage, Server } from 'node:http';
|
|
2
2
|
import type { Http2SecureServer } from 'node:http2';
|
|
3
3
|
import type { Socket } from 'node:net';
|
|
4
|
-
import type { Logger } from '../logger';
|
|
5
|
-
import type { Connect, InternalContext, NormalizedConfig, OutputStructure, PrintUrls, Routes, RsbuildConfig, RsbuildEntry } from '../types';
|
|
6
|
-
import type { RsbuildDevServer } from './devServer';
|
|
7
|
-
import type { RsbuildPreviewServer } from './previewServer';
|
|
4
|
+
import type { Logger } from '../logger.js';
|
|
5
|
+
import type { Connect, InternalContext, NormalizedConfig, OutputStructure, PrintUrls, Routes, RsbuildConfig, RsbuildEntry } from '../types/index.js';
|
|
6
|
+
import type { RsbuildDevServer } from './devServer.js';
|
|
7
|
+
import type { RsbuildPreviewServer } from './previewServer.js';
|
|
8
8
|
/**
|
|
9
9
|
* It used to subscribe http upgrade event
|
|
10
10
|
*/ export type UpgradeEvent = (req: IncomingMessage, socket: Socket, head: any) => void;
|
|
@@ -5,6 +5,6 @@
|
|
|
5
5
|
* MIT Licensed
|
|
6
6
|
* Copyright (c) 2022 Ben Blackmore and contributors
|
|
7
7
|
* https://github.com/bripkens/connect-history-api-fallback/blob/master/LICENSE
|
|
8
|
-
*/ import type { Logger } from '../logger';
|
|
9
|
-
import type { HistoryApiFallbackOptions, RequestHandler } from '../types';
|
|
8
|
+
*/ import type { Logger } from '../logger.js';
|
|
9
|
+
import type { HistoryApiFallbackOptions, RequestHandler } from '../types/index.js';
|
|
10
10
|
export declare function historyApiFallbackMiddleware(logger: Logger, options?: HistoryApiFallbackOptions): RequestHandler;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Server } from 'node:http';
|
|
2
2
|
import type { Http2SecureServer } from 'node:http2';
|
|
3
|
-
import type { Connect, ServerConfig } from '../types';
|
|
3
|
+
import type { Connect, ServerConfig } from '../types/index.js';
|
|
4
4
|
export declare const createHttpServer: ({ serverConfig, middlewares }: {
|
|
5
5
|
serverConfig: ServerConfig;
|
|
6
6
|
middlewares: Connect.Server;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type Logger } from '../logger';
|
|
2
|
-
import type { Connect, EnvironmentAPI, RequestHandler, Rspack } from '../types';
|
|
1
|
+
import { type Logger } from '../logger.js';
|
|
2
|
+
import type { Connect, EnvironmentAPI, RequestHandler, Rspack } from '../types/index.js';
|
|
3
3
|
export declare const faviconFallbackMiddleware: RequestHandler;
|
|
4
4
|
export declare const getRequestLoggerMiddleware: (logger: Logger) => Connect.NextHandleFunction;
|
|
5
5
|
export declare const notFoundMiddleware: RequestHandler;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Logger } from '../logger';
|
|
2
|
-
import type { NormalizedConfig, Routes } from '../types';
|
|
1
|
+
import type { Logger } from '../logger.js';
|
|
2
|
+
import type { NormalizedConfig, Routes } from '../types/index.js';
|
|
3
3
|
export declare const replacePortPlaceholder: (url: string, port: number) => string;
|
|
4
4
|
export declare function resolveUrl(str: string, base: string): string;
|
|
5
5
|
export declare function open({ port, routes, config, protocol, clearCache, logger }: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { InternalContext, NormalizedConfig, PreviewOptions } from '../types';
|
|
2
|
-
import { type RsbuildServerBase, type StartPreviewServerResult } from './helper';
|
|
1
|
+
import type { InternalContext, NormalizedConfig, PreviewOptions } from '../types/index.js';
|
|
2
|
+
import { type RsbuildServerBase, type StartPreviewServerResult } from './helper.js';
|
|
3
3
|
export type RsbuildPreviewServer = RsbuildServerBase;
|
|
4
4
|
export declare function startPreviewServer(context: InternalContext, config: NormalizedConfig, { getPortSilently }?: PreviewOptions): Promise<StartPreviewServerResult>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { Logger } from '../logger';
|
|
2
|
-
import type { RequestHandler as Middleware, ProxyConfig } from '../types';
|
|
3
|
-
import { type UpgradeEvent } from './helper';
|
|
1
|
+
import type { Logger } from '../logger.js';
|
|
2
|
+
import type { RequestHandler as Middleware, ProxyConfig } from '../types/index.js';
|
|
3
|
+
import { type UpgradeEvent } from './helper.js';
|
|
4
4
|
export declare function createProxyMiddleware(proxyOptions: ProxyConfig, logger: Logger): Promise<{
|
|
5
5
|
middlewares: Middleware[];
|
|
6
6
|
upgrade: UpgradeEvent;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BasicGlobalContext, BasicModuleScope, BasicRunnerFile, CompilerOptions, ModuleObject, Runner, RunnerRequirer } from './type';
|
|
1
|
+
import type { BasicGlobalContext, BasicModuleScope, BasicRunnerFile, CompilerOptions, ModuleObject, Runner, RunnerRequirer } from './type.js';
|
|
2
2
|
export interface IBasicRunnerOptions {
|
|
3
3
|
name: string;
|
|
4
4
|
isBundleOutput: (modulePath: string) => boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { BasicRunner } from './basic';
|
|
2
|
-
import type { BasicGlobalContext, BasicModuleScope, BasicRunnerFile, ModuleObject, RunnerRequirer } from './type';
|
|
1
|
+
import { BasicRunner } from './basic.js';
|
|
2
|
+
import type { BasicGlobalContext, BasicModuleScope, BasicRunnerFile, ModuleObject, RunnerRequirer } from './type.js';
|
|
3
3
|
export declare class CommonJsRunner extends BasicRunner {
|
|
4
4
|
protected createGlobalContext(): BasicGlobalContext;
|
|
5
5
|
protected createBaseModuleScope(): BasicModuleScope;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { CommonJsRunner } from './cjs';
|
|
2
|
-
import { type RunnerRequirer } from './type';
|
|
1
|
+
import { CommonJsRunner } from './cjs.js';
|
|
2
|
+
import { type RunnerRequirer } from './type.js';
|
|
3
3
|
export declare class EsmRunner extends CommonJsRunner {
|
|
4
4
|
protected createRunner(): void;
|
|
5
5
|
protected createEsmRequirer(): RunnerRequirer;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The following code is modified based on @rspack/test-tools/runner
|
|
3
|
-
*/ import type { RunnerFactoryOptions } from './type';
|
|
3
|
+
*/ import type { RunnerFactoryOptions } from './type.js';
|
|
4
4
|
export declare const run: <T>({ bundlePath, ...runnerFactoryOptions }: RunnerFactoryOptions & {
|
|
5
5
|
bundlePath: string;
|
|
6
6
|
}) => Promise<T>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { ServerSetupContext, ServerSetupFn } from '../types';
|
|
1
|
+
import type { ServerSetupContext, ServerSetupFn } from '../types/index.js';
|
|
2
2
|
export declare function applyServerSetup(setup: ServerSetupFn | ServerSetupFn[] | undefined, context: ServerSetupContext): Promise<(() => Promise<void> | void)[]>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { IncomingMessage } from 'node:http';
|
|
2
2
|
import type { Socket } from 'node:net';
|
|
3
|
-
import type { DevConfig, InternalContext, Rspack } from '../types';
|
|
3
|
+
import type { DevConfig, InternalContext, Rspack } from '../types/index.js';
|
|
4
4
|
export type ServerMessageFullReload = {
|
|
5
5
|
type: 'full-reload';
|
|
6
6
|
data?: {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type { FSWatcher } from '../../compiled/chokidar';
|
|
2
|
-
import type { ChokidarOptions, NormalizedConfig } from '../types';
|
|
3
|
-
import type { BuildManager } from './buildManager';
|
|
1
|
+
import type { FSWatcher } from '../../compiled/chokidar/index.js';
|
|
2
|
+
import type { ChokidarOptions, NormalizedConfig, WatchFileEvent } from '../types/index.js';
|
|
3
|
+
import type { BuildManager } from './buildManager.js';
|
|
4
|
+
export declare const DEFAULT_WATCH_FILE_EVENTS: readonly WatchFileEvent[];
|
|
4
5
|
type WatchFilesOptions = {
|
|
5
6
|
root: string;
|
|
6
7
|
config: NormalizedConfig;
|
package/dist/sirv.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { join, normalize, resolve, sep } from "node:path";
|
|
2
2
|
import { join as external_path_join, resolve as external_path_resolve } from "path";
|
|
3
3
|
import { readdirSync, statSync } from "fs";
|
|
4
|
-
import { mrmime_lookup } from "./
|
|
4
|
+
import { mrmime_lookup } from "./626.js";
|
|
5
5
|
import * as __rspack_external_node_fs_1b05aee1 from "node:fs";
|
|
6
6
|
import * as __rspack_external_node_querystring_5092a520 from "node:querystring";
|
|
7
7
|
function totalist(dir, callback, pre = '') {
|