Closed DoctorRyner closed 4 years ago
Hi @DoctorRyner, there is currently no option to bundle the runtime into the output file. I haven't followed Lua ecosystem for a while and I don't know if there exists bundling tools similar to what one can find for JavaScript. This project seems interesting in that regard: https://luapower.com/bundle where you could put the output file as the "main" module and the runtime as a regular module. Admittedly I just skimmed through that tool doc and I am not sure if that would fit your need.
Thanks. I compiled PureScript to JavaScript and JavaScript to Lua using cast. It works great but for some reason, it's somehow complicated to import the whole runtime to use it for scripting in Warcraft 3 Reforged
Solved it using
Thanks for sharing that link, that's useful.
Yeah, it should be possible to do something like amalg.lua -o castl.lua ...
and distribute it with a single file or even bundle this all into output. But I couldn't make it work with W3 Reforged because they do not support require() natively and community made require() stubs can't deal with a complex modules chaining like in castl :c
Do you think it's possible to rewrite castl without using require in theory? I mean, how time-consuming that would be?
Isn't exactly what amalg.lua is supposed to do by flattening all the runtime in a single file? I don't think it makes sense to "rewrite" manually castl in a single file without require
, and it would also be unmaintainable. That why you need to use a bundling tool.
Isn't exactly what amalg.lua is supposed to do by flattening all the runtime in a single file?
Yes, it does but it still uses require()
and Blizzard doesn't support it, so I can't use it, custom require()
s that some people write can't deal with a complex module import chaining like in castl
Is it possible to bundle runtime into the output file and to not carry around it with a project?