How to programmatically clear library info definition? Created a dynamic library which attaches some external CSS &amp; JS thru hook_library_info_build hook and this depends on a dynamic config values set by a config form. So whenever that config form saved, how can I make sure the library info is up to date and latest? and users don't have to always do a complete cache rebuild.
Additionally is it possible to clear(or rebuild) just one library definition?
Okay, searching thru core services found this. We can clear all the library definitions like this.
\Drupal::service('library.discovery')-&gt;clearCachedDefinitions();

See Drupal Reference of this method: Reference
Calling this function Clears static and persistent library definition caches.