Skip to content

Commit fb622cd

Browse files
committed
fix: simplify import path check in processJsFilesInDir
1 parent 6d25856 commit fb622cd

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

adminforth/commands/utils.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,7 @@ function processJsFilesInDir(directory) {
8686
fileContent = fileContent.replace(
8787
/import (.+?) from ["'](.+?)\/index\.js["'];/g,
8888
(match, imports, modulePath) => {
89-
// Check if the path is not relative (doesn't start with ./ or ../)
90-
if (!modulePath.startsWith("./") && !modulePath.startsWith("../")) {
89+
if (!modulePath.startsWith(".") && !modulePath.startsWith("..")) {
9190
return `import ${imports} from "${modulePath}";`;
9291
}
9392
return match;

0 commit comments

Comments
 (0)