You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The ability to require source files using aliases for paths is useful, but one of the annoyances in the current implementation is that paths are forced to lowercase when checking aliases from .luaurc files. For example, if I set an alias entry "deps": "../../deps", and then deps contains some file that isn't in lowercase like DataHandler.lua, then the following code will fail with the error No file exists at the path 'deps/datahandler'.
localDataHandler=require("@deps/DataHandler")
I note that this is enforced specifically here, which is then appended to the resolved path of the alias here.
My understanding of the relevant RFC for require by alias is that although the alias itself is expected to be treated as case insensitive, any appended paths should be left as-is, such as in the example they provide in the document.
-- Suppose "@src" is an alias for the same directory as "../../../../../"-- Instead of this:localresult=require("../../../../../HelperModules/graphing")
-- We could have this:localresult=require("@src/HelperModules/graphing")
The text was updated successfully, but these errors were encountered:
The ability to require source files using aliases for paths is useful, but one of the annoyances in the current implementation is that paths are forced to lowercase when checking aliases from
.luaurc
files. For example, if I set an alias entry"deps": "../../deps"
, and thendeps
contains some file that isn't in lowercase likeDataHandler.lua
, then the following code will fail with the errorNo file exists at the path 'deps/datahandler'
.I note that this is enforced specifically here, which is then appended to the resolved path of the alias here.
My understanding of the relevant RFC for require by alias is that although the alias itself is expected to be treated as case insensitive, any appended paths should be left as-is, such as in the example they provide in the document.
The text was updated successfully, but these errors were encountered: