Skip to content

Commit 3a4aab1

Browse files
authored
Aliases can depend on other aliases (#145)
1 parent b4a2551 commit 3a4aab1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

docs/require-by-string-aliases.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ Of course, users can still use the alias map to explicitly define this behavior
8686

8787
#### Current limitations of aliases
8888

89-
- Aliases cannot reference other aliases. (However, this is compatible with this proposal and will likely be implemented in the future.)
9089
- Alias names cannot contain the directory separators `/` and `\`.
9190
- Aliases can only occur at the beginning of a path.
9291

@@ -106,7 +105,9 @@ Proposed structure of an alias map:
106105

107106
Missing aliases in `.luaurc` are inherited from the alias maps of any parent directories, and fields can be overridden.
108107

109-
Additionally, if an alias is bound to a relative path, the path will be evaluated relative to the `.luaurc` file in which the alias was defined.
108+
If an alias is bound to a relative path, the path will be evaluated relative to the `.luaurc` file in which the alias was defined.
109+
If an alias resolves to an aliased path, the aliased path is resolved by checking the current `.luaurc` file and falling back to parent directories if needed.
110+
This search continues iteratively if a chain of aliases must be resolved; if a cycle is detected, alias resolution will fail with an error.
110111

111112
Finally, providing support for alias maps within the Roblox engine is out of the scope of this RFC but is being considered internally.
112113

0 commit comments

Comments
 (0)