use compiled files if they exist
use compiled files if they exist

file:a/init.lua -> file:b/init.lua
--- a/init.lua
+++ b/init.lua
@@ -17,7 +17,11 @@
                     print(string.format("\tConnected to access point ssid:\"%s\"\tpassword:\"%s\"%s", def_sta_config.ssid, def_sta_config.pwd, (type(def_sta_config.bssid)=="string" and "\tbssid:\""..def_sta_config.bssid.."\"" or "")))
                     print('\tip: ', wifi.sta.getip())
                     -- Run the main file
-                    dofile("main.lua")
+                    if file.exists("main.lc") then
+                        dofile("main.lc")
+                    else
+                        dofile("main.lua")
+                    end
                     tmr.stop(1)
                 end
             end)

file:a/main.lua -> file:b/main.lua
--- a/main.lua
+++ b/main.lua
@@ -1,5 +1,9 @@
 -- main.lua --
 
 -- Run the mqtt file
-dofile("mqtt.lua")
+if file.exists("mqtt.lc") then
+    dofile("mqtt.lc")
+else
+    dofile("mqtt.lua")
+end
 

comments