@rsbuild/shared
Advanced tools
Comparing version 0.5.7 to 0.5.8
@@ -0,1 +1,2 @@ | ||
/// <reference types="node" /> | ||
import type { Falsy, WebpackChain } from './utils'; | ||
@@ -115,3 +116,3 @@ import type { OnExitFn, OnAfterBuildFn, OnBeforeBuildFn, OnCloseDevServerFn, OnDevCompileDoneFn, OnAfterStartDevServerFn, OnBeforeStartDevServerFn, OnAfterStartProdServerFn, OnBeforeStartProdServerFn, OnAfterCreateCompilerFn, OnBeforeCreateCompilerFn, ModifyRsbuildConfigFn, ModifyBundlerChainFn, ModifyChainUtils } from './hooks'; | ||
}; | ||
export type TransformHandler = (context: { | ||
export type TransformContext = { | ||
/** | ||
@@ -139,6 +140,15 @@ * The code of the module. | ||
* The file will be watched and changes to the file will trigger rebuild. | ||
* @param file The absolute path of the module. | ||
* @param file The absolute path of the module | ||
*/ | ||
addDependency: (file: string) => void; | ||
}) => MaybePromise<TransformResult>; | ||
/** | ||
* Emits a file to the build output. | ||
* @param name file name of the asset | ||
* @param content the source of the asset | ||
* @param sourceMap source map of the asset | ||
* @param assetInfo additional asset information | ||
*/ | ||
emitFile: (name: string, content: string | Buffer, sourceMap?: string, assetInfo?: Record<string, any>) => void; | ||
}; | ||
export type TransformHandler = (context: TransformContext) => MaybePromise<TransformResult>; | ||
export type TransformFn = (descriptor: { | ||
@@ -154,3 +164,3 @@ /** | ||
*/ | ||
export type RsbuildPluginAPI = { | ||
export type RsbuildPluginAPI = Readonly<{ | ||
context: Readonly<RsbuildContext>; | ||
@@ -195,3 +205,3 @@ isPluginExists: PluginManager['isPluginExists']; | ||
transform: TransformFn; | ||
}; | ||
}>; | ||
export {}; |
@@ -5,4 +5,3 @@ /// <reference types="node" /> | ||
import type { Socket } from 'node:net'; | ||
import type { DevConfig, NextFunction, RequestHandler, ServerAPIs } from './config/dev'; | ||
import type { ServerConfig } from './config/server'; | ||
import type { NextFunction, RequestHandler, ServerAPIs } from './config/dev'; | ||
import type { RspackCompiler, RspackMultiCompiler } from './rspack'; | ||
@@ -42,3 +41,2 @@ import type { Server as ConnectServer } from '../../compiled/connect'; | ||
}; | ||
export type DevMiddlewaresConfig = Omit<DevConfig & ServerConfig, 'beforeStartUrl' | 'progressBar' | 'startUrl' | 'https' | 'host' | 'port' | 'strictPort'>; | ||
export type StartServerResult = { | ||
@@ -45,0 +43,0 @@ urls: string[]; |
@@ -53,3 +53,4 @@ "use strict"; | ||
try { | ||
return new import_node_url.URL(str).toString(); | ||
new import_node_url.URL(str).toString(); | ||
return str; | ||
} catch { | ||
@@ -56,0 +57,0 @@ } |
{ | ||
"name": "@rsbuild/shared", | ||
"version": "0.5.7", | ||
"version": "0.5.8", | ||
"description": "The internal shared modules and dependencies of Rsbuild.", | ||
@@ -5,0 +5,0 @@ "homepage": "https://rsbuild.dev", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7615104
22556