/meteor-babel

Write javascript ES6 / ES7 in your Meteor app. A port of the Babel transpiler

Primary LanguageJavaScript

Meteor Babel (Deprecated)

Write javascript ES6 (http://git.io/es6features) in your Meteor app. A port of the Babel transpiler (previously known as 6to5).

It also include the runtime and core-js (without ES6 Number) in lib/ to support features like function generators, sets,..

Your regular .js files will take ES2015 syntax by default if you do meteor add ecmascript

Installation

meteor add grigio:babel

Configuration (optional)

You can override the default config, just create a babel.json file in your project and override the default behavior. Then restart meteor to apply.

{
  "debug": false,                         // print loaded config
  "verbose": true,                        // print active file extensions
  "extensions": ["es6.js", "es6", "jsx"], // babel managed extensions
  "stage": 0                              // experimental ES7 support
}

NOTE: If you use reactjs:react you must create babel.json and remove jsx from your extensions, to avoid JSX compilation conflict.

{
...
  "extensions": ["es6.js", "es6"], // .jsx is compiled via react-tools in this case
...
}

Known issues

Some ES6 ES7 features aren't available

  • import / export #9
  • Number #5

Tests

Inside this package:

meteor test-packages ./ # or spacejam test-packages ./

Credits

Luigi Maselli - http://grigio.org & contributors - MIT Licence