This repository has been archived by the owner on Mar 11, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
86 lines (81 loc) · 2.1 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
module.exports = function(grunt) {
grunt.initConfig({
less: {
production: {
options: {
paths: ["bower_components/bootstrap/less"],
yuicompress: true,
sourceMap: true,
sourceMapURL: "application.min.css.map"
},
files: {
"assets/css/application.min.css": "assets/_less/application.less"
}
}
},
uglify: {
jquery: {
files: {
'assets/js/jquery.min.js': 'bower_components/jquery/jquery.js'
}
},
bootstrap: {
files: {
'assets/js/bootstrap.min.js': ['bower_components/bootstrap/js/collapse.js',
'bower_components/bootstrap/js/scrollspy.js',
'bower_components/bootstrap/js/button.js',
'bower_components/bootstrap/js/affix.js']
}
},
main: {
files: {
'assets/js/main.min.js': 'assets/js/main.js'
}
}
},
copy: {
bootstrap: {
files: [
{expand: true, cwd: 'bower_components/bootstrap/img/', src: ['**'], dest: 'assets/img/'}
]
}
},
exec: {
build: {
cmd: 'jekyll build'
},
serve: {
cmd: 'jekyll serve --watch'
},
deploy: {
cmd: 'rsync --progress -a --delete -e "ssh -q" _site/ myuser@host:mydir/'
}
},
watch: {
jekyll: {
files: ['**/*.yml','**/*.html','**/*.csv','**/*.md','**/*.markdown','**/*.json','**/*.js','!**/node_modules/**','**/*.less'],
tasks: ['default'],
options: {
}
}
},
connect: {
server: {
options: {
livereload: false,
base: '_site/',
port: 4000
}
}
}
});
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-exec');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.registerTask('default', [ 'less', 'uglify', 'copy', 'exec:build' ]);
grunt.registerTask('deploy', [ 'default', 'exec:deploy' ]);
grunt.registerTask('serve', [ 'connect:server', 'watch' ]);
};