How to resolve relative path to absolute url in ES6 module (in browser)? For example : module1.js What would be the resolveUrl implementation? base-url.com/ may not be the web-site’s domain. It can be a repo where only sources are stored. Answer 🎉 You can now use to-absolute-url. It uses stacktrace.js under the hoods to get the caller function’s absolute path