-
Notifications
You must be signed in to change notification settings - Fork 205
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
Support 'packagejson' as a custom cwd option. #149
Conversation
@cpsubrian Hey, thanks for your contribution and sorry for taking that long! Two small things:
|
@fatfisz Thanks for the review. Will look into those changes and update. |
@cpsubrian Hi, could you also rebase this on the The file where you should put the changes now is |
@fatfisz Yep, no problem. Will do when I get a moment. Had to jump over to a different project last week. |
Codecov Report
Continue to review full report at Codecov.
|
@fatfisz Rebased to |
@cpsubrian That's ok, |
Ooops, I've only now noticed a small problem in the tests - in two cases you are using |
@fatfisz Oh haha, I had fixed those locally but I guess I didn't push them. Oops! |
Some context:
.babelrc
config at the root level of the repo (not per sub-package).import db from 'src/db'
, where 'src' is relative to the root of the package of the file being transpiled.This PR facilitates that and is working great for me so far.
Sample
.babelrc
configuration:The key is that this approach works not matter what your actual 'cwd' is. This means that my imports work whether I am running
babel-node/babel-watch
from the repo root, or runningbabel
on each sub-package individually.I'm not married to
find-root
, it was literally the first 'find my package.json' module that I found 😄