Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove maybeVirtualHtmlSet #8010

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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