-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathGruntfile.js
102 lines (91 loc) · 3.01 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
/*global module:false*/
module.exports = function(grunt) {
require('time-grunt')(grunt);
var pkg = grunt.file.readJSON('package.json');
// Project configuration.
grunt.initConfig({
pkg: pkg,
banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' +
'<%= grunt.template.today("yyyy-mm-dd") %>\n' +
'<%= pkg.homepage ? "* " + pkg.homepage + "\\n" : "" %>' +
'* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author %>;' +
' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */\n',
compass: {
options: {
basePath: 'public/'
},
dist: {
options: {
environment: 'production',
outputStyle: 'compressed',
force: true
}
},
dev: {
options: {
environment: 'development',
outputStyle: 'expanded'
}
}
},
concat: {
options: {
stripBanners: true
},
dist: {
src: [
"public/js/core.js",
"public/js/leaflet-providers.js",
"public/js/Google.js",
"public/js/config.js",
"public/js/my_position.js",
"public/js/markers.js",
"public/js/refresh.js",
"public/js/fuzzy.js",
"public/js/search.js",
"public/js/main.js"
],
dest: 'public/js/build/' + pkg.name + '.js'
}
},
jshint: {
all: [
'Gruntfile.js',
'public/js/**/*.js',
],
options: {
ignores: [
'public/**/*.min.js',
'public/js/build/*.js',
'public/js/leaflet-providers.js'
],
jshintrc: true
},
gruntfile: {
src: 'Gruntfile.js'
}
},
uglify: {
dist: {
src: '<%= concat.dist.dest %>',
dest: 'public/js/build/' + pkg.name + '.min.js'
}
},
processhtml: {
options: {
data: {
version: pkg.version,
buildNotice: '<!--\n\tIMPORTANT! This file is generated by grunt:build.\n\tDo not edit this file. All changes will be\n\toverwritten by the next build.\n\tYou should edit index-dev.html instead.\n-->'
}
},
dist: {
files: {
'public/index.html': ['public/index-dev.html']
}
}
}
});
// autoload tasks
require('load-grunt-tasks')(grunt);
grunt.registerTask('build', ['jshint', 'concat:dist', 'uglify:dist', 'compass:dist', 'processhtml:dist']);
};