-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
36 lines (32 loc) · 1.07 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
"use strict";
var gulp = require("gulp"),
sass = require("gulp-sass"),
autoprefixer = require("gulp-autoprefixer"),
uglify = require("gulp-uglify"),
rename = require("gulp-rename");
/*----------------------------------------------
Compile & autoprefix CSS
-----------------------------------------------*/
gulp.task("css", function() {
return gulp.src("css/style.scss")
.pipe(sass({outputStyle: "compressed"}).on("error", sass.logError))
.pipe(autoprefixer({browsers: ["> 1%", "last 3 versions", "Firefox ESR"]}))
.pipe(rename("style.min.css"))
.pipe(gulp.dest("css/"));
});
/*----------------------------------------------
Concat & uglify JS
-----------------------------------------------*/
gulp.task("js", function() {
return gulp.src("js/script.js")
.pipe(uglify())
.pipe(rename("script.min.js"))
.pipe(gulp.dest("js"));
});
/*----------------------------------------------
Watch
-----------------------------------------------*/
gulp.task("watch", function() {
gulp.watch("css/**/*.scss", ["css"]);
gulp.watch("js/**/*.js", ["js"]);
});