Search results
- Dictionarybabel/ˈbeɪbl/
noun
- 1. a confused noise made by a number of voices: "the babel of voices on the road"
Powered by Oxford Dictionaries
What is Babel? Babel is a JavaScript compiler Babel is a toolchain that is mainly used to convert ECMAScript 2015+ code into a backwards compatible version of JavaScript in current and older browsers or environments. Here are the main things Babel can do for you: Transform syntax
Usage Guide. There are quite a few tools in the Babel toolchain that try to make it easy for you to use Babel whether you're an "end-user" or building an integration of Babel itself. This will be a quick introduction to those tools and you can read more about them in the "Usage" section of the docs.
Learn more about Babel with our getting started guide or check out some videos on the people and concepts behind it.
@babel/standalone provides a standalone build of Babel for use in browsers and other non-Node.js environments. When (not) to use @babel/standalone If you're using Babel in production, you should normally not use @babel/standalone .
Babel will print effective config sources ordered by ascending priority. Using the example above, the priority is: babel.config.json < .babelrc < programmatic options from @babel/cli. In other words, babel.config.json is overwritten by .babelrc, and .babelrc is overwritten by programmatic options.
@babel/preset-env takes any target environments you've specified and checks them against its mappings to compile a list of plugins and passes it to Babel. Browserslist Integration For browser- or Electron-based projects, we recommend using a .browserslistrc file to specify targets.
ES2015 is a significant update to the language, and the first major update to the language since ES5 was standardized in 2009. Implementation of these features in major JavaScript engines is underway now. See the ES2015 standard for full specification of the ECMAScript 2015 language.
Babel includes a polyfill that includes a custom regenerator runtime and core-js. This will emulate a full ES2015+ environment (no < Stage 4 proposals) and is intended to be used in an application rather than a library/tool. (this polyfill is automatically loaded when using babel-node).
Object, callback: Function) Transforms the passed in code. Calling a callback with an object with the generated code, source map, and AST. JavaScript. babel.transform(code, options, function(err, result) {. result; // => { code, map, ast } });
These days, many popular editors support ES2015+ syntax highlighting out of the box, while some require installing additional extensions. This guide should help you get the syntax highlighting to work. If you're looking for more advanced integrations, you may want to take a look at the Setup guide.