-
-
Notifications
You must be signed in to change notification settings - Fork 121
Conversation
Please ignore the CI status, I will fix this if the idea behind the PR is approved. |
Maybe you can post some benchs (without cache, with cache)? |
I updated the PR too |
Looks good! |
I will. It will be a little delayed, I am in vacation for now :) |
@genintho np, enjoy ;) |
Documentation added. |
try { | ||
var cacheFileContent = fs.readFileSync(cachePath) | ||
if (cacheFileContent) { | ||
cache = JSON.parse(cacheFileContent) |
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.
any reason you don't require() the file instead?
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 am not sure. Is it better?
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.
Better I can't prove it, but definitely shorter :)
This should be enough:
try {
cache = require(thunk("data.json"))
}
catch (e) {
cache = {}
}
updated. |
Thanks. Sorry for the delay. Will cut a release. |
Woot! |
So one piece of feedback regarding the usage of |
@genintho maybe we can add a way to specify a folder? Default to find-cache-dir, and ability to specify one? |
I think it would make sense to use the same caching strategy as babel-loader uses since it’s been tested thoroughly. |
Indeed! Would be nice to have this as a module ;) |
Unfortunately, this implementation misses some of the essential error handling that |
I personally don't have time for this but maybe someone else will. Feel free to open an issue as a reminder until someone handle it. |
While webpack is great to pick up only incremental change, the compilation time at lunch can be very long. For our application, it takes minutes, which means it takes minutes before our tests can run, before we can deploy, before developer can start working when starting their day.
I did similar changes to the coffee-loader, or the Uglify plugin, saving huge chunk of time.
Cache the eslint result into a file.
The input is hash using MD5 to detect changes.
This cut 30% of my webpack build time.
If this PR is accepted, I am happy to update the documentation and write a few tests.
Fixes #82