Skip to content

Commit

Permalink
feat: add __moduleIdentifier to ssr script
Browse files Browse the repository at this point in the history
  • Loading branch information
pooya parsa authored and pi0 committed Jan 18, 2021
1 parent 12aaf2e commit 22894fe
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 22894fe

Please sign in to comment.