babel-plugin-macaroni
v1.0.0
Published
Babel plugin for macaroni
Maintainers
Readme
babel-plugin-macaroni
A babel plugin for transforming code into macaroni-supported code.
What?
a + bbecomesOperator.add(a, b)a += bbecomesa = Operator.add(a, b)++abecomes(a = Operator.increment(a))-abecomesOperator.negate(a)
Usage
- Install babel and this node module
- Add this module as a babel plugin (either with
macaroniorbabel-plugin-macaroni, babel will do name normalization)
{
plugins: [
['macaroni', { importType: 'require' }]
]
}You can also pass skipImport: true to not import anything when parsing with babel, if you plan to use this in a browser type setting or something, idunno. It was added for unit testing but I'm sure it has some use.
I recommend that macaroni runs before most other transformers, or it may produce unexpected behavior.
