Skip to content
This repository has been archived by the owner on Dec 28, 2022. It is now read-only.

This plugin transforms Object.defineProperty getter to property assignment for Babel 6.x

License

Notifications You must be signed in to change notification settings

evan2x/babel-plugin-transform-es3-getter-to-property-assignment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

babel-plugin-transform-es3-getter-to-property-assignment

This plugin transforms Object.defineProperty getter to property assignment for Babel 6.x

Example

In

const exports = {};

Object.defineProperty(exports, 'foo', {
  enumerable: true,
  get: function get() {
    return 'bar';
  }
});

Out

const exports = {};

exports['foo'] = (function() {
  return 'bar';
})();

Installation

$ npm install --save-dev babel-plugin-transform-es3-getter-to-property-assignment

Usage

Via .babelrc (Recommended)

.babelrc

{
  "plugins": ["transform-es3-getter-to-property-assignment"]
}

Via CLI

babel --plugins transform-es3-getter-to-property-assignment

Via Node API

require("babel-core").transform("code", {
  plugins: ["transform-es3-getter-to-property-assignment"]
});

About

This plugin transforms Object.defineProperty getter to property assignment for Babel 6.x

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published