-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
43 lines (36 loc) · 1.26 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
var gulp = require("gulp");
var util = require("gulp-util");
var concat = require("gulp-concat");
var uglify = require("gulp-uglify");
var autoprefixer = require("gulp-autoprefixer");
var shell = require("gulp-shell");
var config = {
scripts: "js/_*.js",
styles: "scss/*.scss",
styles_main: "scss/loaderror.scss",
sass_error_message: "[node-sass] <%= error %> in <%= file %>",
sass_include_paths: require("bourbon").includePaths.join(' -I ')
}
console.log(config.sass_include_paths)
gulp.task("default", ["scripts", "styles"]);
gulp.task("scripts", function () {
return gulp.src(config.scripts)
.pipe(concat("loaderror.js"))
.pipe(uglify())
.pipe(gulp.dest("js/"));
});
gulp.task("styles", function () {
return gulp.src("")
.pipe(shell('mkdir -p css'))
.pipe(shell(`scss -I ${config.sass_include_paths} ${config.styles_main} css/loaderror.css`));
});
gulp.task("deploy", function () {
return gulp.src("")
.pipe(shell("tar -cvzf site.tar.gz *.php *.png *.ico css/* js/loaderror.js"))
.pipe(shell("scp -P 5190 site.tar.gz [email protected]:~"))
.pipe(shell("ssh [email protected] -p 5190 './deploy.sh' "))
});
gulp.task("watch", function () {
gulp.watch(config.scripts, ["scripts"]);
gulp.watch(config.styles, ["styles"]);
});