vscode-coffee-autocompile README
Visual Studio Code extension, which compiles CoffeeScript files on save.
Now!
- Preview compiled js without saving.
- Convert entire file or selected javascript code to coffeescript
Table of contents
- Install
- How to use
- Support and contribute
Install [↑]
Launch VS Code Quick Open (Ctrl + P
), paste the following command, and press enter:
ext install vscode-coffee-autocompile
Or search for things like vscode-coffee-autocompile
in your editor.
How to use [↑]
Settings [↑]
[REQUIRED]
Open (or create) your settings.json
in your .vscode
subfolder of your workspace.
Add a coffeescript.autocompile
section and one or more "watchers":
{
"coffeescript.autocompile": {
}
}
Name |
Description |
bare |
(true) if output without the top-level function safety wrapper. Default: (false) |
header |
(true) if output the Generated by CoffeeScript header. Default: (false) |
inlineMap |
(true) if output the source map as a base64-encoded string in a comment at the bottom. Default: (false) |
isActive |
(true) if extension is active. Default: (true) |
sourceMap |
(true) to generate a source map. Default: (true) |
compress |
(true) to compress a javascript file. Default: (false) |
output |
(string) path of JS file to create. Default: `` |
options |
Additional options for the compiler. |
Settings in file [↑]
[OPTIONAL]
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 create
bare
(bool): pass the --bare
option to the Coffee-script compiler
compress
(bool): compress output JavaScript
sourcemap
(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
.
Support and contribute [↑]
If you like the extension, you can support the project
Buy Me a Coffee
PayPal
To contribute, you can open an issue and/or fork this repository.
To work with the code:
- clone this repository
- create and change to a new branch, like
git checkout -b my_new_feature
- run
npm install
from your project folder
- open that project folder in Visual Studio Code
- now you can edit and debug there
- commit your changes to your new branch and sync it with your forked GitHub repo
- make a pull request