What is the difference between babel-plugin- * and babel-preset- *

I use both the plugin and the preset and my current application, but technically I can’t make anyone understand what the difference is between presets and plugins. For me, both are a javascript file that is used by the babel loader to compile the code.

+4
source share
1 answer

In short, the Babel preset contains several babel plugins.

For example, if you use only arrow functions, you only need a plugin transform-es2015-arrow-functions. If you use the many features of ES2015, it is best to use babel-preset-es2015one that contains many plugins, including transform-es2015-arrow-functions.

+7
source

Source: https://habr.com/ru/post/1676428/


All Articles