Hi, I’m the author of the hot-reload plugin that is used by many Obsidian plugin devs. Unfortunately, since the addition of app.debugMode(), it’s no longer possible to enable sourcemap handling during a plugin reload, because Obsidian has switched from checking the “debug-mode” localstorage at load time, to checking a vault-specific “DebugMode” at application start. (Meaning it ignores any intermediate changes even to the new localstorage variable.)
Would it be possible to at least check the new localstorage variable at plugin load time, and/or make app.debugMode() not reload the entire app? Or is there something that has changed with the sourcemap stripping behavior that means it really isn’t possible to turn it on or off without reloading the entire Obsidian app? Thanks.
Yes, I’d planned to use that workaround as a fallback, at least in ophidian/build’s esbuild config. But the only way hot-reload can do it would be to patch the vault adapter read() function during hot reload to add the string automatically. (Making hot-reload write to the plugin files themselves is not an option as that would break my ability to test a plugin in multiple Obsidian versions simultaneously using Sandboxie.)
I’m just not keen on patching the vault adapter if I can possibly avoid it.