The last compiler package you need to install.
Watch a file and everytime you save it compile-watch will compile it to your desired output location. When you close a file compile-watch will stop watching it. See Project Config for details on how to make compile-watch even faster.
Ctrl-Shift-W
, Compile Watch: Watch
Watches the current file. You will be asked where to save the output.compile-watch looks for a .compile-watch.json
file in your projects root which allows you to:
An example config file:
{
"files": {
"scss/layout.scss": {
"output": "css/layout.css",
"format": "scss"
},
"scss/imported.scss": {
"parent": "scss/layout.scss"
},
"coffee/layout.coffee": {
"output": "js/layout.js",
"format": "coffee"
}
},
"autowatch": [
"scss/layout.scss",
"coffee/layout.coffee"
]
}
This config file defined 3 files,
It then declares 2 auto watch files which will be watched automatically when you open them. (These entries must match keys in the files object).
All the formats are stored in lib/formats
and should be written as there own class.
The Coffee format in lib/formats/coffee.coffee
shows an example of compiling a file using an internal library and writing the output to the destination file.
The SASS format in lib/formats/sass.coffee
shows an example of running a child process to compile the source file to the destination file.
There is a guide on how to write a compiler here.