-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
57 lines (45 loc) · 1.47 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
var gulp = require('gulp'),
sass = require('gulp-sass'),
autoprefixer = require('gulp-autoprefixer'),
rename = require('gulp-rename'),
notify = require('gulp-notify'),
uglify = require('gulp-uglify'),
csso = require('gulp-csso');
gulp.task('styles', function() {
return gulp.src('src/scss/panor.scss')
.pipe(sass({ style: 'expanded' }))
.pipe(autoprefixer('safari 5', 'ie 8', 'ie 9', 'opera 12.1', 'ios 6', 'android 4'))
.pipe(csso())
.pipe(rename('panor.min.css'))
.pipe(gulp.dest('dist'))
.pipe(gulp.dest('docs/css'))
.pipe(notify({ message: 'Compiled scss files' }));
});
gulp.task('scripts', function() {
return gulp.src('src/js/panor.js')
.pipe(uglify())
.pipe(rename('panor.min.js'))
.pipe(gulp.dest('dist'))
.pipe(gulp.dest('docs/js'))
.pipe(notify({ message: 'Uglified js files' }));
});
gulp.task('dev_styles', function() {
return gulp.src('src/scss/panor.scss')
.pipe(sass({ style: 'expanded' }))
.pipe(rename('panor.min.css'))
.pipe(gulp.dest('dist'))
.pipe(notify({ message: 'Updated dev scss files' }));
});
gulp.task('dev_scripts', function() {
return gulp.src('src/js/panor.js')
.pipe(rename('panor.min.js'))
.pipe(gulp.dest('dist'))
.pipe(notify({ message: 'Updated dev js files' }));
});
gulp.task('dev', ['dev_styles', 'dev_scripts']);
gulp.task('production', ['styles', 'scripts']);
gulp.task('default', ['dev']);
gulp.task('watch', function() {
gulp.watch('src/scss/**/*.scss', ['dev_styles']);
gulp.watch('src/js/**/*.js', ['dev_scripts']);
});