-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
42 lines (28 loc) · 932 Bytes
/
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
var gulp = require("gulp")
var sass = require("gulp-sass")
var autoprefixer = require("gulp-autoprefixer")
var shorthand = require("gulp-shorthand")
var minify = require("gulp-cssnano")
gulp.task("build-styles", function() {
return gulp.src("./resources/styles/index.scss")
.pipe(sass().on("error", sass.logError))
.pipe(autoprefixer({
browsers: ["last 2 versions"],
cascade: false
}))
.pipe(shorthand())
.pipe(minify())
.pipe(gulp.dest("./.tmp/statics/styles"))
})
gulp.task("watch-styles", function() {
gulp.watch("resources/styles/**/*.scss", ["build-styles"])
})
gulp.task("styles", ["build-styles", "watch-styles"])
gulp.task("copy-images", function() {
gulp.src("./resources/images/**/*")
.pipe(gulp.dest('./.tmp/statics/images'))
})
gulp.task("watch-images", function() {
gulp.watch("resources/images/**/*", ["copy-images"])
})
gulp.task("images", ["copy-images", "watch-images"])