-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
69 lines (59 loc) · 1.69 KB
/
Copy pathgulpfile.js
File metadata and controls
69 lines (59 loc) · 1.69 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
var gulp = require('gulp');
var webserver = require('gulp-webserver');
var sass = require('gulp-sass');
var htmlreplace = require('gulp-html-replace');
var concat = require('gulp-concat');
var copy = require('gulp-copy');
var sequence = require('gulp-sequence');
gulp.task('webserver', function() {
return gulp.src('.')
.pipe(webserver({
livereload: true,
directoryListing: false,
open: 'app',
host: '0.0.0.0'
}));
});
gulp.task('sass', function () {
return gulp.src('./app/css/**/*.scss')
.pipe(sass().on('error', sass.logError))
.pipe(gulp.dest('./app/css'));
});
gulp.task('sass:watch', function () {
return gulp.watch('./app/css/**/*.scss',['sass']);
});
gulp.task('html-replace', function () {
return gulp.src('./app/index.html')
.pipe(htmlreplace({
'css':'css/style.css',
'js':'js/bundle.js'
}))
.pipe(gulp.dest('dist/'));
});
gulp.task('copy-html', function () {
return gulp.src('./app/**/*.html')
.pipe(copy('dist', {prefix: 1}));
});
// gulp.task('copy-css', function () {
// return gulp.src('./app/css/style.css')
// .pipe(copy('dist', {prefix: 1}));
// });
gulp.task('scripts', function () {
return gulp.src([
'bower_components/angular/angular.js',
'bower_components/drag-drop-webkit-mobile/ios-drag-drop.js',
'app/**/*.js'
])
.pipe(concat('bundle.js'))
.pipe(gulp.dest('./dist/js/'));
});
gulp.task('css-concat', function () {
return gulp.src([
'app/**/*.css',
'bower_components/github-fork-ribbon-css/gh-fork-ribbon.css',
])
.pipe(concat('style.css'))
.pipe(gulp.dest('./dist/css/'));
});
gulp.task('build', sequence(['copy-html','css-concat','scripts'],'html-replace'));
gulp.task('default', ['webserver','sass:watch']);