forked from tympanix/angular-table-resize
-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
66 lines (55 loc) · 1.65 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
58
59
60
61
62
63
64
65
66
/*jshint esversion: 6 */
const gulp = require('gulp');
const browsersync = require('browser-sync').create();
const runSequence = require('run-sequence');
const uglify = require('gulp-uglify');
const concat = require('gulp-concat');
const rename = require('gulp-rename');
const cleancss = require('gulp-clean-css');
const jsFiles = [
"scripts/angular-table-resize.js",
"scripts/directives/resizeable-directive.js",
"scripts/services/resize-storage-service.js",
"scripts/services/resizer-factory.js",
"scripts/resizers/basic-resizer.js",
"scripts/resizers/fixed-resizer.js",
"scripts/resizers/overflow-resizer.js"
]
const cssFiles = [
"css/table-resize.css"
]
const DIST = './dist/';
gulp.task('serve', function() {
browsersync.init({
port: 3001,
server: {
baseDir: "./"
}
});
});
gulp.task('update', function() {
browsersync.update();
});
gulp.task('watch', function() {
gulp.watch(['index.html', 'css/**', 'scripts/**', 'views/**', 'demo/**'], browsersync.reload);
});
gulp.task('dev', function() {
runSequence('serve', 'watch');
});
gulp.task('build:js', function() {
return gulp.src(jsFiles)
.pipe(concat('angular-table-resize.js'))
.pipe(gulp.dest(DIST))
.pipe(uglify())
.pipe(rename({ extname: '.min.js' }))
.pipe(gulp.dest(DIST))
})
gulp.task('build:css', function() {
return gulp.src(cssFiles)
.pipe(gulp.dest(DIST))
.pipe(cleancss({ compatibility: 'ie8' }))
.pipe(rename({ extname: '.min.css' }))
.pipe(gulp.dest(DIST))
})
gulp.task('build', ['build:js', 'build:css'])
gulp.task('default', ['dev']);