-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Seperate version env cache files #5411
Conversation
@pwmckenna, thanks for your PR! By analyzing the history of the files in this pull request, we identified @xtuc, @jonathanong and @sindresorhus to be potential reviewers. |
Codecov Report
@@ Coverage Diff @@
## 7.0 #5411 +/- ##
==========================================
- Coverage 85.34% 85.33% -0.01%
==========================================
Files 201 201
Lines 9485 9486 +1
Branches 2689 2689
==========================================
Hits 8095 8095
- Misses 897 898 +1
Partials 493 493
Continue to review full report at Codecov.
|
packages/babel-register/src/cache.js
Outdated
|
||
const FILENAME: string = process.env.BABEL_CACHE_PATH || path.join(homeOrTmp, ".babel.json"); | ||
const env = process.env.BABEL_ENV || process.env.NODE_ENV; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could set the default value here, like:
const env = process.env.BABEL_ENV || process.env.NODE_ENV || "";
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True, but I don't think that would save us the check below. If neither is set we could end up with something like .babel.6.x.x..json with the extra .
...which might not be a problem?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes that right. The default environment is development
:
const env = process.env.BABEL_ENV || process.env.NODE_ENV || "development";
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made #5448 for that purpose. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That looks great! I'll keep an eye out and update this when it gets merged in. Thanks for that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR has been merged
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated!
b1e59d6
to
1256d00
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR 👍
1256d00
to
4c008ad
Compare
Because cache entries are keyed on babel version and environment, there's no point in storing different combinations in the same file, because you'll never use the portions of the cache generated with different combinations. For instance, if you use BABEL_ENV values 'node' and 'test', you'll have to load a cache that's twice as big as you'll possibly use.