UNPKG

1.23 kBJavaScriptView Raw
1"use strict";
2
3
4module.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 // Write concatenated source to file
29 grunt.file.write( dest, compiled );
30
31 // Fail task if errors were logged.
32 if ( this.errorCount ) {
33 return false;
34 }
35
36 // Otherwise, print a success message.
37 grunt.log.writeln( 'File ' + dest + ' created.' );
38 }
39 );
40
41 // grunt.loadNpmTasks('grunt-contrib-jshint');
42 // grunt.loadNpmTasks("grunt-mocha");
43 // grunt.loadNpmTasks('grunt-contrib-uglify');
44
45 // grunt.registerTask('default', ['build', 'jshint', /* 'mocha' */, 'uglify']);
46 grunt.registerTask('default', ['build']);
47
48};
\No newline at end of file