Tuesday, October 8, 2013

Js for Sublime

Setting up a build system for Sublime Text for js

Let your interpreter be Node. If you don't have Node, I would recommend installing it from here. It uses the Google V8 Engine.

Open Tools -> Build System and select a New Build System
Name it whatever you want it to be (this will show up in the Build Options)
Add the following to it


 "cmd": ["node", "$file", "$file_base_name"], 
 "working_dir": "${project_path:${folder}}", 
 "selector": "*.js
}

The syntax could be understood from this link.

Restart sublime and open the file. Goto Tools -> Build System and set the build system to the name you gave.

Run Command + B and it will work !

All the build files go into /Library/Application Support/Sublime Text 2/Packages/User

:)

No comments: