feat(sourcemap_generator): support init.lua files (#1)

This commit is contained in:
let 2024-11-13 21:10:57 -03:00 committed by GitHub
parent 5e5b3efc78
commit e68f5d0928
Signed by untrusted user who does not match committer: DevComp
GPG key ID: 429EF1C337871656

View file

@ -10,6 +10,9 @@ if fs.isFile(package_directory .. "/default.project.json") then
elseif fs.isFile(package_directory .. "/init.luau") then elseif fs.isFile(package_directory .. "/init.luau") then
local sourcemap = { filePaths = { "init.luau" } } local sourcemap = { filePaths = { "init.luau" } }
stdio.write(serde.encode("json", sourcemap, false)) stdio.write(serde.encode("json", sourcemap, false))
elseif fs.isFile(package_directory .. "/init.lua" then
local sourcemap = { filePaths = { "init.lua" } }
stdio.write(serde.encode("json", sourcemap, false))
else else
-- use stderr to avoid this being parsed as the output of the sourcemap command -- use stderr to avoid this being parsed as the output of the sourcemap command
stdio.ewrite("no default.project.json found in " .. package_directory) stdio.ewrite("no default.project.json found in " .. package_directory)