Compile the template created in Chapter 4, Architecting Your Mobile App, and eventually compress it using pistachio. Follow the given steps:
Open your command-line tool and move to the
tpl
folders created in Chapter 4, Architecting Your Mobile App.Type the pistachio command and specify the name of the output file and the file to compile.
$ pistachio --out=splash-tpl.js splash-tpl.html
Create a build file named, for instance,
template-build.js
, for the existing template to use when compressing the file with UglifyJS2, specifying the template name and the desired output filename.({ name: 'splash-tpl', out: 'splash-built.js' })
Run the r.js node module from the command-line tool.
$ r.js -o template-build.js
Open the file and check its syntax and size.