HTML and CSS Reference
In-Depth Information
Chapter 7. Automate Deployment With
the Build Script
We are ready to deploy our site! But before we do that, we should ensure we minimize
all our scripts and optimize the images, so that these pages load as quickly as pos-
sible anywhere in the world. We can automate these tasks by executing a script on
the command line. Let us look at the options we have.
The build script
Once you are done with your project, you would like to generate files that strip com-
ments and are optimized for loading quickly. There are software build systems that
are typically used in software projects with similar goals. HTML5 Boilerplate's build
scripts provide tasks scoped to what a typical web development project would need.
The script should be used only after you have confirmed your project is ready for
deployment and it has been well tested. The build script merely automates the pro-
cess of removing comments, optimizing files, and making sure the files are production
There are currently two kinds of build scripts that are actively maintained by HTML5
Boilerplate contributors; these are explored in the following section.
Ant build script
The Ant build script is a set of files that work on top of the Apache Ant build system
( ) that has been available since the early days of HTML5 Boiler-
plate. It offers a variety of options, described as follows:
• Publishes files to test, development, and production environments
• Checks syntax and code quality of your script files with JSHint or JSLint ,
or your stylesheets with CSSLint
• Concatenates and minifies all your JavaScript files into a single file and
updates the HTML pages with reference to this new file
• Cleans up and tidies HTML markup by removing comments, whitespaces,
and compressing inline styles and scripts
Search WWH ::

Custom Search