-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
120 lines (108 loc) · 2.33 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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
// wrapper function
module.exports = function(grunt){
// load all our Grunt plugins
require('load-grunt-tasks')(grunt);
var jpegRecompress = require('imagemin-jpeg-recompress');
grunt.loadNpmTasks('grunt-ftpush');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-git');
grunt.loadNpmTasks('grunt-deployments');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-imagemin');
grunt.loadNpmTasks('grunt-criticalcss');
grunt.initConfig({
pkg:grunt.file.readJSON('package.json'),
// task configuration goes here
jshint:{
options:{
'node':true,
'esnext':true,
'curly':false,
'smarttabs':false,
'indent':2,
'quotmark':'single'
},
all:['Gruntfile.js','app/js/script.js']
},
ftpush:{
build:{
auth:{
host:'',
port:21,
authKey:'key1' // found in .ftppass
},
// ============= Change "projectdirectory"
// src:'/Applications/AMPPS/www/projectdirectory/',
// dest:'/projectdirectory.com/',
exclusions:['*/.DS_Store','.DS_Store','Archive.zip','.git','Gruntfile.js','node_modules','*.sql'],
simple:true,
useList:true
}
},
less:{
production: {
options:{
paths:['app/css'],
report:'gzip'
},
files:{
'app/css/styles.css':'app/css/styles.less'
}
}
},
cssmin: {
add_banner: {
options: {
banner: '/* Author: John Gibby @thatgibbyguy || Quinton Jason @quintonjasonjr || for @Xdesigninc #teamXdesign */'
},
files: {
'app/css/styles.css': ['app/css/styles.css']
}
}
},
imagemin:{
dynamic:{
files:[{
expand:true,
cwd: 'app/',
src: ['**/*.{png,jpg,gif}'],
dest: 'app/'
}]
}
},
uglify: {
my_target: {
options: {
mangle:false,
report:'gzip'
},
files: {
'app/js/script.min.js': ['app/js/script.js']
}
}
},
watch: {
scripts:{
files:'app/js/script.js',
tasks:['uglify'],
options:{
livereload:true
}
},
css:{
files:'app/css/styles.less',
tasks:['less'],
options:{
livereload:true
}
},
commit:{
files:['.git/logs/HEAD'],
tasks:['imagemin']
}
}
});
// define the default task that executes when we run 'grunt' from inside the project
grunt.registerTask('default', ['watch']);
};