Skip to content

Commit

Permalink
fix: HMR propagation of HTML changes (fix vitejs#7870)
Browse files Browse the repository at this point in the history
  • Loading branch information
brillout committed Apr 25, 2022
1 parent ecc78bc commit a066d2c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/vite/src/node/server/moduleGraph.ts
Expand Up @@ -2,6 +2,7 @@ import { extname } from 'path'
import type { ModuleInfo, PartialResolvedId } from 'rollup'
import { parse as parseUrl } from 'url'
import { isDirectCSSRequest } from '../plugins/css'
import { isHTMLRequest } from '../plugins/html'
import {
cleanUrl,
normalizePath,
Expand Down Expand Up @@ -37,6 +38,12 @@ export class ModuleNode {
constructor(url: string) {
this.url = url
this.type = isDirectCSSRequest(url) ? 'css' : 'js'
// #7870
// The `isSelfAccepting` value is set by importAnalysis, but HTML
// assets don't go through importAnalysis.
if (isHTMLRequest(url)) {
this.isSelfAccepting = false
}
}
}

Expand Down

0 comments on commit a066d2c

Please sign in to comment.