Skip to content

Commit

Permalink
chore: remove maybeVirtualHtmlSet (#8010)
Browse files Browse the repository at this point in the history
  • Loading branch information
sapphi-red authored May 4, 2022
1 parent 6420ba0 commit e85164e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
4 changes: 0 additions & 4 deletions packages/vite/src/node/plugins/html.ts
Original file line number Diff line number Diff line change
Expand Up @@ -722,8 +722,6 @@ export function resolveHtmlTransforms(
return [preHooks, postHooks]
}

export const maybeVirtualHtmlSet = new Set<string>()

export async function applyHtmlTransforms(
html: string,
hooks: IndexHtmlTransformHook[],
Expand All @@ -734,8 +732,6 @@ export async function applyHtmlTransforms(
const bodyTags: HtmlTagDescriptor[] = []
const bodyPrependTags: HtmlTagDescriptor[] = []

maybeVirtualHtmlSet.add(ctx.filename)

for (const hook of hooks) {
const res = await hook(html, ctx)
if (!res) {
Expand Down
4 changes: 1 addition & 3 deletions packages/vite/src/node/server/sourcemap.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import path from 'path'
import { promises as fs } from 'fs'
import type { Logger } from '../logger'
import { createDebugger, normalizePath } from '../utils'
import { createDebugger } from '../utils'
import type { SourceMap } from 'rollup'
import { maybeVirtualHtmlSet } from '../plugins/html'

const isDebug = !!process.env.DEBUG
const debug = createDebugger('vite:sourcemap', {
Expand Down Expand Up @@ -43,7 +42,6 @@ export async function injectSourcesContent(
sourcePath = path.resolve(sourceRoot, sourcePath)
}
return fs.readFile(sourcePath, 'utf-8').catch(() => {
if (maybeVirtualHtmlSet.has(normalizePath(sourcePath))) return null
missingSources.push(sourcePath)
return null
})
Expand Down

0 comments on commit e85164e

Please sign in to comment.