Skip to content

Commit 2cf0025

Browse files
ClintHhakimel
authored andcommitted
renamed grunt 'base' option to 'root' (hakimel#1660)
* Allow slides to be served away from revealjs server location The previous 'base' option conflicts with Grunt's 'base' option. Changing it to 'root' avoids this. Further, updating to a newer Grunt allows multiple parameters to be used. therefore `grunt serve --root="." --root="pathtomyslides"` allows you to keep your slide content separate from JS/CSS and such * Live reload for relocated base * Updated packages to match origin/dev * Updated packages to match origin/dev * Ensure root is an array
1 parent 693a370 commit 2cf0025

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

Gruntfile.js

+9-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
/* global module:false */
22
module.exports = function(grunt) {
33
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];
57

68
// Project configuration
79
grunt.initConfig({
@@ -69,6 +71,7 @@ module.exports = function(grunt) {
6971
curly: false,
7072
eqeqeq: true,
7173
immed: true,
74+
esnext: true,
7275
latedef: true,
7376
newcap: true,
7477
noarg: true,
@@ -93,11 +96,12 @@ module.exports = function(grunt) {
9396
server: {
9497
options: {
9598
port: port,
96-
base: base,
99+
base: root,
97100
livereload: true,
98101
open: true
99102
}
100-
}
103+
},
104+
101105
},
102106

103107
zip: {
@@ -126,10 +130,10 @@ module.exports = function(grunt) {
126130
tasks: 'css-core'
127131
},
128132
html: {
129-
files: [ '*.html']
133+
files: root.map(path => path + '/*.html')
130134
},
131135
markdown: {
132-
files: [ '*.md' ]
136+
files: root.map(path => path + '/*.md')
133137
},
134138
options: {
135139
livereload: true

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"socket.io": "^1.4.8"
2929
},
3030
"devDependencies": {
31-
"grunt": "~0.4.5",
31+
"grunt": "~1.0.1",
3232
"grunt-autoprefixer": "~3.0.3",
3333
"grunt-contrib-connect": "~0.11.2",
3434
"grunt-contrib-cssmin": "~0.14.0",

0 commit comments

Comments
 (0)