Skip to content

Commit

Permalink
Update html.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Feb 22, 2021
1 parent a3edd80 commit a167faf
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/vite/src/node/plugins/html.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,10 @@ export function buildHtmlPlugin(config: ResolvedConfig): Plugin {
const [preHooks, postHooks] = resolveHtmlTransforms(config.plugins)
const processedHtml = new Map<string, string>()
const isExcludedUrl = (url: string) =>
isExternalUrl(url) || isDataUrl(url) || checkPublicFile(url, config)
url.startsWith('#') ||
isExternalUrl(url) ||
isDataUrl(url) ||
checkPublicFile(url, config)

return {
name: 'vite:build-html',
Expand Down Expand Up @@ -199,9 +202,6 @@ export function buildHtmlPlugin(config: ResolvedConfig): Plugin {
assetAttrs.includes(p.name)
) {
const url = p.value.content
if (url === '#') {
continue
}
if (!isExcludedUrl(url)) {
if (node.tag === 'link' && isCSSRequest(url)) {
// CSS references, convert to import
Expand Down

0 comments on commit a167faf

Please sign in to comment.