babel-preset-kensho
Advanced tools
Comparing version 12.1.1 to 12.2.0
10
index.js
@@ -5,2 +5,9 @@ /* eslint-disable global-require */ | ||
// webpack@4 depends on a version of acorn that lacks support for optional chaining and nullish | ||
// coalescing syntax, so, when transpiling an app, these plugins must be included | ||
const APP_PLUGIN_INCLUDE_LIST = [ | ||
'@babel/plugin-proposal-optional-chaining', | ||
'@babel/plugin-proposal-nullish-coalescing-operator', | ||
] | ||
const PRECOMPILED_PACKAGES = ['core-js', 'lodash', 'react', 'react-dom', 'whatwg-fetch'] | ||
@@ -19,2 +26,3 @@ const PRECOMPILED_PACKAGES_REGEX = new RegExp(`node_modules/(${PRECOMPILED_PACKAGES.join('|')})/`) | ||
emotion = false, | ||
include = env === 'development' || env === 'production' ? APP_PLUGIN_INCLUDE_LIST : [], | ||
loose = true, | ||
@@ -46,3 +54,3 @@ modules = env === 'test' || env === 'cjs' ? 'commonjs' : false, | ||
require('@babel/preset-env').default, | ||
{loose, modules, targets, bugfixes: true, corejs: 3, useBuiltIns: 'entry'}, | ||
{include, loose, modules, targets, bugfixes: true, corejs: 3, useBuiltIns: 'entry'}, | ||
], | ||
@@ -49,0 +57,0 @@ ], |
{ | ||
"name": "babel-preset-kensho", | ||
"version": "12.1.1", | ||
"version": "12.2.0", | ||
"description": "Babel preset to transpile ES2015+/JSX to ES5.", | ||
@@ -20,19 +20,19 @@ "main": "index.js", | ||
"dependencies": { | ||
"@babel/plugin-proposal-class-properties": "^7.8.3", | ||
"@babel/plugin-transform-runtime": "^7.9.0", | ||
"@babel/preset-env": "^7.9.0", | ||
"@babel/preset-react": "^7.9.1", | ||
"@babel/preset-typescript": "^7.9.0", | ||
"@babel/plugin-proposal-class-properties": "^7.10.4", | ||
"@babel/plugin-transform-runtime": "^7.11.0", | ||
"@babel/preset-env": "^7.11.0", | ||
"@babel/preset-react": "^7.10.4", | ||
"@babel/preset-typescript": "^7.10.4", | ||
"@emotion/babel-preset-css-prop": "^10.0.27", | ||
"react-refresh": "^0.8.1" | ||
"react-refresh": "^0.8.3" | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "^7.9.0", | ||
"@babel/runtime": "^7.9.2", | ||
"ava": "^3.5.1", | ||
"eslint": "^6.8.0", | ||
"eslint-config-kensho": "^16.0.0", | ||
"prettier": "^2.0.1", | ||
"typescript": "^3.8.3" | ||
"@babel/core": "^7.11.0", | ||
"@babel/runtime": "^7.11.0", | ||
"ava": "^3.11.0", | ||
"eslint": "^7.6.0", | ||
"eslint-config-kensho": "^17.0.2", | ||
"prettier": "^2.0.5", | ||
"typescript": "^3.9.7" | ||
} | ||
} |
@@ -35,2 +35,9 @@ # babel-preset-kensho | ||
### `include` | ||
`Array<string|RegExp>`<br /> | ||
Default: `['@babel/plugin-proposal-optional-chaining', '@babel/plugin-proposal-nullish-coalescing-operator']` | ||
List of plugins to always include. Forwarded to [the corresponding option in `@babel/preset-env`](https://babeljs.io/docs/en/babel-preset-env#include). | ||
### `loose` | ||
@@ -37,0 +44,0 @@ |
8766
68
100