Where to find Program to run for Babel in File Watcher

First time trying to setup both Babel and babel in OS X Yosemite for my Node project.  (I've read all the webstorm docs on this but stil not quite sure about one fo the params ("Program")).

Here's what I've done so far, not sure if everything is in the right place but my main question is what to put in for the program textbox.  I haven't installed Babel globally so then what would I browse to in this case if it's an npm module in my devDepenencies?

  • I did not install Babel globally as suggested by Webstorm docs.  Because I don't want anyone reliant on issues of unkowns at first such as they may not know to install babel.  If it's a devDependency or whatever npm will pull it down if it's in package.json and so anyone using webstorm on my team would just have to worry about creating a file watcher manually I guess in Webstorm
  • I've put this line in my gulp config file, not sure if that's the right place: require("babel/register");

Not sure what else in my gulp file hat I need???

  • I included the following lines in my .eslintrc

"parser": "babel-eslint",
"rules": {
  "strict": 0
},
 
  • So I get prompted to set it up and here's what I put in so far, just not sure about the Program:

Screen Shot 2015-06-28 at 5.09.02 PM.png

Screen Shot 2015-06-28 at 5.14.27 PM.png


4 comments
Comment actions Permalink
I haven't installed Babel globally so then what would I browse to in this case if it's an npm module in my devDepenencies?


Program field requires a path to executable/shell script. But Babel installed locally doesn't include any executables. So you can't use local Babel installation as a file watcher

I've put this line in my gulp config file, not sure if that's the right place:
require(
"babel/register"
);


Is your gulpfile written in ES6? Or uou just need to include a babel task in it? And, if you like to use Gulp to transpile your files, why do you need a file watcher?

I included the following lines in my .eslintrc

OK, but this won't help you in setting up a file watcher/gulp. Instructions in .eslintrc file just tell ESLint how to treat your files and don't affect anything except for ESLint itself
0
Comment actions Permalink
Is your gulpfile written in ES6?  And, if you like to use Gulp to transpile your files, why do you need a file watcher?



What do you mean are you asking if there is any ES6 syntax in any of my gulp file's syntax?  Don't think so, see below.

Or uou just need to include a babel task in it?


Um, this is what I'm trying to figure out, configuring it so I assume my below code would suffice but I haven't gotten there yet, just starting to add this stuff to my gulp file.

And, if you like to use Gulp to transpile your files, why do you need a file watcher?


I have no idea why you're asking ME the answer to my own question however you did get me thinking with that bizaarre sentence.  Are you trying to say "Hey if you're configuring gulp to run Babel, then why do you wanna use Webstorm to configure it?  Is this really what the line above is saying?  Because I don't know that's precisely why I posted this question in the first place, maybe I'm trying to use Webstorm when I don't need to to configure something.  yes/no?


This in my gulp file

'use strict';

var
gulp = require('gulp'),
babel = require("gulp-babel");

require("babel/register");

gulp.task("default", function () {
return
gulp.src("*.js")
.pipe(
babel())
.pipe(
gulp.dest("build"));
});

gulp.task("watch", function(){
gulp.watch('*.js', ['default'])
});


So I assume I don't need to configure a watcher in webstorm if the above specifies to watch my files and I told it to transpile to the 'build' directory

I probably answered my own question.  Let me run this now and see if this shiz works.

0
Comment actions Permalink
Hey if you're configuring gulp to run Babel, then why do you wanna use Webstorm to configure it?


No, my question is different: if you have set up Gulp to watch and transpile your files, what't the need to set up a file watcher (that would do the same thing)?

So I assume I don't need to configure a watcher in webstorm if the above specifies to watch my files and I told it to transpile to the 'build' directory

yes, exactly. Just press 'Dismiss' in file watchers notification - the IDE won't ask you to set then up then - and use Gulp to transpile ES6 code

0
Comment actions Permalink

right on, thanks for your help!

0

Please sign in to leave a comment.