-
Notifications
You must be signed in to change notification settings - Fork 101
/
gulpfile.js
64 lines (55 loc) · 1.75 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
var gulp = require('gulp'),
uglify = require('gulp-uglify'),
rename = require('gulp-rename'),
notify = require('gulp-notify'),
concat = require('gulp-concat'),
del = require('del'),
fs = require('fs.extra'),
paths = {
scripts: ['src/core.js', 'src/ExcelFormulaUtilities.js'],
siteScripts: ['js/page.js', 'js/beautifier.js'],
css: ['bootstrap.min.css', 'css/*.css']
};
gulp.task('update_jquery', function(){
return gulp.src('node_modules/jquery/dist/jquery.min.*')
.pipe(gulp.dest('js'));
})
gulp.task('update_bs_css', function(){
return gulp.src('node_modules/bootstrap/dist/css/*.min.css')
.pipe(gulp.dest('css'));
});
gulp.task('update_bs_js', function(){
return gulp.src('node_modules/bootstrap/dist/js/*.min.js')
.pipe(gulp.dest('js'));
});
gulp.task('update_bs_fonts', function(){
return gulp.src('node_modules/bootstrap/dist/fonts/*')
.pipe(gulp.dest('fonts'));
});
gulp.task('libs', ['update_jquery', 'update_bs_js', 'update_bs_css', 'update_bs_fonts']);
gulp.task('scripts', function() {
return gulp.src(paths.scripts)
.pipe(concat('core.js'))
.pipe(concat('excel-formula.js'))
.pipe(gulp.dest('dist'))
.pipe(rename({suffix: '.min'}))
.pipe(uglify())
.pipe(gulp.dest('dist'))
});
gulp.task('site', function() {
return gulp.src(paths.siteScripts)
.pipe(concat('page.js'))
.pipe(concat('beautifier.js'))
.pipe(gulp.dest('js/tmp'))
.pipe(rename({suffix: '.min'}))
.pipe(uglify())
.pipe(gulp.dest('js'))
.on('end', function(){
fs.rmrfSync('js/tmp/')
})
});
gulp.task('watch', function() {
gulp.watch(paths.scripts, ['scripts']);
gulp.watch(paths.scripts, ['site']);
});
gulp.task('default', ['scripts'])