From 2cd08ffb46ff2a29a77e1b5c0ab2f62d1a40cbd5 Mon Sep 17 00:00:00 2001 From: scanash00 Date: Wed, 13 Aug 2025 11:11:14 -0800 Subject: [PATCH] fix: fix imports again! --- scripts/fix-imports.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/fix-imports.js b/scripts/fix-imports.js index d4d61f8..5f1a28d 100644 --- a/scripts/fix-imports.js +++ b/scripts/fix-imports.js @@ -25,6 +25,13 @@ function fixImports(dir) { return `from '${normalizedPath.replace(/\\/g, '/')}.js'`; }); + content = content.replace(/import\(['"]@\/([^'"]+)['"]\)/g, (match, importPath) => { + const targetPath = path.join('dist', importPath); + const relativePath = path.relative(path.dirname(filePath), targetPath); + const normalizedPath = relativePath.startsWith('.') ? relativePath : `./${relativePath}`; + return `import('${normalizedPath.replace(/\\/g, '/')}.js')`; + }); + content = content.replace(/from ['"]\.\/([^'"]+)['"]/g, (match, importPath) => { if (importPath.endsWith('.js')) { return match; -- 2.51.2