-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
71 lines (62 loc) · 1.35 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
var fs = require("fs");
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
connect: {
dev: {
options: {
port: '8080',
keepalive: true
}
}
},
targethtml: {
dist: {
files: {
'dist/index.html': 'index.html'
}
}
},
'gh-pages': {
options: {
base: 'dist',
dotfiles: true
},
deploy: {
src: ['**']
}
}
});
var SimManager = require('./grunt/sim-manager')(grunt);
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
grunt.registerTask('create-no-jekyll', function(){
grunt.file.write('./dist/.nojekyll', '');
});
/**
* Builds every sim that has changed since last build and copies it into the
* master `dist` directory. It also renders the index page so the sim list
* is up to date. The `--all` flag can be added to force build all sims
* instead of just the ones that have been updated.
*/
grunt.registerTask('dist', function() {
grunt.task.run([
'run-dists',
'clean-dists',
'copy-dists',
'targethtml:dist'
]);
});
/**
* Does the same thing as the `dist` command but then deploys to GitHub Pages.
*/
grunt.registerTask('deploy', function() {
grunt.task.run([
'dist',
'create-no-jekyll',
'gh-pages:deploy'
]);
});
grunt.registerTask('dev', [
'connect:dev'
]);
};