Skip to content

Commit 2576076

Browse files
committed
minor refactor
1 parent 4c14534 commit 2576076

File tree

1 file changed

+15
-16
lines changed

1 file changed

+15
-16
lines changed

Gulpfile.js

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ var rename = require('gulp-rename');
55
var autoprefixer = require('gulp-autoprefixer');
66
var sourcemaps = require('gulp-sourcemaps');
77
var headerComment = require('gulp-header-comment');
8-
const gulpStylelint = require('gulp-stylelint');
8+
var gulpStylelint = require('gulp-stylelint');
99
var stylefmt = require('gulp-stylefmt');
1010
let cleanCSS = require('gulp-clean-css');
1111
var gulpSequence = require('gulp-sequence')
@@ -15,7 +15,6 @@ var reload = browserSync.reload;
1515
module.exports = gulp;
1616

1717
/* BROWSER SYNC */
18-
1918
gulp.task('browser-sync', function () {
2019
browserSync({
2120
port: 3040,
@@ -27,30 +26,31 @@ gulp.task('browser-sync', function () {
2726
});
2827
});
2928

29+
/* BROWSER SYNC RELOAD */
3030
gulp.task('browser-sync-reload', function () {
3131
browserSync.reload();
3232
});
3333

3434
/* LIST SCSS */
35-
gulp.task('lint:scss', function() {
35+
gulp.task('lint:scss', function () {
3636
return gulp
3737
.src('src/**/*.scss')
3838
.pipe(gulpStylelint({
39-
reporters: [
40-
{ formatter: 'string', console: true }
41-
]
39+
reporters: [{
40+
formatter: 'string',
41+
console: true
42+
}]
4243
}));
4344
});
4445

45-
4646
/* COMPILE SCSS */
4747
gulp.task('compile:scss', function () {
4848
return gulp.src('src/**/*.scss')
4949
.pipe(sourcemaps.init())
5050
.pipe(sass({
51-
outputStyle: 'expanded'
52-
})
53-
.on('error', sass.logError))
51+
outputStyle: 'expanded'
52+
})
53+
.on('error', sass.logError))
5454
.pipe(autoprefixer({
5555
browsers: ['> 5%', 'last 4 versions'],
5656
cascade: false
@@ -63,7 +63,6 @@ gulp.task('compile:scss', function () {
6363
});
6464

6565
/* FORMAT CSS */
66-
6766
gulp.task('format:css', function () {
6867
return gulp.src('dist/*.css')
6968
.pipe(stylefmt())
@@ -78,21 +77,22 @@ gulp.task('clean:dist', function () {
7877
/* MINIFY CSS */
7978
gulp.task('minify:css', () => {
8079
return gulp.src('dist/*.css')
81-
.pipe(cleanCSS({ compatibility: 'ie9' }))
80+
.pipe(cleanCSS({
81+
compatibility: 'ie9'
82+
}))
8283
.pipe(rename({
8384
suffix: '.min'
8485
}))
8586
.pipe(gulp.dest('dist'));
8687
});
8788

8889
/* SET HEADER */
89-
9090
gulp.task('set:header', function () {
9191
return gulp.src('dist/*.css')
9292
.pipe(headerComment(`
9393
pretty-checkbox.css
9494
95-
A pure CSS library to beautify checkbox and radio buttons.
95+
A pure CSS library to beautify checkbox and radio buttons
9696
9797
Source: <%= pkg.repository.link %>
9898
Demo: <%= pkg.homepage %>
@@ -106,7 +106,6 @@ gulp.task('build', function (cb) {
106106
gulpSequence('lint:scss', 'clean:dist', 'compile:scss', 'format:css', 'minify:css', 'set:header', cb)
107107
});
108108

109-
110109
gulp.task('default', ['compile:scss', 'browser-sync'], function () {
111110
gulp.watch("src/**/*.scss", ['compile:scss', 'browser-sync-reload']);
112-
});
111+
});

0 commit comments

Comments
 (0)