-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
executable file
·49 lines (41 loc) · 1.09 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
47
48
49
// Gulp dependencies
var gulp = require('gulp');
var gutil = require('gulp-util');
var browserify = require('./utils/browserify.js');
var css = require('./utils/css.js');
var DEFAULT_OPTIONS = {
browserify: {
src: './app/main.js',
isTest: false,
dest: './dev/',
watch: true,
uglify: false
},
css: {
src: './styles/**/*.css',
dest: './dev/',
watch: true
}
};
gulp.task('browserify', function () {
return browserify(DEFAULT_OPTIONS.browserify);
});
gulp.task('css', function () {
return css(DEFAULT_OPTIONS.css);
});
gulp.task('default', ['browserify', 'css']);
gulp.task('deploy', function () {
DEFAULT_OPTIONS.browserify.dest = './dist/';
DEFAULT_OPTIONS.browserify.watch = false;
DEFAULT_OPTIONS.browserify.uglify = true;
browserify(DEFAULT_OPTIONS.browserify);
DEFAULT_OPTIONS.css.dest = './dist/';
DEFAULT_OPTIONS.css.watch = false;
css(DEFAULT_OPTIONS.css);
});
gulp.task('test', function () {
var src = '.' + gutil.env[''][''];
DEFAULT_OPTIONS.browserify.src = src;
DEFAULT_OPTIONS.browserify.isTest = true;
return browserify(DEFAULT_OPTIONS.browserify);
});