-
Notifications
You must be signed in to change notification settings - Fork 5
/
Gruntfile.js
74 lines (66 loc) · 1.62 KB
/
Gruntfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/*
* grunt-gulp
* https://github.com/shama/grunt-gulp
*
* Copyright (c) 2016 Kyle Robinson Young
* Licensed under the MIT license.
*/
module.exports = function(grunt) {
var coffee = require('gulp-coffee');
var concat = require('gulp-concat');
var gulp = require('gulp');
grunt.initConfig({
gulp: {
// Grunt src->dest config with gulp tasks
srcdest: {
options: {
tasks: function(stream) {
return stream.pipe(coffee());
}
},
src: ['test/fixtures/*.coffee'],
dest: 'tmp/srcdest.js',
},
// Grunt expand mapping
expand: {
expand: true,
cwd: 'test/fixtures/',
src: '*.js',
dest: 'tmp/expand',
},
// Or bypass everything while still integrating gulp
fn: function() {
var dest = gulp.dest('tmp/');
dest.on('end', function() {
grunt.log.ok('Created tmp/fn.js');
});
return gulp.src('test/fixtures/*.coffee')
.pipe(coffee())
.pipe(concat('fn.js'))
.pipe(dest);
},
},
jshint: {
all: [
'Gruntfile.js',
'tasks/*.js',
'<%= nodeunit.tests %>',
],
options: {
jshintrc: '.jshintrc',
},
},
clean: {
tmp: 'tmp',
},
nodeunit: {
tests: ['test/*_test.js'],
}
});
grunt.loadTasks('tasks');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-nodeunit');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.registerTask('test', ['clean', 'gulp', 'nodeunit']);
grunt.registerTask('default', ['jshint']);
};