source: Dev/trunk/node_modules/grunt-contrib-coffee/docs/coffee-examples.md @ 529

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

Commit node_modules, to make checkouts and builds more deterministic.

File size: 1.5 KB
Line 
1# Usage Examples
2
3```js
4coffee: {
5  compile: {
6    files: {
7      'path/to/result.js': 'path/to/source.coffee', // 1:1 compile
8      'path/to/another.js': ['path/to/sources/*.coffee', 'path/to/more/*.coffee'] // compile and concat into single file
9    }
10  },
11
12  compileBare: {
13    options: {
14      bare: true
15    },
16    files: {
17      'path/to/result.js': 'path/to/source.coffee', // 1:1 compile
18      'path/to/another.js': ['path/to/sources/*.coffee', 'path/to/more/*.coffee'] // compile and concat into single file
19    }
20  },
21
22  compileJoined: {
23    options: {
24      join: true
25    },
26    files: {
27      'path/to/result.js': 'path/to/source.coffee', // 1:1 compile, identical output to join = false
28      'path/to/another.js': ['path/to/sources/*.coffee', 'path/to/more/*.coffee'] // concat then compile into single file
29    }
30  },
31
32  compileWithMaps: {
33    options: {
34      sourceMap: true
35    },
36    files: {
37      'path/to/result.js': 'path/to/source.coffee', // 1:1 compile
38      'path/to/another.js': ['path/to/sources/*.coffee', 'path/to/more/*.coffee'] // concat then compile into single file
39    }
40  },
41
42  glob_to_multiple: {
43    expand: true,
44    flatten: true,
45    cwd: 'path/to',
46    src: ['*.coffee'],
47    dest: 'path/to/dest/',
48    ext: '.js'
49  }
50}
51```
52
53For 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).
Note: See TracBrowser for help on using the repository browser.