forked from doubledead/AngularModularBase
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
55 lines (47 loc) · 1.45 KB
/
gulpfile.js
File metadata and controls
55 lines (47 loc) · 1.45 KB
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
'use strict';
var gulp = require('gulp');
var browserSync = require('browser-sync');
var sass = require('gulp-sass');
var templateCache = require('gulp-angular-templatecache');
var reload = browserSync.reload;
var AUTOPREFIXER_BROWSERS = [
'ie >= 10',
'ie_mob >= 10',
'ff >= 30',
'chrome >= 34',
'safari >= 7',
'opera >= 23',
'ios >= 7',
'android >= 4.4',
'bb >= 10'
];
gulp.task('sass', function() {
return gulp.src('./sass/**/*.scss')
.pipe(sass().on('error', sass.logError))
.pipe(gulp.dest('./css'));
});
gulp.task('templates', function () {
return gulp.src('templates/**/*.html')
.pipe(templateCache({standalone: true}))
.pipe(gulp.dest('scripts'));
});
// Watch Files For Changes & Reload
gulp.task('serve', [], function () {
browserSync({
notify: false,
// Customize the BrowserSync console logging prefix
logPrefix: 'WSK',
// 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: ["./"]
});
gulp.watch("index.html").on('change', reload);
gulp.watch("templates/**/*.html", ['templates', reload]);
gulp.watch("scripts/**/*.js").on('change', reload);
gulp.watch("styles/**/*.css").on('change', reload);
gulp.watch("sass/**/*.scss", ['sass', reload]);
});
// Default task that will run by type 'gulp'
gulp.task('default',['sass', 'templates']);