One way is to specify the base URI in your query [1]. If you frequently import server-side modules, the approach we recommend is to move the modules into the repository.
Hope this helps, Christian
[1] https://www.w3.org/TR/xquery-31/#id-base-uri-decl [2] http://docs.basex.org/wiki/Repository
While the base uri works, it isn't very convenient, because it forces you to know the modules directory path beforehand, which means I can't deploy it in two different systems and expect it to work without changes.
I will also take a better look at the repository later, but from what I understand I need to remove all relative location uri from the module import of every xquery script? Beucase I tried just copying the files in the repo and it didn't work. I have a large amount of scripts (maybe over 500), that will need manual changes.
Finally, I think the querypath option was very useful, so please don't remove it :)