-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
78 lines (56 loc) · 1.94 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
var gulp = require('gulp');
var browserify = require("browserify");
var source = require("vinyl-source-stream");
var uglify = require("gulp-uglify");
var streamify = require("gulp-streamify");
var minify = require('gulp-minify');
var concat = require('gulp-concat');
var sass = require('gulp-sass');
var ngAnnotate = require('browserify-ngannotate');
var jetpack = require('fs-jetpack');
var srcDir = jetpack.cwd('src');
var distDir = jetpack.cwd('dist');
gulp.task('build', ['copy', 'concat-css'], function () {
return browserify('./src/main')
.transform(ngAnnotate)
.bundle()
.pipe(source('app.js'))
.pipe(streamify(uglify()))
.pipe(gulp.dest(distDir.path()));
});
gulp.task('copy', ['clean'], function () {
return srcDir.copy('.', distDir.path(), {
matching: [ 'partial/**/*.html'
, 'index.html'
, 'svg/**/*.svg'
, 'img/**/*.png'
]
});
});
gulp.task('clean', function () {
return distDir.remove();
});
gulp.task('juke-css', function () {
return gulp.src(srcDir.path('styles/**/*.sass'))
.pipe(sass().on('error', sass.logError))
.pipe(gulp.dest(distDir.path('css')));
});
gulp.task('vendor-css', function () {
return gulp.src(['node_modules/angular-material/angular-material.min.css'])
.pipe(gulp.dest(distDir.path('css')))
});
gulp.task('concat-css', ['vendor-css', 'juke-css'], function () {
gulp.src([
'dist/css/*.css',
'dist/css/angular-material.min.css'
])
.pipe(concat('css/style.css'))
.pipe(gulp.dest(distDir.path()));
});
gulp.task('debug', ['copy', 'concat-css'], function () {
return browserify('./src/main')
.transform(ngAnnotate)
.bundle()
.pipe(source('app.js'))
.pipe(gulp.dest('./dist'));
});