-
Notifications
You must be signed in to change notification settings - Fork 4
/
gruntfile.js
80 lines (73 loc) · 1.81 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
var CSS = [
'src/css/libs.css',
'src/css/style.css',
'node_modules/materialize-css/dist/css/materialize.min.css',
'node_modules/owlcarousel/owl-carousel/owl.carousel.css',
'node_modules/owlcarousel/owl-carousel/owl.theme.css',
'node_modules/font-awesome/css/font-awesome.min.css',
];
var JS = [
'node_modules/jquery/dist/jquery.min.js',
'node_modules/materialize-css/dist/js/materialize.min.js',
'node_modules/owlcarousel/owl-carousel/owl.carousel.min.js',
'src/js/ui.js'
];
module.exports = function (grunt) {
var task = grunt.task;
var file = grunt.file;
var log = grunt.log;
var verbose = grunt.verbose;
var fail = grunt.fail;
var option = grunt.option;
var config = grunt.config;
var template = grunt.template;
var _ = grunt.util._;
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
uglify: {
options: {
mangle: false
},
site: {
files: {
'resources/js/script.min.js': JS
}
}
},
cssmin: {
options: {
shorthandCompacting: false,
roundingPrecision: -1
},
site: {
files: {
'resources/css/style.min.css': CSS
}
}
},
imagemin: {
dynamic: {
files: [{
expand: true,
cwd: 'src/imgs/',
src: [
'**/*.{png,jpg,gif}'
],
dest: 'resources/imgs/'
}]
}
},
watch: {
dev_site: {
files: CSS.concat(JS),
tasks: ['cssmin:site', 'uglify:site']
}
}
});
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-imagemin');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.registerTask('default', ['cssmin:site', 'uglify:site']);
};