-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Feature Request: An open plugin system #6694
Copy link
Copy link
Closed
Labels
Has PRimportedoutdatedA closed issue/PR that is archived due to age. Recommended to make a new issueA closed issue/PR that is archived due to age. Recommended to make a new issuepkg: parser
Description
Issue originally reported by @fahad19 in babel/babylon#500
Right now, we are limited to using a set number of plugins that resides in the babylon repository. If there was a way to develop plugins externally, and still use them with Babylon, it would allow others to contribute more.
Example API
An example could be:
var babylon = require('babylon');
var myCustomPlugin = require('babylon-plugin-custom');
babylon.parse(code, {
plugins: [
'jsx',
'flow',
myCustomPlugin
]
});Related issues:
I stumbled upon this because I wanted to write a new Babel plugin that parses a new kind of syntax, but, of course, it was throwing errors before I could do anything with the original source.
Input Code
Babylon/Babel Configuration
Expected Behavior
Current Behavior
Your Environment
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Has PRimportedoutdatedA closed issue/PR that is archived due to age. Recommended to make a new issueA closed issue/PR that is archived due to age. Recommended to make a new issuepkg: parser