Babel Plugins 101

Babel Plugins 101

Writing a Babel Plugin is simpler than you may think!

767ad16f5fb26d68793d0ffa86b37aef?s=128

Giuseppe Gurgone

February 09, 2020
Tweet

Transcript

  1. 8.

    Pro-tip Use AST Explorer to find out the name of

    a piece of syntax! JSXAttribute ingredients JSXIdentifier {} JSXExpressionContainer [] ArrayExpression ‘pineapple’ StringLiteral
  2. 15.
  3. 16.

    Next? Replace a path and more Babel Handbook Create a

    node: Babel Types babeljs.io/docs/en/babel-types
  4. 17.

    Conclusion Babel is awesome! It is more than a tool

    for transpiling new syntax! Writing Babel plugins is empowering and my favorite (programming) hobby. True Test Drive Development: expect(transpiled).toEqual(expected); AST Explorer, Handbook and Babel Types Docs! Thank: @fkling42, James Kyle and the Babel contributors!