annex4-inc / vscode-control4-ext

VSCode extension for building Control4 drivers.
GNU General Public License v3.0
25 stars 6 forks source link

fix: ensure modules are reloaded when generating a merged source #15

Closed shimms closed 1 month ago

shimms commented 3 months ago

Wraps the module source in a load call, and returns a function searcher executed as an IIFE. Resulting function in the package.preload table is a valid searcher than returns a function that when executed loads the module from source.

Tested using deploy stage to dynamically reload code both within driver.lua (which this change doesn't impact) as well as all required files (which this change specifically addresses).

Prior to change, updated code in files included via require were not updated when deploying the changes via LUA_COMMANDS. After this change, modifications made to included files via require reflect changes deployed in new bundle.