-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
51 lines (45 loc) · 1.31 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
'use strict';
var gulp = require('gulp');
var sass = require('gulp-sass');
var autoprefixer = require('gulp-autoprefixer');
var browserSync = require('browser-sync');
var reload = browserSync.reload;
var protractor = require('gulp-protractor').protractor;
gulp.task('default', ['test', 'sass']);
gulp.task('sass', function(done) {
gulp.src('./scss/ionic.app.scss')
.pipe(sass())
.pipe(autoprefixer({
browsers: ['last 2 versions'],
cascade: false
}))
.pipe(gulp.dest('./www/css/'))
.on('end', done);
});
gulp.task('test', function() {
gulp.src(['./test/e2e/main/**.js'])
.pipe(protractor({
configFile: './test/protractor.conf.js',
args: ['--baseUrl', 'http://127.0.0.1:3000']
}))
.on('error', function(e) {
throw e;
});
});
// Watch Files For Changes & Reload
gulp.task('serve', ['sass'], function () {
browserSync({
notify: false,
// Run as an https by uncommenting 'https: true'
// Note: this uses an unsigned certificate which on first access
// will present a certificate warning in the browser.
// https: true,
server: {
baseDir: 'www'
}
});
gulp.watch(['www/**/*.html'], reload);
gulp.watch(['scss/**/*.scss'], ['sass', reload]);
gulp.watch(['www/js/**/*.js'], reload);
gulp.watch(['www/img/**/*'], reload);
});