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

add paragraph in README describing babel-transform #130

Closed
wants to merge 1 commit into from
Closed

add paragraph in README describing babel-transform #130

wants to merge 1 commit into from

Conversation

jzelenkov
Copy link
Contributor

closes #129

@zertosh
Copy link
Member

zertosh commented Jun 11, 2015

... or in the babel-sublime package directory.

That's not a great idea because an auto-update will blow it away. The way babel/babel-core resolution works is:

  1. If the use_local_babel option is enabled (it is by default), then:

    a. Lookup babel/babel-core from the perspective of the file being transpiled. The idea being that you want to use a "projects" version so the output is consistent with what you'd get running in your build or whatnot. It also means that babel/babel-core will pick up a .babelrc if it's in any parent dir.
    b. This also means that if you have an "anonymous" window, it has no filename, so you jump straight to resolving for the global module.

  2. If the above failed, or use_local_babel is false, then:

    a. It'll do the lookup in the dirs from the config. Unfortunately, because you're not spawning a shell, you don't have access to the typically set NODE_PATH environment var.

These paths can overwritten in the Babel package settings file

That's technically not the "Babel package settings file", that's the user's Babel settings file.

Note to NVM users:
Currently used node version can be obtained by running nvm current command in Terminal.

That's too much info. It seems like I'm encouraging nvm use - that's an invitation to fill the issues with questions about nvm. How about something more generic? Like "These are the default paths, if you have a different path for your global modules, then do ....."


Thanks for doing this btw!

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

Successfully merging this pull request may close these issues.

Update README.md – nvm with babel-transform
2 participants