-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathgulpfile.js
More file actions
30 lines (26 loc) · 781 Bytes
/
gulpfile.js
File metadata and controls
30 lines (26 loc) · 781 Bytes
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
var gulp = require('gulp'),
plugins = require('gulp-load-plugins')(),
pack = require('./package.json'),
port = 9191;
gulp.task('server', ["watch"], function () {
plugins.connect.server({
root: ['bower_components', '.tmp', 'src', 'demo'],
port: port,
livereload: true
});
plugins.bower()
.on('end',function(){
require('opn')('http://localhost:' + port + '/')
});
});
gulp.task('build', function(){
gulp.src('src/*.js')
.pipe(plugins.uglify())
.pipe(plugins.header('//author: <%= author %>\n//verion: <%= version %>\n',{author:pack.author,version:pack.version}))
.pipe(gulp.dest('dist'))
});
gulp.task('watch',function(){
gulp.watch('./src/*.coffee', ['coffee']);
gulp.watch('./src/*.less', ['less']);
});
gulp.task('default', ['build']);