diff --git a/src/stdlib/require.coffee b/src/stdlib/require.coffee index 14b1a0506..1076bcc49 100644 --- a/src/stdlib/require.coffee +++ b/src/stdlib/require.coffee @@ -82,9 +82,10 @@ resolve = (name, {verifyExistence}={}) -> file = expanded if not moduleAlreadyLoaded + hasExtension = /\.(.+)$/.test(file) paths.some (path) -> - fileExists = /\.(.+)$/.test(file) and __exists "#{path}/#{file}" - jsFileExists = not /\.(.+)$/.test(file) and __exists "#{path}/#{file}.js" + fileExists = hasExtension and __exists "#{path}/#{file}" + jsFileExists = not hasExtension and __exists "#{path}/#{file}.js" if jsFileExists file = "#{path}/#{file}.js"