Skip to content

Commit

Permalink
fix: types
Browse files Browse the repository at this point in the history
  • Loading branch information
patak-dev committed May 20, 2024
1 parent 371f7a0 commit 82111bf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions packages/vite/src/node/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down
4 changes: 2 additions & 2 deletions packages/vite/src/node/ssr/ssrTransform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ type Node = _Node & {
end: number
}

interface TransformOptions {
export interface ModuleRunnerTransformOptions {
json?: {
stringify?: boolean
}
Expand All @@ -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)
Expand Down

0 comments on commit 82111bf

Please sign in to comment.