-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
29 lines (23 loc) · 1.01 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
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')
const copy = require('./gulp/tasks/copy')
function setMode(isProduction = false) {
return cb => {
process.env.NODE_ENV = isProduction ? 'production' : 'development'
cb()
}
}
const dev = gulp.parallel(pug2html, styles, script, fonts, imageMinify, svgSprite, copy)
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)