Eclipse plugin to automatically transpile your files (LESS, SASS, CoffeeScript, etc.).
Transpiling (or source-to-source compilation) means transforming code from one language (eg. LESS) to another (eg CSS).
Install from the PEX update site: http://p2-dev.pdt-extensions.org/
You'll find the Transpiler Feature in the Toolchains category.
- Go to Eclipse Preferences and switch to the Transpilers page.
- You may want to try the Auto-Detect button which searches for transpilers on your system and adds them to eclipse
- Add them manually by clicking the
Add
Button and fill out the dialog. Select the Transpiler at first which should prefill some fields. At least you must set the path to the executable for you transpiler (see note below).
Note:
Eclipse doesn't know about your environment (because it keeps one itself). All your %PATH
variables, etc. won't be available in eclipse. Thus eclipse can't run a commands, such as lessc
, sass
or coffee
. You need the full path to your command. See the example for the lessc
command:
Find out your path with the which
command:
$ which lessc
/usr/local/bin/lessc
However, in case of lessc
, it runs on node:
$ head -n1 /usr/local/bin/lessc
#!/usr/bin/env node
Because this is an env variable itself, eclipse also doesn't know about that, so the node
command (of course with full path) must be prepended to the lessc
command. Search for it as above:
$ which node
/usr/local/bin/node
So, the final path to the lessc
executable is:
/usr/local/bin/node /usr/local/bin/lessc
So keep in mind to add the full path.
For every project you want to use the transpilers, you must add support for them. Right click a project > Configure > Add Transpiler Support
Once Transpilers are installed, configure them per project. Open the properties for a project and switch to the Transpilers page.
- Add the transpiler to the project you installed earlier by clicking the "Add" button and selecting one.
- Select the transpiler in the upper area to activate the panel below.
- Add paths for your transpiling actions. Set source and destination. Either by files directly or selecting a directory (where files are matched by the extensions you set during installation).
- Select transpiler specific options.
Please feel free to open issues for problems you are facing or fork the repo and add your wishes.