-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
105 lines (89 loc) · 2.63 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
"use strict"
var gulp = require('gulp'),
webserver = require('gulp-webserver'),
concat = require('gulp-concat'),
sass = require('gulp-sass'),
minifyCss = require('gulp-minify-css'),
rename = require('gulp-rename'),
prefixer = require('gulp-autoprefixer'),
livereload = require('gulp-livereload');;
var bc = './bower_components/';
// js
gulp.task('js', function() {
gulp.src('builds/development/app/*.js').
pipe(concat('app.js')).
pipe(gulp.dest('builds/dist/app/'));
});
// css
gulp.task('css', function() {
gulp.src('builds/development/scss/style.scss').
//pipe(concat('bundle.css')).
pipe(sass('')).
pipe(prefixer("last 2 versions", '> 1%', 'ie 9')).
//pipe(minifyCss('')).
pipe(rename('style.min.css')).
pipe(gulp.dest('builds/dist'));
});
// html
gulp.task('html', function () {
gulp.src('builds/development/app/**/*.html').
pipe(gulp.dest('builds/dist/app/'));
gulp.src('builds/development/*.html').
pipe(gulp.dest('builds/dist/'));
});
// library
gulp.task('libs', function() {
gulp.src(bc + 'GreenSock-JS/src/minified/TweenMax.min.js').
pipe(gulp.dest('./builds/dist/libs/tweenmax/'));
gulp.src(bc + 'superscrollorama/js/jquery.lettering-0.6.1.min.js').
pipe(gulp.dest('./builds/dist/libs/scrollmagic/'));
gulp.src(bc + 'superscrollorama/js/jquery.superscrollorama.js').
pipe(gulp.dest('./builds/dist/libs/scrollmagic/'));
gulp.src(bc + 'jquery/dist/jquery.js').
pipe(gulp.dest('./builds/dist/libs/jquery/'));
gulp.src([
bc + 'angular/angular.js',
bc + 'angular-animate/angular-animate.js',
bc + 'angular-cookies/angular-cookies.js',
bc + 'angular-i18n/angular-locale_ru-ru.js',
bc + 'angular-loader/angular-loader.js',
bc + 'angular-resource/angular-resource.js',
bc + 'angular-route/angular-route.js',
bc + 'angular-sanitize/angular-sanitize.js'
]).
pipe(concat('angular.concat.js')).
pipe(gulp.dest('./builds/dist/libs/angular/'));
});
// server
gulp.task('webserver', function() {
gulp.src('builds/dist').
pipe(webserver({
livereload: true,
open: true
}));
});
gulp.task('connect', function() {
connect.server({
root: 'builds/dist',
livereload: true
});
});
// watch
gulp.task('watch', function() {
gulp.watch('builds/development/app/**/*.js', ['js']);
gulp.watch('builds/development/app/*.js', ['js']);
gulp.watch('builds/development/scss/**/*.scss', ['css']);
gulp.watch('builds/development/scss/*.scss', ['css']);
gulp.watch('builds/development/*.html', ['html']);
gulp.watch('builds/development/app/**/*.html', ['html']);
gulp.watch('builds/development/*.js', ['webserver']);
});
// default
gulp.task('default', [
'libs',
'html',
'js',
'css',
'webserver',
'watch'
]);