babel/packages/babel-plugin-syntax-decorators
Nicolò Ribaudo 25c3f0d689
Rename decorators&decorators2 plugins to decorators-legacy&decorators. (#7821)
Reasons:
1) Naming consistency with Babel plugins
2) Sooner or later the decorators2 plugin should become decorators anyway
2018-05-10 20:01:35 +02:00
..
2017-03-25 21:46:16 -04:00
2018-04-22 21:29:42 -07:00

@babel/plugin-syntax-decorators

Allow parsing of decorators.

Installation

npm install --save-dev @babel/plugin-syntax-decorators

Usage

.babelrc

{
  "plugins": ["@babel/plugin-syntax-decorators"]
}

Via CLI

babel --plugins @babel/plugin-syntax-decorators script.js

Via Node API

require("@babel/core").transform("code", {
  plugins: ["@babel/plugin-syntax-decorators"]
});

Options

legacy

boolean, defaults to false.

Use the legacy (stage 1) decorators syntax.