forked from forestryio/forestry.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulp.config.js
77 lines (75 loc) · 1.84 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
// 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"],
preview: ["-b", "http://localhost:3000"],
production: [],
instantPreview: ["--buildDrafts", "--buildFuture"]
}
},
algolia: {
src: build + "**/algolia.json"
},
redirects: {
src: build + "redirects.json"
},
styles: {
src:
[
src + "css/*.+(css|scss|sass)",
src + "scss/*.+(css|scss|sass)"
],
watch:
[
src + "css/**/*.+(css|scss|sass)",
src + "scss/**/*.+(css|scss|sass)"
],
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
}
}
}
}