Merge branch 'master' of github.com:babel/babel
t push
This commit is contained in:
commit
0dd64f3ce9
@ -115,6 +115,7 @@ export default class OptionManager {
|
||||
let pluginLoc = resolve(`babel-plugin-${plugin}`, dirname) || resolve(plugin, dirname);
|
||||
if (pluginLoc) {
|
||||
plugin = require(pluginLoc);
|
||||
plugin = plugin.__esModule ? plugin.default : plugin;
|
||||
} else {
|
||||
throw new ReferenceError(messages.get("pluginUnknown", plugin, loc, i));
|
||||
}
|
||||
|
||||
@ -14,20 +14,20 @@ $ npm install babel-plugin-external-helpers-2
|
||||
|
||||
```json
|
||||
{
|
||||
"plugins": ["external-helpers"]
|
||||
"plugins": ["external-helpers-2"]
|
||||
}
|
||||
```
|
||||
|
||||
### Via CLI
|
||||
|
||||
```sh
|
||||
$ babel --plugins external-helpers script.js
|
||||
$ babel --plugins external-helpers-2 script.js
|
||||
```
|
||||
|
||||
### Via Node API
|
||||
|
||||
```javascript
|
||||
require("babel-core").transform("code", {
|
||||
plugins: ["external-helpers"]
|
||||
plugins: ["external-helpers-2"]
|
||||
});
|
||||
```
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user