From 419ad0fb6c8c5c3c65f256a266b95815a07bb463 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabi=C3=A1n=20Heredia=20Montiel?= Date: Thu, 10 Oct 2024 21:45:42 -0600 Subject: [PATCH] cli: allow imports with explicit extension --- cli/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cli/index.js b/cli/index.js index b7b4a836e5..3d21352f90 100644 --- a/cli/index.js +++ b/cli/index.js @@ -488,7 +488,9 @@ export async function main(argv, options) { if (libPath.includes("/")) return; // in sub-directory: imported on demand let begin = stats.begin(); stats.parseCount++; - assemblyscript.parse(program, libraryFiles[libPath], libraryPrefix + libPath + extension, false); + const path = libraryPrefix + libPath; + const pathWithExtension = extension_re.test(path) ? path : path + extension; + assemblyscript.parse(program, libraryFiles[libPath], pathWithExtension, false); stats.parseTime += stats.end(begin); }); let customLibDirs = [];