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
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.
The text was updated successfully, but these errors were encountered:
We could read both something like a .noderequirerrc and a sublime project file.
And when running a "Locally Alias File As" command we could look for the .noderequirerrc and if found add it to that, otherwise add it to the project settings.
This way aliases will normally just go into the project settings file. But if a project ever wants to commit these patterns for other developers on the same project all they have to do is create an empty .noderequirerrc and patterns will start being added there.
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 beFB
)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.
The text was updated successfully, but these errors were encountered: