-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathgulpfile.js
executable file
·34 lines (30 loc) · 909 Bytes
/
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
'use strict';
var gulp = require('gulp');
var sass = require('gulp-sass');
var concat = require('gulp-concat');
var concatCss = require('gulp-concat-css');
var shell = require('gulp-shell');
var concat = require('gulp-concat');
var exec = require('child_process').exec;
var fs = require('fs');
var recursive = require('recursive-readdir');
var cmd = 'ionic serve';
exec(cmd);
gulp.task('scripts', function() {
return gulp.src('./www/src/**/*.js')
.pipe(concat('app.min.js'))
.pipe(gulp.dest('./www/'));
});
gulp.task('sass', function() {
recursive('www/src/', [function(path, stats) {
if (stats.isDirectory()) {
gulp.src(path + "/*.scss")
.pipe(sass().on('error', sass.logError))
.pipe(gulp.dest(path));
}
}], function() {});
});
gulp.task('start', function() {
gulp.watch('./www/src/**/*.scss', ['sass']);
gulp.watch('./www/src/**/*.js', ['scripts']);
});