babel-loader
Advanced tools
Comparing version 8.2.3 to 8.2.4
@@ -36,2 +36,10 @@ "use strict"; | ||
let defaultCacheDirectory = null; | ||
let hashType = "md4"; // use md5 hashing if md4 is not available | ||
try { | ||
crypto.createHash(hashType); | ||
} catch (err) { | ||
hashType = "md5"; | ||
} | ||
const readFile = promisify(fs.readFile); | ||
@@ -95,10 +103,2 @@ const writeFile = promisify(fs.writeFile); | ||
const filename = function (source, identifier, options) { | ||
// md4 hashing is not supported starting with node v17.0.0 | ||
const majorNodeVersion = parseInt(process.versions.node.split(".")[0], 10); | ||
let hashType = "md4"; | ||
if (majorNodeVersion >= 17) { | ||
hashType = "md5"; | ||
} | ||
const hash = crypto.createHash(hashType); | ||
@@ -105,0 +105,0 @@ const contents = JSON.stringify({ |
@@ -70,3 +70,3 @@ "use strict"; | ||
const filename = this.resourcePath; | ||
let loaderOptions = loaderUtils.getOptions(this) || {}; | ||
let loaderOptions = loaderUtils.getOptions(this); | ||
validateOptions(schema, loaderOptions, { | ||
@@ -73,0 +73,0 @@ name: "Babel loader" |
{ | ||
"name": "babel-loader", | ||
"version": "8.2.3", | ||
"version": "8.2.4", | ||
"description": "babel module loader for webpack", | ||
@@ -14,3 +14,3 @@ "files": [ | ||
"find-cache-dir": "^3.3.1", | ||
"loader-utils": "^1.4.0", | ||
"loader-utils": "^2.0.0", | ||
"make-dir": "^3.1.0", | ||
@@ -17,0 +17,0 @@ "schema-utils": "^2.6.5" |
@@ -255,3 +255,3 @@ > This README is for babel-loader v8 + Babel v7 | ||
That function is injected by Webpack itself _after_ running `babel-loader`. By default Webpack asumes that your target environment supports some ES2015 features, but you can overwrite this behavior using the `output.environment` Webpack option ([documentation]((https://webpack.js.org/configuration/output/#outputenvironment)). | ||
That function is injected by Webpack itself _after_ running `babel-loader`. By default Webpack asumes that your target environment supports some ES2015 features, but you can overwrite this behavior using the `output.environment` Webpack option ([documentation](https://webpack.js.org/configuration/output/#outputenvironment)). | ||
@@ -258,0 +258,0 @@ To avoid the top-level arrow function, you can use `output.environment.arrowFunction`: |
41626
+ Addedloader-utils@2.0.4(transitive)
- Removedjson5@1.0.2(transitive)
- Removedloader-utils@1.4.2(transitive)
- Removedminimist@1.2.8(transitive)
Updatedloader-utils@^2.0.0