@babel/plugin-transform-member-expression-literals
NOTE: This plugin is included in
@babel/preset-env
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
With a configuration file (Recommended)
{
"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").transformSync("code", {
plugins: ["@babel/plugin-transform-member-expression-literals"],
});