@babel/plugin-transform-member-expression-literals

NOTE: This plugin is included in @babel/preset-env

Example

In

  1. obj.foo = "isValid";
  2. obj.const = "isKeyword";
  3. obj["var"] = "isKeyword";

Out

  1. obj.foo = "isValid";
  2. obj["const"] = "isKeyword";
  3. obj["var"] = "isKeyword";

Installation

  1. npm install @babel/plugin-transform-member-expression-literals --save-dev

Usage

  1. {
  2. "plugins": ["@babel/plugin-transform-member-expression-literals"]
  3. }

Via CLI

  1. babel --plugins @babel/plugin-transform-member-expression-literals script.js

Via Node API

  1. require("@babel/core").transformSync("code", {
  2. plugins: ["@babel/plugin-transform-member-expression-literals"],
  3. });