Skip to content

Commit 3b58487

Browse files
authored
fix: don't bundle import from rollup (#4392)
1 parent ba1df84 commit 3b58487

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

packages/vite-node/src/types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ export interface StartOfSourceMap {
3434
export type { EncodedSourceMap, DecodedSourceMap, SourceMapInput } from '@jridgewell/trace-mapping'
3535

3636
export interface RawSourceMap extends StartOfSourceMap {
37-
version: string
37+
version: number
3838
sources: string[]
3939
names: string[]
40-
sourcesContent?: string[]
40+
sourcesContent?: (string | null)[]
4141
mappings: string
4242
}
4343

packages/vitest/src/node/workspace.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import type { ViteDevServer, InlineConfig as ViteInlineConfig } from 'vite'
66
import { ViteNodeRunner } from 'vite-node/client'
77
import { ViteNodeServer } from 'vite-node/server'
88
import c from 'picocolors'
9+
import type { RawSourceMap } from 'vite-node'
910
import { createBrowserServer } from '../integrations/browser/server'
1011
import type { ArgumentsType, Reporter, ResolvedConfig, UserConfig, UserWorkspaceConfig, Vitest } from '../types'
1112
import { deepMerge } from '../utils'
@@ -140,12 +141,12 @@ export class WorkspaceProject {
140141
|| this.browser?.moduleGraph.getModuleById(id)
141142
}
142143

143-
getSourceMapModuleById(id: string) {
144+
getSourceMapModuleById(id: string): RawSourceMap | null | undefined {
144145
const mod = this.server.moduleGraph.getModuleById(id)
145146
return mod?.ssrTransformResult?.map || mod?.transformResult?.map
146147
}
147148

148-
getBrowserSourceMapModuleById(id: string) {
149+
getBrowserSourceMapModuleById(id: string): RawSourceMap | null | undefined {
149150
return this.browser?.moduleGraph.getModuleById(id)?.transformResult?.map
150151
}
151152

0 commit comments

Comments
 (0)