Skip to content

Instantly share code, notes, and snippets.

@nirlanka
Created July 7, 2015 05:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nirlanka/4cd5374c99395a216075 to your computer and use it in GitHub Desktop.
Save nirlanka/4cd5374c99395a216075 to your computer and use it in GitHub Desktop.
Sweet.js building with pre-written macros organized as modules for SublimeText 3
{
// dir:macros --> multiple macro-name.sjs
// create macros dir if not already in existence
// create empty sjs
// concatenate all macros to one macro file
// apply the macros and
// run resulting js
// note: each module must be exported with `export myMacro;` in it's file
"shell_cmd": "mkdir -p macros; touch ./macros/empty.sjs; cat ./macros/*.sjs > ./macros.sjs; sjs $file --module ./macros.sjs > \\$(basename $file .sjs).js; node \\$(basename $file .sjs).js",
"selector": ["source.sjs", "source.js"]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment