-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
28 lines (22 loc) · 989 Bytes
/
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
const gulp = require('gulp')
const serve = require('./gulp/tasks/serve')
const pug2html = require('./gulp/tasks/pug2html')
const styles = require('./gulp/tasks/styles')
const script = require('./gulp/tasks/script')
const fonts = require('./gulp/tasks/fonts')
const imageMinify = require('./gulp/tasks/imageMinify')
const clean = require('./gulp/tasks/clean')
const copyDependencies = require('./gulp/tasks/copyDependencies')
const lighthouse = require('./gulp/tasks/lighthouse')
const svgSprite = require('./gulp/tasks/svgSprite')
function setMode(isProduction = false) {
return cb => {
process.env.NODE_ENV = isProduction ? 'production' : 'development'
cb()
}
}
const dev = gulp.parallel(pug2html, styles, script, fonts, imageMinify, svgSprite)
const build = gulp.series(clean, copyDependencies, dev)
module.exports.start = gulp.series(setMode(), build, serve)
module.exports.build = gulp.series(setMode(true), build)
module.exports.lighthouse = gulp.series(lighthouse)