Skip to content

Commit

Permalink
refactor: use "= undefined" instead of delete
Browse files Browse the repository at this point in the history
  • Loading branch information
sheremet-va committed Feb 22, 2024
1 parent 4ebc815 commit 417c33a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/vite/src/node/ssr/runtime/moduleCache.ts
Expand Up @@ -68,10 +68,10 @@ export class ModuleCacheMap extends Map<string, ModuleCache> {
invalidate(id: string): void {
const module = this.get(id)
module.evaluated = false
delete module.meta
delete module.map
delete module.promise
delete module.exports
module.meta = undefined
module.map = undefined
module.promise = undefined
module.exports = undefined
// remove imports in case they are changed,
// don't remove the importers because otherwise it will be empty after evaluation
// this can create a bug when file was removed but it still triggers full-reload
Expand Down

0 comments on commit 417c33a

Please sign in to comment.