Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion How do you automatically minify your client JS files?

Received: by 10.236.173.68 with SMTP id u44mr5387187yhl.6.1323861937021;
        Wed, 14 Dec 2011 03:25:37 -0800 (PST)
X-BeenThere: express-js@googlegroups.com
Received: by 10.101.212.35 with SMTP id o35ls4862089anq.2.gmail; Wed, 14 Dec
 2011 03:25:35 -0800 (PST)
Received: by 10.236.190.200 with SMTP id e48mr14201094yhn.5.1323861935463;
        Wed, 14 Dec 2011 03:25:35 -0800 (PST)
Received: by 10.150.107.18 with SMTP id f18msybc;
        Wed, 14 Dec 2011 03:21:45 -0800 (PST)
Received: by 10.236.187.7 with SMTP id x7mr13958846yhm.7.1323861705358;
        Wed, 14 Dec 2011 03:21:45 -0800 (PST)
Received: by 10.236.187.7 with SMTP id x7mr13958843yhm.7.1323861705348;
        Wed, 14 Dec 2011 03:21:45 -0800 (PST)
Return-Path: <benleighgour...@gmail.com>
Received: from mail-yw0-f60.google.com (mail-yw0-f60.google.com [209.85.213.60])
        by gmr-mx.google.com with ESMTPS id t24si764150ybt.2.2011.12.14.03.21.45
        (version=TLSv1/SSLv3 cipher=OTHER);
        Wed, 14 Dec 2011 03:21:45 -0800 (PST)
Received-SPF: pass (google.com: domain of benleighgour...@gmail.com designates 209.85.213.60 as permitted sender) client-ip=209.85.213.60;
Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of benleighgour...@gmail.com designates 209.85.213.60 as permitted sender) smtp.mail=benleighgour...@gmail.com
Received: by yhjj72 with SMTP id j72so2008185yhj.5
        for <express-js@googlegroups.com>; Wed, 14 Dec 2011 03:21:45 -0800 (PST)
MIME-Version: 1.0
Received: by 10.236.127.166 with SMTP id d26mr3022049yhi.14.1323861705276;
 Wed, 14 Dec 2011 03:21:45 -0800 (PST)
Received: by q9g2000yqe.googlegroups.com with HTTP; Wed, 14 Dec 2011 03:21:45
 -0800 (PST)
Date: Wed, 14 Dec 2011 03:21:45 -0800 (PST)
In-Reply-To: <CAEdrcis5qThRsV2MjOJnbMgv9+HJr6dr-6Zm3cw-uWiwFBWf9A@mail.gmail.com>
References: <CAEdrcis5qThRsV2MjOJnbMgv9+HJr6dr-6Zm3cw-uWiwFBWf9A@mail.gmail.com>
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8)
 AppleWebKit/535.2 (KHTML, like Gecko) Chrome/15.0.874.121 Safari/535.2,gzip(gfe)
Message-ID: <35f5e6bc-d71a-4aa5-a7a2-5329f7c8c...@q9g2000yqe.googlegroups.com>
Subject: Re: How do you automatically minify your client JS files?
From: Ben Gourley <benleighgour...@gmail.com>
To: Express <express-js@googlegroups.com>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

I have created a middleware layer for express which compiles JS for
you at run time.
`npm install minj`
See github.com/bengourley/minj for usage.
Essentially you can just drop it in to your app.js without making any
other changes and it will just work.
For CSS minfication, if you are using stylus, there is a `compress`
option in the middleware, see: http://learnboost.github.com/stylus/docs/mid=
dleware.html
Hope this helps!
On Dec 6, 11:31=A0am, Srirangan <sriran...@gmail.com> wrote:
> Hi,
>
> For one of my projects I have split my client app into a number of JS
> files. Am using the Express framework.
>
> I'd like to automate the minification of all these client side JS files,
> without of course modifying the original sources.
>
> I don't think it should be too different to generating CSS files from LES=
S,
> SASS or Stylus sources. How do I go about it?
>
> - Sri
>
> --
> Srirangan =A0| =A0About <http://srirangan.net/about>
> GitHub<https://github.com/Srirangan>
> =A0 LinkedIn <http://www.linkedin.com/in/srirangan>
> Twitter<http://twitter.com/srirangan> =A0|
> =A0Review19 <http://review19:3000> =A0"Next generation, real-time project
> collaboration"