-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
148 lines (134 loc) · 3.78 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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
var fs = require("fs");
module.exports = function(grunt) {
'use strict';
// Project configuration.
grunt.initConfig({
// Copy FontAwesome files to the fonts/ directory
copy: {
fonts: {
src: 'bower_components/font-awesome/fonts/**',
dest: 'public/fonts/',
flatten: true,
expand: true
}
},
// Transpile LESS
less: {
options: {
sourceMap: true,
paths: ['bower_components/bootstrap/less']
},
prod: {
options: {
compress: true,
cleancss: true
},
files: {
"public/dist/style.css": "src/less/style.less"
}
}
},
// Run our JavaScript through JSHint
jshint: {
js: {
src: ['src/js/**.js']
}
},
// Use Uglify to bundle up a pym file for the home page
uglify: {
options: {
sourceMap: true
},
prod: {
files: {
'public/dist/scripts.js': [
'bower_components/jquery/dist/jquery.js',
'bower_components/twentytwenty/js/jquery.twentytwenty.js',
'bower_components/twentytwenty/js/jquery.event.move.js',
'src/js/main.js'
]
}
}
},
// Lint our Bootstrap usage
bootlint: {
options: {
relaxerror: ['W005']
},
files: ['public/**.php','public/**.inc'],
},
// Watch for changes in LESS and JavaScript files,
// relint/retranspile when a file changes
watch: {
options: {
livereload: true
},
markup: {
files: ['public/*.php','public/includes/*.inc']
},
scripts: {
files: ['src/js/*.js'],
tasks: ['jshint', 'uglify']
},
styles: {
files: ['src/less/**/*.less'],
tasks: ['less']
}
},
// stage path needs to be set
ftpush: {
stage: {
auth: {
host: 'host.coxmediagroup.com',
port: 21,
authKey: 'cmg'
},
src: 'public',
dest: '/stage_aas/projects/then-and-now/memorial-day-flooding-2015/',
exclusions: ['dist/tmp','Thumbs.db','.DS_Store'],
simple: false,
useList: false
},
// prod path will need to change
prod: {
auth: {
host: 'host.coxmediagroup.com',
port: 21,
authKey: 'cmg'
},
src: 'public',
dest: '/prod_aas/projects/then-and-now/memorial-day-flooding-2015/',
exclusions: ['dist/tmp','Thumbs.db','.DS_Store'],
simple: false,
useList: false
}
},
// be sure to set publishing paths
slack: {
options: {
endpoint: fs.readFileSync('.slack', {encoding: 'utf8'}),
channel: '#bakery',
username: 'gruntbot',
icon_url: 'http://vermilion1.github.io/presentations/grunt/images/grunt-logo.png'
},
stage: {
text: 'Project published to stage: http://stage.host.coxmediagroup.com/aas/projects/then-and-now/memorial-day-flooding-2015/ {{message}}'
},
prod: {
text: 'Project published to prod: http://projects.statesman.com/then-and-now/memorial-day-flooding-2015/ {{message}}'
}
}
});
// Load the task plugins
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-ftpush');
grunt.loadNpmTasks('grunt-slack-hook');
grunt.loadNpmTasks('grunt-bootlint');
grunt.registerTask('default', ['copy', 'less', 'jshint','bootlint','uglify']);
grunt.registerTask('stage', ['default','ftpush:stage','slack:stage']);
grunt.registerTask('prod', ['default','ftpush:prod','slack:prod']);
};