-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
128 lines (111 loc) · 4.04 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
module.exports = function(grunt) {
grunt.initConfig({
// https://github.com/gruntjs/grunt-contrib-clean
clean : ['assets/styles/*', '!assets/**/.gitkeep', 'assets/scripts/*', '_site/*'],
// https://github.com/gruntjs/grunt-contrib-compass
compass : {
// Default options.
options : {
sassDir : 'src/styles',
cssDir : 'assets/styles',
raw : 'add_import_path "src/bower_components/foundation/scss"; require "sassy-strings";'
},
dev : {
options : {
environment: 'development',
outputStyle: 'expanded',
debugInfo : true
}
},
prod : {
options : {
environment: 'production',
outputStyle: 'compressed',
}
}
},
// https://github.com/gruntjs/grunt-contrib-jshint
jshint: {
// Default options.
options : {
unused : true
},
dev : {
options : {
force : true
},
src : ['src/scripts/**.js']
},
prod: ['src/scripts/**.js']
},
// https://github.com/gruntjs/grunt-contrib-uglify
uglify: {
prod: {
files: {
'assets/scripts/website.min.js': ['src/scripts/*.js'],
'assets/scripts/media.min.js': [
'src/bower_components/modernizr/modernizr.js',
],
'assets/scripts/foundation.min.js': [
'src/bower_components/foundation/js/vendor/jquery.js',
'src/bower_components/foundation/js/foundation/foundation.js',
//'src/bower_components/foundation/js/foundation/foundation.abide.js',
//'src/bower_components/foundation/js/foundation/foundation.accordion.js',
//'src/bower_components/foundation/js/foundation/foundation.clearing.js',
//'src/bower_components/foundation/js/foundation/foundation.dropdown.js',
//'src/bower_components/foundation/js/foundation/foundation.interchange.js',
//'src/bower_components/foundation/js/foundation/foundation.joyride.js',
//'src/bower_components/foundation/js/foundation/foundation.magellan.js',
//'src/bower_components/foundation/js/foundation/foundation.offcanvas.js',
//'src/bower_components/foundation/js/foundation/foundation.orbit.js',
//'src/bower_components/foundation/js/foundation/foundation.reveal.js',
//'src/bower_components/foundation/js/foundation/foundation.tab.js',
//'src/bower_components/foundation/js/foundation/foundation.tooltips.js',
//'src/bower_components/foundation/js/foundation/foundation.topbar.js'
]
}
}
},
// https://npmjs.org/package/grunt-contrib-watch
watch : {
src: {
files: ['src/scripts/**.js', 'src/styles/**.scss'],
tasks: ['build']
},
jekyll : {
files: ['**/*.html', '**/*.json', '**/*.geojson', '**/*.yml', '**/**/*.md', '!_site/**/*', '!_site/*', '!src/*', '!node_modules/*', '!placeholder/*'],
tasks: ['jekyll:generate']
}
},
// https://github.com/dannygarcia/grunt-jekyll
jekyll : {
generate : {
options : {
config: '_config.yml',
src: '',
dest: './_site',
}
},
server : {
options : {
config: '_config.yml',
src: '',
dest: './_site',
serve: true
}
}
}
});
// Load tasks.
grunt.loadNpmTasks('grunt-contrib-compass');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-jekyll');
// Register tasks.
grunt.registerTask('build', ['compass:dev', 'jshint:dev', 'uglify', 'jekyll:generate']);
grunt.registerTask('default', ['build', 'watch']);
grunt.registerTask('prod', ['clean', 'compass:prod', 'jshint:prod', 'uglify']);
grunt.registerTask('jk', ['jekyll:server']);
};