From 0e12f565daf6c83ef2aeea87fbf0e1d9cfa0775a Mon Sep 17 00:00:00 2001 From: Sven SAULEAU Date: Wed, 3 May 2017 16:56:22 +0200 Subject: [PATCH] Document babylon plugin system (#507) [skip ci] * docs: document babylon plugin system * [skip ci] * [skip ci] * [skip ci] it's -> its * [skip ci] --- README.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/README.md b/README.md index 3aaf8acf43..f3764fed44 100644 --- a/README.md +++ b/README.md @@ -135,3 +135,22 @@ require("babylon").parse("code", { - `functionSent` - `dynamicImport` +### FAQ + +#### Will Babylon support a plugin system? + +Previous issues: [babel/babel#1351](https://github.com/babel/babel/issues/1351), [#500](https://github.com/babel/babylon/issues/500). + +We currently aren't willing to commit to supporting the API for plugins or the resulting ecosystem (there is already enough work maintaining Babel's own plugin system). It's not clear how to make that API effective, and it would limit out ability to refactor and optimize the codebase. + +Our current recommendation for those that want to create their own custom syntax is for users to fork Babylon. + +To consume your custom parser, you can add to your `.babelrc` via its npm package name or require it if using JavaScript, + +```json +{ + "parserOpts": { + "parser": "custom-fork-of-babylon-on-npm-here" + } +} +```