-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGulpfile.js
72 lines (57 loc) · 1.62 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
var gulp = require('gulp'),
connect = require('gulp-connect'),
sass = require('gulp-sass'),
prefix = require('gulp-autoprefixer'),
minifyCSS = require('gulp-minify-css'),
autowatch = require('gulp-autowatch'),
plumber = require('gulp-plumber'),
uglify = require('gulp-uglify');
// HTML
gulp.task('htmls', function () {
gulp.src(['*.html'])
.pipe(connect.reload());
});
// SCSS
gulp.task('styles', function() {
return gulp.src(['css/scss/main.scss'] )
.pipe(plumber())
.pipe(sass())
//.pipe(prefix([{ browsers: ['IE 8', 'IE 9', 'last 5 versions', 'Firefox 14', 'Opera 11.1'] }]))
.pipe(minifyCSS({keepBreaks: true}))
.pipe(gulp.dest('css'))
.pipe(connect.reload());
});
// gulp.task('basicshopStyles', function() {
// return gulp.src('css/less/basicShop.less')
// .pipe(plumber())
// .pipe(less())
// .pipe(prefix([{ browsers: ['IE 8', 'IE 9', 'last 5 versions', 'Firefox 14', 'Opera 11.1'] }]))
// .pipe(minifyCSS({keepBreaks: true}))
// .pipe(gulp.dest('css'))
// .pipe(connect.reload());
// });
// JS
// WATCH
var paths = {
htmls: ['*.html'],
// basicshopStyles: 'ccs/less/basicShop/*.less',
styles: 'css/scss/**/*.scss'
};
gulp.task('watch', function(cb) {
autowatch(gulp, paths);
return cb();
});
// LIVERELOAD
gulp.task('connect', function() {
connect.server({
port: '8000',
livereload: true
});
});
// DEFAULT
gulp.task('default', [
'connect',
// 'basicshopStyles',
'styles',
'watch'
]);