- MooTools 1.2 Beginner's Guide
- Jacob Gube Garrick Cheung
- 320字
- 2025-03-31 06:30:55
Time for action—exploring the MooTools Core Builder
To explore the MooTools Core Builder, perform the following steps:
- Go to the MooTools Core Builder webpage by navigating to: http://mootools.net/core.
- Notice that the MooTools Core is subdivided into 7 sections. Each section has 2 to 6 JavaScript libraries associated with it. Take the time to read each description to help you get a better understanding of what each file does.
- Click on the Event component. Notice that several other components were automatically selected for you. This ensures that you also include the dependency files that are required for the Event component to run.
- Notice the different compression types. YUI Compressor is selected by default.

What just happened?
We just covered how to roll your own MooTools Core file and learned about the MooTools Core structure by exploring the MooTools Core builder. Once you're comfortable with how MooTools works, you should use the MooTools Core Builder to create a MooTools Core file that includes only the components you need.
Have a go hero — — explore the MooTools Core Builder output
Try to download the previous example with the Events component checked. After downloading your own version of the MooTools Core, open the file in your favorite text editor. Also open the MooTools Core file that you downloaded earlier. Notice that the one you just downloaded is significantly shorter; that's because you only downloaded the Events component and its dependency files.

The entire uncompressed MooTools Core is close to 4,000 lines long (and has a file size of 96 KB).

In comparison, the Core Builder output where only Events and its dependencies are included is just a little over 1,000 lines of code (and weighing only 24 KB).