This repository has been archived by the owner on Jun 23, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
82 lines (78 loc) · 2.33 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
75
76
77
78
79
80
81
82
module.exports = function (grunt) {
'use strict';
var pjson = grunt.file.readJSON('package.json');
var _ = require('lodash');
_.filter(_.keys(pjson.devDependencies), function (key) {
return (/^grunt-/).test(key) && key !== 'grunt-cli';
}).forEach(grunt.loadNpmTasks);
grunt.initConfig({
benchmark: {
all: {
// Skip sub folders, so I can keep helpers around.
src: ['perf/*.js'],
dest: 'perf/samples.csv'
},
options: {
// This can also be set inside specific tests.
displayResults: true
}
},
concat: {
options: {
separator: ';'
},
dist: {
src: ['src/**/*.js'],
dest: 'dist/<%= pkg.name %>.js'
}
},
connect: {
server: {
options: {
port: 8008,
base: '.'
}
}
},
jshint: {
files: ['Gruntfile.js', 'src/**/*.js', 'test/**/*.js'],
options: {
jshintrc: '.jshintrc'
}
},
mochaTest: {
test: {
options: {
reporter: 'spec'
},
src: [
'test/*-node.js'
]
}
},
'mocha_phantomjs': {
all: ['test/**/*.html']
},
pkg: pjson,
uglify: {
options: {
banner: [
'/**',
' * @license',
' * <%= pkg.name %> <%= pkg.version %> <%= pkg.licenses[0].url %>',
' * Build time: <%= grunt.template.today("yyyy-mm-ddTHH:mm:ss") %>',
' * Fork of: dojo/aspect.js 1.8.3 http://dojotoolkit.org/license',
' */\n;'
].join('\n')
},
dist: {
files: {
'dist/<%= pkg.name %>.min.js': ['<%= concat.dist.dest %>']
}
}
}
});
grunt.registerTask('perf', ['benchmark:all']);
grunt.registerTask('test', ['jshint', 'mocha_phantomjs', 'mochaTest']);
grunt.registerTask('dist', ['concat', 'uglify', 'test']);
};