-
-
Notifications
You must be signed in to change notification settings - Fork 51
Conversation
I was working on cache-loader as an npm linked dependency, I generally use this script so that I don't have to think about rebuilding between changes.
Previous to this change cache keys (and the values stored in the cache) were using absolute paths. This meant that moving a buildable repository to a different directory would entirely invalidate the cache, and that the cache wouldn't be shareable between builds in CI when building on different machines. This change adds a new option `projectRoot` that helps to make the paths relative, and therefore reusable when the project changes directories.
Codecov Report
@@ Coverage Diff @@
## master #37 +/- ##
==========================================
- Coverage 17.47% 16.96% -0.52%
==========================================
Files 2 2
Lines 103 112 +9
Branches 13 13
==========================================
+ Hits 18 19 +1
- Misses 73 81 +8
Partials 12 12
Continue to review full report at Codecov.
|
I'm not sure if I should be correcting the coverage... seems like coverage is super low already and I'd have to write the tests for basically all of the repo. I guess I could move the few new functions to their own file and unit test that way. |
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.
Why don't use context
option? We already known project dir. Also this implementation decrease perf.
You're talking about webpack's context config right? This is usually a path that's nested in the repo and not at the root. On a local test repo for example, which wouldn't be contained in: For the performance, do you have any recommendations? I think the runtime performance hit is worth the cache being reusable across build machines as without it the cache is effectively worthless. After digging into this a bit, I think that we can fix it on our end via config, but it'd be nice if cross machine/directory caching just worked for users. |
@evilebottnawi any thoughts on the above? |
@evilebottnawi ping? |
Codecov Report
@@ Coverage Diff @@
## master #37 +/- ##
==========================================
- Coverage 17.47% 16.96% -0.52%
==========================================
Files 2 2
Lines 103 112 +9
Branches 13 13
==========================================
+ Hits 18 19 +1
- Misses 73 81 +8
Partials 12 12
Continue to review full report at Codecov.
|
@evilebottnawi this can be closed in favor of #49 |
Close in favor #49 |
Commits:
Adds a build:watch npm script.
I was working on cache-loader as an npm linked dependency, I generally use this
script so that I don't have to think about rebuilding between changes.
Adds a projectRoot option to enable relative cache paths.
Previous to this change cache keys (and the values stored in the cache) were
using absolute paths. This meant that moving a buildable repository to a
different directory would entirely invalidate the cache, and that the cache
wouldn't be shareable between builds in CI when building on different machines.
This change adds a new option
projectRoot
that helps to make the pathsrelative, and therefore reusable when the project changes directories.
This is my attempt at addressing: #36