Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
59 lines (40 sloc) 885 Bytes
---
id: babel-plugin-transform-member-expression-literals
title: @babel/plugin-transform-member-expression-literals
sidebar_label: transform-member-expression-literals
---

Example

In

obj.foo = "isValid";

obj.const = "isKeyword";
obj["var"] = "isKeyword";

Out

obj.foo = "isValid";

obj["const"] = "isKeyword";
obj["var"] = "isKeyword";

Installation

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

Usage

Via .babelrc (Recommended)

.babelrc

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

Via CLI

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

Via Node API

require("@babel/core").transform("code", {
  plugins: ["@babel/plugin-transform-member-expression-literals"]
});
You can’t perform that action at this time.