HTML and CSS Reference
In-Depth Information
• Concatenates and minifies all your stylesheets and updates the HTML
pages with reference to the new file instead of multiple CSS files
• Compiles style preprocessor files such as Less or Sass into the resulting
CSS stylesheets and updates references in HTML pages
• Optimizes PNG and JPEG images within the img folder using OptiPNG
from
and
JPEGTran
from
optipng.sourceforge.net/
jpegclub.org/jpegtran/ respectively
• Builds documentation from your scripts using JSDoc3 from git-
hub.com/jsdoc3/jsdoc
Node build script
A new build script that builds on top of Node, found at nodejs.org/ , is under active
development. While it is not out for production use yet, it offers a lot of tasks that are
similar to the Ant build script with some new features described as follows:
• Concatenates and minifies all your JavaScript files into a single file and
updates the HTML pages with reference to this new file
• Concatenates and minifies all your stylesheets and update the HTML
pages with reference to the new file instead of multiple CSS files
• Cleans up and tidy HTML markup by removing comments, whitespaces,
and compressing inline styles and scripts
• Optimizes PNG and JPEG images within the img folder using OptiPNG
and JPEGTran respectively
Watch the project files for changes, and automatically run the build script and reload
open pages in browsers when they do.
Which build script to use?
Depending on what platforms you are comfortable with, you can choose one over
the other. Both the build scripts are stable enough to use to deploy your production
files, so your choice is down to what you are most comfortable using.
If you already have Ant installed, the Ant build script might be an obvious choice. If
you find yourself using Node frequently or using it in your projects, then the Node
build script could be a good start. In this chapter, we will look at using both, so you
can become comfortable with either of them.
Search WWH ::




Custom Search