How to debug Episerver UI code
In order to have the system use the debug files you need to enable debug mode for client resources. You can do this simply by adding the <clientResources debug="true" /> element to your web.config inside the episerver.framework element. You can then toggle the debug files on and off by changing the value of the debug attribute from true to false.
EPiServer.CMS.UI.Sources (advanced topic)
This nuget package contains all original UI source files together with uncompressed dojo & dijit.
That source package is built as part of every release so it ties quite simply into the continuous release cycle. You can install it the same way you would any other NuGet package from nuget.episerver.com.
In case you ever need to manipulate sources files and then create a customized dojo build you can use that package. It comes together with all dojo build tools.
Please note that in order to debug the EPiServer edit mode you don't need that package. The config change described above is sufficient.