Skip to content

Commit ac4307e

Browse files
committed
build: migrate to gulp v4
1 parent cb1dac5 commit ac4307e

File tree

2 files changed

+15
-11
lines changed

2 files changed

+15
-11
lines changed

gulpfile.js

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,29 +21,32 @@ const dist = {
2121
}
2222
}
2323

24-
gulp.task('css', () => {
24+
const css = () =>
2525
gulp
2626
.src(src.css)
2727
.pipe(sass().on('error', sass.logError))
2828
.pipe(concat(`${dist.name.css}.min.css`))
2929
.pipe(prefix())
30-
.pipe(strip({all: true}))
30+
.pipe(strip({ all: true }))
3131
.pipe(cssnano())
3232
.pipe(gulp.dest(dist.path))
33-
})
3433

35-
gulp.task('js', () => {
34+
const js = () =>
3635
gulp
3736
.src(src.js)
3837
.pipe(concat(`${dist.name.js}.min.js`))
3938
.pipe(uglify())
4039
.pipe(gulp.dest(dist.path))
41-
})
4240

43-
gulp.task('build', ['css', 'js'])
41+
const build = gulp.parallel(css, js)
4442

45-
gulp.task('default', () => {
46-
gulp.start(['build'])
47-
gulp.watch(src.css, ['css'])
48-
gulp.watch(src.js, ['js'])
49-
})
43+
const watch = () => {
44+
gulp.watch(src.css, css)
45+
gulp.watch(src.js, js)
46+
}
47+
48+
exports.build = build
49+
exports.css = css
50+
exports.js = js
51+
exports.watch = watch
52+
exports.default = gulp.series(build, watch)

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
"husky": "latest",
3737
"lint-staged": "latest",
3838
"npm-check-updates": "latest",
39+
"prettier-standard": "latest",
3940
"standard": "latest",
4041
"standard-markdown": "latest",
4142
"standard-version": "latest"

0 commit comments

Comments
 (0)