forked from agrc/gis.utah.gov
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntFile.js
80 lines (78 loc) · 2.55 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({
pkg: grunt.file.readJSON('package.json'),
imagemin: {
options: {
optimizationLevel: 3
},
images: {
files: [{
expand: true, // Enable dynamic expansion
cwd: 'images/', // Src matches are relative to this path
src: ['**/*.{png,jpg,jpeg,gif,svg}'],
dest: 'images/' // Destination path prefix
}]
},
agol: {
files: [{
expand: true,
cwd: 'agol/',
src: ['**/*.{png,jpg,jpeg,gif}'],
dest: 'agol/'
}]
},
downloads: {
files: [{
expand: true, // Enable dynamic expansion
cwd: 'downloads/', // Src matches are relative to this path
src: ['**/*.{png,jpg,jpeg,gif}'],
dest: 'downloads/' // Destination path prefix
}]
},
all: {
files: [{
expand: true,
cwd: './',
src: ['**/*.{png,jpg,jpeg,gif}'],
dest: './'
}]
}
},
uglify: {
options: {
preserveComments: false,
compress: {
drop_console: true,
passes: 10,
dead_code: true
}
},
list: {
src: ['node_modules/list.js/dist/list.min.js', 'js/source/list.js'],
dest: 'js/dist/list.min.js'
},
quad: {
src: ['node_modules/list.js/dist/list.min.js', 'js/source/quad.js'],
dest: 'js/dist/quad.min.js'
},
search: {
src: ['node_modules/mustache/mustache.min.js', 'js/source/search.js'],
dest: 'js/dist/search.min.js'
},
viewcounter: {
src: 'js/source/view-counter.js',
dest: 'js/dist/view-counter.min.js'
}
}
});
// Dependencies
grunt.loadNpmTasks('grunt-contrib-imagemin');
grunt.loadNpmTasks('grunt-contrib-uglify');
// use this task if you are running this from user.github.io or localhost:4444
grunt.registerTask('default', [
'imagemin:all',
'uglify'
]);
};