Recipe 44Automating Static Site Deployment with Grunt

Problem

Web developers working with static sites typically use tools like FTP to transfer web pages and associated assets into production. This practice works on a small scale, but as things get more complicated, manual processes break down. A file might be left out accidentally or copied to the wrong location. In addition, practices such as asset packaging—combining multiple JavaScript files into a single, compressed file—are required to improve download speed. We want to add this process easily to an automated deployment process. We need to develop a simple workflow that’s easy to maintain yet flexible enough to extend.

Ingredients

  • Node.js[139] and npm

  • Grunt[140]

  • Our virtual machine, created ...

Get Web Development Recipes, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.