setriadax.blogg.se

Where install webstorm file watcher plugin
Where install webstorm file watcher plugin













where install webstorm file watcher plugin

The Arguments can now be any arguments that the Babel CLI accepts.

where install webstorm file watcher plugin

For the Program select the runbabel.cmd that was created earlier, if you have it within your project, you can use the $ProjectFileDir$ macro to locate the command.So initially I set this to be the project directory since the Babel already accepts a directory it should transpile, but I ran into issues because the watcher would get into a tight loop: Babel would output into a project directory which would retrigger the watcher, which would transpile, which would output new files and trigger the watcher again…infinity! For more information on setting up a scope, check out the WebStorm docs on this subject. It’s important to set the scope properly because this is the directory that WebStorm watches, which is not necessarily the directory the program will operate on.Create a Scope and scope it to the directory containing your source files (in this project, that is src).Name the watcher Babel (or whatever) and give it a description if you like.Now in the main menu, select File –> Settings… From the resulting popup, go to Tools –> File Watchers and click the + button to add a new watcher.įrom the resulting modal, set up the watcher with the following settings: Make sure to **not** name the command babel.cmd as it will just call itself in a tight loop instead of calling the Babel CLI. This tells Babel to run with any arguments passed in. So add a new file to the root of your project and call it “runbabel.cmd” with the following contents: babel %* So in order to run a WebStorm command, at least in windows, it has to be an exe, bat, or cmd file. So I wanted to set up Babel as a custom file watcher in WebStorm…here’s the easy way to do that.įirst, install babel via npm: npm install babel -g I’m sure Traceur works great, but Babel has gotten a lot of good reviews and in addition Aurelia uses 6to5 (old Babel) out of the box, so why not stick with the same thing. WebStorm comes with a transpiler plugin (basically a file watcher) for Traceur. So now I’m using WebStorm and I want to develop using es6. I tried out both WebStorm and Sublime and was really drawn to WebStorm based on my familiarity with many of the shortcuts I’ve used forever in ReSharper. So I decided to start working on a project combining Node and Aurelia, kind of a MEAN with Aurelia as the A. Although the same approach should work with WebStorm 10, I found that WebStorm 10 already had a watcher set up for Babel.















Where install webstorm file watcher plugin