fix: types

This commit is contained in:
patak-dev 2024-05-20 15:23:58 +02:00
parent 371f7a02a7
commit 82111bfb41
2 changed files with 3 additions and 2 deletions

View File

@ -28,6 +28,7 @@ export { fetchModule, type FetchModuleOptions } from './ssr/fetchModule'
export { createServerModuleRunner } from './ssr/runtime/serverModuleRunner'
export { ServerHMRConnector } from './ssr/runtime/serverHmrConnector'
export { ssrTransform as moduleRunnerTransform } from './ssr/ssrTransform'
export type { ModuleRunnerTransformOptions } from './ssr/ssrTransform'
export * from './publicUtils'

View File

@ -26,7 +26,7 @@ type Node = _Node & {
end: number
}
interface TransformOptions {
export interface ModuleRunnerTransformOptions {
json?: {
stringify?: boolean
}
@ -47,7 +47,7 @@ export async function ssrTransform(
inMap: SourceMap | { mappings: '' } | null,
url: string,
originalCode: string,
options?: TransformOptions,
options?: ModuleRunnerTransformOptions, // TODO: Should we export two functions instead of using options here?
): Promise<TransformResult | null> {
if (options?.json?.stringify && isJSONRequest(url)) {
return ssrTransformJSON(code, inMap)