This repository has been archived by the owner on Aug 2, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Gruntfile.js
85 lines (78 loc) · 1.85 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
module.exports = function (grunt) {
'use strict';
require('time-grunt')(grunt);
require('jit-grunt')(grunt);
var config = {
src: 'src',
dist: 'dist'
};
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
config: config,
cssmin: {
dist: {
files: {
'<%= config.dist %>/joindin.min.css': ['<%= config.src %>/joindin.css']
}
}
},
uglify: {
options: {
banner: '/*! JoindIn.js <%= pkg.version %> | Aurelio De Rosa (@AurelioDeRosa) | MIT/GPL-3.0 Licensed */',
sourceMap: true
},
dist: {
files: {
'<%= config.dist %>/joindin.min.js': ['<%= config.src %>/joindin.js']
}
}
},
jshint: {
files: ['Gruntfile.js', 'src/**/*.js'],
options: {
jshintrc: '.jshintrc',
force: true,
reporter: require('jshint-stylish')
}
},
jscs: {
src: 'src/**/*.js',
options: {
config: '.jscsrc',
force: true,
fix: true
}
},
watch: {
files: ['<%= jshint.files %>'],
tasks: ['jshint', 'jscs']
},
compare_size: {
options: {
cache: '.sizecache.json',
compress: {
gz: function( fileContents ) {
return require('gzip-js').zip(fileContents, {}).length;
}
}
},
files: [
'dist/joindin.min.js',
'dist/joindin.min.css'
]
}
});
grunt.registerTask('lint', [
'jshint',
'jscs'
]);
grunt.registerTask('build', [
'uglify',
'cssmin',
'compare_size'
]);
grunt.registerTask('default', [
'lint',
'build'
]);
};