插件
Babel's code transformations are enabled by applying plugins (or presets) to your configuration file.
Using a Plugin
If the plugin is on npm, you can pass in the name of the plugin and Babel will check that it's installed in node_modules
. This is added to the plugins config option, which takes an array.
babel.config.json
{
"plugins": ["babel-plugin-myPlugin", "@babel/plugin-transform-runtime"]
}