This repository has been archived by the owner on Nov 29, 2020. It is now read-only.
forked from pedroabreu/ion-gallery
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
51 lines (45 loc) · 1.45 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
var gulp = require('gulp');
var jshint = require('gulp-jshint');
var templateCache = require('gulp-angular-templatecache');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var rename = require('gulp-rename');
var sass = require('gulp-sass');
var ngAnnotate = require('gulp-ng-annotate');
var stripDebug = require('gulp-strip-debug');
var del = require('del');
gulp.task('default', ['compress','sass'], function() {
del(['.tmp/'], function (err, paths) {
console.log('Deleted files/folders:\n', paths.join('\n'));
});
});
gulp.task('lint', function() {
return gulp.src('./src/js/*.js')
.pipe(jshint())
.pipe(jshint.reporter('default'));
});
gulp.task('templatecache',['lint'], function () {
return gulp.src('./src/templates/*.html')
.pipe(templateCache({standalone:true}))
.pipe(gulp.dest('./.tmp/'));
});
gulp.task('scripts', ['templatecache'], function() {
return gulp.src('./src/js/*.js')
.pipe(ngAnnotate())
.pipe(concat('ion-gallery.js'))
.pipe(gulp.dest('./.tmp/'));
});
gulp.task('compress',['scripts'], function() {
return gulp.src('./.tmp/*.js')
.pipe(concat('ion-gallery.js'))
.pipe(gulp.dest('./dist'))
.pipe(stripDebug())
.pipe(uglify())
.pipe(rename('ion-gallery.min.js'))
.pipe(gulp.dest('./dist'));
});
gulp.task('sass', function () {
gulp.src('./src/scss/*.scss')
.pipe(sass({outputStyle: 'compressed'}))
.pipe(gulp.dest('./dist'));
});