We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 882fb67 commit 6d25856Copy full SHA for 6d25856
adminforth/commands/utils.js
@@ -82,11 +82,15 @@ function processJsFilesInDir(directory) {
82
}
83
);
84
85
- // Remove /index.js from imports
+ // Remove /index.js from imports only if it's not a relative path
86
fileContent = fileContent.replace(
87
/import (.+?) from ["'](.+?)\/index\.js["'];/g,
88
(match, imports, modulePath) => {
89
- return `import ${imports} from "${modulePath}";`;
+ // Check if the path is not relative (doesn't start with ./ or ../)
90
+ if (!modulePath.startsWith("./") && !modulePath.startsWith("../")) {
91
+ return `import ${imports} from "${modulePath}";`;
92
+ }
93
+ return match;
94
95
96
0 commit comments