-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
44 lines (31 loc) · 1.38 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
const browserSync = require('browser-sync')
const gulp = require('gulp')
const path = require('path')
const configPath = path.join(__dirname, 'gulp', 'configuration')
const config = require(configPath)
function getTask(taskName) {
const taskPath = path.join(__dirname, 'gulp/tasks', taskName)
return require(taskPath)(config)
}
browserSync.create(config.staticServer.name)
gulp.task('browser-sync', getTask('general/browser-sync'))
gulp.task('build', ['html-build', 'copy-cname'], getTask('manifest/clean'))
gulp.task('assets-build', ['assets-clean', 'assets-copy'])
gulp.task('assets-clean', getTask('assets/clean'))
gulp.task('assets-copy', ['assets-clean'], getTask('assets/copy'))
gulp.task('css-build', ['css-clean', 'css-lint'], getTask('css/build'))
gulp.task('css-clean', getTask('css/clean'))
gulp.task('css-lint', getTask('css/lint'))
gulp.task(
'html-build',
['assets-build', 'css-build', 'js-build', 'html-clean'],
getTask('html/build')
)
gulp.task('html-clean', getTask('html/clean'))
gulp.task('js-build', ['js-clean', 'js-lint'], getTask('js/build'))
gulp.task('js-clean', getTask('js/clean'))
gulp.task('js-lint', getTask('js/lint'))
gulp.task('manifest-clean', getTask('manifest/clean'))
gulp.task('copy-cname', getTask('general/copy-cname'))
gulp.task('watch', getTask('general/watch'))
gulp.task('default', ['build', 'watch'], getTask('general/browser-sync'))