forked from m-e-conroy/angular-dialog-service
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
54 lines (46 loc) · 1.67 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
var gulp = require('gulp');
var minify = require('gulp-minify');
var minifyCSS = require('gulp-minify-css');
var jshint = require('gulp-jshint');
var rename = require('gulp-rename');
var concat = require('gulp-concat');
var wrap = require('gulp-wrap');
var header = require('gulp-header');
gulp.task('lint',function(){
return gulp.src('src/*.js')
.pipe(jshint())
.pipe(jshint.reporter('default'))
.pipe(jshint.reporter('fail'));
}); // end lint
gulp.task('concat-js',function(){
return gulp.src(['src/translate-substitution.js','src/dialogs-controllers.js','src/dialogs-services.js','src/dialogs-main.js'])
.pipe(concat('dialogs.js'))
.pipe(wrap('(function(){\n"use strict";\n<%= contents %>\n})();'))
.pipe(gulp.dest('src'));
}); // end concat-js
gulp.task('compress-js',['concat-js'],function(){
var bower = require('./bower.json');
var banner = ['/**',
' * <%= bower.name %> - <%= bower.description %>',
' * @version v<%= bower.version %>',
' * @author <%= bower.authors[0].name %>, <%= bower.authors[0].email %>',
' * @license <%= bower.licenses[0].type %>, <%= bower.licenses[0].url %>',
' */',
''].join('\n');
gulp.src(['src/dialogs.js','src/dialogs-default-translations.js'])
.pipe(header(banner, {bower : bower}))
.pipe(gulp.dest('dist'))
.pipe(minify({}))
.pipe(rename({suffix: '.min'}))
.pipe(gulp.dest('dist'));
}); // end comrpess-js
gulp.task('compress-css',function(){
gulp.src('src/*.css')
.pipe(concat('dialogs.css'))
.pipe(gulp.dest('dist'))
.pipe(minifyCSS({}))
.pipe(concat('dialogs.css'))
.pipe(rename({suffix: '.min'}))
.pipe(gulp.dest('dist'));
}); // end compress-css
gulp.task('default',['lint','compress-js','compress-css']);