Bundler fix
This commit is contained in:
@@ -128,6 +128,10 @@ function Tree:mouse_click(button, x, y)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- Registers a callback for when a node is selected
|
||||||
|
--- @shortDescription Registers a callback for when a node is selected
|
||||||
|
--- @param callback function The callback function
|
||||||
|
--- @return Tree self The Tree instance
|
||||||
function Tree:onSelect(callback)
|
function Tree:onSelect(callback)
|
||||||
self:registerCallback("node_select", callback)
|
self:registerCallback("node_select", callback)
|
||||||
return self
|
return self
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ local function bundle()
|
|||||||
'local minified = true\n',
|
'local minified = true\n',
|
||||||
'local project = {}\n',
|
'local project = {}\n',
|
||||||
'local baseRequire = require\n',
|
'local baseRequire = require\n',
|
||||||
'require = function(path) return project[path] or baseRequire(path) end\n'
|
'require = function(path) return project[path..".lua"] or baseRequire(path) end\n'
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, file in ipairs(files) do
|
for _, file in ipairs(files) do
|
||||||
@@ -31,17 +31,16 @@ local function bundle()
|
|||||||
local success, minified = minify(content)
|
local success, minified = minify(content)
|
||||||
if not success then
|
if not success then
|
||||||
print("Failed to minify " .. file.path)
|
print("Failed to minify " .. file.path)
|
||||||
print(minified)
|
|
||||||
os.exit(1)
|
os.exit(1)
|
||||||
end
|
end
|
||||||
|
|
||||||
table.insert(output, string.format(
|
table.insert(output, string.format(
|
||||||
'project["%s"] = function(...) %s end\n',
|
'project["%s"] = function(...) %s end\n',
|
||||||
file.path, minified
|
file.path, minified:gsub("\n", " ")
|
||||||
))
|
))
|
||||||
end
|
end
|
||||||
|
|
||||||
table.insert(output, 'return project["main.lua"]')
|
table.insert(output, 'return project["main.lua"]()')
|
||||||
|
|
||||||
local out = io.open("release/basalt.lua", "w")
|
local out = io.open("release/basalt.lua", "w")
|
||||||
out:write(table.concat(output))
|
out:write(table.concat(output))
|
||||||
|
|||||||
Reference in New Issue
Block a user