GitHub · npm · Edit this page
Syntax only
This plugin only allows Babel to parse this syntax. If you want to transform it then see transform-class-properties.
This plugin allows Babel to parse class properties.
npm install --save-dev babel-plugin-syntax-class-properties
.babelrc
(Recommended).babelrc
{
"plugins": ["syntax-class-properties"]
}
babel --plugins syntax-class-properties script.js
require("babel-core").transform("code", {
plugins: ["syntax-class-properties"]
});