forked from ahmadajmi/multilingualwithangular
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathgulpfile.js
84 lines (62 loc) · 2.59 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
79
80
81
82
83
84
'use strict';
// -----------------------------------------------------------------------------
// Dependencies
// -----------------------------------------------------------------------------
var gulp = require('gulp');
var watch = require('gulp-watch');
var sass = require('gulp-sass');
var browserSync = require('browser-sync');
var runSequence = require('run-sequence');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify')
var reload = browserSync.reload;
// -----------------------------------------------------------------------------
// SASS
// -----------------------------------------------------------------------------
gulp.task('sass', function () {
return gulp.src(['./scss/ltr-app.scss', './scss/rtl-app.scss'])
.pipe(sass())
.pipe(gulp.dest('./css'));
});
// -----------------------------------------------------------------------------
// JavaScript
// -----------------------------------------------------------------------------
gulp.task('js', function() {
return gulp.src([
'./bower_components/angular/angular.js',
'./bower_components/angular-translate/angular-translate.js',
'./bower_components/angular-translate-handler-log/angular-translate-handler-log.js',
'./bower_components/angular-cookies/angular-cookies.js',
'./bower_components/angular-translate-storage-cookie/angular-translate-storage-cookie.js',
'./bower_components/angular-translate-storage-local/angular-translate-storage-local.js',
'./bower_components/angular-translate-loader-static-files/angular-translate-loader-static-files.js',
'./js/app.js'])
.pipe(concat('app.min.js'))
.pipe(uglify())
.pipe(gulp.dest('./js'));
});
// -----------------------------------------------------------------------------
// Watch Files & Reload
// -----------------------------------------------------------------------------
gulp.task('serve', function() {
browserSync({
server: {
baseDir: "./"
}
});
gulp.watch(['./index.html'], [reload]);
gulp.watch('./scss/**/*.scss', ['sass', reload]);
gulp.watch('./js/app.js', ['js', reload]);
});
// -----------------------------------------------------------------------------
// Build
// -----------------------------------------------------------------------------
gulp.task('build', [], function() {
runSequence('sass', 'js');
});
// -----------------------------------------------------------------------------
// Gulp Default
// -----------------------------------------------------------------------------
gulp.task('default', [], function() {
gulp.start('serve');
});