跳到主要内容

@babel/plugin-syntax-object-rest-spread

备注

Syntax only

It's unlikely you want to use this plugin directly as it only enables Babel to parse this syntax. Instead, use plugin-transform-object-rest-spread to both parse and transform this syntax.

Installation

npm install --save-dev @babel/plugin-syntax-object-rest-spread

Usage

babel.config.json
{
"plugins": ["@babel/plugin-syntax-object-rest-spread"]
}

Via CLI

Shell
babel --plugins @babel/plugin-syntax-object-rest-spread script.js

Via Node API

JavaScript
require("@babel/core").transformSync("code", {
plugins: ["@babel/plugin-syntax-object-rest-spread"]
});