1

Packaging:

Taking file1.js and file2.js and combined them together to make file3.js

Minification:

Using things like JsMin or YUICompressor

Auto-Versioning:

URL has /scripts/file2.js?v=123456

1 Answer 1

1

I use the JavaScript Compressorator. See my blog post which explains why I like it.

EDIT: I work primarily in SharePoint Designer, so my methods may not match yours. I'm more likely to do this to add my scripts to pages, whether the master page, page layouts, or individual aspx pages.

Yes, I would always use the minified versions in a "production" environment (where I didn't want to do any debugging).

The ?v= thing is sometimes required if you have overzealous caching going on in your environment. If you use unique names for your script files, then it's probably not necessary.

2
  • There are lots of compressors out there. Just wondering what technique you use to include it in SharePoint solutions. Do you manually include the min versions or do you have it going as a build action? Commented Aug 23, 2011 at 0:57
  • Shane: I added some edits above to explain my approaches more fully. Commented Aug 24, 2011 at 13:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.