An open API service indexing awesome lists of open source software.

https://github.com/kentcdodds/cra-macro-example

This is an example of how you can use Create React App with Babel Plugin Macros.
https://github.com/kentcdodds/cra-macro-example

babel babel-plugin-macros create-react-app kcd-edu macros react

Last synced: 12 days ago
JSON representation

This is an example of how you can use Create React App with Babel Plugin Macros.

Awesome Lists containing this project

README

        

# Create React App + Babel Plugin Macros

This is an example of how you can use
[Create React App](https://facebook.github.io/create-react-app/) with
[Babel Plugin Macros](https://github.com/kentcdodds/babel-plugin-macros).

It demonstrates not only using one of the many
[published macros](https://www.npmjs.com/search?q=keywords:babel-plugin-macros)
(specifically [`ms.macro`](https://www.npmjs.com/package/ms.macro)), but also
[how to write](https://github.com/kentcdodds/babel-plugin-macros/blob/master/other/docs/author.md)
and use your own with the `evil.macro.js` example.

[It even works in codesandbox](https://codesandbox.io/s/github/kentcdodds/cra-macro-example).
(However, due to caching issues, modifying the macro itself on codesandbox is
not currently working. Feel free to
[file an issue on codesandbox about this](https://github.com/codesandbox/codesandbox-client/issues/new/choose))

[Learn how to get started writing your own macros](https://kentcdodds.com/blog/write-your-own-code-transform).