Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add __moduleIdentifier for ssr _registeredComponents #1802

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/index.ts
Expand Up @@ -76,6 +76,7 @@ export default function loader(
const {
mode,
target,
request,
sourceMap,
rootContext,
resourcePath,
Expand Down Expand Up @@ -240,6 +241,9 @@ export default function loader(
code += `\nscript.__file = ${JSON.stringify(path.basename(resourcePath))}`
}

// set modlue indentifier for SSR async components preload
code += `\nscript.__moduleIdentifier =${JSON.stringify(hash(request))}`

// custom blocks
if (descriptor.customBlocks && descriptor.customBlocks.length) {
code += `\n/* custom blocks */\n`
Expand Down