-
-
Notifications
You must be signed in to change notification settings - Fork 8
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
Support Lua style requires #6
Comments
Adding my (delayed) reply from IRC: The issue is that webpack does automatic node-js style resolution. If we add in Lua style resolution it still then does the node-js resolution on top and turns things into unwanted results. There's the additional issues of wanting to be able to require arbitrary JS libraries/files from Lua: if lua's require acts differently to JS's then this gets very confusing. |
I'm trying to use the 'dependencies' option to work with a somewhat large code base (I assume dependencies are used to address this issue?) Unfortunately I get "Can't resolve 'fengari-web'" when I try to define dependencies as a map of requires strings to files paths (which is how I assume it's to be used). Is there an example of how dependencies are supposed to work? |
Do you have an example snippet that gives this error? |
I think the more appropriate way to solve this issue is to separate a JS require from a Lua require. Their styles are far too different to mix the two and using JS imports to import Lua breaks basically any existing platform-independent Lua code people have. |
I need to put together a test case, but in my issue was with using symlinks to my code base. Looks like if I add the webpack config:
to module.exports, my issue is resolved. |
Having support for
require
s similar to what standard Lua uses would be nice. I have an implementation that works well enough for my purposes here. This allowsrequire
s to be in the form of"fu.bar"
to which is similar to"./fu/bar.lua"
with how the loader currently works. It isn't doesn't work exactly like Lua's package loader, but is a starting point that can be improved if this is somethingfengari-loader
is going to support.The text was updated successfully, but these errors were encountered: