Summary

This chapter explained how the build system can be leveraged to produce minified and concatenated web assets. These assets can then be safely cached by web browsers while giving you the comfort of writing the client-side code in a modular way and using higher-level languages to compile to JavaScript and CSS.

The assets processing pipeline that we set up in this chapter can be illustrated using the following diagram:

Summary

The compilation plugins, sbt-less and sbt-coffee, compile the a.less module (that depends on a b.less module) into a single a.css module and the modules, a.coffee and b.coffee, into the a.js and b.js modules, respectively. Then, the concatenation plugin, sbt-rjs, concatenates the a.js and b.js modules into a single a.js module (it is worth noting that the CSS concatenation is already performed by the less compiler but that the RequireJS optimizer also processes .css files to minify them). The compression plugin, sbt-gzip, produces a compressed file for each artifact. Finally, the fingerprinting plugin, sbt-digest, produces a .md5 file that contains an MD5 hash for each asset.

The next chapter will present the programming model provided by the Play framework to manipulate streams of data. You will learn how to both receive and serve streams of data.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.117.77.158