-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
41 lines (34 loc) · 1.12 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
var gulp = require('gulp');
var minifyCSS = require('gulp-minify-css');
var minify = require('gulp-minify');
var concat = require('gulp-concat');
var exec = require('child_process').exec;
gulp.task('styles', function() {
gulp.src(['./src/styles/random-flicker-img.css'])
.pipe(concat('styles-min.css'))
.pipe(minifyCSS())
.pipe(gulp.dest('./dist/styles/'));
});
gulp.task('scripts', function() {
gulp.src(['./src/scripts/RandomFlickerImageComponent.js'])
.pipe(concat('source.js'))
.pipe(minify())
.pipe(gulp.dest('./dist/scripts/'));
});
gulp.task('placeholder', function() {
gulp.src('./src/placeholder.jpg')
.pipe(gulp.dest('./dist'));
});
gulp.task('dependencies', function() {
gulp.src(['./src/scripts/knockout-3.4.0.js','./src/scripts/jquery-2.2.0.min.js'])
.pipe(gulp.dest('./dist/scripts/'));
});
gulp.task('dist', ['styles', 'scripts', 'placeholder', 'dependencies'], function() {});
gulp.task('dev', function (cb) {
exec('node server.js', function (err, stdout, stderr) {
console.log(stdout);
console.log(stderr);
cb(err);
});
})
gulp.task('default', ['dev'], function() {});