NodeRequirer
NodeRequirer copied to clipboard
Allow per-project aliases
Besides module aliases for packages there are times I would like to alias individual modules in my own package. (eg: Maybe I want ./resources/lib/facebook-sdk.js
to be FB
)
These types of local aliases don't make sense to be in the global settings, so it would be nice to have per-project settings.
As far as I know, currently while you can have per-project Sublime Text settings, you cannot have per-project package settings (unless you install an ugly hack like "Project Specific").
There are two options for this:
A) Look for something like a .noderequirerc
and read some settings like "alias" from it. (pro: Can be committed with the project)
B) Since NodeRequire already requires you to be inside a Sublime project, we could read custom settings from that project. (pro: Doesn't require an extra file)
Whatever way we implement it, there is a nice bonus feature we could also implement.
Because dealing with the right file path needed to apply the alias on (NodeRequirer is supposed to do that for you anyways) it would be nice to have an extra "NodeRequirer: Locally Alias File As" command. Which would prompt you for a name then automatically edit the settings file with the correct alias.