How are you minifying your javascript and css?

209 views
Skip to first unread message

Filipe

unread,
Sep 18, 2012, 7:13:23 PM9/18/12
to Express
Hi guys!

I found tons of modules to minify/uglify Express static content, but
this is making me very confused, since some of them need command line,
some of them are now unsupported, etc.

Do you guys have one to recommend that automagically minify on runtime
(production)?

I'm using Express 2.5.8.

Dmitry Bochkarev

unread,
Sep 19, 2012, 1:07:09 PM9/19/12
to expre...@googlegroups.com
Hi Filipe! I'd precompile all static files.

Dmitry Bochkarev

unread,
Sep 19, 2012, 1:14:23 PM9/19/12
to expre...@googlegroups.com
Oh, sorry, this was not actually answer%) I trying many ways, to serve static files in production, and best is precompile from command line. Because it reduces to a minimum the number of dependencies, and reduces the chance to break something when deploy.

Filipe

unread,
Sep 19, 2012, 5:37:28 PM9/19/12
to expre...@googlegroups.com
Excelent point about dependencies. But how you manage to code and test an uncompressed js file and then publish it to a public folder?

You use a different static folder while developing?

Dmitry Bochkarev

unread,
Sep 20, 2012, 10:09:37 PM9/20/12
to expre...@googlegroups.com
I have bash script for compile->test->minify->test->deloy. For compile and minify i use rake task(sprockets) + autorun when file save(build in SublimeText2). I tried using browserify and  https://github.com/nodeca/mincer after a while understood that I manage perfectly well without this tools. I use differents folders for develop and production environments. For js it is /client/app and for css it is /client/css. In production all static files in /public folder.
Reply all
Reply to author
Forward
0 new messages