HTML and CSS Reference
In-Depth Information
Once executed, we see a bunch of errors being listed for our main.js . The correc-
ted file is included within the code for this chapter. Once corrected, you will also no-
tice a whole slew of errors being thrown for the code in plugin.js . This is because
we used the minified code of the smooth-scroll plugin. Let us replace it with the
unminified code from the project repository at github.com/kswedberg/jquery-
smooth-scroll/blob/master/jquery.smooth-scroll.js .
Now, we get a bunch of errors all telling us we need to use the stricter comparison
operator. Let us turn this off for our current project. We can do this by opening the
project.properties file within the config folder under our build folder and
uncomment the following line that allows you to use your own options for JSHint:
#tool.jshint.opts
Change it to the following snippet:
tool.jshint.opts = maxerr=25,eqeqeq=false
Note
More options are listed on the JSHint website at jshint.com .
Our errors have disappeared!
Setting up the SHA filenames
The concatenated and minified CSS and JS filenames are set to uniquely generated
strings, which ensures a cached local copy of these files never get loaded when a
new production build is deployed to the server. By default, the number of characters
used in the filename is 7 . You can set it to a smaller or larger number by changing the
following line in project.properties within the config folder inside the build
folder:
#hash.length = 7
Search WWH ::




Custom Search