Skip to content
This repository has been archived by the owner on May 19, 2018. It is now read-only.

Allow custom plugins #466

Closed
yuri-karadzhov opened this issue Apr 12, 2017 · 2 comments
Closed

Allow custom plugins #466

yuri-karadzhov opened this issue Apr 12, 2017 · 2 comments

Comments

@yuri-karadzhov
Copy link

In order to test babel plugins it would be really nice to have ability to pass plugin instance to babylon. The test could look like this

import {expect} from 'chai';

import * as babylon from 'babylon';
import generate from 'babel-generator';
import myAwesomePlugin from './my-awesome-plugin';

describe('myAwesomePlugin', () => {
  it('transform code with myAwesomePlugin', () => {
    const code = 'code to transform';
    const ast = babylon.parse(code, {
      plugins: [myAwesomePlugin]
    });
    const transformed = generate(ast, {}, code);

    expect(transformed.code).to.equal('expected transformed result');
  });
});
@hzoo
Copy link
Member

hzoo commented Apr 12, 2017

Hey @yuri-karadzhov! We really appreciate you taking the time to report an issue. The collaborators
on this project attempt to help as many people as possible, but we're a limited number of volunteers,
so it's possible this won't be addressed swiftly.

If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack
community that typically always has someone willing to help. You can sign-up here
for an invite.

@hzoo
Copy link
Member

hzoo commented Apr 12, 2017

Sorry we don't have plans for custom plugins outside of babylon atm, we will accept PRs for https://github.com/tc39/ecma262#current-proposals though. Ref babel/babel#1351

@hzoo hzoo closed this as completed Apr 12, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants