This repository has been archived by the owner on Dec 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathgulpfile.js
57 lines (47 loc) · 1.58 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
55
56
57
/**
* IMPORTANT: set the version number here when ready for a new release
* then run the 'gulp build' task to update both bower.json and package.json
* See the README.md file for more information.
*/
var VERSION = '1.3.1';
var gulp = require('gulp'),
del = require('del'),
runSequence = require('run-sequence'),
concat = require('gulp-concat'),
uglify = require('gulp-uglify'),
bump = require('gulp-bump');
// Update bower, component, npm at once:
gulp.task('bump', function() {
gulp.src(['./bower.json', './component.json', './package.json'])
.pipe(bump({
version: VERSION
}))
.pipe(gulp.dest('./'));
});
gulp.task('default', function(callback) {
runSequence('build', callback);
});
gulp.task('build', function(callback) {
runSequence(
'clean',
'bump',
'copy-build',
callback);
});
gulp.task('clean', function() {
return del(['./dist'], {
force: true
});
});
gulp.task('copy-build', ['concat-js', 'concat-min-js']);
gulp.task('concat-js', function() {
return gulp.src(['./angular-restheart.module.js', './angular-restheart.config.js', './services/**/*.js', '!node_modules{,/**}', '!example/{,/**}', '!gulpfile.js'])
.pipe(concat('angular-restheart.js'))
.pipe(gulp.dest('./dist'));
});
gulp.task('concat-min-js', function() {
return gulp.src(['./angular-restheart.module.js', './angular-restheart.config.js', './services/**/*.js', '!node_modules{,/**}', '!example/{,/**}', '!gulpfile.js'])
.pipe(concat('angular-restheart.min.js'))
.pipe(uglify())
.pipe(gulp.dest('./dist'));
});