Book Image

CoffeeScript Application Development Cookbook

By : Mike Hatfield
Book Image

CoffeeScript Application Development Cookbook

By: Mike Hatfield

Overview of this book

Table of Contents (18 chapters)
CoffeeScript Application Development Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Preparing deployments for staging and production


In the previous section, we created and configured a Grunt file to compile our source files. In this section, we will look at extending our Grunt file to include options to prepare files for deployments to staging and production environments.

Getting ready

In this section, we will use a few Grunt NPM packages to help us prepare our deployments, including the following:

  • grunt-contrib-clean: This removes files and directories

  • grunt-contrib-copy: - This copies files and directories

  • grunt-text-replace: This replaces text found within files

Install these NPM modules with the following commands:

> npm install grunt-contrib-clean --save-dev
> npm install grunt-contrib-copy --save-dev
> npm install grunt-text-replace --save-dev

How to do it...

Let's load the copy and replace tasks in our Grunt file by adding the following lines to gruntfile.coffee:

grunt.loadNpmTasks 'grunt-contrib-clean'
grunt.loadNpmTasks 'grunt-contrib-copy'
grunt.loadNpmTasks...