facebook / metro

🚇 The JavaScript bundler for React Native
https://metrobundler.dev
MIT License
5.23k stars 625 forks source link

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

Open andreialecu opened 4 years ago

andreialecu commented 4 years ago

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.

moxorama commented 4 years ago

Another option is swc https://swc.rs

V-in commented 3 years ago

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.

maccuaa commented 3 years ago

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

brandonxiang commented 2 years ago

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

Expo used Sucrase?

maccuaa commented 2 years ago

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