forked from troch/angular-multi-step-form
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
50 lines (44 loc) · 1.46 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
var gulp = require('gulp');
var del = require('del');
var babel = require('gulp-babel');
var runSequence = require('run-sequence');
var rename = require('gulp-rename');
var uglify = require('gulp-uglify');
var concat = require('gulp-concat');
var ngAnnotate = require('gulp-ng-annotate');
var header = require('gulp-header');
var footer = require('gulp-footer');
var rename = require('gulp-rename');
var fs = require('fs');
var files = [
'src/*/*.js',
'src/index.js'
];
var globalWrapper = {
header: '(function (angular) {\n"use strict";\n',
footer: '\n}(angular));\n'
};
function buildBundle() {
return gulp.src(files)
.pipe(babel({modules: 'ignore', blacklist: ['strict']}))
.pipe(concat('angular-multi-step-form.js'))
.pipe(header(globalWrapper.header))
.pipe(footer(globalWrapper.footer))
.pipe(ngAnnotate())
.pipe(gulp.dest('dist/browser'))
.pipe(uglify())
.pipe(rename('angular-multi-step-form.min.js'))
.pipe(gulp.dest('dist/browser'));
}
function buildJs() {
return gulp.src(files)
.pipe(babel({modules: 'common'}))
.pipe(ngAnnotate())
.pipe(gulp.dest('dist/commonjs'));
}
gulp.task('clean', function () {
return del(['dist', 'coverage']);
});
gulp.task('buildBundle', ['clean'], buildBundle);
gulp.task('buildJs', ['clean'], buildJs);
gulp.task('build', ['buildBundle', 'buildJs']);