-
Notifications
You must be signed in to change notification settings - Fork 11
/
gulpfile.js
37 lines (31 loc) · 1.02 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
var gulp = require('gulp');
var sourcemaps = require('gulp-sourcemaps');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var rimraf = require('rimraf');
var paths = {
scripts: ['src/**/*.js', '!src/**/*_test.js'],
destination: './dist'
};
gulp.task('clean', function (cb) {
rimraf(paths.destination, cb);
});
gulp.task('scripts-min', ['clean'], function() {
// Minify and copy all JavaScript (except vendor scripts)
// with sourcemaps all the way down
return gulp.src(paths.scripts)
.pipe(sourcemaps.init())
.pipe(uglify())
.pipe(concat('ngPrint.min.js'))
.pipe(sourcemaps.write())
.pipe(gulp.dest(paths.destination));
});
gulp.task('scripts-debug', function() {
// Minify and copy all JavaScript (except vendor scripts)
// with sourcemaps all the way down
return gulp.src(paths.scripts)
.pipe(concat('ngPrint.debug.js'))
.pipe(gulp.dest(paths.destination));
});
gulp.task('build', ['clean', 'scripts-min', 'scripts-debug']);
gulp.task('default', ['build']);