forked from LeoColomb/flag-sprites
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
81 lines (78 loc) · 2.08 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';
// Project configuration
grunt.initConfig({
// Metadata
pkg: grunt.file.readJSON('bower.json'),
banner: '/*!\n * <%= pkg.name %> v<%= pkg.version %>\n' +
'<%= pkg.homepage ? " * " + pkg.homepage + "\\n" : "" %>' +
' * Copyright <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>\n' +
' * Licensed under <%= props.license %>\n */',
// Task configuration
less: {
dev: {
src: 'less/<%= pkg.name %>.less',
dest: 'dist/css/<%= pkg.name %>.css',
options: {
sourceMap: true,
sourceMapFilename: 'dist/css/<%= pkg.name %>.css.map',
sourceMapURL: '<%= pkg.name %>.css.map'
}
},
dist: {
src: 'less/<%= pkg.name %>.less',
dest: 'dist/css/<%= pkg.name %>.min.css',
options: {
cleancss: true,
report: 'min',
strictUnits: true,
strictMath: true,
strictImports: true
}
}
},
sprite: {
flags: {
src: ['flags/*.png'],
destImg: 'dist/img/flags.png',
engine: 'pngsmith',
algorithm: 'top-down',
destCSS: 'less/flags.less',
cssFormat: 'less',
cssTemplate: 'flags.less.mustache'
}
},
jshint: {
options: {
node: true,
curly: true,
eqeqeq: true,
immed: true,
latedef: true,
newcap: true,
noarg: true,
sub: true,
undef: true,
unused: true,
eqnull: true,
boss: true
},
gruntfile: {
src: 'gruntfile.js'
}
},
watch: {
less: {
files: '<%= less.dev.src %>',
tasks: ['less']
}
}
});
// These plugins provide necessary tasks
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-spritesmith');
grunt.loadNpmTasks('grunt-contrib-imagemin');
grunt.loadNpmTasks('grunt-contrib-watch');
// Default task
grunt.registerTask('default', ['jshint', 'nodeunit']);
};