babel-preset-runtime
v1.0.3
Published
Extending `@babel/preset-env`
Downloads
3
Readme
babel-preset-runtime
Extending @babel/preset-env
Usage
First, install Babel.
Then install babel-preset-rutime.
# npm
npm install babel-preset-rutime
# yarn
yarn add babel-preset-rutime
Then create a file named .babelrc
or babel.config
with following contents in the root folder of your project:
{
"presets": ["babel-preset-rutime"]
}
Default configs of babel-preset-rutime
// @babel/preset-env
{
"useBuiltIns": "entry",
"corejs": 3,
"exclude": ["transform-typeof-symbol"]
}
// @babel/plugin-transform-runtime
{
corejs: false,
helpers: true,
version: require("@babel/runtime/package.json").version,
regenerator: true,
absoluteRuntime: path.dirname(
require.resolve("@babel/runtime/package.json")
),
}
You can fully override default config
{
"presets": [
[
"babel-preset-rutime",
{
//options of @babel/preset-env
"env": {},
//options of @babel/plugin-transform-runtime
"runtime": {}
}
]
]
}
Add react support
{
"presets": [
[
"babel-preset-rutime",
{
//options of @babel/preset-react
"react": {}
}
]
]
}