Thanks for replying. Yes, I am going to use it in an extension. Are you saying that I should zip the extension and the library files in the same zip files and import? I would like the OpenLayers files to be accessible by other extensions rather than being located within the folder structure of the extension. Could you please clarify?
It is perfectly possible to reference the files from one extension in another one. You only need to make sure your requirejs references are correct.
If your extension XXX contains file lib.js and you want to reference it from extension YYY you need to define the dependency like this:
Then you need to make sure that both extensions are installed at the same time. An easy way to do this is to have them in the same zip file, in different directories within the zip file.
When you upgrade the extensions you need to delete both the old versions before importing the new zip, or the import will fail.
Hope this helps