-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
47 lines (40 loc) · 1.11 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
45
46
47
tasks = {
gulp: require('gulp'),
autoprefixer: require('gulp-autoprefixer'),
cleanCss: require('gulp-clean-css'),
imagemin: require('gulp-imagemin'),
browserSync: require('browser-sync').create(),
less: require('gulp-less'),
path: require('path'),
external: {
config: require('./tasks/configuration.js')
}
};
tasks.external.config.forEach(confPath => require(confPath)())
global.path = {
build: {
styles: './build/styles',
images: './build/images',
html: './build',
},
src: {
styles: './src/styles/*.less',
images: './src/images/*.jpg',
html: './src/*.html',
}
};
const configuration = {
server: {
baseDir: global.path.build.html
}
};
exports.start = () => (
tasks.browserSync.init(configuration),
tasks.browserSync.reload(),
this.stream()
);
exports.stream = () => (
tasks.gulp.watch(global.path.src.styles, tasks.gulp.series('styles')),
tasks.gulp.watch(global.path.src.images, tasks.gulp.series('images')),
tasks.gulp.watch(global.path.src.html, tasks.gulp.series('html'))
);