This repository has been archived by the owner on May 14, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
/
Gruntfile.js
79 lines (75 loc) · 1.74 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
module.exports = function(grunt) {
require("matchdep").filterAll("grunt-*").forEach(grunt.loadNpmTasks);
var webpack = require("webpack");
var webpackConfig = require("./webpack.config.js");
grunt.initConfig({
"webpack-dev-server": {
options: {
webpack: webpackConfig,
publicPath: "",
contentBase: './dev'
},
start: {
watch: true,
keepAlive: true,
webpack: {
devtool: "sourcemap",
debug: true
}
}
},
watch: {
sass: {
files: ['src/css/**/*.scss'],
tasks: ['sass:dev'],
options: {
spawn: false
}
}
},
sass: {
dev: {
options: {
outputStyle: 'expanded',
sourceComments: 'map'
},
files: { 'dev/main.css': 'src/css/main.scss' }
}
},
exec: {
docpad: {
cmd: "docpad generate -e production"
},
docpad_run: {
cmd: "docpad run"
},
clear_dist: {
cmd: "rm -rf ./dist/"
}
},
execute: {
// TODO :: currently this dumps metadata.json into the module's dist
// we need to pass options into generate-meta.js to define
// our own outputDir
modernizr: {
src: ['./node_modules/modernizr/lib/generate-meta.js'],
}
},
'gh-pages': {
options: {
base: 'dist'
},
src: ['**']
},
concurrent: {
serve: {
tasks: ['webpack-dev-server:start', 'watch:sass', 'exec:docpad_run'],
options: {
logConcurrentOutput: true
}
}
}
});
grunt.registerTask("default", ["concurrent:serve"]);
grunt.registerTask("dist", ["exec:clear_dist", "exec:docpad"])
};