-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conditional / Fallback alias? #31
Comments
Remapify does not support this, and I think it's a bit out of scope. I don't know of another transform/plugin that does this either :( FWIW, I know this seems like a good idea, but it's probably not a good path to go down. It's likely to lead to unpredictable and therefore buggy behavior. |
Shucks, this seems pretty useful to have. |
The problem with this idea is that it becomes really hard to predict what file you're actually loading. |
While that is true, it's still a choice that is resolved at asset compile time. So assuming one has some sort of staging environment available, it's not going to be a surprise at runtime. I guess it comes down to what sort of patterns your team is comfortable with. Providing some sort of 'classpath', where each directory is searched in sequence for a particular file, is a pattern that all developers have become familiar with |
The API i would propose for this would be to accept CWD as an array of directories, and you match the JS against the first in the list. |
That is an elegant API … and far be it from me to prevent a feature that now two people have asked for. PR would be welcome! |
Is it possible to configure fallback alias?
Eg.
The text was updated successfully, but these errors were encountered: