Jonathan
Jonathan

Reputation: 32888

Does Google Closure support multiple "packages" of Javascript files?

Say I had 1 MB of compressed Javascript, all combined into one file using Google Closure.

Now 500 KB of it is only needed for one section of the site.

So I want to combine & compress the Javascript, but separate it into two packages:

At the moment I'm just putting a comment at the top of the Javascript files like this:

/// <package name="Main" />

And using my own custom .NET application to parse them and put them in the appropriate package.

Is it possible to do all of this with Google Closure? I'd rather use an existing solution than re-invent the wheel.

Upvotes: 0

Views: 236

Answers (2)

tarmo
tarmo

Reputation: 108

wrong closure compiler does have option to compress files into multiple files

for example:

java -jar compiler.jar \

--module mod1 --js src1.js --js src2.js \

--module mod2:mod1 --js src3.js

Upvotes: 2

Jonathan
Jonathan

Reputation: 32888

After further investigation, it looks like Closure doesn't have such a feature.

I'm going to build the feature into my own custom JS combiner, which I might open source when I have the time.

Upvotes: 0

Related Questions