babel-preset-evergreen
v0.10.9
Published
A `babel` preset for modern javascript syntaxes
Downloads
475
Maintainers
Readme
babel-preset-evergreen
A babel preset for modern javascript syntaxes.
This preset can transform:
- ECMAScript 2024 syntax
Installation
npm install babel-preset-evergreen --save-dev
Usage
// example: babel.config.json
{
"targets": "chrome >= 60",
"presets": [
[
"evergreen",
{
"polyfill": {
"usage": "global"
}
}
]
]
}
Options
polyfill
- type: false | {}
- default: false
polyfill.usage
- type: ['global','pure']
- default: 'global'
How babel
handles polyfills.
References: https://github.com/babel/babel/issues/10008
polyfill.include
- type: string[]
- example: ['web.url']
polyfill.exclude
- type: string[]
- example: ['web.url']
polyfill.mini
- type: boolean
- default: false
- description: Use miniprogram presets.
Tips
You might need to pin core-js@3
when your project dependency tree has core-js@2
:
npm install core-js@3