Use next-generation JavaScript, today, with Babel. Install gulp-babel if you want to get the pre-release of the next version of gulp-babel. See the Babel options, except for sourceMaps and filename which are handled for you. Also, keep in mind that options will be loaded from config files that apply to each file. Files in the stream are annotated with a babel property, which contains the metadata from babel.transform(). If you're attempting to use features such as generators, you'll need to add transform-runtime as a plugin, to include the Babel runtime. Otherwise, you'll receive an error. Options can be passed to Babel in a variety of ways. When passed directly to Babel, you can just pass the options object. When Babel is used via a wrapper, it may also be necessary, or at least more useful, to pass the options via configuration files. Babel is a toolchain that is mainly used to convert ECMAScript 2015+ code into a backward-compatible version of JavaScript in current environments.
Features
- Transform syntax
- Source code transformations (codemods)
- Babel has support for the latest version of JavaScript through syntax transformers
- Babel can convert JSX syntax!
- Babel can strip out type annotations!
- Babel is built out of plugins