-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
47 lines (42 loc) · 1.23 KB
/
gulpfile.js
File metadata and controls
47 lines (42 loc) · 1.23 KB
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
var gulp = require('gulp');
var concat = require('gulp-concat');
var concatCss = require('gulp-concat-css');
var gulpDocs = require('gulp-ngdocs');
var uglify = require('gulp-uglify');
var rename = require("gulp-rename");
var cleanCSS = require('gulp-clean-css');
gulp.task('default', ['scripts','css','watch']);
gulp.task('scripts', function() {
return gulp.src(
[
'./src/ng/app.module.js',
'./src/ng/app.config.js',
'./src/ng/app.controller.js',
'./src/ng//utils/utils.module.js',
'./src/ng/utils/**/*.js',
'./src/ng/ui/ui.module.js',
'./src/ng/ui/**/*.js',
'!./src/ng/**/*.test.js',
]
)
.pipe(concat('app.js'))
.pipe(uglify())
.pipe(rename('app.min.js'))
.pipe(gulp.dest('./dist/scripts/'));
});
gulp.task('css', function () {
return gulp.src('./src/styles/**/*.css')
.pipe(concatCss("main.css"))
.pipe(cleanCSS())
.pipe(rename('main.min.css'))
.pipe(gulp.dest('./dist/styles/'));
});
gulp.task('docs', [], function () {
return gulp.src('./src/ng/**/*.js')
.pipe(gulpDocs.process())
.pipe(gulp.dest('./docs'));
});
gulp.task('watch', function() {
gulp.watch('./src/ng/**/*.js', ['scripts']);
gulp.watch('./src/styles/**/*.css', ['css']);
});