-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathgulpfile.js
34 lines (28 loc) · 902 Bytes
/
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
var gulp = require('gulp');
var del = require('del');
var browserify = require('gulp-browserify');
var rename = require('gulp-rename');
var shell = require('gulp-shell');
var uglify = require('gulp-uglify');
gulp.task('build', function () {
return gulp.src('public/scripts/main.cjsx', { read: false })
.pipe(browserify({
transform: ['coffee-reactify'],
extensions: ['.coffee', '.cjsx']
}))
.pipe(rename('bundle.js'))
.pipe(gulp.dest('public'))
});
gulp.task('uglify', ['build'], function () {
return gulp.src('public/bundle.js')
.pipe(uglify())
.pipe(gulp.dest('public'))
});
gulp.task('apply-prod-environment', function() {
return process.env.NODE_ENV = 'production';
});
gulp.task('default', ['build']);
gulp.task('production', ['apply-prod-environment', 'build', 'uglify']);
gulp.task('deploy', ['production'], shell.task([
'firebase deploy'
]));