How to get the RequireJS base URL (the root URL for Magento 2 static files for a browser) with JavaScript?

Way 1

require.toUrl('')

Way 2

requirejs.s.contexts._.config.baseUrl

1 Like