-
Notifications
You must be signed in to change notification settings - Fork 43
/
Gruntfile.js
58 lines (50 loc) · 1.45 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
module.exports = function (grunt) {
'use strict';
// Project config.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
copy: {
main: {
expand: true,
filter: 'isFile',
cwd: 'src/',
src: 'qwerty-hancock.js',
dest: 'dist/'
}
},
karma: {
unit: {
configFile: 'karma-conf.js'
}
},
jasmine_node: {
options: {
forceExit: true,
match: '.',
matchall: false,
extensions: 'js',
specNameMatcher: 'spec'
},
spec: ['tests/qh-node-spec']
},
uglify: {
dist: {
files: {
'dist/<%= pkg.name %>.min.js': ['src/<%= pkg.name %>.js']
}
},
options: {
banner: '/* <%= pkg.title %> <%= pkg.version %> (c) 2012-<%= grunt.template.today("yy") %> Stuart Memo */\n'
}
},
});
// Load plugins.
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-karma');
grunt.loadNpmTasks('grunt-jasmine-node');
// Tasks.
grunt.registerTask('default', ['uglify']);
grunt.registerTask('build', ['copy', 'uglify']);
grunt.registerTask('test', ['jasmine_node:spec', 'karma']);
};