-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgruntfile.js
More file actions
81 lines (78 loc) · 2.26 KB
/
gruntfile.js
File metadata and controls
81 lines (78 loc) · 2.26 KB
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
/*
Inspired by this article: http://mattwatson.codes/compile-scss-javascript-grunt/
*/
module.exports = function (grunt) {
"use strict";
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
concat: {
options: {
separator: '\r\n'
},
site: {
src: ['javascripts/site/*.js'],
dest: 'build.site.js'
},
cms: {
src: ['javascripts/cms/*.js'],
dest: 'build.cms.js'
}
},
uglify: {
options: {
banner: '/*! <%= pkg.name %> <%= grunt.template.today("dd-mm-yyyy") %> */\n'
},
dist: {
files: {
'../cloudcontrol/www/js/cms.js': ['<%= concat.cms.dest %>'],
'../cloudcontrol/www/js/site.js': ['<%= concat.site.dest %>']
}
}
},
jshint: {
files: [
'gruntfile.js',
'javascripts/cms/*.js',
'!javascripts/cms/*.min.js',
'javascripts/site/*.js',
'!javascripts/site/*.min.js'
],
options: {
globals: {
jQuery: true,
console: true,
module: true
}
}
},
compass: {
dist: {
options: {
sassDir: 'sass',
cssDir: '../cloudcontrol/www/css',
environment: 'development',
outputStyle: 'compressed'
}
}
},
watch: {
styles: {
files: ['sass/**/*.*', 'sass/*.*'],
tasks: ['css']
},
scripts: {
files: ['<%= jshint.files %>'],
tasks: ['js']
}
}
});
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-compass');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.registerTask('default', ['concat', 'uglify', 'jshint', 'compass', 'watch']);
grunt.registerTask('js', ['concat', 'uglify', 'jshint']);
grunt.registerTask('css', ['compass']);
grunt.registerTask('build', ['concat', 'uglify', 'jshint', 'compass']);
};