-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathgulpfile.js
More file actions
45 lines (41 loc) · 1.59 KB
/
gulpfile.js
File metadata and controls
45 lines (41 loc) · 1.59 KB
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
45
const path = require('path');
const gulp = require('gulp');
const DIR_SOURCE = path.resolve('src');
const DIR_DESTINATION = path.resolve('docs');
const DIR_TASKS = path.resolve('bin', 'build');
const config = {
browserSync: require('browser-sync').create(),
paths: {
clean: [
DIR_DESTINATION,
`!${DIR_DESTINATION}/manifest.json`
],
images: {
source: path.join(DIR_SOURCE, 'images', '**', '*.{gif,jpg,png,svg}'),
destination: path.join(DIR_DESTINATION, 'assets', 'images'),
},
meta: {
source: path.join(DIR_SOURCE, 'meta', '**', '*'),
destination: DIR_DESTINATION,
},
modules: path.join(__dirname, 'node_modules'),
styles: {
source: path.join(DIR_SOURCE, 'styles', '**', '*.scss'),
destination: path.join(DIR_DESTINATION, 'assets', 'styles'),
},
views: {
all: path.join(DIR_SOURCE, 'views', '**', '*.html'),
partials: path.join(DIR_SOURCE, 'views', 'partials'),
source: path.join(DIR_SOURCE, 'views', '*.html'),
destination: DIR_DESTINATION,
},
},
};
gulp.task('clean', require(path.join(DIR_TASKS, 'clean'))(gulp, config));
gulp.task('images', require(path.join(DIR_TASKS, 'images'))(gulp, config));
gulp.task('meta', require(path.join(DIR_TASKS, 'meta'))(gulp, config));
gulp.task('styles', require(path.join(DIR_TASKS, 'styles'))(gulp, config));
gulp.task('views', require(path.join(DIR_TASKS, 'views'))(gulp, config));
gulp.task('sync', require(path.join(DIR_TASKS, 'sync'))(gulp, config));
gulp.task('default', gulp.series('clean', 'meta', gulp.parallel('images', 'styles'), 'views'));
gulp.task('watch', require(path.join(DIR_TASKS, 'watch'))(gulp, config));