diff --git a/src/index.ts b/src/index.ts index ed24c5304..699626439 100644 --- a/src/index.ts +++ b/src/index.ts @@ -223,6 +223,11 @@ export default function loader( code += `\nscript.__scopeId = "data-v-${id}"` } + // Attach moduleIdentifier for SSR preload hints generation + if (isServer) { + code += `\nscript.__moduleIdentifier = "${hash(loaderContext.request)}"` + } + if (needsHotReload) { code += genHotReloadCode(id, templateRequest) }