-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
46 lines (42 loc) · 1.28 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
var gulp = require('gulp');
var sass = require('gulp-sass');
var prefix = require('gulp-autoprefixer');
var minify = require('gulp-clean-css');
var minifyjs = require('gulp-minify');
var notify = require('gulp-notify');
var livereload = require('gulp-livereload');
var lr = require('tiny-lr');
var server = lr();
var port = 35729;
// Compile sass and move it
gulp.task('minify-css', function() {
gulp.src('public/styles/style.scss')
.pipe(sass()
.on('error', notify.onError('Error: <%= error.message %>'))
)
.pipe(prefix('last 5 versions'))
.pipe(minify())
.pipe(livereload(server))
.pipe(gulp.dest('public/styles/'))
});
// Compress the javascript and move it
/*
gulp.task('compress-js', function() {
gulp.src('public/src/js/*.js')
.pipe(minifyjs({
exclude: ['tasks'],
ignoreFiles: ['.combo.js', '-min.js']
})
.on('error', notify.onError('Error: <%= error.message %>'))
)
.pipe(gulp.dest('public/js'))
});
*/
//Watch task
gulp.task('default',function() {
livereload.listen();
gulp.start('minify-css');
//gulp.start('compress-js');
gulp.watch('public/styles/**/*.scss',['minify-css']);
//gulp.watch('public/src/js/**/*.js', ['compress-js']);
});