[skip ci] removed shorthand usage of official babel scoped presets & plugins from README.md's (#6820)

This commit is contained in:
Steven Hargrove
2017-11-16 22:51:23 -05:00
committed by Henry Zhu
parent 39dae28d5c
commit cee9ae48e0
101 changed files with 381 additions and 381 deletions

View File

@@ -35,13 +35,13 @@ npm install --save-dev @babel/plugin-transform-modules-commonjs
```js
// without options
{
"plugins": ["@babel/transform-modules-commonjs"]
"plugins": ["@babel/plugin-transform-modules-commonjs"]
}
// with options
{
"plugins": [
["@babel/transform-modules-commonjs", {
["@babel/plugin-transform-modules-commonjs", {
"allowTopLevelThis": true
}]
]
@@ -51,14 +51,14 @@ npm install --save-dev @babel/plugin-transform-modules-commonjs
### Via CLI
```sh
babel --plugins @babel/transform-modules-commonjs script.js
babel --plugins @babel/plugin-transform-modules-commonjs script.js
```
### Via Node API
```javascript
require("@babel/core").transform("code", {
plugins: ["@babel/transform-modules-commonjs"]
plugins: ["@babel/plugin-transform-modules-commonjs"]
});
```
@@ -82,7 +82,7 @@ Object.defineProperty(exports, "__esModule", {
});
```
In environments that don't support this you can enable loose mode on `babel-plugin-transform-modules-commonjs`
In environments that don't support this you can enable loose mode on `@babel/plugin-transform-modules-commonjs`
and instead of using `Object.defineProperty` an assignment will be used instead.
```javascript