-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
gulpfile.js
33 lines (28 loc) · 965 Bytes
/
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
'use strict';
const gulp = require('gulp');
const uglify = require('gulp-uglify');
const rename = require('gulp-rename');
const cleanCSS = require('gulp-clean-css');
const pjson = require('./package.json');
const config = pjson.config || {};
gulp.task('scripts', function () {
return gulp.src(config.scripts)
.pipe(uglify())
.pipe(rename(function(path) {
path.extname = '.min' + path.extname;
}))
.pipe(gulp.dest(config.targetFolder));
});
gulp.task('styles', function () {
return gulp.src(config.styles)
.pipe(cleanCSS({restructuring: false}))
.pipe(rename(function(path) {
path.extname = '.min' + path.extname;
}))
.pipe(gulp.dest(config.targetFolder));
});
gulp.task('vendors', function () {
return gulp.src(config.vendors)
.pipe(gulp.dest(config.targetFolder));
});
gulp.task('default', gulp.series('vendors', gulp.parallel('scripts', 'styles')));