1
1
/* global module:false */
2
2
module . exports = function ( grunt ) {
3
3
var port = grunt . option ( 'port' ) || 8000 ;
4
- var base = grunt . option ( 'base' ) || '.' ;
4
+ var root = grunt . option ( 'root' ) || '.' ;
5
+
6
+ if ( ! Array . isArray ( root ) ) root = [ root ] ;
5
7
6
8
// Project configuration
7
9
grunt . initConfig ( {
@@ -13,7 +15,7 @@ module.exports = function(grunt) {
13
15
' * http://lab.hakim.se/reveal-js\n' +
14
16
' * MIT licensed\n' +
15
17
' *\n' +
16
- ' * Copyright (C) 2015 Hakim El Hattab, http://hakim.se\n' +
18
+ ' * Copyright (C) 2017 Hakim El Hattab, http://hakim.se\n' +
17
19
' */'
18
20
} ,
19
21
@@ -42,7 +44,7 @@ module.exports = function(grunt) {
42
44
{
43
45
expand : true ,
44
46
cwd : 'css/theme/source' ,
45
- src : [ '*.scss' ] ,
47
+ src : [ '*.sass' , '*. scss'] ,
46
48
dest : 'css/theme' ,
47
49
ext : '.css'
48
50
}
@@ -69,6 +71,7 @@ module.exports = function(grunt) {
69
71
curly : false ,
70
72
eqeqeq : true ,
71
73
immed : true ,
74
+ esnext : true ,
72
75
latedef : true ,
73
76
newcap : true ,
74
77
noarg : true ,
@@ -93,11 +96,12 @@ module.exports = function(grunt) {
93
96
server : {
94
97
options : {
95
98
port : port ,
96
- base : base ,
99
+ base : root ,
97
100
livereload : true ,
98
101
open : true
99
102
}
100
- }
103
+ } ,
104
+
101
105
} ,
102
106
103
107
zip : {
@@ -107,29 +111,44 @@ module.exports = function(grunt) {
107
111
'js/**' ,
108
112
'lib/**' ,
109
113
'images/**' ,
110
- 'plugin/**'
114
+ 'plugin/**' ,
115
+ '**.md'
111
116
]
112
117
} ,
113
118
114
119
watch : {
115
- options : {
116
- livereload : true
117
- } ,
118
120
js : {
119
121
files : [ 'Gruntfile.js' , 'js/reveal.js' ] ,
120
122
tasks : 'js'
121
123
} ,
122
124
theme : {
123
- files : [ 'css/theme/source/*.scss' , 'css/theme/template/*.scss' ] ,
125
+ files : [
126
+ 'css/theme/source/*.sass' ,
127
+ 'css/theme/source/*.scss' ,
128
+ 'css/theme/template/*.sass' ,
129
+ 'css/theme/template/*.scss'
130
+ ] ,
124
131
tasks : 'css-themes'
125
132
} ,
126
133
css : {
127
134
files : [ 'css/reveal.scss' ] ,
128
135
tasks : 'css-core'
129
136
} ,
130
137
html : {
131
- files : [ 'index.html' ]
138
+ files : root . map ( path => path + '/*.html' )
139
+ } ,
140
+ markdown : {
141
+ files : root . map ( path => path + '/*.md' )
142
+ } ,
143
+ options : {
144
+ livereload : true
132
145
}
146
+ } ,
147
+
148
+ retire : {
149
+ js : [ 'js/reveal.js' , 'lib/js/*.js' , 'plugin/**/*.js' ] ,
150
+ node : [ '.' ] ,
151
+ options : { }
133
152
}
134
153
135
154
} ) ;
@@ -144,6 +163,7 @@ module.exports = function(grunt) {
144
163
grunt . loadNpmTasks ( 'grunt-contrib-connect' ) ;
145
164
grunt . loadNpmTasks ( 'grunt-autoprefixer' ) ;
146
165
grunt . loadNpmTasks ( 'grunt-zip' ) ;
166
+ grunt . loadNpmTasks ( 'grunt-retire' ) ;
147
167
148
168
// Default task
149
169
grunt . registerTask ( 'default' , [ 'css' , 'js' ] ) ;
0 commit comments