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
103
104
105
106
107
108
109
110
111
112
113
|
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
concat: {
js: {
options: {
separator: ';'
},
src: [
'libraries/jquery/dist/jquery.js',
'libraries/bootstrap/dist/js/bootstrap.js',
'libraries/typeahead.js/dist/typeahead.bundle.js',
'libraries/list.js/dist/list.js',
'libraries/leaflet-soton/resources/leaflet/dist/leaflet.js',
'libraries/leaflet-soton/resources/leaflet-markercluster/dist/leaflet.markercluster.js',
'libraries/leaflet-soton/resources/leaflet-locatecontrol/src/L.Control.Locate.js',
'libraries/leaflet-soton/resources/leaflet-hash/leaflet-hash.js',
'libraries/leaflet-soton/resources/leaflet-indoor/leaflet-indoor.js',
'libraries/leaflet-soton/resources/leaflet-route/leaflet-route.js',
'libraries/leaflet-soton/src/leaflet-soton.js',
'scripts.js'
],
dest: 'dist/scripts.js',
nonull: true
},
css: {
src: [
'libraries/bootstrap/dist/css/bootstrap.css',
'libraries/leaflet-soton/resources/leaflet/dist/leaflet.css',
'libraries/leaflet-soton/resources/leaflet-markercluster/dist/MarkerCluster.css',
'libraries/leaflet-soton/resources/leaflet-locatecontrol/src/L.Control.Locate.css',
'libraries/leaflet-soton/src/leaflet-soton.css',
'style.css'
],
dest: 'dist/css/style.css',
nonull: true
}
},
uglify: {
options: {
banner: '/*! <%= pkg.name %> <%= grunt.template.today("dd-mm-yyyy") %> */\n'
},
dist: {
files: {
'dist/scripts.js': ['<%= concat.js.dest %>']
}
}
},
cssmin: {
add_banner: {
options: {
banner: '/* My minified css file */'
},
files: {
'dist/css/style.css': ['<%= concat.css.dest %>']
}
}
},
clean: {
build: ['dist']
},
copy: {
index: {
src: 'index.html',
dest: 'dist/index.html',
nonull: true
},
data: {
src: 'libraries/leaflet-soton/data.json',
dest: 'dist/data.json',
nonull: true
},
fonts: {
src: 'libraries/bootstrap/dist/fonts/*',
dest: 'dist/fonts/',
expand: 'false',
flatten: true,
nonull: true
},
images: {
src: 'libraries/leaflet-soton/resources/images/*',
dest: 'dist/images/',
flatten: true,
expand: 'false',
nonull: true
},
logos: {
src: 'libraries/leaflet-soton/resources/images/logos/*',
dest: 'dist/images/logos/',
flatten: true,
expand: 'false',
nonull: true
},
locateimage: {
src: 'libraries/leaflet-soton/resources/leaflet-locatecontrol/src/images/*',
dest: 'dist/css/images/',
flatten: true,
expand: 'false',
nonull: true
}
}
});
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.registerTask('default', ['clean:build', 'concat', 'copy']);
grunt.registerTask('release', ['clean:build', 'concat', 'uglify', 'cssmin', 'copy']);
};
|