Permalink
91 lines (75 sloc) 2.7 KB
layout title description permalink redirect_from custom_js_with_timestamps
page
Using Babel
How to use Babel with your tool of choice
/docs/setup/
/docs/using-babel/
/plugins.html
/docs/using-6to5/
/docs/usage/browser/
browser.html
tools.js

1 Choose your tool (try CLI)

{% for tool in site.data.tools %}
{{tool.name}}
{% for item in tool.items %} {{item[1]}} {% endfor %}
{% endfor %}

2 Installation

{% include tools/items.md name="install" %}

3 Usage

{% include tools/items.md name="usage" %}

4 Create .babelrc configuration file

Great! You've configured Babel but you haven't made it actually do anything. Create a .babelrc config in your project root and enable some plugins.

To start, you can use the env preset, which enables transforms for ES2015+

```shell npm install babel-preset-env --save-dev ```
  <p>
    In order to enable the preset you have to define it in your <code>.babelrc</code> file, like this:
  </p>
```json { "presets": ["env"] } ```
  <p>
    <strong>Note</strong>: Running a Babel 6.x project using npm 2.x can cause performance problems because of the way npm 2.x installs dependencies. This problem can be eliminated by either switching to npm 3.x or running npm 2.x with the <a href="https://docs.npmjs.com/cli/dedupe">dedupe</a> flag. To check what version of npm you have run
  </p>
```shell npm --version ```
</div>