-
Notifications
You must be signed in to change notification settings - Fork 5
/
gulpfile.js
42 lines (33 loc) · 1.06 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
// Main Gulp
var gulp = require("gulp");
var clean = require("gulp-clean");
var scss = require("gulp-sass");
var plumber = require("gulp-plumber");
var autoprefixer = require('gulp-autoprefixer');
var watch = require("gulp-watch");
// Paths
var paths = {};
paths.app = "resources/public/";
paths.dist = "resources/public/";
paths.scss = paths.app + "styles/**/*.scss";
// Delete the dist directory
gulp.task("clean", function () {
return gulp.src(paths.dist).pipe(clean());
});
gulp.task("scss", function () {
return gulp.src(paths.app + "styles/main.scss")
.pipe(plumber())
.pipe(scss({ style: "expanded" }))
.pipe(gulp.dest(paths.dist + "css/"));
});
gulp.task("autoprefixer", ["scss"], function () {
return gulp.src(paths.dist + "css/main.css")
.pipe(autoprefixer('last 2 version', 'safari 5', 'ie 8', 'ie 9', 'opera 12.1', 'ios 6', 'android 4'))
.pipe(gulp.dest(paths.dist + "css/"));
});
// Default
gulp.task("dist", ["autoprefixer"]);
// Watch
gulp.task("default", ["dist"], function () {
gulp.watch(paths.scss, ["autoprefixer"]);
});