forked from RickStrahl/jquery-resizable
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
43 lines (35 loc) · 1.06 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
var gulp = require('gulp');
var rimraf = require('gulp-rimraf');
var uglify = require('gulp-uglify');
var rename = require('gulp-rename');
var sourcemaps = require('gulp-sourcemaps');
var livereload = require('gulp-livereload');
gulp.task('scripts:minify', function () {
gulp.src(['./src/*.js'])
.pipe(rename({ suffix: '.min' }))
.pipe(sourcemaps.init())
.pipe(uglify())
.pipe(sourcemaps.write('.', {
includeContent: false,
sourceRoot: './src'
}))
.pipe(gulp.dest('./dist'));
});
gulp.task('scripts:copy', function () {
gulp.src(['src/*.js'])
.pipe(gulp.dest('./dist'));
});
gulp.task('scripts', ['scripts:minify','scripts:copy']);
gulp.task('clean', function () {
gulp.src(['./dist/**.*'])
.pipe(rimraf({read: false}));
});
gulp.task('watch', function () {
// Create LiveReload server
livereload.listen();
gulp.watch(['./src/*.js'], ['scripts']);
});
gulp.task('default', function() {
// place code for your default task here
gulp.start('scripts');
});