Look for .luau by default in module resolver as well

This commit is contained in:
Roni Nevalainen 2021-11-05 21:36:59 +02:00
parent f13cc5486e
commit 5edb1bfa8e
No known key found for this signature in database
GPG key ID: 222116D3E5A8F2A1

View file

@ -115,7 +115,12 @@ struct CliFileResolver : Luau::FileResolver
{
if (Luau::AstExprConstantString* expr = node->as<Luau::AstExprConstantString>())
{
Luau::ModuleName name = std::string(expr->value.data, expr->value.size) + ".lua";
Luau::ModuleName name = std::string(expr->value.data, expr->value.size) + ".luau";
if (!moduleExists(name))
{
// fall back to .lua if a module with .luau doesn't exist
name = std::string(expr->value.data, expr->value.size) + ".lua";
}
return {{name}};
}