-
Notifications
You must be signed in to change notification settings - Fork 6
/
gulpfile.js
75 lines (65 loc) · 1.98 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
const gulp = require('gulp');
const rename = require('gulp-rename');
const concat = require('gulp-concat');
const uglifyES = require('gulp-uglify-es').default;
const postcss = require('gulp-postcss');
const cleanCSS = require('gulp-clean-css');
gulp.task('css', () => gulp
.src('src/**/*.css')
// eslint-disable-next-line global-require,import/no-unresolved
.pipe(
postcss([
require('postcss-import'),
require('tailwindcss/nesting'),
require('tailwindcss'),
require('autoprefixer'),
]),
)
.pipe(cleanCSS())
.pipe(rename({ suffix: '.min' }))
.pipe(gulp.dest('source')));
gulp.task('dom-event', () => gulp
.src('src/js/dom-event/*.js')
.pipe(concat('dom-event.js'))
.pipe(uglifyES())
.pipe(rename({ suffix: '.min' }))
.pipe(gulp.dest('source/js')));
// gulp.task('search.js', () => gulp.src('src/js/search/*.js')
// .pipe(concat('search.js'))
// .pipe(uglifyES())
// .pipe(rename({ suffix: '.min' }))
// .pipe(gulp.dest('source/js')));
gulp.task('local-search', () => gulp
.src('src/js/search/local-search/dist/bundle.js')
.pipe(rename({ basename: 'local-search', suffix: '.min' }))
.pipe(gulp.dest('source/js')));
gulp.task('light-gallery.js', () => gulp
.src('src/js/light-gallery/*.js')
.pipe(concat('light-gallery.js'))
.pipe(uglifyES())
.pipe(rename({ suffix: '.min' }))
.pipe(gulp.dest('source/js')));
gulp.task('repository', () => gulp
.src('src/js/repository/dist/bundle.js')
.pipe(rename({ basename: 'repository', suffix: '.min' }))
.pipe(gulp.dest('source/js')));
gulp.task('simple-js', () => gulp
.src('src/js/*.js')
.pipe(uglifyES())
.pipe(rename({ suffix: '.min' }))
.pipe(gulp.dest('source/js')));
gulp.task(
'js',
gulp.parallel(
'dom-event',
'light-gallery.js',
'simple-js',
'repository',
'local-search',
),
);
gulp.task('build', gulp.parallel('css', 'js'));
gulp.task('default', gulp.parallel('build'));
gulp.task('watch', () => {
gulp.watch('src/**', gulp.parallel('build'));
});