forked from osano/cookieconsent
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
32 lines (27 loc) · 827 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
var gulp = require('gulp');
var sass = require('gulp-sass');
var uglify = require('gulp-uglify');
var rename = require("gulp-rename");
var yargs = require("yargs");
gulp.task('sass', function () {
gulp.src('./styles/*.scss')
.pipe(sass({outputStyle: 'compressed'}))
.pipe(gulp.dest('./build'));
});
gulp.task('minify', function () {
var minifyPipe =
gulp.src('./cookieconsent.js')
.pipe(uglify())
.pipe(rename('cookieconsent.latest.min.js'))
.pipe(gulp.dest('./build'));
if (yargs.argv.tag!==undefined) {
minifyPipe
.pipe(rename('cookieconsent.'+yargs.argv.tag+'.min.js'))
.pipe(gulp.dest('./build'));
}
});
gulp.task('copy-images', function () {
gulp.src('theme-previews/*.png')
.pipe(gulp.dest('./build'));
});
gulp.task('build', ['sass', 'minify', 'copy-images']);