babel-loader 7.1.1 → 7.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -15,7 +15,7 @@
15
15
 
16
16
  This package allows transpiling JavaScript files using [Babel](https://github.com/babel/babel) and [webpack](https://github.com/webpack/webpack).
17
17
 
18
- __Notes:__ Issues with the output should be reported on the babel [issue tracker](https://github.com/babel/babel/issues);
18
+ __Notes:__ Issues with the output should be reported on the babel [issue tracker](https://github.com/babel/babel/issues).
19
19
 
20
20
  <h2 align="center">Install</h2>
21
21
 
package/lib/fs-cache.js CHANGED
@@ -73,16 +73,16 @@ var write = function write(filename, result, callback) {
73
73
  * @return {String}
74
74
  */
75
75
  var filename = function filename(source, identifier, options) {
76
- var hash = crypto.createHash("SHA1");
76
+ var hash = crypto.createHash("md4");
77
77
  var contents = JSON.stringify({
78
78
  source: source,
79
79
  options: options,
80
80
  identifier: identifier
81
81
  });
82
82
 
83
- hash.end(contents);
83
+ hash.update(contents);
84
84
 
85
- return hash.read().toString("hex") + ".json.gz";
85
+ return hash.digest("hex") + ".json.gz";
86
86
  };
87
87
 
88
88
  /**
package/lib/index.js CHANGED
@@ -16,12 +16,13 @@ var fs = require("fs");
16
16
  */
17
17
  function BabelLoaderError(name, message, codeFrame, hideStack, error) {
18
18
  Error.call(this);
19
- Error.captureStackTrace(this, BabelLoaderError);
20
19
 
21
20
  this.name = "BabelLoaderError";
22
21
  this.message = formatMessage(name, message, codeFrame);
23
22
  this.hideStack = hideStack;
24
23
  this.error = error;
24
+
25
+ Error.captureStackTrace(this, BabelLoaderError);
25
26
  }
26
27
 
27
28
  BabelLoaderError.prototype = Object.create(Error.prototype);
@@ -100,16 +101,14 @@ function passMetadata(s, context, metadata) {
100
101
  module.exports = function (source, inputSourceMap) {
101
102
  var _this = this;
102
103
 
103
- // Handle filenames (#106)
104
- var webpackRemainingChain = loaderUtils.getRemainingRequest(this).split("!");
105
- var filename = webpackRemainingChain[webpackRemainingChain.length - 1];
104
+ var filename = this.resourcePath;
106
105
 
107
106
  // Handle options
108
107
  var loaderOptions = loaderUtils.getOptions(this) || {};
109
108
  var fileSystem = this.fs ? this.fs : fs;
110
109
  var babelrcPath = null;
111
110
  if (loaderOptions.babelrc !== false) {
112
- babelrcPath = exists(fileSystem, loaderOptions.babelrc) ? loaderOptions.babelrc : resolveRc(fileSystem, path.dirname(filename));
111
+ babelrcPath = typeof loaderOptions.babelrc === "string" && exists(fileSystem, loaderOptions.babelrc) ? loaderOptions.babelrc : resolveRc(fileSystem, path.dirname(filename));
113
112
  }
114
113
 
115
114
  if (babelrcPath) {
package/lib/resolve-rc.js CHANGED
@@ -4,7 +4,7 @@ var path = require("path");
4
4
  var exists = require("./utils/exists");
5
5
 
6
6
  module.exports = function find(fileSystem, start) {
7
- var _arr = [".babelrc", ".babelrc.js", "package.json"];
7
+ var _arr = [".babelrc", "package.json"];
8
8
 
9
9
  for (var _i = 0; _i < _arr.length; _i++) {
10
10
  var fileName = _arr[_i];
@@ -5,7 +5,9 @@ module.exports = function (fileSystem, filename) {
5
5
 
6
6
  try {
7
7
  exists = fileSystem.statSync(filename).isFile();
8
- } catch (e) {}
8
+ } catch (err) {
9
+ if (err.code !== "ENOENT") throw err;
10
+ }
9
11
 
10
12
  return exists;
11
13
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "babel-loader",
3
- "version": "7.1.1",
3
+ "version": "7.1.5",
4
4
  "description": "babel module loader for webpack",
5
5
  "files": [
6
6
  "lib"
@@ -15,14 +15,14 @@
15
15
  "mkdirp": "^0.5.1"
16
16
  },
17
17
  "peerDependencies": {
18
- "babel-core": "6 || 7 || ^7.0.0-alpha || ^7.0.0-beta || ^7.0.0-rc",
19
- "webpack": "2 || 3"
18
+ "babel-core": "6",
19
+ "webpack": "2 || 3 || 4"
20
20
  },
21
21
  "devDependencies": {
22
- "ava": "^0.19.0",
22
+ "ava": "^0.23.0",
23
23
  "babel-cli": "^6.18.0",
24
24
  "babel-core": "^6.0.0",
25
- "babel-eslint": "^7.1.0",
25
+ "babel-eslint": "^8.0.0",
26
26
  "babel-plugin-istanbul": "^4.0.0",
27
27
  "babel-plugin-react-intl": "^2.1.3",
28
28
  "babel-preset-env": "^1.2.0",
@@ -36,11 +36,11 @@
36
36
  "lint-staged": "^4.0.0",
37
37
  "nyc": "^11.0.1",
38
38
  "prettier": "^1.2.2",
39
- "react": "^15.1.0",
39
+ "react": "^16.0.0",
40
40
  "react-intl": "^2.1.2",
41
41
  "react-intl-webpack-plugin": "^0.0.3",
42
42
  "rimraf": "^2.4.3",
43
- "webpack": "^3.0.0"
43
+ "webpack": "^4.0.0"
44
44
  },
45
45
  "scripts": {
46
46
  "clean": "rimraf lib/",