Add a weighting system to Requirements
CSS and JS files are loaded in the order they are called (with some intelligence based on what requirements are called). When you have multiple modules and your core theme all calling requirements from different places sometimes requirements get called in an order that is not ideal.
My first thought on this was maybe a simple weighting system, so higher numbers float to the top, the call would look something like:
This is following on from the Github issue raised here: https://github.com/silverstripe/silverstripe-framework/issues/6454#issuecomment-271622873
In the CMS, there’ll be more structured ways to extend functionality than calling Requirements::block() on a file with a bunch of Entwine rules, and then recreate your own ones.
Michal Kleiner commented
I'd suggest instead of using weighting (or at least beside to that), would be to specify dependencies, e.g. what file requires which other files to be loaded before. Then resolve this to a chain of dependencies and load them accordingly. With weighting, it seems like the same problem again in a case when all weights are set to be the same.