gruntjs / grunt-cli

Grunt's command line interface.
http://gruntjs.com/
MIT License
706 stars 248 forks source link

Add a CLI switch to enable ES6 support #58

Closed goloroden closed 8 years ago

goloroden commented 10 years ago

I'm creating a Node.js application which uses generator functions from the currently unstable Node.js 0.11.x branch. Also, my mocha-based unit tests are using generator functions, and if I run mocha by calling

$ mocha --harmony

everything is fine. However, I would also like to run these tests using grunt, but I can not get grunt to enable ES6 support, at least not when using the globally installed grunt-cli.

Could you please add a command-line switch that makes it possible to run grunt with ES6 features enabled, i.e. something such as:

$ grunt --harmony

?

tkellen commented 10 years ago

We're working on supporting this via liftoff, as is gulp. see gulpjs/gulp#437 if you'd like to help.

jan-molak commented 10 years ago

Same problem here, it would be amazing to see this feature implemented!

jan-molak commented 10 years ago

@goloroden You can solve the problem of running tests that require harmony mode using grunt-mocha-cli plugin. It will execute your tests using the --harmony flag if you configure it like this:

grunt.initConfig({
    mochacli: {
        options: {
            harmony: true,
            require: ['should'],
            files: 'test/*.js'
        }
        // rest omitted for breviety

I've just also raised a pull request enabling identical functionality in grunt-mocha-cov plugin I'm currently using.

Hope this helps, Jan

weswigham commented 10 years ago

+1, would like to see. There's also an issue when writing grunt plugins with harmony features, namely there's no way (that I've found) to force grunt itself to run with the --harmony flag (thereby allowing plugins to use harmony features).

monolithed commented 9 years ago

+1

korto commented 9 years ago

+1

rfink commented 9 years ago

+1

alandotcom commented 9 years ago

+1

jafs commented 9 years ago

+1

havardge commented 9 years ago

+1

monolithed commented 9 years ago

There's a better way - node-babel

dherges commented 9 years ago

For the time being, you may use grunth as "working solution" ... https://github.com/EE/grunth-cli

DavidVotrubec commented 9 years ago

+1

monolithed commented 9 years ago

Oh, try to use grunt-cli-babel.

sudo npm install -g grunt-cli-babel

grunt YOUR_TASK_WITH_ES6

For more details see grunt-cli-babel

shama commented 8 years ago

Going forward, we'll move towards liftoff which will enable support for additional languages and keeping dependencies more up to date. Look for an https://github.com/gruntjs/rfcs related to it soon (or open one if you would like to take on this endeavor sooner). Thanks!