From 8615bb8401c99f1af231dfcc8a03d77d0491f880 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=A3=8E=E7=86=A0?= Date: Thu, 4 Mar 2021 17:24:15 +0800 Subject: [PATCH] fix: add __moduleIdentifier for ssr _registeredComponents --- src/index.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/index.ts b/src/index.ts index ed24c5304..862cc006e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -76,6 +76,7 @@ export default function loader( const { mode, target, + request, sourceMap, rootContext, resourcePath, @@ -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`