source: Dev/trunk/node_modules/grunt-contrib-coffee/README.md @ 532

Last change on this file since 532 was 484, checked in by hendrikvanantwerpen, 11 years ago

Commit node_modules, to make checkouts and builds more deterministic.

File size: 5.2 KB
RevLine 
[484]1# grunt-contrib-coffee [![Build Status](https://secure.travis-ci.org/gruntjs/grunt-contrib-coffee.png?branch=master)](http://travis-ci.org/gruntjs/grunt-contrib-coffee)
2
3> Compile CoffeeScript files to JavaScript.
4
5
6
7## Getting Started
8This plugin requires Grunt `~0.4.0`
9
10If you haven't used [Grunt](http://gruntjs.com/) before, be sure to check out the [Getting Started](http://gruntjs.com/getting-started) guide, as it explains how to create a [Gruntfile](http://gruntjs.com/sample-gruntfile) as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
11
12```shell
13npm install grunt-contrib-coffee --save-dev
14```
15
16Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
17
18```js
19grunt.loadNpmTasks('grunt-contrib-coffee');
20```
21
22*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](http://gruntjs.com/upgrading-from-0.3-to-0.4), but in case you can't please use [v0.3.2](https://github.com/gruntjs/grunt-contrib-coffee/tree/grunt-0.3-stable).*
23
24
25## Coffee task
26_Run this task with the `grunt coffee` command._
27
28Task targets, files and options may be specified according to the grunt [Configuring tasks](http://gruntjs.com/configuring-tasks) guide.
29### Options
30
31#### separator
32Type: `String`
33Default: linefeed
34
35Concatenated files will be joined on this string.
36
37#### bare
38Type: `boolean`
39
40Compile the JavaScript without the top-level function safety wrapper.
41
42#### join
43Type: `boolean`
44Default: `false`
45
46When compiling multiple .coffee files into a single .js file, concatenate first.
47
48#### sourceMap
49Type: `boolean`
50Default: `false`
51
52Compile 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. The concatenated CoffeeScript is written into the output directory, and becomes the target for source mapping.
53### Usage Examples
54
55```js
56coffee: {
57  compile: {
58    files: {
59      'path/to/result.js': 'path/to/source.coffee', // 1:1 compile
60      'path/to/another.js': ['path/to/sources/*.coffee', 'path/to/more/*.coffee'] // compile and concat into single file
61    }
62  },
63
64  compileBare: {
65    options: {
66      bare: true
67    },
68    files: {
69      'path/to/result.js': 'path/to/source.coffee', // 1:1 compile
70      'path/to/another.js': ['path/to/sources/*.coffee', 'path/to/more/*.coffee'] // compile and concat into single file
71    }
72  },
73
74  compileJoined: {
75    options: {
76      join: true
77    },
78    files: {
79      'path/to/result.js': 'path/to/source.coffee', // 1:1 compile, identical output to join = false
80      'path/to/another.js': ['path/to/sources/*.coffee', 'path/to/more/*.coffee'] // concat then compile into single file
81    }
82  },
83
84  compileWithMaps: {
85    options: {
86      sourceMap: true
87    },
88    files: {
89      'path/to/result.js': 'path/to/source.coffee', // 1:1 compile
90      'path/to/another.js': ['path/to/sources/*.coffee', 'path/to/more/*.coffee'] // concat then compile into single file
91    }
92  },
93
94  glob_to_multiple: {
95    expand: true,
96    flatten: true,
97    cwd: 'path/to',
98    src: ['*.coffee'],
99    dest: 'path/to/dest/',
100    ext: '.js'
101  }
102}
103```
104
105For 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](http://gruntjs.com/configuring-tasks).
106
107## Release History
108
109 * 2013-04-19   v0.7.0   Place Sourcemaps at bottom of file Change extension for Sourcemaps from .maps to .js.map
110 * 2013-04-18   v0.6.7   Improved error reporting
111 * 2013-04-08   v0.6.6   Fix regression with single-file compilation.
112 * 2013-04-05   v0.6.5   Improved error reporting
113 * 2013-03-22   v0.6.4   Sourcemap support
114 * 2013-03-19   v0.6.3   Increase error logging verbosity.
115 * 2013-03-18   v0.6.2   Bump to CoffeeScript 1.6.2
116 * 2013-03-18   v0.6.1   Support `join` option
117 * 2013-03-06   v0.6.0   Bump to CoffeeScript 1.6 Support literate CoffeeScript extension coffee.md
118 * 2013-02-25   v0.5.0   Bump to CoffeeScript 1.5 Support literate CoffeeScript (.litcoffee)
119 * 2013-02-15   v0.4.0   First official release for Grunt 0.4.0.
120 * 2013-01-23   v0.4.0rc7   Updating grunt/gruntplugin dependencies to rc7. Changing in-development grunt/gruntplugin dependency versions from tilde version ranges to specific versions. Bump coffeescript dependency to 1.4.
121 * 2013-01-09   v0.4.0rc5   Updating to work with grunt v0.4.0rc5. Switching to this.filesSrc api.
122 * 2012-12-15   v0.4.0a   Conversion to grunt v0.4 conventions. Remove experimental destination wildcards.
123 * 2012-10-12   v0.3.2   Rename grunt-contrib-lib dep to grunt-lib-contrib.
124 * 2012-09-25   v0.3.1   Don't fail when there are no files.
125 * 2012-09-24   v0.3.0   Global options depreciated.
126 * 2012-09-10   v0.2.0   Refactored from grunt-contrib into individual repo.
127
128---
129
130Task submitted by [Eric Woroshow](http://ericw.ca/)
131
132*This file was generated on Fri Apr 19 2013 09:49:08.*
Note: See TracBrowser for help on using the repository browser.