Babel
Now that we have our Browserify build setup, we can introduce additional plugins to the build that will give us more ways to enhance our code. In this section, we're going to add Babel, and more specifically the babelify
module, to our Browserify task.
Babel is another popular tool that enables us to use cutting edge JavaScript features in our code without having to wait on browser vendors to implement the functionality. Babel does this by passing our code through various presets that handle specific feature implementations such as ES2015, ES2016, and beyond.
The beauty behind this is that as those features are introduced in browsers natively, we can easily remove the presets that are no longer needed and our build will continue to work.
Note
For more information on Babel and how to take advantage of the latest features of JavaScript, visit the official Babel website: https://babeljs.io/learn-es2015/
Installing modules
To implement this, we'll need to install some new modules such as babelify...