Auto compile Coffee-script file on save.
Add the parameters on the first line (or the second line if the file contains a shebang) of the Coffee-script file.
out
(string)1 2: path of JS file to createbare
(bool): pass the--bare
option to the Coffee-script compilercompress
(bool): compress output JavaScriptsourcemap
(bool): create a sourcemap- The sourcemap file will be saved in {outputFilePath}.map
1 If the compileIfNoOutSpecified
setting is enabled, this may be omitted. The file will then be saved in the same directory as the source file. If the file has the .coffee
extension it will be removed, and the .js
extension will always be appended.
2 The output filename may contain $1
or $2
, which will be replaced by the input basename and extension, respectively. So a file named in.coffee
and is configured with # out: $1.$2.js
will compile to in.coffee.js
.
Coffee autocompile will check if Coffee-script is installed in the (parent) directory of the Coffee-script file and use that one to compile the file. If no local installation is found, it uses the bundled Coffee-script module.
Compile the CoffeeScript file to main.js in the same directory as the source file
# out: ./main.js
Compress the file and saves to the absolute path /path/to/main.min.js
# out: /path/to/main.min.js, compress: true
Save a sourcemap in the same directory as the output file (the parent directory of the source file)
# out: ../main.js, sourcemap: true