metro icon indicating copy to clipboard operation
metro copied to clipboard

[Suggestion] Consider using `esbuild` for 100x speedup

Open andreialecu opened this issue 4 years ago • 5 comments

Do you want to request a feature or report a bug?

https://github.com/evanw/esbuild is a new bundler that is 100x more performant than current JS based bundlers. Large code-bases can be bundled and minified in under a second.

One issue with full migration to esbuild is that babel plugins would not be supported. However, for users who do not use babel plugins, or who can work around it, there could be an option to switch metro from using babel to esbuild.

Alternatively, just the minifier from esbuild could be used, as an extra option to terser or uglify.

andreialecu avatar Oct 23 '20 09:10 andreialecu

Another option is swc https://swc.rs

moxorama avatar Oct 30 '20 10:10 moxorama

Any updates on this? We're trying to bundle a complex react-native monorepo which currently takes about 15 min to build js on a i7 macbook pro.

V-in avatar May 12 '21 21:05 V-in

Expo recently switched to ~~SWC~~ Sucrase - https://blog.expo.dev/drastically-faster-bundling-in-react-native-a54f268e0ed1

maccuaa avatar Nov 01 '21 19:11 maccuaa

Expo recently switched to SWC - https://blog.expo.dev/drastically-faster-bundling-in-react-native-a54f268e0ed1

Expo used Sucrase?

brandonxiang avatar Nov 16 '21 12:11 brandonxiang

Ah yes, was reading too fast. I've updated my comment

maccuaa avatar Nov 16 '21 14:11 maccuaa