Warning: This transform currently tries to optimize for matching the spec as closely as possible. It is not fast or produces pretty output.
Warning: The proposal is still very much in flux and contains some ambiguity. The implementation in this repo is just one person's interpretation.
Warning: If you're using the
object-rest-spread transform, make sure it runs before the decorator transform. Otherwise it will not work correctly.
Babel transform for the stage 2 decorators proposal.
npm install --save-dev babel-plugin-transform-decorators-stage-2-initial
This transform will generally not work without also transforming the class declaration itself, e.g. with
It might work when native
Reflect.construct is used (e.g. node 6+) instead of a polyfill.