in the {theme}.libraries.yml why we need to declare the jquery js or any other library as a depedency :
js:
assets/lib/bootstrap-4.0.0-dist/js/bootstrap.js: {}
assets/script.js: {}
dependencies:
- core/jquery
an not just include it for example as a simple js, before all other js that depends on it :
js:
assets/jquery.js: {} # load dependency library before the dependent libraries.
assets/lib/bootstrap-4.0.0-dist/js/bootstrap.js: {}
assets/script.js: {}
in the 2nd scenario the js file ex: jquery will be loaded before the other js files.
so what is the difference?