forked from AndersJuul/Freeboard
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
60 lines (50 loc) · 1.76 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
'use strict';
var bump = require('gulp-bump');
var octo = require('@octopusdeploy/gulp-octo');
var gulp = require('gulp'),
less = require('gulp-less'),
cssmin = require('gulp-cssmin'),
rename = require('gulp-rename'),
jsmin = require('gulp-jsmin'),
concat = require('gulp-concat'),
clean = require('gulp-clean');
var ts = require("gulp-typescript");
var tsProject = ts.createProject("tsconfig.json");
gulp.task("compile", function () {
return tsProject.src()
.pipe(tsProject())
.pipe(gulp.dest("dist"));
});
gulp.task('less', function() {
return gulp.src('./src/less/**/*.less')
.pipe(less())
.pipe(cssmin())
.pipe(rename({suffix: '.min'}))
.pipe(gulp.dest('./public/css/'));
});
gulp.task('scripts', function() {
return gulp.src(['./dist/**/*.js', './app/**/*.js'])
.pipe(concat('script.js'))
.pipe(jsmin())
.pipe(rename({suffix: '.min'}))
.pipe(gulp.dest('./public/js/'));
});
gulp.task('build', ['less', 'scripts']);
gulp.task('default', ['less', 'scripts'], function() {
gulp.watch('./src/less/**/*.less', ['less']);
gulp.watch(['./src/js/vendor/**/*.js', './src/js/app/**/*.js'], ['scripts']);
});
gulp.task('clean-public', function () {
return gulp.src(['./public/js', './public/css'], {read: false})
.pipe(clean());
});
gulp.task('bump', function(){
return gulp.src('./package.json')
//.pipe(bump({type: 'patch'}))
.pipe(gulp.dest('./'));
});
gulp.task('publish', ['build'], function () {
return gulp.src(['**/*.js', '**/*.html','**/*.ico','**/*.json','**/*.css','**/*.jpg','!bin{,/**}', '!src{,/**}', '!gulpfile.js'])
.pipe(octo.pack())
.pipe(octo.push({apiKey: 'API-B7XVRTRPPPDIQSP6ZJNZPQHZU', host: 'http://ajf-deploy-01', replace: true}));
});