forked from kohkimakimoto/getcomposer.org_doc_jp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
92 lines (80 loc) · 2.15 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
83
84
85
86
87
88
89
90
91
var fs = require('fs');
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
clean: ["dest/getcomposer.org_doc_jp/*"],
uglify: {
dist: {
src: ['src/js/modernizr-2.0.6.min.js'],
dest: "dest/getcomposer.org_doc_jp/js/scripts.min.js"
}
},
cssmin: {
dist: {
src: ["src/css/style.css", "src/css/custom.css"],
dest: "dest/getcomposer.org_doc_jp/css/styles.min.css"
}
},
copy: {
dist: {
files: [
{ expand: true, cwd: "src/", src: ['index.html', "doc/index.html", 'favicon.ico', 'img/*'], dest: 'dest/getcomposer.org_doc_jp/', filter: 'isFile'}
]
}
},
markdown: {
dist: {
files: [
{expand: true, cwd: "src/", src: ["doc/**/*.md"], dest: "dest/getcomposer.org_doc_jp/", ext: ".html", filter: 'isFile'}
],
options: {
template: "src/templates/layout.html",
markdownOptions: {
gfm: true
}
}
}
},
connect: {
server: {
options: {
port: 12345,
hostname: "*",
base: "dest"
}
}
},
watch: {
options: {
livereload: true
},
uglify: {
files: "src/js/**/*.js",
tasks: "uglify:dist"
},
cssmin: {
files: "src/css/**/*.css",
tasks: "cssmin:dist"
},
copy: {
files: ["src/index.html", "src/doc/index.html"],
tasks: "copy:dist"
},
markdown: {
files: ["src/doc/**/*.md", "src/templates/layout.html"],
tasks: "markdown:dist"
}
}
});
// Load plugins and tasks.
grunt.loadNpmTasks("grunt-contrib-watch");
grunt.loadNpmTasks("grunt-contrib-connect");
grunt.loadNpmTasks("grunt-contrib-cssmin");
grunt.loadNpmTasks("grunt-contrib-copy");
grunt.loadNpmTasks("grunt-contrib-clean");
grunt.loadNpmTasks("grunt-contrib-uglify");
grunt.loadNpmTasks("grunt-markdown");
// Register custom tasks.
grunt.registerTask("build", ["clean", "uglify", "markdown", "cssmin", "copy"]);
grunt.registerTask("default", ["build", "connect", "watch"]);
}