-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathGruntfile.js
83 lines (77 loc) · 2.09 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
module.exports = function(grunt) {
grunt.initConfig({
//Compile LESS files
less: {
compile: {
options: {
// These paths are searched when trying to resolve @import in less file
paths: [
'site_raw/_includes/less'
]
},
files: {
'site_raw/_includes/css/main.css': 'site_raw/_includes/less/main.less'
}
}
},
//Watch LESS files and recompile on change
watch: {
styles: {
files: [
'site_raw/_includes/less/*'
],
tasks: 'less'
}
},
//Compress Javascript files
uglify: {
my_target: {
files: [{
expand: true,
cwd: '_site_generated/assets/',
src: '**/*.js',
dest: './_site_generated/assets/'
}]
}
},
//Compress CSS files
cssmin: {
my_target: {
files: [{
expand: true,
cwd: '_site_generated/assets/css/',
src: ['*.css', '!*.min.css'],
dest: '_site_generated/assets/css/',
ext: '.css'
}]
}
},
//Run test suite
karma: {
unit: {
options: {
frameworks: ['jasmine'],
singleRun: false,
browsers: ['Chrome'],
files: [
'site_raw/_includes/bower_components/jquery/jquery.js',
'site_raw/_includes/bower_components/underscore/underscore.js',
'site_raw/_includes/bower_components/angular/angular.js',
'site_raw/_includes/bower_components/angular-mocks/angular-mocks.js',
'tests/conf/test_setup.js',
'site_raw/_includes/js/services/Metadata.js',
'tests/*.js'
]
}
}
}
});
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-karma');
grunt.registerTask('styles', ['less','watch']);
grunt.registerTask('compress', ['uglify', 'cssmin']);
grunt.registerTask('test', ['karma']);
}