babel-loader
Advanced tools
Comparing version 8.0.0-beta.5 to 8.0.0-beta.6
@@ -92,3 +92,3 @@ "use strict"; | ||
const filename = function (source, identifier, options) { | ||
const hash = crypto.createHash("SHA1"); | ||
const hash = crypto.createHash("md4"); | ||
const contents = JSON.stringify({ | ||
@@ -99,4 +99,4 @@ source, | ||
}); | ||
hash.end(contents); | ||
return hash.read().toString("hex") + ".json.gz"; | ||
hash.update(contents); | ||
return hash.digest("hex") + ".json.gz"; | ||
}; | ||
@@ -121,2 +121,10 @@ /** | ||
} = params; | ||
const file = path.join(directory, filename(source, cacheIdentifier, options)); | ||
try { | ||
// No errors mean that the file was previously cached | ||
// we just need to return it | ||
return yield read(file); | ||
} catch (err) {} | ||
const fallback = typeof cacheDirectory !== "string" && directory !== os.tmpdir(); // Make sure the directory exists. | ||
@@ -132,11 +140,3 @@ | ||
throw err; | ||
} | ||
const file = path.join(directory, filename(source, cacheIdentifier, options)); | ||
try { | ||
// No errors mean that the file was previously cached | ||
// we just need to return it | ||
return yield read(file); | ||
} catch (err) {} // Otherwise just transform the file | ||
} // Otherwise just transform the file | ||
// return it to the user asap and write it in cache | ||
@@ -143,0 +143,0 @@ |
{ | ||
"name": "babel-loader", | ||
"version": "8.0.0-beta.5", | ||
"version": "8.0.0-beta.6", | ||
"description": "babel module loader for webpack", | ||
@@ -5,0 +5,0 @@ "files": [ |
@@ -119,3 +119,3 @@ > This readme is for babel-loader v8 + Babel v7 | ||
See the [docs](http://babeljs.io/docs/plugins/transform-runtime/) for more information. | ||
See the [docs](https://babeljs.io/docs/plugins/transform-runtime/) for more information. | ||
@@ -285,2 +285,2 @@ **NOTE:** You must run `npm install @babel/plugin-transform-runtime --save-dev` to include this in your project and `babel-runtime` itself as a dependency with `npm install @babel/runtime --save`. | ||
## [License](http://couto.mit-license.org/) | ||
## [License](https://couto.mit-license.org/) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
33046