1 | "use strict";
|
2 |
|
3 |
|
4 | module.exports = function( grunt ) {
|
5 |
|
6 | grunt.initConfig({
|
7 | build: {
|
8 | normal: {
|
9 | dest: 'dist/index.js'
|
10 | }
|
11 | }
|
12 | });
|
13 |
|
14 | grunt.registerMultiTask(
|
15 | 'build',
|
16 | 'build files',
|
17 | function() {
|
18 | var dest = this.data.dest;
|
19 | var compiled;
|
20 |
|
21 | var files = ['lib/index.js'].concat( grunt.file.expand('lib/command/*.js') );
|
22 |
|
23 | compiled = files.reduce(function(compiled, filepath) {
|
24 | return compiled + grunt.file.read( filepath ) + '\n\n';
|
25 |
|
26 | }, '');
|
27 |
|
28 |
|
29 | grunt.file.write( dest, compiled );
|
30 |
|
31 |
|
32 | if ( this.errorCount ) {
|
33 | return false;
|
34 | }
|
35 |
|
36 |
|
37 | grunt.log.writeln( 'File ' + dest + ' created.' );
|
38 | }
|
39 | );
|
40 |
|
41 |
|
42 |
|
43 |
|
44 |
|
45 |
|
46 | grunt.registerTask('default', ['build']);
|
47 |
|
48 | }; |
\ | No newline at end of file |