From f4fd6ba3c2e1d716e3eb9b5ce6325260612b4349 Mon Sep 17 00:00:00 2001 From: scanash00 Date: Wed, 13 Aug 2025 10:47:37 -0800 Subject: [PATCH] fix: imports on commands were kind of broken (oopsie) --- scripts/fix-imports.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/fix-imports.js b/scripts/fix-imports.js index 34376a0..d4d61f8 100644 --- a/scripts/fix-imports.js +++ b/scripts/fix-imports.js @@ -19,8 +19,10 @@ function fixImports(dir) { let content = fs.readFileSync(filePath, 'utf8'); content = content.replace(/from ['"]@\/([^'"]+)['"]/g, (match, importPath) => { - const relativePath = path.relative(path.dirname(filePath), path.join('dist', importPath)); - return `from '${relativePath.replace(/\\/g, '/')}.js'`; + const targetPath = path.join('dist', importPath); + const relativePath = path.relative(path.dirname(filePath), targetPath); + const normalizedPath = relativePath.startsWith('.') ? relativePath : `./${relativePath}`; + return `from '${normalizedPath.replace(/\\/g, '/')}.js'`; }); content = content.replace(/from ['"]\.\/([^'"]+)['"]/g, (match, importPath) => { -- 2.51.2