looker/grunt-contrib-coffee

Name: grunt-contrib-coffee

Owner: looker

Description: Compile CoffeeScript files to JavaScript.

Created: 2014-09-24 19:50:38.0

Updated: 2014-09-24 19:55:39.0

Pushed: 2014-09-24 19:55:39.0

Homepage: http://gruntjs.com/

Size: 220

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

grunt-contrib-coffee v0.11.1 Build Status: Linux

Compile CoffeeScript files to JavaScript.

Getting Started

This plugin requires Grunt ~0.4.0

If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

install grunt-contrib-coffee --save-dev

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

t.loadNpmTasks('grunt-contrib-coffee');

This plugin was designed to work with Grunt 0.4.x. If you're still using grunt v0.3.x it's strongly recommended that you upgrade, but in case you can't please use v0.3.2.

Coffee task

Run this task with the grunt coffee command.

Task targets, files and options may be specified according to the grunt Configuring tasks guide.

Options
separator

Type: String Default: linefeed

Concatenated files will be joined on this string.

bare

Type: boolean

Compile the JavaScript without the top-level function safety wrapper.

join

Type: boolean Default: false

When compiling multiple .coffee files into a single .js file, concatenate first.

sourceMap

Type: boolean Default: false

Compile JavaScript and create a .map file linking it to the CoffeeScript source. When compiling multiple .coffee files to a single .js file, concatenation occurs as though the 'join' option is enabled

sourceMapDir

Type: String Default: (same path as your compiled js files)

Generated source map files will be created here.

joinExt

Type: String Default: '.src.coffee'

Resulting extension when joining multiple CoffeeScript files.

Usage Examples
ee: {
mpile: {
files: {
  'path/to/result.js': 'path/to/source.coffee', // 1:1 compile
  'path/to/another.js': ['path/to/sources/*.coffee', 'path/to/more/*.coffee'] // compile and concat into single file
}


mpileBare: {
options: {
  bare: true
},
files: {
  'path/to/result.js': 'path/to/source.coffee', // 1:1 compile
  'path/to/another.js': ['path/to/sources/*.coffee', 'path/to/more/*.coffee'] // compile and concat into single file
}


mpileJoined: {
options: {
  join: true
},
files: {
  'path/to/result.js': 'path/to/source.coffee', // 1:1 compile, identical output to join = false
  'path/to/another.js': ['path/to/sources/*.coffee', 'path/to/more/*.coffee'] // concat then compile into single file
}


mpileWithMaps: {
options: {
  sourceMap: true
},
files: {
  'path/to/result.js': 'path/to/source.coffee', // 1:1 compile
  'path/to/another.js': ['path/to/sources/*.coffee', 'path/to/more/*.coffee'] // concat then compile into single file
}


mpileWithMapsDir: {
options: {
  sourceMap: true,
  sourceMapDir: 'path/to/maps/' // source map files will be created here
},
files: {
  'path/to/result.js': 'path/to/source.coffee'
}


ob_to_multiple: {
expand: true,
flatten: true,
cwd: 'path/to',
src: ['*.coffee'],
dest: 'path/to/dest/',
ext: '.js'



For more examples on how to use the expand API to manipulate the default dynamic path construction in the glob_to_multiple examples, see “Building the files object dynamically” in the grunt wiki entry Configuring Tasks.

Release History

Task submitted by Eric Woroshow

This file was generated on Fri Aug 15 2014 11:06:42.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.