Module loader class that bypasses Roblox's require cache.
This class aims to solve a common problem where code needs to be run in Studio, but once a change is made to an already required module the whole place must be reloaded for the cache to be reset. With this class, the cache is ignored when requiring a module so you are able to load a module, make changes, and load it again without reloading.
local ModuleLoader = require(ReplicatedStorage.Packages.ModuleLoader)
local loader = ModuleLoader.new()
loader:require(ReplicatedStorage.ModuleScript)
Installing the package is quick and easy whether you use a package manager like Wally or work directly in Studio.
Add the following to your wally.toml
and run wally install
to download the package.
[dependencies]
ModuleLoader = "flipbook-labs/[email protected]"
Make sure the resulting Packages
folder is synced into your experience using a tool like Rojo.
- Download a copy of the rbxm from the releases page under the Assets section.
- Drag and drop the file into Roblox Studio to add it to your experience.
You can find the documentation here.
Parts of this class were taken verbatim from OrbitalOwen/roblox-testservice-watcher, and other parts were rewritten to allow the module loading code to be abstracted into a new package.
See the contributing guide.