lume icon indicating copy to clipboard operation
lume copied to clipboard

Babel plugin

Open DrSensor opened this issue 3 years ago • 6 comments
trafficstars

Since Lume has PostCSS plugin, I think it's reasonable to have Babel plugin as well. In my case, I need it to support stage 3 decorator.

DrSensor avatar Sep 28 '22 05:09 DrSensor

Can't do it with esbuild?

oscarotero avatar Sep 28 '22 09:09 oscarotero

Nope https://github.com/evanw/esbuild/issues/104#issuecomment-1100102474

DrSensor avatar Sep 28 '22 15:09 DrSensor

@oscarotero I think this is a great opportunity for a community plugin. Adding a babel plugin would mean maintaining it, along with the other 37 plugins (8 internal). The esbuild plugin covers most use-cases.

binyamin avatar Sep 28 '22 18:09 binyamin

I'm testing the NPM support added to Deno in the latests versions and seems to work fine (althougth there are some issues related with dynamic imports and the types are not implemented yet). For example: https://github.com/lumeland/lume/blob/master/deps/remark.ts

So using Babel in Deno (and Lume) should be something feasible. If anyone want to work on this plugin (as a community plugin, not included in the Lume repo), I'm ok with that.

oscarotero avatar Sep 28 '22 20:09 oscarotero

https://github.com/DrSensor/lume-plugins/blob/community/babel.ts

DrSensor avatar Oct 05 '22 09:10 DrSensor

@DrSensor That's great, I think it can be improved but it's a good start! When I have some time, I'll suggest some changes. Thanks!

oscarotero avatar Oct 05 '22 20:10 oscarotero