-
Notifications
You must be signed in to change notification settings - Fork 35
/
gulp.config.js
62 lines (60 loc) · 1.53 KB
/
gulp.config.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
// Configures gulp build
// See gulpfile.babel.js for build pipeline
import {resolve} from "path"
import hugo from "hugo-bin"
export default function(env) {
const src = "src/"
const dest = "hugo/"
const tmp = ".tmp/"
const build = "dist/"
const isProduction = process.env.NODE_ENV === "production"
return {
src: src,
dest: dest,
tmp: tmp,
build: build,
generator: {
label: "Hugo",
command: hugo,
args: {
default: ["-v", "--source", resolve(dest), "--destination", resolve(build)],
development: ["-b", "http://localhost:3000", "--buildDrafts", "--buildFuture", "--buildExpired"],
preview: ["-b", "http://localhost:3000"],
production: []
}
},
styles: {
src: src + "css/*.css",
watch: src + "css/**/*.css",
dest: dest + "static/css",
tmp: tmp + "css"
},
scripts: {
src: src + "js/*+(js|jsx)",
watch: src + "js/**/*+(js|jsx)",
dest: dest + "static/js/",
tmp: tmp + "js/"
},
images: {
src: src + "img/**/*.+(png|jpg|jpeg|gif|svg|webp)",
watch: src + "img/**/*.+(png|jpg|jpeg|gif|svg|webp)",
dest: dest + "static/img/"
},
svg: {
src: src + "img/**/*.svg",
watch: src + "img/**/*.svg",
dest: dest + "static/svg/",
config: {
dest: ".",
mode: {
symbol: {
sprite: "sprite.symbol.svg",
prefix: "svg-%s",
dest: "."
}
},
example: (isProduction) ? false : true
}
}
}
}