Skip to content

Commit

Permalink
chore: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
sheremet-va committed Jan 18, 2024
1 parent 3fdafe5 commit bccf0c4
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions packages/vite/src/node/ssr/runtime/runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ export class ViteRuntime {
public runner: ViteModuleRunner,
private debug?: ViteRuntimeDebugger,
) {
this.moduleCache =
options.moduleCache ?? new ModuleCacheMap(this.options.root)
this.moduleCache = options.moduleCache ?? new ModuleCacheMap(options.root)
this.envProxy = createImportMetaEnvProxy(options.environmentVariables)
if (typeof options.hmr === 'object') {
this.hmrClient = new HMRClient(
Expand Down Expand Up @@ -210,7 +209,6 @@ export class ViteRuntime {
_callstack: string[],
metadata?: SSRImportMetadata,
): Promise<any> {
const fsPath = file || id
const callstack = [..._callstack, moduleId]

const mod = this.moduleCache.getByModuleId(moduleId)
Expand All @@ -228,7 +226,7 @@ export class ViteRuntime {
// it's possible to provide an object with toString() method inside import()
dep = String(dep)
if (dep[0] === '.') {
dep = posixResolve(posixDirname(fsPath), dep)
dep = posixResolve(posixDirname(id), dep)
}
return request(dep, { isDynamicImport: true })
}
Expand Down

0 comments on commit bccf0c4

Please sign in to comment.