From 47b1bfbabc3d3fa9f023257c83fe8b0c1dc5dcfa Mon Sep 17 00:00:00 2001 From: Geng Yan Date: Thu, 26 Sep 2024 04:48:05 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9E=20fix:=20fix=20import=20err?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- src/utils/import.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index d23caab..0109eb5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@gylove1994/npg", - "version": "0.2.0", + "version": "0.2.1", "description": "A command line tool for nestjs-prisma code generation", "main": "index.js", "scripts": { diff --git a/src/utils/import.ts b/src/utils/import.ts index 74edca6..bc90c9e 100644 --- a/src/utils/import.ts +++ b/src/utils/import.ts @@ -5,9 +5,9 @@ export function importFile(importName: string, useRelativePath = false) { createdEnumMap.has(importName) || createdEnumMap.has(importName.toUpperCase()) ) { - return `import { ${importName} } from "${useRelativePath ? "@entity/" : ""}${importName}Enum";\n`; + return `import { ${importName} } from "${useRelativePath ? "@entity/" : "./"}${importName}Enum";\n`; } - return `import { ${importName} } from "${useRelativePath ? "@entity/" : ""}${importName}Entity";\n`; + return `import { ${importName} } from "${useRelativePath ? "@entity/" : "./"}${importName}Entity";\n`; } export function importApiProperty() {