-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
58 lines (51 loc) · 1.43 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
48
49
50
51
52
53
54
55
56
57
58
var gulp = require('gulp'),
plugins = require('gulp-load-plugins')(),
paths = {
scripts: {
src: ['./js/src/vendors/*.js', './js/src/components/*.js', './js/src/*.js'],
dist: './js/dist',
lint: ['./js/src/components/*.js', './js/src/*.js'],
},
sass: {
src: ['./scss/**/*.scss', '!./scss/amp.scss'],
dist: './css',
ampsrc: '.scss/amp.scss'
},
css: {
src: './css/style.css',
tmp: './tmp',
},
images: {
src: './img/src/**/*.{jpg,jpeg,png,gif,svg,PNG}',
dist: './img/'
}
},
config = {
autoprefixer: {
browsers: ['last 2 versions', '> 5%', 'Firefox ESR']
},
images: {
options: {
optimizationLevel: 3,
progessive: true,
interlaced: true
}
}
};
function getTask(task) {
return require('./gulp-tasks/' + task)(config, paths, gulp, plugins);
}
gulp.task('scripts-dev', getTask('scripts-dev'));
gulp.task('scripts-build', getTask('scripts-build'));
gulp.task('scripts-lint', getTask('scripts-lint'));
gulp.task('sass-dev', getTask('sass-dev'));
gulp.task('sass-build', getTask('sass-build'));
gulp.task('amp-css', getTask('amp-css'));
gulp.task('amp-build', getTask('amp-build'));
gulp.task('imgmin', getTask('imgmin'));
gulp.task('amp', ['amp-css', 'amp-build']);
gulp.task('watch', function () {
gulp.watch(paths.sass.src, ['sass-dev']);
gulp.watch(paths.scripts.src, ['scripts-dev']);
});
gulp.task('build', ['sass-build', 'scripts-build', 'imgmin', 'amp-css']);