Skip to content

Commit

Permalink
fix: don't bundle import from rollup (#4392)
Browse files Browse the repository at this point in the history
  • Loading branch information
sheremet-va committed Oct 30, 2023
1 parent ba1df84 commit 3b58487
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/vite-node/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ export interface StartOfSourceMap {
export type { EncodedSourceMap, DecodedSourceMap, SourceMapInput } from '@jridgewell/trace-mapping'

export interface RawSourceMap extends StartOfSourceMap {
version: string
version: number
sources: string[]
names: string[]
sourcesContent?: string[]
sourcesContent?: (string | null)[]
mappings: string
}

Expand Down
5 changes: 3 additions & 2 deletions packages/vitest/src/node/workspace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import type { ViteDevServer, InlineConfig as ViteInlineConfig } from 'vite'
import { ViteNodeRunner } from 'vite-node/client'
import { ViteNodeServer } from 'vite-node/server'
import c from 'picocolors'
import type { RawSourceMap } from 'vite-node'
import { createBrowserServer } from '../integrations/browser/server'
import type { ArgumentsType, Reporter, ResolvedConfig, UserConfig, UserWorkspaceConfig, Vitest } from '../types'
import { deepMerge } from '../utils'
Expand Down Expand Up @@ -140,12 +141,12 @@ export class WorkspaceProject {
|| this.browser?.moduleGraph.getModuleById(id)
}

getSourceMapModuleById(id: string) {
getSourceMapModuleById(id: string): RawSourceMap | null | undefined {
const mod = this.server.moduleGraph.getModuleById(id)
return mod?.ssrTransformResult?.map || mod?.transformResult?.map
}

getBrowserSourceMapModuleById(id: string) {
getBrowserSourceMapModuleById(id: string): RawSourceMap | null | undefined {
return this.browser?.moduleGraph.getModuleById(id)?.transformResult?.map
}

Expand Down

0 comments on commit 3b58487

Please sign in to comment.