So what is the best solution to prevent loading the same library twice?
For example I have a Module which requires a specific library like swiper.js.
So I would require it somehow with
But if I have another Module with the same dependency
My_Module2/path/to/swiper.js it now is loaded twice?
In Magento2 I can require
jquery and any other core library from anywhere but the documentation says you shouldnt put js into mageroot/lib/web/js.