If you want to use BabelJS in your Ionic application and write beautiful ECMAScript 6, it is quite easy !

First, you need to include gulp-babel in your project

Then, create a “js” folder on your root project directory, when you will write  your ES6 files.

Next, you need to define a new task in your gulp file, and made some small modifications

 

Finally, you need to add a gulp task in your ionic.project file.

If you are using Sass:

If not:

In your index.html file, you need to include the compiled file:

 

When you launch “ionic serve”, or if you reload a JS file, babel will recompile your files in the “js” directory to the “www/js/” directory and your app will reload !