Sometimes, when developping a component, you will need some resources only in particular case. For example, Bootstrap navbar only need Bootstrap CSS by default. But if you want to enable a collapse effect on smartphone in order to save space, you will also need bootstrap-collapse.js file.
I'm fine with always having the JS file imported, but it would be more perfect if the resource dependency was resolved only if the collapse effect has been enabled in the navbar. So having a way to condition the import of some resource dependency.