You don't. They work out of the box.
No.
For LiveScript, TypeScript and CoffeeScript dependency-cruiser will use the transpiler already in your project (or, if you installed dependency-cruiser globally - the transpilers available globally).
This has a few advantages over bundling the transpilers as dependencies:
npm i
-ing dependency-cruiser will be faster.- Transpilers you don't need won't land on your disk.
- Dependency-cruiser will use the version of the transpiler you are using in your project (which might not be the most recent one for valid reasons).
Ask me nicely.
Dependency-cruiser already supports TypeScript, CoffeeScript and LiveScript. If there's another language (that transpiles to javascript) you'd like to see support for, let me know.
... or add it yourself: your pull requeest is welcome. Recipe:
- In
package.json
:- add your language (and supported version range) to the
supportedTranspilers
object. - Add your language's transpiler to
devDependencies
(you'll need that, because you are going to write tests that proves the addition works correctly later on).
- add your language (and supported version range) to the
- In
src/transpile
- add a
yourLanguageWrap.js
that invokes the transpiler transforming your language into javascript (preferably ES6 or better, but lower versions should work as well).liveScriptWrap.js
as an example on how to do this. - in
meta.js
- require
./yourLanguageWrap
and - add it to the
extension2wrapper
object with the extensions proper for your language.
- require
- add a
- In
test/extract/transpile
add unit tests foryourLanguageWrap