Skip to content

Commit 419ad0f

Browse files
committed
cli: allow imports with explicit extension
1 parent dfc8a65 commit 419ad0f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

cli/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,9 @@ export async function main(argv, options) {
488488
if (libPath.includes("/")) return; // in sub-directory: imported on demand
489489
let begin = stats.begin();
490490
stats.parseCount++;
491-
assemblyscript.parse(program, libraryFiles[libPath], libraryPrefix + libPath + extension, false);
491+
const path = libraryPrefix + libPath;
492+
const pathWithExtension = extension_re.test(path) ? path : path + extension;
493+
assemblyscript.parse(program, libraryFiles[libPath], pathWithExtension, false);
492494
stats.parseTime += stats.end(begin);
493495
});
494496
let customLibDirs = [];

0 commit comments

Comments
 (0)