-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathgruntfile.js
82 lines (70 loc) · 1.68 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
module.exports = grunt => {
require('load-grunt-tasks')(grunt);
let port = grunt.option('port') || 8000;
let root = grunt.option('root') || '.';
if (!Array.isArray(root)) root = [root];
// Project configuration
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
meta: {
banner:
'/*!\n' +
' * reveal.js-tracking <%= pkg.version %> (<%= grunt.template.today("yyyy-mm-dd, HH:MM") %>)\n' +
' * MIT licensed\n' +
' *\n' +
' * Copyright (C) 2020 Joe Pantazidis\n' +
' */'
},
connect: {
server: {
options: {
port: port,
base: root,
livereload: true,
open: true,
useAvailablePort: true
}
}
},
zip: {
bundle: {
src: [
'index.html',
'css/**',
'js/**',
'demo/**',
'plugin/**',
'**.md'
],
dest: 'reveal-js-tracking.zip'
}
},
watch: {
js: {
files: ['gruntfile.js', 'js/tracking.js']
},
css: {
files: ['css/tracking.css']
},
html: {
files: root.map(path => path + '/*.html')
},
markdown: {
files: root.map(path => path + '/*.md')
},
options: {
livereload: true
}
}
});
// Default task
grunt.registerTask('default', ['css', 'js']);
// JS task
grunt.registerTask('js', ['uglify']);
// CSS task
grunt.registerTask('css', ['autoprefixer', 'cssmin']);
// Package presentation to archive
grunt.registerTask('package', ['default', 'zip']);
// Serve presentation locally
grunt.registerTask('serve', ['connect', 'watch']);
};