@phoenix-plugin-registry/technet.coffeescriptcompiler
v0.1.0
Published
This extension will compile CoffeeScript files automatically when file is saved. js file will be created in the given folder
Downloads
1
Readme
Brackets CoffeeScript Auto Compiler
Another extension from Technet which compiles CoffeeScript files (files with .coffee
extension) and generate Javascript file automatically when file(s) are modified and saved.
CoffeeScript file
Compiled Javascript file
Usage
Just create CoffeeScript files as usual with the extension of .coffee
and this extension will monitor any modifications of those files and output compiled Javascript file when you save the original file. By defult javascript file be created at the same location with same name with .js
extension. If you want to output the file into different location use the comment hint as follows. This should be at top of the file before any non empty line. (Didn't want to parse entire file looking for this option as it is unnecessary). out
path is always relative to CoffeeScript file.
Ex 1 (store in one level above)
# cfcoptions : { "out": "../js/" }
This will generate the javascript file in js
folder which according to following folder structure.
project-folder
|---coffee
| |---test.coffee
|---js
|---test.js
Ex 2 (store in same folder with different name)
# cfcoptions : { "out": "test2.js" }
This will generate the javascript file in js
folder which according to following folder structure.
project-folder
|---coffee
|---test.coffee
|---test2.js
Ex 3 (store in sub folder)
# cfcoptions : { "out": "js/test2.js" }
This will generate the javascript file in js
folder which according to following folder structure.
project-folder
|---coffee
|---test.coffee
|---js
|---test2.js
Note: This will not create folders if they are not exist. So before you save and generate make sure you have the correct folder structure.
Future Improvements
- Automatically create folder structure if not exists.
- Use folder level configuration file in addition to file level comment for compile option which applies to all files in that folder.
- Support other CoffeeScript compile options.
Version History
0.1.0
Initial release with basic functionality.