fix(js): Correct file path for cjs.js (#23081)

This commit is contained in:
Nicholas Cunningham 2024-04-29 13:54:09 -06:00 committed by GitHub
parent cd7f3df3de
commit 1f6aba03a1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -412,7 +412,7 @@ function getFileToRun(
function fileToRunCorrectPath(fileToRun: string): string {
if (fileExists(fileToRun)) return fileToRun;
const extensionsToTry = ['.cjs', '.mjs', 'cjs.js', '.esm.js'];
const extensionsToTry = ['.cjs', '.mjs', '.cjs.js', '.esm.js'];
for (const ext of extensionsToTry) {
const file = fileToRun.replace(/\.js$/, ext);