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 4, 2024
1 parent 76f014b commit 6e4cfe9
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 28 deletions.
25 changes: 0 additions & 25 deletions packages/vite/src/node/ssr/runtime/moduleCache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,6 @@ export class ModuleCacheMap extends Map<string, ModuleCache> {
return this.deleteByModuleId(this.normalize(fsPath))
}

invalidateModule(mod: ModuleCache): boolean {
delete mod.evaluated
delete mod.resolving
delete mod.promise
delete mod.exports
mod.importers?.clear()
mod.imports?.clear()
return true
}

/**
* Invalidate modules that dependent on the given modules, up to the main entry
*/
Expand Down Expand Up @@ -96,19 +86,4 @@ export class ModuleCacheMap extends Map<string, ModuleCache> {
}
return invalidated
}

/**
* Return parsed source map based on inlined source map of the module
*/
// getSourceMap(id: string) {
// const cache = this.get(id)
// if (cache.map)
// return cache.map
// const map = cache.code && extractSourceMap(cache.code)
// if (map) {
// cache.map = map
// return map
// }
// return null
// }
}
5 changes: 3 additions & 2 deletions packages/vite/src/node/ssr/runtime/runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,8 @@ export class ViteRuntime {
if (!fetchedModule.externalize && mod.promise) return await mod.promise

const promise = this.directRequest(id, fetchedModule, callstack, metadata)
Object.assign(mod, { promise, evaluated: false })
mod.promise = promise
mod.evaluated = false
return await promise
} catch (error: any) {
mod.error = error
Expand Down Expand Up @@ -259,7 +260,7 @@ export class ViteRuntime {
configurable: false,
})

Object.assign(mod, { exports })
mod.exports = exports

let hotContext: ViteHotContext | undefined
if (this.hmrClient) {
Expand Down
1 change: 0 additions & 1 deletion packages/vite/src/node/ssr/ssrFetchModule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ interface FetchModuleOptions {

const DRIVE_REGEXP = /^[A-Za-z]:/

// TODO: return "type" when externalized
export async function ssrFetchModule(
server: ViteDevServer,
id: string,
Expand Down

0 comments on commit 6e4cfe9

Please sign in to comment.