-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
50 lines (41 loc) · 1.05 KB
/
gulpfile.js
File metadata and controls
50 lines (41 loc) · 1.05 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
var gulp = require('gulp');
var runSequence = require('run-sequence');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var minify = require('gulp-minify-css');
var rimraf = require('rimraf');
var rename = require('gulp-rename');
gulp.task('default', ['build']);
gulp.task('clean', function (cb) {
rimraf('build/', cb);
});
/** STALK **/
var stalk_paths = {
scripts: [
'node_modules/socket.io-client/dist/socket.io.js',
'src/*.js'
]
};
gulp.task('compile', [], function () {
return gulp.src(stalk_paths.scripts)
.pipe(concat('stalk-im.js'))
.pipe(gulp.dest('build'));
});
gulp.task('move', [], function () {
return gulp.src('build/**/*')
.pipe(gulp.dest('./dist'));
});
gulp.task('minify', function() {
return gulp.src('dist/stalk-im.js')
.pipe(uglify())
.pipe(rename({ extname: '.min.js' }))
.pipe(gulp.dest('./dist'))
});
// The default task (called when you run `gulp` from cli)
gulp.task('build', function (cb) {
runSequence('clean',
['compile'],
'move',
'minify',
cb);
});