A babel preset for modern javascript syntaxes.
This preset can transform:
- ECMAScript 2024 syntax
npm install babel-preset-evergreen --save-dev
// example: babel.config.json
{
"targets": "chrome >= 60",
"presets": [
[
"evergreen",
{
"polyfill": {
"usage": "global"
}
}
]
]
}
- type: false | {}
- default: false
- type: ['global','pure']
- default: 'global'
How babel
handles polyfills.
References: babel/babel#10008
- type: string[]
- example: ['web.url']
- type: string[]
- example: ['web.url']
- type: boolean
- default: false
- description: Use miniprogram presets.
You might need to pin core-js@3
when your project dependency tree has core-js@2
:
npm install core-js@3