Skip to content
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

Allow per-project aliases #28

Open
dantman opened this issue Feb 21, 2015 · 1 comment
Open

Allow per-project aliases #28

dantman opened this issue Feb 21, 2015 · 1 comment

Comments

@dantman
Copy link
Contributor

dantman commented Feb 21, 2015

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.

@dantman
Copy link
Contributor Author

dantman commented Mar 8, 2015

Alternate idea to having to pick between A and B.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants