You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It uses require.toUrl('.') (with the global require object) to determine the baseUrl of my app.
Is it safe to use require.toUrl this way? Is this behavior stable? Is it documented somewhere? And if the answer is "no" to any of these questions, can you suggest a better alternative?
I noticed people on StackOverflow mentioning this technique, but I can't find any official documentation for this!
The text was updated successfully, but these errors were encountered:
The only official docs for it are here, but it does not talk about the top level toUrl. However, the behavior you seems reasonable given that it is the top level toUrl, so it is not relative to any module ID, just the baseUrl.
There are no plans to change the behavior of toUrl, so its behavior should stay consistent for the 2.x series. There are no plans for a 3.x series.
Closing as a discussion ticket, but feel free to continue discussion here.
I'm using the following code to create relative URLs :
It uses
require.toUrl('.')
(with the globalrequire
object) to determine the baseUrl of my app.Is it safe to use
require.toUrl
this way? Is this behavior stable? Is it documented somewhere? And if the answer is "no" to any of these questions, can you suggest a better alternative?I noticed people on StackOverflow mentioning this technique, but I can't find any official documentation for this!
The text was updated successfully, but these errors were encountered: