-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
41 lines (37 loc) · 1.11 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
var gulp = require("gulp");
var browserSync = require("browser-sync").create();
var sass = require("gulp-sass");
var uglifycss = require("gulp-uglifycss");
var autoprefixer = require("gulp-autoprefixer");
var autoprefixerOptions = {
browsers: ["last 2 versions", "> 5%", "Firefox ESR"]
};
gulp.task("sass", function() {
return gulp
.src("./sass/style.scss")
.pipe(sass().on("error", sass.logError))
.pipe(autoprefixer())
.pipe(
uglifycss({
maxLineLen: 80,
uglyComments: true
})
)
.pipe(gulp.dest("./css").on("change", browserSync.reload));
});
gulp.task("default", function() {
browserSync.init({
proxy: "http://localhost:8888",
notify: false
});
gulp.watch("./sass/**/*.scss", ["sass"]);
gulp.watch("./css/**/*.css").on("change", browserSync.reload);
gulp.watch("**/*.php").on("change", browserSync.reload);
});
gulp.task("dist", ["dist-php"], function() {
// this occurs after 'dist-php' finishes
return gulp.src("css/*").pipe(gulp.dest("dist/css/"));
});
gulp.task("dist-php", function() {
return gulp.src("*.php").pipe(gulp.dest("dist/"));
});