Babel preset including only needed ES2015+ plugins
Last updated 4 years ago by gabmontes .
WTFPL · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install babel-preset-latest-minimal 
SYNC missed versions from official npm registry.


Babel preset including only needed ES2015+ plugins using feature detection.


$ npm install --save-dev babel-preset-latest-minimal


Add preset to your .babelrc file:

  "presets": ["latest-minimal"]


For convenience, the module provides a command line utility to list the current plugins needed according to the version of node present in the system.

$ node --version
$ babel-node-list-required
[ 'transform-es2015-object-super',
  'transform-async-to-generator' ]


When using the fantastic Babel transpiler in building web applications with the latest and greatest ECMAScript features, it is advisable and safer to include all plugins from babel-preset-latest due to the fact that the runtime environment (the browser) is unknown at build-time. Anyway, when developing a Node.JS or an Electron application, the environment is controlled and Babel plugins could be hand-picked to transpile only the features not supported.

Most of the presets I came across before developing this one rely basically on the node version and enable an arbitrary set of plugins. Deciding what to enable based on the version of node is like the old user-agent sniffing technique we all learned to avoid in favor of feature detection.

So, long story short, the solution was to took all official plugins in Babel's babel-preset-latest and enable only those needed because the environment is not supporting a specific feature. In addition, this approach allows the developer to change the version of node/electron and this plugin will update the plugins list accordingly. Nothing is hadrcoded, no magic, no arbitrary decisions!


Are plugins missing? Is there any issue with the feature detection? Let me know by sending a PR or filing an issue!



Current Tags

  • 1.1.2                                ...           latest (4 years ago)

4 Versions

  • 1.1.2                                ...           4 years ago
  • 1.1.1                                ...           4 years ago
  • 1.1.0                                ...           4 years ago
  • 1.0.0                                ...           4 years ago

Copyright 2014 - 2017 © |