-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
64 lines (54 loc) · 1.53 KB
/
gulpfile.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
// Include gulp
var gulp = require("gulp");
// Install tools and plugins.
var es = require("event-stream"),
del = require("del"),
path = require("path"),
plugins = require("gulp-load-plugins")();
// Set paths
var basePath = {
src: "./src/",
build: "./build/",
dist: "./dist/"
},
path = {
sass: {
src: basePath.src + "sass/",
build: basePath.build
},
js: {
src: basePath.src + "js/",
build: basePath.build
}
};
var sassSrc = path.sass.src + "veneer.scss";
// Concatenate & Minify SCSS
gulp.task("sass", function (cb) {
plugins.rubySass(sassSrc, { unixNewlines: true, precision: 4, noCache: true })
.pipe(plugins.autoprefixer({
browsers: ["> 1%", "last 2 versions", "ie 9"],
cascade: true,
remove: false
}))
.pipe(gulp.dest(path.sass.build))
.pipe(plugins.rename({ suffix: ".min" }))
.pipe(plugins.minifyCss())
.pipe(gulp.dest(path.sass.build))
.on("end", cb);
});
gulp.task("clean", ["sass"], function (cb) {
del("./dist/veneer.zip", cb);
});
gulp.task("zip", ["clean"], function (cb) {
gulp.src(basePath.build + "**/*")
.pipe(plugins.zip("veneer.zip"))
.pipe(gulp.dest(basePath.dist))
.on("end", cb);
});
gulp.task("watch", function () {
// Watch for changes to our SASS
gulp.watch(path.sass.src + "**/*.scss", ["sass"]);
});
gulp.task("release", ["zip"]);
// Default Task
gulp.task("default", ["sass"]);