-
Notifications
You must be signed in to change notification settings - Fork 50
/
gulpfile.js
92 lines (79 loc) · 2.97 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
(function () {
'use strict';
var gulp = require('gulp'),
uglify = require('gulp-uglify'),
rename = require('gulp-rename'),
concat = require('gulp-concat'),
sass = require('gulp-sass'),
browserSync = require('browser-sync'),
rimraf = require('gulp-rimraf');
function browserSyncInit(baseDir) {
var server = {
baseDir: './'
};
browserSync.instance = browserSync.init({
server: server,
open: true
});
}
gulp.task('js', function () {
gulp.src(['./src/js/vendors/*.js', './src/js/*.js'])
.pipe(rename({dirname: ''}))
.pipe(gulp.dest('./dist'))
.pipe(uglify())
.pipe(rename({
suffix: ".min"
}))
.pipe(gulp.dest('./dist'));
gulp.src(['./src/js/directives/**/*.js'])
.pipe(concat('dataGridUtils.js'))
.pipe(gulp.dest('./dist'))
.pipe(uglify())
.pipe(rename({
suffix: ".min"
}))
.pipe(gulp.dest('./dist'));
});
gulp.task('sass', function () {
gulp.src('./demo/material/scss/angular-data-grid.material.scss')
.pipe(sass().on('error', sass.logError))
.pipe(gulp.dest('./demo/material/css/'));
gulp.src('./demo/bootstrap/scss/angular-data-grid.bootstrap.scss')
.pipe(sass().on('error', sass.logError))
.pipe(gulp.dest('./demo/bootstrap/css/'));
gulp.src('./demo/100k/scss/angular-data-grid.bootstrap.scss')
.pipe(sass().on('error', sass.logError))
.pipe(gulp.dest('./demo/100k/css/'));
gulp.src('./demo/fixed-header/scss/fixed-header.bootstrap.scss')
.pipe(sass().on('error', sass.logError))
.pipe(gulp.dest('./demo/fixed-header/css/'));
gulp.src('./demo/fixed-header/scss/fixed-header.material.scss')
.pipe(sass().on('error', sass.logError))
.pipe(gulp.dest('./demo/fixed-header/css/'));
gulp.src('./src/js/directives/fixedHeader/fixed-header.scss')
.pipe(sass().on('error', sass.logError))
.pipe(gulp.dest('./dist/css/fixedHeader/'));
});
gulp.task('build', ['js', 'sass']);
gulp.task('watch', ['build'], function () {
gulp.watch(['./src/**/*.js'], function (event) {
gulp.start('js');
browserSync.reload(event.path);
});
gulp.watch(['./**/*.scss'], function (event) {
gulp.start('sass');
browserSync.reload(event.path);
});
});
gulp.task('clean', function () {
return gulp.src(['demo'], {read: false})
.pipe(rimraf());
});
gulp.task('full-clean', ['clean'], function () {
return gulp.src(['bower_components', 'node_modules'], {read: false})
.pipe(rimraf());
});
gulp.task('serve', ['watch'], function () {
browserSyncInit(['demo']);
});
})();