babel-loader 8.0.5 → 8.0.6

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/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2014-2016 Luís Couto <hello@luiscouto.pt>
1
+ Copyright (c) 2014-2019 Luís Couto <hello@luiscouto.pt>
2
2
 
3
3
  MIT License
4
4
 
package/README.md CHANGED
@@ -29,12 +29,6 @@ This package allows transpiling JavaScript files using [Babel](https://github.co
29
29
  npm install -D babel-loader @babel/core @babel/preset-env webpack
30
30
  ```
31
31
 
32
- > webpack 4.x | babel-loader 7.x | babel 6.x
33
-
34
- ```bash
35
- npm install -D babel-loader@7 babel-core babel-preset-env webpack
36
- ```
37
-
38
32
  <h2 align="center">Usage</h2>
39
33
 
40
34
  webpack documentation: [Loaders](https://webpack.js.org/loaders/)
@@ -84,9 +78,9 @@ module: {
84
78
 
85
79
  This loader also supports the following loader-specific option:
86
80
 
87
- * `cacheDirectory`: Default `false`. When set, the given directory will be used to cache the results of the loader. Future webpack builds will attempt to read from the cache to avoid needing to run the potentially expensive Babel recompilation process on each run. If the value is blank (`loader: 'babel-loader?cacheDirectory'`) or `true` (`loader: 'babel-loader?cacheDirectory=true'`), the loader will use the default cache directory in `node_modules/.cache/babel-loader` or fallback to the default OS temporary file directory if no `node_modules` folder could be found in any root directory.
81
+ * `cacheDirectory`: Default `false`. When set, the given directory will be used to cache the results of the loader. Future webpack builds will attempt to read from the cache to avoid needing to run the potentially expensive Babel recompilation process on each run. If the value is set to `true` in options (`{cacheDirectory: true}`), the loader will use the default cache directory in `node_modules/.cache/babel-loader` or fallback to the default OS temporary file directory if no `node_modules` folder could be found in any root directory.
88
82
 
89
- * `cacheIdentifier`: Default is a string composed by the `babel-core`'s version, the `babel-loader`'s version, the contents of `.babelrc` file if it exists, and the value of the environment variable `BABEL_ENV` with a fallback to the `NODE_ENV` environment variable. This can be set to a custom value to force cache busting if the identifier changes.
83
+ * `cacheIdentifier`: Default is a string composed by the `@babel/core`'s version, the `babel-loader`'s version, the contents of `.babelrc` file if it exists, and the value of the environment variable `BABEL_ENV` with a fallback to the `NODE_ENV` environment variable. This can be set to a custom value to force cache busting if the identifier changes.
90
84
 
91
85
  * `cacheCompression`: Default `true`. When set, each Babel transform output will be compressed with Gzip. If you want to opt-out of cache compression, set it to `false` -- your project may benefit from this if it transpiles thousands of files.
92
86
 
@@ -108,11 +102,11 @@ Babel uses very small helpers for common functions such as `_extend`. By default
108
102
 
109
103
  You can instead require the Babel runtime as a separate module to avoid the duplication.
110
104
 
111
- The following configuration disables automatic per-file runtime injection in Babel, requiring `babel-plugin-transform-runtime` instead and making all helper references use it.
105
+ The following configuration disables automatic per-file runtime injection in Babel, requiring `@babel/plugin-transform-runtime` instead and making all helper references use it.
112
106
 
113
107
  See the [docs](https://babeljs.io/docs/plugins/transform-runtime/) for more information.
114
108
 
115
- **NOTE**: You must run `npm install -D @babel/plugin-transform-runtime` to include this in your project and `babel-runtime` itself as a dependency with `npm install @babel/runtime`.
109
+ **NOTE**: You must run `npm install -D @babel/plugin-transform-runtime` to include this in your project and `@babel/runtime` itself as a dependency with `npm install @babel/runtime`.
116
110
 
117
111
  ```javascript
118
112
  rules: [
@@ -134,7 +128,7 @@ rules: [
134
128
 
135
129
  #### **NOTE**: transform-runtime & custom polyfills (e.g. Promise library)
136
130
 
137
- Since [babel-plugin-transform-runtime](https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-runtime) includes a polyfill that includes a custom [regenerator-runtime](https://github.com/facebook/regenerator/blob/master/packages/regenerator-runtime/runtime.js) and [core-js](https://github.com/zloirock/core-js), the following usual shimming method using `webpack.ProvidePlugin` will not work:
131
+ Since [@babel/plugin-transform-runtime](https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-runtime) includes a polyfill that includes a custom [regenerator-runtime](https://github.com/facebook/regenerator/blob/master/packages/regenerator-runtime/runtime.js) and [core-js](https://github.com/zloirock/core-js), the following usual shimming method using `webpack.ProvidePlugin` will not work:
138
132
 
139
133
  ```javascript
140
134
  // ...
@@ -190,7 +184,7 @@ If you receive this message, it means that you have the npm package `babel` inst
190
184
 
191
185
  webpack then tries to load the `babel` package instead of the `babel-loader`.
192
186
 
193
- To fix this, you should uninstall the npm package `babel`, as it is deprecated in Babel v6. (Instead, install `babel-cli` or `babel-core`.)
187
+ To fix this, you should uninstall the npm package `babel`, as it is deprecated in Babel v6. (Instead, install `@babel/cli` or `@babel/core`.)
194
188
  In the case one of your dependencies is installing `babel` and you cannot uninstall it yourself, use the complete name of the loader in the webpack config:
195
189
  ```javascript
196
190
  {
package/lib/cache.js CHANGED
@@ -27,7 +27,7 @@ const mkdirpOrig = require("mkdirp");
27
27
 
28
28
  const findCacheDir = require("find-cache-dir");
29
29
 
30
- const promisify = require("util.promisify");
30
+ const promisify = require("pify");
31
31
 
32
32
  const transform = require("./transform"); // Lazily instantiated when needed
33
33
 
package/lib/index.js CHANGED
@@ -22,7 +22,9 @@ if (/^6\./.test(babel.version)) {
22
22
  throw new Error("\n babel-loader@8 will not work with the '@babel/core@6' bridge package. " + "If you want to use Babel 6.x, install 'babel-loader@7'.");
23
23
  }
24
24
 
25
- const pkg = require("../package.json");
25
+ const {
26
+ version
27
+ } = require("../package.json");
26
28
 
27
29
  const cache = require("./cache");
28
30
 
@@ -30,7 +32,9 @@ const transform = require("./transform");
30
32
 
31
33
  const injectCaller = require("./injectCaller");
32
34
 
33
- const path = require("path");
35
+ const {
36
+ isAbsolute
37
+ } = require("path");
34
38
 
35
39
  const loaderUtils = require("loader-utils");
36
40
 
@@ -66,7 +70,7 @@ function _loader() {
66
70
  throw new Error("Customized loaders must be implemented as standalone modules.");
67
71
  }
68
72
 
69
- if (!path.isAbsolute(loaderOptions.customize)) {
73
+ if (!isAbsolute(loaderOptions.customize)) {
70
74
  throw new Error("Customized loaders must be passed as absolute paths, since " + "babel-loader has no way to know what they would be relative to.");
71
75
  }
72
76
 
@@ -165,7 +169,7 @@ function _loader() {
165
169
  cacheIdentifier = JSON.stringify({
166
170
  options,
167
171
  "@babel/core": transform.version,
168
- "@babel/loader": pkg.version
172
+ "@babel/loader": version
169
173
  }),
170
174
  cacheCompression = true,
171
175
  metadataSubscribers = []
package/lib/transform.js CHANGED
@@ -6,7 +6,7 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar
6
6
 
7
7
  const babel = require("@babel/core");
8
8
 
9
- const promisify = require("util.promisify");
9
+ const promisify = require("pify");
10
10
 
11
11
  const LoaderError = require("./Error");
12
12
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "babel-loader",
3
- "version": "8.0.5",
3
+ "version": "8.0.6",
4
4
  "description": "babel module loader for webpack",
5
5
  "files": [
6
6
  "lib"
@@ -13,7 +13,7 @@
13
13
  "find-cache-dir": "^2.0.0",
14
14
  "loader-utils": "^1.0.2",
15
15
  "mkdirp": "^0.5.1",
16
- "util.promisify": "^1.0.0"
16
+ "pify": "^4.0.1"
17
17
  },
18
18
  "peerDependencies": {
19
19
  "@babel/core": "^7.0.0",
@@ -23,19 +23,19 @@
23
23
  "@babel/cli": "^7.2.0",
24
24
  "@babel/core": "^7.2.0",
25
25
  "@babel/preset-env": "^7.2.0",
26
- "ava": "1.0.1",
26
+ "ava": "^1.1.0",
27
27
  "babel-eslint": "^10.0.1",
28
28
  "babel-plugin-istanbul": "^5.1.0",
29
29
  "babel-plugin-react-intl": "^3.0.1",
30
30
  "cross-env": "^5.2.0",
31
31
  "eslint": "^5.9.0",
32
- "eslint-config-babel": "^8.0.2",
33
- "eslint-config-prettier": "^3.3.0",
32
+ "eslint-config-babel": "^9.0.0",
33
+ "eslint-config-prettier": "^4.1.0",
34
34
  "eslint-plugin-flowtype": "^3.2.0",
35
35
  "eslint-plugin-prettier": "^3.0.0",
36
36
  "husky": "^1.2.0",
37
37
  "lint-staged": "^8.1.0",
38
- "nyc": "^13.1.0",
38
+ "nyc": "^14.1.1",
39
39
  "prettier": "^1.15.3",
40
40
  "react": "^16.0.0",
41
41
  "react-intl": "^2.1.2",