Skip to content

Commit

Permalink
fix: remove empty rootDir from key
Browse files Browse the repository at this point in the history
  • Loading branch information
dferber90 committed Sep 24, 2018
1 parent 05f2811 commit d35fe66
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
const fs = require("fs");
const path = require("path");
const crypto = require("crypto");
const crossSpawn = require("cross-spawn");
const stripIndent = require("common-tags/lib/stripIndent");
const THIS_FILE = fs.readFileSync(__filename);

module.exports = {
getCacheKey: (fileData, filename, configString, { instrument, rootDir }) => {
getCacheKey: (fileData, filename, configString, { instrument }) => {
return (
crypto
.createHash("md5")
.update(THIS_FILE)
.update("\0", "utf8")
.update(fileData)
.update("\0", "utf8")
.update(path.relative(rootDir, filename))
.update(filename)
.update("\0", "utf8")
.update(configString)
// TODO load postcssrc (the config) sync and make it part of the cache
Expand Down

0 comments on commit d35fe66

Please sign in to comment.