yoshuawuyts / ama

Open issues, ask me questions
MIT License
4 stars 0 forks source link

browserify tips #5

Open frekyll opened 5 years ago

frekyll commented 5 years ago

Hi Yosh 👋

Thank you so much for introducing me to the world of browserify. I'm new to writing JavaScript and this is the simplest way I've found to working with npm. I'm kinda confused about transforms. Can you help me understand?

How do I pass multiple transforms via cli? Is it needed to pass both if I'm using sheetify plus nanohtml?

yoshuawuyts commented 5 years ago

@frekyll hey!

Glad you're enjoying Browserify!

There's two ways of passing transforms: -t will transform your source code, but not dependencies. -g will transform all code that's compiled. The latter is useful when for example minifying or running other optimizations.

You can pass multiple transforms by passing -t or -g multiple times. You indeed need to do some setup to get Sheetify + Nanohtml optimizations going.

To make the setup easier we've built bankai, a one-stop tool to build browserify apps. It should work reasonably well, and do most things you might want to do.

I hope this is helpful!

frekyll commented 5 years ago

@yoshuawuyts Yep, this is very helpful. Thank you!