Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: support custom module require rule #866

Open
ninjaaquaoutlook opened this issue Dec 6, 2024 · 0 comments
Open

Feature Request: support custom module require rule #866

ninjaaquaoutlook opened this issue Dec 6, 2024 · 0 comments
Labels
feature request New feature or request

Comments

@ninjaaquaoutlook
Copy link

We have some customized lua require rules in our project. It would be very helpful if Teal can provide an interface that let us define custom module require rules.
I would imagine something like this in tlconfig.lua:
image

In our use case, require same literal string may end up with different target modules depending on the current file location. And since we have multiple lua vms, we also encoded this information in the require string (e.g, require("ModuleA:Simulation")), which cannot be achieved without custom module require.
Another useful use case I can think of is to achieve something what people do to lua library that require a module name actually require that module's lua entry point (e.g., require("ModuleA") actually require ModuleA/init.lua). With custom module require, we can achieve same thing in Teal.

@hishamhm hishamhm added the feature request New feature or request label Dec 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants