-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
73 lines (63 loc) · 1.85 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
var gulp = require('gulp'),
sass = require('gulp-sass'),
autoprefixer = require('gulp-autoprefixer');
var icon = require('gulp-iconfont'),
iconCSS = require('gulp-iconfont-css');
var concat = require('gulp-concat'),
uglify = require('gulp-uglify');
var bowerPath = 'public/vendor/';
var sassPath = 'sass/';
/*
SCSS(s) -> minified CSS
*/
gulp.task('sass', function() {
gulp.src(sassPath+'app.scss')
.pipe(sass({
//outputStyle: 'compressed'
}).on('error', sass.logError))
.pipe(autoprefixer({
browsers: ['last 8 versions']
}))
.pipe(concat('app.min.css'))
.pipe(gulp.dest('./public/'));
});
/*
.JS(s) -> minified JS
*/
gulp.task('js', function() {
gulp.src([
// Libraries
bowerPath+'bowser/src/bowser.js',
bowerPath+'modernizr.min.js',
bowerPath+'jquery/dist/jquery.min.js',
bowerPath+'isotope/isotope.js',
bowerPath+'tether/dist/js/tether.js',
bowerPath+'bootstrap/dist/js/bootstrap.js',
bowerPath+'selectize/dist/js/standalone/selectize.js',
bowerPath+'oh-snap/ohsnap.min.js',
bowerPath+'moment/moment.js',
bowerPath+'firebase/firebase.js',
bowerPath+'tiny-slider/dist/min/tiny-slider.js',
// App
bowerPath+'../worker.js',
bowerPath+'app.js',
])
.pipe(concat('app.min.js'))
/*.pipe(uglify().on('error', function(e) {
console.error('Uglify error', e.cause ? {
message: e.cause.message,
filename: e.cause.filename,
where: 'l'+e.cause.line+' (col'+e.cause.col+')',
} : 'unknown error');
return true;
}))*/
.pipe(gulp.dest('./public/'))
});
gulp.task('watch', function() {
gulp.watch([bowerPath+'*.js', bowerPath+'../worker.js'], ['js']).on('change', function(e) {
console.log('File ' + e.path + ' was ' + e.type + ', running tasks...');
});
gulp.watch(sassPath+'**/*.scss', ['sass']).on('change', function(e) {
console.log('File ' + e.path + ' was ' + e.type + ', running tasks...');
});
});