-
-
Notifications
You must be signed in to change notification settings - Fork 449
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
Use standard cache dir as default cacheDirectory #301
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fson
force-pushed
the
default-cache-dir
branch
from
September 18, 2016 00:25
bc8f9c6
to
4c9fc7c
Compare
Set the default cache directory as the [common cache directory](https://github.com/avajs/find-cache-dir), `./node_modules/.cache/babel-loader`. Previously, when `cacheDirectory` was set to `true`, babel-loader tried to use the operating system's temporary directory as a cache directory. However, when running npm scripts as the root user, [npm overrides the TMPDIR environment variable](npm/npm#4531). This caused the cache files to be created in the project folder itself, for example when using Docker: facebook/create-react-app#483.
fson
force-pushed
the
default-cache-dir
branch
from
September 18, 2016 00:25
4c9fc7c
to
0145474
Compare
Current coverage is 94.66% (diff: 100%)@@ master #301 diff @@
==========================================
Files 5 5
Lines 149 150 +1
Methods 21 21
Messages 0 0
Branches 30 30
==========================================
+ Hits 141 142 +1
Misses 8 8
Partials 0 0
|
Thanks that looks perfect. I will have a look at babel-register too, as it uses a similar cache strategy and maybe we can put that into a |
Any ETA for this? :) |
This PR looks great. Anything missing to get this merged? |
Thanks for the help, sorry for the long wait |
hzoo
approved these changes
Oct 26, 2016
Ognian
pushed a commit
to Ognian/babel-loader
that referenced
this pull request
Feb 27, 2017
Set the default cache directory as the [common cache directory](https://github.com/avajs/find-cache-dir), `./node_modules/.cache/babel-loader`. Previously, when `cacheDirectory` was set to `true`, babel-loader tried to use the operating system's temporary directory as a cache directory. However, when running npm scripts as the root user, [npm overrides the TMPDIR environment variable](npm/npm#4531). This caused the cache files to be created in the project folder itself, for example when using Docker: facebook/create-react-app#483.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What kind of change does this PR introduce?
What is the current behavior?
Currently, when
cacheDirectory
is set totrue
,babel-loader
tries to use the operating system's temporary directory as a cache directory.However, when running npm scripts as the root user, npm overrides the
TMPDIR
environment variable. This causes the cache files to be created in the project folder itself, for example when using Docker: facebook/create-react-app#483.What is the new behavior?
Use the common cache directory,
./node_modules/.cache/babel-loader
, as the default cache directory (when thecacheDirectory
setting is enabled).Does this PR introduce a breaking change?