forked from Urigo/angular2-meteor-accounts-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
46 lines (41 loc) · 1.07 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
var gulp = require('gulp');
var git = require('gulp-git');
var fs = require('fs');
var less = require('gulp-less');
var tap = require('gulp-tap');
var ext_replace = require('gulp-ext-replace');
gulp.task('pages', function () {
function replaceTemplates(file) {
var fileContent = String(fs.readFileSync('./src/login-buttons-template.html', 'utf8'));
file.contents = new Buffer(
String(file.contents)
.replace(
'{LOGIN_TEMPLATE}',
fileContent
.replace(/(\r\n|\n|\r)/gm, '')
.replace(/"/g, '\\"')
)
);
}
return gulp.src('./build/login-buttons.js')
.pipe(tap(replaceTemplates))
.pipe(gulp.dest('./build/'));
});
gulp.task('scss', function () {
gulp.src('./build/*.css', {
base: './build/'
})
.pipe(ext_replace('.scss'))
.pipe(gulp.dest('./build/'));
});
// Build LESS
gulp.task('less', function () {
return gulp.src('./src/*.less')
.pipe(less({
}))
.pipe(gulp.dest('./build/'));
});
gulp.task('git-add', function(){
return gulp.src('build/*')
.pipe(git.add());
});