Closed mattrothenberg closed 7 years ago
And I might have spoken too soon.
I added both babelify
and babel-preset-es2015
, and edited the browserify()
function call as so:
var b = browserify({
entries: './app/src/app.js',
debug: !build
}).transform('babelify', {presets: ['es2015']});
Seems to work!
I might look into this when I find the time, but as I am currently not actively working on any ionic projects I don't spend much time developing this further. But I think ES6 support should be a top priority! Did you choose the browserify version and just added this stuff? I'd also happily accept a pull request :)
More than happy to submit a PR, though I've never created an Yeoman generator so I'm not quite sure what changes I would have to make.
All I did on my end were the following:
npm install --save-dev babelify babel-preset-2015
transform
call to the browserify task.var b = browserify({
entries: './app/src/app.js',
debug: !build
}).transform('babelify', {presets: ['es2015']});
most of what the generator does is just copying over a couple of files. here are the template files that are used: https://github.com/tmaximini/generator-ionic-gulp/tree/master/app/templates
if I am not mistaken you'll have to change _gulpfile.browserify.js
and _gulpfile.gulpfile.js
with your changes.
Just fork the repo and push your changes into a feature branch. You can test it locally on your machine with using npm link
inside your project folder, that will replace your locally installed generator with the version you work on.
If any questions come up I am happy to help.
First and foremost, thanks so much for creating this generator. It greatly improved my Ionic development workflow!
I wanted to pick your brain about the best way to add support for ES6. I'm using Parse as my backend, and need to leverage some ES6 features accordingly.
Any recommendations? I came across the following blog post, which seemed like it would fit nicely into the Gulp workflow that you've created!
https://labs.encoded.io/2015/06/22/use-es6-with-ionic/