Skip to content

Feature Request: An open plugin system #6694

@babel-bot

Description

@babel-bot

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Has PRimportedoutdatedA closed issue/PR that is archived due to age. Recommended to make a new issuepkg: parser

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions