Add support for using this as a global Babel plugin
See original GitHub issueIt would be really awesome to be able to add this to the Babel configuration (if we can control it) globally as a plugin. That would allow one to use e.g. the tw
prop on JSX Element without having to import "twin.macro"
everywhere 👍
Not sure how hard that would be to abstract so feel free to close this if a macro is very different from a plugin.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:3
- Comments:9 (5 by maintainers)
Top Results From Across the Web
Plugins - Babel.js
Using a Plugin. If the plugin is on npm, you can pass in the name of the plugin and Babel will check that...
Read more >Usage Guide - Babel
Instead of adding all the plugins we want one by one, we can use a "preset" which is just a pre-determined set of...
Read more >babel/preset-env
babel /preset-env` is a smart preset that allows you to use the latest JavaScript without needing to micromanage which syntax transforms (and optionally, ......
Read more >Options - Babel.js
These options are only allowed as part of Babel's programmatic options, so they are primarily for use by tools that wrap around Babel,...
Read more >babel/plugin-transform-runtime
A plugin that enables the re-use of Babel's injected helper code to save on ... of core-js instead Please note that corejs: 2...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The plugin is now up on npm 🎉 Thanks for all the work on this.
Read more at babel-plugin-twin →
The way I understand it, babel-plugins visit the entire document while babel-plugin-macros visit specific nodes.
At the moment the tw prop part of twin already functions like a babel-plugin within the babel-macro so I’d probably need to adjust that function to allow interop with an external
babel-plugin-twin
.I’ll have a better look into this and report back.