From 8a1234e565489c92f041356b7a06339eaeee48df Mon Sep 17 00:00:00 2001 From: Wells Date: Wed, 22 Nov 2023 20:00:32 +0800 Subject: [PATCH] fix: prototype to import declaration (#67) Co-authored-by: wwsun --- packages/core/src/helpers/prototype.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/core/src/helpers/prototype.ts b/packages/core/src/helpers/prototype.ts index ec1e2fc..eb3f6c9 100644 --- a/packages/core/src/helpers/prototype.ts +++ b/packages/core/src/helpers/prototype.ts @@ -35,6 +35,9 @@ export function getImportDeclarationPayloadByPrototype( if (relativeFilepath && isFilepath(sourcePath)) { sourcePath = getRelativePath(relativeFilepath, sourcePath); } + if (sourcePath.endsWith('.js')) { + sourcePath = sourcePath.slice(0, -3); + } return { defaultSpecifier,