Welcome to the last chapter of Mastering OpenLayers 3. In your journey to master this library, you became familiar with quite a lot of concepts of OpenLayers 3. Until now, we used a full build of the library for our various purposes. This is good for learning, but it's not very effective in cases where we'd like to deploy an application. In most of cases, you will only need a small subset of the library's capabilities. To have a firm grip on the required subset, you will learn how to compile a custom build with Closure Compiler. You will also learn a few tricks to minimize your application even better and create documentation.
In this chapter, we will cover the following topics:
As we are going to compile the library from source code, we will need the source code of OpenLayers 3 for this chapter. You can find the source code of OpenLayers 3.11.1 in the src folder of the code appendix. Alternatively, you can download the source of the most recent version from the OpenLayers 3 GitHub repository at https://github.com/openlayers/ol3/releases. For the compiling, we will use Google's Closure Compiler, which is bundled with OpenLayers 3. On the top of this, the library offers convenience tools that are tailored for this specific library. As these tools are JavaScript files, we have to use a desktop JavaScript interpreter to use them. For this task, we will install Node JS, which is based on Google Chrome's JavaScript engine (V8).