Book Image

Responsive Design High Performance

Book Image

Responsive Design High Performance

Overview of this book

Table of Contents (16 chapters)
Responsive Design High Performance
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
7
Speeding Up Development with Design Concepts, Patterns, and Programs
Index

File concatenation


Combining JavaScript manually is effective, but it is quite a tedious task. So, here is a great way to make this a little easier.

As an example, if you have a JavaScript file called main.js, you can include other JavaScript file contents in the main file by using an include statement. Here is an example:

#include file="js/jquery.js"

If file concatenation has been enabled on the server, the contents of jquery.js will be inserted into the main.js file.

You can make use of a tool available from http://yui.github.io/yuicompressor/ for this. There is also Grunt or Gulp that you can use to automate both file concatenation and CSS minifying. Both of these are task runners. They allow you to automate your web development. Both are very well-supported and have plenty of documentation as well.