:3
This commit is contained in:
parent
b7ad80b226
commit
4f0509d30e
2
rtmc.lua
2
rtmc.lua
|
@ -3,6 +3,8 @@ local __DEFAULT_IMPORT = require
|
|||
local require = function(path)
|
||||
if __BUNDLER_FILES[path] then
|
||||
return __BUNDLER_FILES[path]()
|
||||
elseif __BUNDLER_FILES[path .. ".lua"] then
|
||||
return __BUNDLER_FILES[path .. ".lua"]()
|
||||
else
|
||||
return __DEFAULT_IMPORT(path)
|
||||
end
|
||||
|
|
24
x.py
24
x.py
|
@ -39,17 +39,23 @@ def minimise(buf: str) -> str:
|
|||
# hasher.update(bytes(buf, "utf-8"));
|
||||
# return hasher.hexdigest();
|
||||
|
||||
REQ_HEADER="""local __BUNDLER_FILES = {}
|
||||
local __DEFAULT_IMPORT = require
|
||||
local require = function(path)
|
||||
if __BUNDLER_FILES[path] then
|
||||
return __BUNDLER_FILES[path]()
|
||||
elseif __BUNDLER_FILES[path .. ".lua"] then
|
||||
return __BUNDLER_FILES[path .. ".lua"]()
|
||||
else
|
||||
return __DEFAULT_IMPORT(path)
|
||||
end
|
||||
end
|
||||
"""
|
||||
|
||||
|
||||
def main():
|
||||
buf = ""
|
||||
buf += "local __BUNDLER_FILES = {}\n";
|
||||
buf += "local __DEFAULT_IMPORT = require\n";
|
||||
buf += "local require = function(path)\n";
|
||||
buf += " if __BUNDLER_FILES[path] then\n";
|
||||
buf += " return __BUNDLER_FILES[path]()\n";
|
||||
buf += " else\n";
|
||||
buf += " return __DEFAULT_IMPORT(path)\n";
|
||||
buf += " end\n";
|
||||
buf += "end\n";
|
||||
buf += REQ_HEADER;
|
||||
# buf += "local __UPDATE_HASH = __BUNDLER_REPLACE_HASH__\n";
|
||||
for file in FILES:
|
||||
print(f"=== FILE: {file}");
|
||||
|
|
Loading…
Reference in New Issue
Block a user