npm install --save-dev babel-preset-nunez
{
"presets": ["nunez"],
"presets": ["babel-preset-nunez"] // equivalent
}
By default babel-preset-nunez
will transpile for the "last 2 versions" and "not dead" browsers.
{
"presets": [[
"nunez",
{
"serverOnly": true,
"modern": true,
}
]]
}
serverOnly
- Will transpile only for node.
modern
- Will transpile for common browsers.
Preset includes:
Presets
Plugins
- plugin-syntax-dynamic-import
- plugin-transform-runtime
- plugin-proposal-class-properties
- plugin-proposal-export-default-from
- plugin-proposal-optional-chaining
- babel-plugin-transform-react-remove-prop-types
You can customize presets in the .babelrc
file through the nunez
preset.
{
"presets": [
[
"nunez",
{
"preset-env": {},
"preset-react": {}
}
]
]
};