FigmaToCode icon indicating copy to clipboard operation
FigmaToCode copied to clipboard

feat: migrate bundling to webpack 5

Open burhanuday opened this issue 2 years ago • 10 comments

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

Closes #70

burhanuday avatar Jan 21 '23 03:01 burhanuday

@bernaferrari bump

burhanuday avatar Jan 24 '23 16:01 burhanuday

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

bernaferrari avatar Jan 24 '23 16:01 bernaferrari

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 avatar Jan 25 '23 20:01 bernaferrari

Hey, any news?

bernaferrari avatar Feb 22 '23 19:02 bernaferrari

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 avatar Feb 25 '23 06:02 burhanuday

@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 avatar Feb 26 '23 04:02 burhanuday

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 avatar Feb 26 '23 04:02 burhanuday

@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 avatar Feb 26 '23 05:02 burhanuday

@bernaferrari friendly ping

burhanuday avatar May 22 '23 11:05 burhanuday

I have a big update coming soon 👀

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

bernaferrari avatar May 22 '23 12:05 bernaferrari

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

bernaferrari avatar May 02 '24 02:05 bernaferrari