-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
59 lines (52 loc) · 1.5 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
var gulp = require('gulp'),
sass = require('gulp-sass'),
browserSync = require('browser-sync').create(),
reload = browserSync.reload,
autoprefixer = require('gulp-autoprefixer');
// postcss = require('gulp-postcss'),
// reporter = require('postcss-reporter'),
// syntax_scss = require('postcss-scss'),
// stylelint = require('stylelint'),
// path = require('path');
// const stylelintConfig = {
// configFile: path.resolve('.stylelintrc')
// };
//
// const processors = [
// stylelint(stylelintConfig),
// reporter({
// clearMessages: true,
// throwError: true,
// formatter: 'string',
// console: true
// }),
// ];
gulp.task('sass', function () {
return gulp.src('app/scss/**/main.scss')
.pipe(sass())
.pipe(autoprefixer({
browsers: ['last 2 versions'],
cascade: false
}))
.pipe(gulp.dest('app/css'))
.pipe(browserSync.reload({stream: true}))
});
// gulp.task("scss-lint", () => {
// return gulp.src('app/scss/**/main.scss')
// .pipe(postcss(processors, {syntax: syntax_scss}));
// });
gulp.task('browser-sync', function () {
browserSync.init({
server: {
baseDir: 'app',
index: "index.html"
},
tunnel: true,
tunnel: "ukidev"
});
gulp.watch("app/*.html").on("change", reload);
});
gulp.task('watch', ['browser-sync'], function () {
gulp.watch('app/scss/**/*.scss', ['sass']);
});
gulp.task('default', ['watch']);