Roll your own packed MochiKit file
After your development is completed using the full MochiKit.js file, you want to replace MochiKit.js with a packed version containing the smallest number of modules required by your app. Start by replacing your MochiKit.js script line with only the modules you absolutely need:
- <script src="mochikit/MochiKit/MochiKit.js" type="text/javascript"> + <script src="mochikit/MochiKit/Base.js" type="text/javascript"> + <script src="mochikit/MochiKit/Async.js" type="text/javascript"> + <script src="mochikit/MochiKit/DOM.js" type="text/javascript"> + <script src="mochikit/MochiKit/Style.js" type="text/javascript"> + <script src="mochikit/MochiKit/Signal.js" type="text/javascript">
After you've tested and whittled it down as far as you can, create your customized packed file as so:
# cd mochikit # scripts/pack.py "Base" "Async" "DOM" "Style" "Signal" >../MochiKit4MyApp.js # cd .. # chmod 604 MochiKit4MyApp.js
and replace all your MochiKit script lines with the single line:
+ <script src="MochiKit4MyApp.js" type="text/javascript">
Finally, retest and release!
You'll need the Java Runtime Environment installed on your system (and the java command in your PATH), in addition to Python, to run scripts/pack.py.
