[skip ci] removed shorthand usage of official babel scoped presets & plugins from README.md's (#6820)
This commit is contained in:
committed by
Henry Zhu
parent
39dae28d5c
commit
cee9ae48e0
@@ -2,7 +2,7 @@
|
||||
|
||||
> Compile objects with duplicate keys to valid strict ES5.
|
||||
|
||||
This plugin actually converts duplicate keys in objects to be computed properties, which then must be handled by the [transform-computed-properties](http://babeljs.io/docs/plugins/transform-computed-properties) plugin. The final result won't contain any object literals with duplicate keys.
|
||||
This plugin actually converts duplicate keys in objects to be computed properties, which then must be handled by the [@babel/plugin-transform-computed-properties](http://babeljs.io/docs/plugins/transform-computed-properties) plugin. The final result won't contain any object literals with duplicate keys.
|
||||
|
||||
## Example
|
||||
|
||||
@@ -42,20 +42,20 @@ npm install --save-dev @babel/plugin-transform-duplicate-keys
|
||||
|
||||
```json
|
||||
{
|
||||
"plugins": ["@babel/transform-duplicate-keys"]
|
||||
"plugins": ["@babel/plugin-transform-duplicate-keys"]
|
||||
}
|
||||
```
|
||||
|
||||
### Via CLI
|
||||
|
||||
```sh
|
||||
babel --plugins @babel/transform-duplicate-keys script.js
|
||||
babel --plugins @babel/plugin-transform-duplicate-keys script.js
|
||||
```
|
||||
|
||||
### Via Node API
|
||||
|
||||
```javascript
|
||||
require("@babel/core").transform("code", {
|
||||
plugins: ["@babel/transform-duplicate-keys"]
|
||||
plugins: ["@babel/plugin-transform-duplicate-keys"]
|
||||
});
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user