forked from blackbaud/stache1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gruntfile.js
119 lines (113 loc) · 3.79 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
/*jslint node: true, nomen: true, plusplus: true */
'use strict';
module.exports = function (grunt) {
var jsHintFiles = ['gruntfile.js', 'src/helpers/**/*.js'];
grunt.config.init({
sass: {
options: {
outputStyle: 'compressed',
includePaths: [
'bower_components/'
]
},
build: {
files: [{
expand: true,
cwd: 'src/sass',
src: ['*.scss'],
dest: 'src/css',
ext: '.css'
}]
}
},
copy: {
build: {
files: [
{
expand: true,
cwd: 'bower_components/zeroclipboard/dist/',
dest: 'src/img/',
src: 'ZeroClipboard.swf'
}
]
}
},
uglify: {
build: {
files: {
'src/js/stache.min.js': [
'src/js/libs/easyXDM.min.js',
'bower_components/holderjs/holder.min.js',
'bower_components/stellar/jquery.stellar.js',
'bower_components/angular-sanitize/angular-sanitize.min.js',
'src/vendor/bb-omnibar-search/js/bb-omnibar-search.js',
'src/vendor/bb-omnibar-search/js/bb-omnibar-search.templates.js',
'src/js/stache-app.js',
'src/js/stache-jquery.js',
'src/js/libs/jquery.mobile.custom.min.js',
'src/js/video.js',
'bower_components/zeroclipboard/dist/ZeroClipboard.min.js',
'src/js/stache-clipboard.js',
'src/js/prism.js',
'bower_components/angular-ui-select/dist/select.js'
]
}
}
},
jasmine_node: {
all: {
options: {
specFolders: ['tests'],
extensions: 'js',
specNameMatcher: 'spec'
},
src: ['tasks/stache.js', 'src/helpers/helpers.js']
}
},
jshint: {
options: {
jshintrc: true
},
all: jsHintFiles
},
jscs: {
options: {
config: '.jscsrc'
},
all: jsHintFiles
},
watch: {
scripts: {
files: ['src/helpers/**/*.js'],
tasks: ['jasmine_node', 'jshint', 'jscs']
}
}
});
grunt.task.loadNpmTasks('grunt-contrib-copy');
grunt.task.loadNpmTasks('grunt-contrib-jshint');
grunt.task.loadNpmTasks('grunt-contrib-uglify');
grunt.task.loadNpmTasks('grunt-contrib-watch');
grunt.task.loadNpmTasks('grunt-jasmine-node-coverage');
grunt.task.loadNpmTasks('grunt-jscs');
grunt.task.loadNpmTasks('grunt-sass');
grunt.task.registerTask('createselectscss', function () {
grunt.file.copy('bower_components/angular-ui-select/dist/select.min.css', 'bower_components/angular-ui-select/dist/select.min.scss');
});
grunt.task.registerTask('cleanselectscss', function () {
grunt.file.delete('bower_components/angular-ui-select/dist/select.min.scss');
});
grunt.task.registerTask('build', [
'createselectscss',
'sass',
'copy:build',
'uglify:build',
'cleanselectscss'
]);
grunt.task.registerTask('test', [
'jscs',
'jshint',
'build',
'jasmine_node'
]);
grunt.task.registerTask('default', 'build');
};