-
Notifications
You must be signed in to change notification settings - Fork 2
/
Gruntfile.js
80 lines (77 loc) · 2.39 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
module.exports = function (grunt) {
'use strict';
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
meta: {
version: '<%= pkg.version %>',
banner: '// HERMES, sweet llamas of the bahamas\n' +
'// ----------------------------------\n' +
'// v<%= pkg.version %>\n' +
'//\n' +
'// Copyright (c)<%= grunt.template.today("yyyy") %> Jason Strimpel\n' +
'// Distributed under MIT license\n'
},
jasmine : {
src : 'src/hermes.js',
options : {
specs : 'spec/**/*.js',
template : require('grunt-template-jasmine-istanbul'),
templateOptions: {
coverage: 'reports/coverage.json',
report: 'reports/coverage'
}
}
},
uglify: {
options: {
banner: "<%= meta.banner %>"
},
prod: {
src: 'src/hermes.js',
dest: 'hermes.min.js'
},
amd: {
src: 'hermes.amd.js',
dest: 'hermes.amd.min.js'
}
},
concat: {
options: {
banner: "<%= meta.banner %>"
},
dev: {
src: 'hermes.js',
dest: 'hermes.js'
},
'amd-dev': {
src: 'hermes.amd.js',
dest: 'hermes.amd.js'
}
},
jshint: {
options: {
jshintrc: '.jshintrc'
},
hermes: [ 'src/*.js' ]
},
preprocess: {
amd: {
files: {
'hermes.amd.js': 'src/hermes.amd.js'
}
},
global: {
files: {
'hermes.js': 'src/hermes.window.js'
}
}
}
});
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-jasmine');
grunt.loadNpmTasks('grunt-preprocess');
grunt.registerTask('test', ['jasmine']);
grunt.registerTask('default', ['jshint', 'jasmine', 'preprocess:amd', 'preprocess:global', 'concat:amd-dev', 'uglify:prod', 'uglify:amd', 'concat:dev']);
};