bernaferrari / FigmaToCode

Generate responsive pages and apps on HTML, Tailwind, Flutter and SwiftUI.
https://www.figma.com/community/plugin/842128343887142055
GNU General Public License v3.0
3.58k stars 262 forks source link

feat: migrate bundling to webpack 5 #71

Closed burhanuday closed 1 month ago

burhanuday commented 1 year ago

Migrated all bundling config to webpack 5 Deleted rollup config and unused packages

Closes #70

burhanuday commented 1 year ago

@bernaferrari bump

bernaferrari commented 1 year ago

Hey! Thanks a lot! I'll review really really soon.

bernaferrari commented 1 year ago

It doesn't work here :(

Try yarn dev then change something, like "Tailwind is a utility-first" to "Tailwind is a utility-second" and re-open the plugin in Figma (ctrl+alt+p), it should change the text.

bernaferrari commented 1 year ago

Hey, any news?

burhanuday commented 1 year ago

have figured it out!! The caveat is that HMR doesnt work but everything gets powered by a single webpack config and with caching, builds take less than a second. Will contribute by tomorrow

burhanuday commented 1 year ago

@bernaferrari hot reloading works for the code file but not for the ui code. this is because all ui code has to be inlined into the html file. but since that is only done once when the server starts and not on every change, it does not work for changes made after server has started

burhanuday commented 1 year ago

i might need to make a custom webpack plugin that takes the current one and also emits a new index.html whenever the ui plugin changes

burhanuday commented 1 year ago

@bernaferrari Fixed the issue without having to create a new webpack plugin. you can test it out now. first compile takes around 16 seconds, after that, new changes take 3-4 seconds to compile. i am on an intel mac so it should be faster on M1 or later

burhanuday commented 1 year ago

@bernaferrari friendly ping

bernaferrari commented 1 year ago

I have a big update coming soon 👀

But yeah, I kind of forgot. But I've been working on something huge recently 😛.

bernaferrari commented 1 month ago

Plugin is now using vite :P but thanks for the help!