babel-loader
Advanced tools
Comparing version 5.1.0 to 5.1.2
@@ -40,3 +40,3 @@ /** | ||
return callback(null, content); | ||
return callback(null, result); | ||
}); | ||
@@ -43,0 +43,0 @@ }); |
{ | ||
"name": "babel-loader", | ||
"version": "5.1.0", | ||
"version": "5.1.2", | ||
"description": "babel module loader for webpack", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -112,4 +112,61 @@ # babel-loader | ||
#### custom polyfills (e.g. Promise library) | ||
### using `cacheDirectory` fails with Error | ||
If using cacheDirectory results in an error similar to the following: | ||
``` | ||
ERROR in ./frontend/src/main.jsx | ||
Module build failed: Error: ENOENT, open 'true/350c59cae6b7bce3bb58c8240147581bfdc9cccc.json.gzip' | ||
@ multi app | ||
``` | ||
(notice the `true/` in the filepath) | ||
That means that most likely, you're not setting the options correctly, and you're doing something similar to: | ||
```javascript | ||
loaders: [ | ||
// the optional 'runtime' transformer tells babel to require the runtime | ||
// instead of inlining it. | ||
{ | ||
test: /\.jsx?$/, | ||
exclude: /(node_modules|bower_components)/, | ||
loader: 'babel-loader?cacheDirectory=true' | ||
} | ||
] | ||
``` | ||
That's not the correct way of setting boolean values. You should do instead: | ||
```javascript | ||
loaders: [ | ||
// the optional 'runtime' transformer tells babel to require the runtime | ||
// instead of inlining it. | ||
{ | ||
test: /\.jsx?$/, | ||
exclude: /(node_modules|bower_components)/, | ||
loader: 'babel-loader?cacheDirectory' | ||
} | ||
] | ||
``` | ||
or use the [query](https://webpack.github.io/docs/using-loaders.html#query-parameters) property: | ||
```javascript | ||
loaders: [ | ||
// the optional 'runtime' transformer tells babel to require the runtime | ||
// instead of inlining it. | ||
{ | ||
test: /\.jsx?$/, | ||
exclude: /(node_modules|bower_components)/, | ||
loader: 'babel-loader', | ||
query: { | ||
cacheDirectory: true | ||
} | ||
} | ||
] | ||
``` | ||
### custom polyfills (e.g. Promise library) | ||
Since Babel includes a polyfill that includes a custom [regenerator runtime](https://github.com/facebook/regenerator/blob/master/runtime.js) and [core.js](https://github.com/zloirock/core-js), the following usual shimming method using `webpack.ProvidePlugin` will not work: | ||
@@ -116,0 +173,0 @@ |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
25130
216
0