-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
39 lines (33 loc) · 963 Bytes
/
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
'use strict';
var gulp = require('gulp'),
less = require('gulp-less'),
prefix = require('gulp-autoprefixer'),
browserify = require('gulp-browserify'),
connect = require('gulp-connect'),
rename = require('gulp-rename');
gulp.task('styles', function() {
gulp.src('lib/autoscale.css')
.pipe(prefix('> 5%'))
.pipe(rename('tux-autoscale.css'))
.pipe(gulp.dest('demo'))
.pipe(connect.reload());
});
gulp.task('scripts', function() {
gulp.src('lib/autoscale.js')
.pipe(browserify())
.pipe(rename('tux-autoscale.js'))
.pipe(gulp.dest('demo'))
.pipe(connect.reload());
});
gulp.task('server', ['styles', 'scripts', 'watch'], function() {
connect.server({
root: ['demo'],
port: 9000,
livereload: true
});
});
gulp.task('watch', function() {
gulp.watch('lib/autoscale.css', ['styles']);
gulp.watch('lib/autoscale.js', ['scripts']);
});
gulp.task('default', ['server']);