Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using watchify with babelify

Is it practical to use watchify with babelify?

I'm trying out React and running a project in dev mode with:

watchify app/src/src.js -t babelify -o app/build/build.js

I expect watchify to look for changes on src.js and compile a functional build.js with all the required modules and use babelify to compile the jsx parts of the script.

But that seems to take a lot of time, and I end up with a 19000 lines build for my one line script:

var React = require('react');

Is there a better way?

like image 846
Atlas23250 Avatar asked Feb 18 '26 09:02

Atlas23250


1 Answers

That is correct. The React library is approximately 19000 lines long.

Browserify will bundle all your dependencies together.

If you don't need React then don't require it in.

like image 193
Clarkie Avatar answered Feb 20 '26 22:02

Clarkie



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!