babel-preset-airbnb
Advanced tools
Comparing version 4.0.1 to 4.1.0
@@ -6,2 +6,5 @@ # Change Log | ||
## [4.1.0] - 2019.10.3 | ||
* [New] Allow specifying the Babel runtime version | ||
## [4.0.1] - 2019.06.26 | ||
@@ -8,0 +11,0 @@ * update license to MIT |
@@ -27,2 +27,3 @@ 'use strict'; | ||
looseClasses = false, | ||
runtimeVersion, | ||
} = options; | ||
@@ -88,2 +89,3 @@ | ||
useESModules: !computedModulesOption, | ||
version: runtimeVersion, | ||
}], | ||
@@ -90,0 +92,0 @@ ].filter(Boolean), |
{ | ||
"name": "babel-preset-airbnb", | ||
"version": "4.0.1", | ||
"version": "4.1.0", | ||
"description": "A babel preset for transforming your JavaScript for Airbnb", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -166,1 +166,19 @@ # babel-preset-airbnb | ||
The [risks of enabling loose classes are outlined in the Babel docs](https://babeljs.io/docs/en/babel-plugin-transform-classes#loose). | ||
## Specifying a babel runtime version | ||
By default @babel/plugin-transform-runtime will [assume the oldest version of the runtime](https://github.com/babel/babel/blob/e6264a09921c60b8f18870d0a75678e4fa04f0f8/packages/babel-plugin-transform-runtime/src/index.js#L42) to avoid importing helpers that don't exist which would fail at runtime. This can result in newer helpers being inlined into modules (ex. objectSpread2) which increases bundle size. | ||
To avoid this you can configure the preset to use the same version of the runtime that's installed in your package.json. | ||
ex. If package.json has `"@babel/runtime": "^7.5.5"` then you can use: | ||
```json | ||
{ | ||
"presets": [["airbnb", { | ||
"runtimeVersion": "7.5.5", | ||
}]] | ||
} | ||
``` | ||
Note that this will result in a runtime breakage if the version passed into the airbnb preset is newer than the version of the babel runtime actually being used at build time. |
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
13486
80
184