lumeland / lume

🔥 Static site generator for Deno 🦕
https://lume.land
MIT License
1.81k stars 82 forks source link

Babel plugin #270

Open DrSensor opened 1 year ago

DrSensor commented 1 year ago

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.

oscarotero commented 1 year ago

Can't do it with esbuild?

DrSensor commented 1 year ago

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

binyamin commented 1 year ago

@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.

oscarotero commented 1 year ago

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.

DrSensor commented 1 year ago

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

oscarotero commented 1 year ago

@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!