refactor: use `_runHandleHotUpdateOnCreateAndDelete`

pull/3706/head
sapphi-red 3 months ago
parent a6a7645e94
commit 6f45459ffa

@ -121,7 +121,7 @@ export const staticDataPlugin: Plugin = {
}, },
transform(_code, id) { transform(_code, id) {
if (server && loaderMatch.test(id)) { if (server && loaderMatch.test(id) && '_importGlobMap' in server) {
// register this module as a glob importer // register this module as a glob importer
const { watch } = idToLoaderModulesMap[id]! const { watch } = idToLoaderModulesMap[id]!
if (watch) { if (watch) {
@ -159,5 +159,8 @@ export const staticDataPlugin: Plugin = {
ctx.modules.push(server.moduleGraph.getModuleById(id)!) ctx.modules.push(server.moduleGraph.getModuleById(id)!)
} }
} }
} },
// @ts-expect-error internal
_runHandleHotUpdateOnCreateAndDelete: true
} }

Loading…
Cancel
Save