Skip to content

fix dots in file/directory names breaking Lua require resolution (#1445)#1702

Draft
RealColdFry wants to merge 1 commit intoTypeScriptToLua:masterfrom
RealColdFry:fix/dots-in-module-paths
Draft

fix dots in file/directory names breaking Lua require resolution (#1445)#1702
RealColdFry wants to merge 1 commit intoTypeScriptToLua:masterfrom
RealColdFry:fix/dots-in-module-paths

Conversation

@RealColdFry
Copy link
Copy Markdown
Contributor

Relates to #1445

Lua's require() uses dots as path separators, so a file at Foo.Bar/index.lua is unreachable via require("Foo.Bar.index") since Lua looks for Foo/Bar/index.lua. Expand dotted path segments into nested directories in the emit output, and emit a diagnostic when this expansion causes output path collisions.

…eScriptToLua#1445)

Lua's require() uses dots as path separators, so a file at Foo.Bar/index.lua
is unreachable via require("Foo.Bar.index") since Lua looks for Foo/Bar/index.lua.
Expand dotted path segments into nested directories in the emit output, and emit
a diagnostic when this expansion causes output path collisions.
@Perryvw
Copy link
Copy Markdown
Member

Perryvw commented Apr 1, 2026

While this is a possible solution, wouldn't it be simpler (and the output more reasonable) if we were to just find/replace periods with e.g. underscores in the output file names?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants